diff --git a/packages/google-cloud-networksecurity/README.md b/packages/google-cloud-networksecurity/README.md index 53fc16a30c3..857f0b1bda3 100644 --- a/packages/google-cloud-networksecurity/README.md +++ b/packages/google-cloud-networksecurity/README.md @@ -19,7 +19,7 @@ A comprehensive list of changes in each version may be found in [the CHANGELOG][homepage_changelog]. * [Network Security API Nodejs Client API Reference](https://cloud.google.com/nodejs/docs/reference/networksecurity/latest) - +* [Network Security API Documentation](https://cloud.google.com/products/networking) Read more about the client libraries for Cloud APIs, including the older Google APIs Client Libraries, in [Client Libraries Explained][explained]. @@ -67,21 +67,106 @@ Samples are in the [`samples/`][homepage_samples] directory. Each sample's `READ | list address groups | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-networksecurity/samples/generated/v1/address_group_service.list_address_groups.js) | | remove address group items | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-networksecurity/samples/generated/v1/address_group_service.remove_address_group_items.js) | | update address group | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-networksecurity/samples/generated/v1/address_group_service.update_address_group.js) | +| create dns threat detector | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-networksecurity/samples/generated/v1/dns_threat_detector_service.create_dns_threat_detector.js) | +| delete dns threat detector | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-networksecurity/samples/generated/v1/dns_threat_detector_service.delete_dns_threat_detector.js) | +| get dns threat detector | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-networksecurity/samples/generated/v1/dns_threat_detector_service.get_dns_threat_detector.js) | +| list dns threat detectors | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-networksecurity/samples/generated/v1/dns_threat_detector_service.list_dns_threat_detectors.js) | +| update dns threat detector | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-networksecurity/samples/generated/v1/dns_threat_detector_service.update_dns_threat_detector.js) | +| create firewall endpoint | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-networksecurity/samples/generated/v1/firewall_activation.create_firewall_endpoint.js) | +| create firewall endpoint association | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-networksecurity/samples/generated/v1/firewall_activation.create_firewall_endpoint_association.js) | +| delete firewall endpoint | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-networksecurity/samples/generated/v1/firewall_activation.delete_firewall_endpoint.js) | +| delete firewall endpoint association | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-networksecurity/samples/generated/v1/firewall_activation.delete_firewall_endpoint_association.js) | +| get firewall endpoint | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-networksecurity/samples/generated/v1/firewall_activation.get_firewall_endpoint.js) | +| get firewall endpoint association | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-networksecurity/samples/generated/v1/firewall_activation.get_firewall_endpoint_association.js) | +| list firewall endpoint associations | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-networksecurity/samples/generated/v1/firewall_activation.list_firewall_endpoint_associations.js) | +| list firewall endpoints | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-networksecurity/samples/generated/v1/firewall_activation.list_firewall_endpoints.js) | +| update firewall endpoint | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-networksecurity/samples/generated/v1/firewall_activation.update_firewall_endpoint.js) | +| update firewall endpoint association | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-networksecurity/samples/generated/v1/firewall_activation.update_firewall_endpoint_association.js) | +| create intercept deployment | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-networksecurity/samples/generated/v1/intercept.create_intercept_deployment.js) | +| create intercept deployment group | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-networksecurity/samples/generated/v1/intercept.create_intercept_deployment_group.js) | +| create intercept endpoint group | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-networksecurity/samples/generated/v1/intercept.create_intercept_endpoint_group.js) | +| create intercept endpoint group association | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-networksecurity/samples/generated/v1/intercept.create_intercept_endpoint_group_association.js) | +| delete intercept deployment | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-networksecurity/samples/generated/v1/intercept.delete_intercept_deployment.js) | +| delete intercept deployment group | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-networksecurity/samples/generated/v1/intercept.delete_intercept_deployment_group.js) | +| delete intercept endpoint group | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-networksecurity/samples/generated/v1/intercept.delete_intercept_endpoint_group.js) | +| delete intercept endpoint group association | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-networksecurity/samples/generated/v1/intercept.delete_intercept_endpoint_group_association.js) | +| get intercept deployment | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-networksecurity/samples/generated/v1/intercept.get_intercept_deployment.js) | +| get intercept deployment group | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-networksecurity/samples/generated/v1/intercept.get_intercept_deployment_group.js) | +| get intercept endpoint group | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-networksecurity/samples/generated/v1/intercept.get_intercept_endpoint_group.js) | +| get intercept endpoint group association | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-networksecurity/samples/generated/v1/intercept.get_intercept_endpoint_group_association.js) | +| list intercept deployment groups | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-networksecurity/samples/generated/v1/intercept.list_intercept_deployment_groups.js) | +| list intercept deployments | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-networksecurity/samples/generated/v1/intercept.list_intercept_deployments.js) | +| list intercept endpoint group associations | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-networksecurity/samples/generated/v1/intercept.list_intercept_endpoint_group_associations.js) | +| list intercept endpoint groups | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-networksecurity/samples/generated/v1/intercept.list_intercept_endpoint_groups.js) | +| update intercept deployment | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-networksecurity/samples/generated/v1/intercept.update_intercept_deployment.js) | +| update intercept deployment group | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-networksecurity/samples/generated/v1/intercept.update_intercept_deployment_group.js) | +| update intercept endpoint group | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-networksecurity/samples/generated/v1/intercept.update_intercept_endpoint_group.js) | +| update intercept endpoint group association | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-networksecurity/samples/generated/v1/intercept.update_intercept_endpoint_group_association.js) | +| create mirroring deployment | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-networksecurity/samples/generated/v1/mirroring.create_mirroring_deployment.js) | +| create mirroring deployment group | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-networksecurity/samples/generated/v1/mirroring.create_mirroring_deployment_group.js) | +| create mirroring endpoint group | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-networksecurity/samples/generated/v1/mirroring.create_mirroring_endpoint_group.js) | +| create mirroring endpoint group association | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-networksecurity/samples/generated/v1/mirroring.create_mirroring_endpoint_group_association.js) | +| delete mirroring deployment | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-networksecurity/samples/generated/v1/mirroring.delete_mirroring_deployment.js) | +| delete mirroring deployment group | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-networksecurity/samples/generated/v1/mirroring.delete_mirroring_deployment_group.js) | +| delete mirroring endpoint group | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-networksecurity/samples/generated/v1/mirroring.delete_mirroring_endpoint_group.js) | +| delete mirroring endpoint group association | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-networksecurity/samples/generated/v1/mirroring.delete_mirroring_endpoint_group_association.js) | +| get mirroring deployment | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-networksecurity/samples/generated/v1/mirroring.get_mirroring_deployment.js) | +| get mirroring deployment group | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-networksecurity/samples/generated/v1/mirroring.get_mirroring_deployment_group.js) | +| get mirroring endpoint group | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-networksecurity/samples/generated/v1/mirroring.get_mirroring_endpoint_group.js) | +| get mirroring endpoint group association | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-networksecurity/samples/generated/v1/mirroring.get_mirroring_endpoint_group_association.js) | +| list mirroring deployment groups | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-networksecurity/samples/generated/v1/mirroring.list_mirroring_deployment_groups.js) | +| list mirroring deployments | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-networksecurity/samples/generated/v1/mirroring.list_mirroring_deployments.js) | +| list mirroring endpoint group associations | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-networksecurity/samples/generated/v1/mirroring.list_mirroring_endpoint_group_associations.js) | +| list mirroring endpoint groups | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-networksecurity/samples/generated/v1/mirroring.list_mirroring_endpoint_groups.js) | +| update mirroring deployment | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-networksecurity/samples/generated/v1/mirroring.update_mirroring_deployment.js) | +| update mirroring deployment group | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-networksecurity/samples/generated/v1/mirroring.update_mirroring_deployment_group.js) | +| update mirroring endpoint group | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-networksecurity/samples/generated/v1/mirroring.update_mirroring_endpoint_group.js) | +| update mirroring endpoint group association | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-networksecurity/samples/generated/v1/mirroring.update_mirroring_endpoint_group_association.js) | | create authorization policy | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-networksecurity/samples/generated/v1/network_security.create_authorization_policy.js) | +| create authz policy | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-networksecurity/samples/generated/v1/network_security.create_authz_policy.js) | +| create backend authentication config | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-networksecurity/samples/generated/v1/network_security.create_backend_authentication_config.js) | | create client tls policy | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-networksecurity/samples/generated/v1/network_security.create_client_tls_policy.js) | +| create gateway security policy | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-networksecurity/samples/generated/v1/network_security.create_gateway_security_policy.js) | +| create gateway security policy rule | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-networksecurity/samples/generated/v1/network_security.create_gateway_security_policy_rule.js) | | create server tls policy | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-networksecurity/samples/generated/v1/network_security.create_server_tls_policy.js) | +| create tls inspection policy | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-networksecurity/samples/generated/v1/network_security.create_tls_inspection_policy.js) | +| create url list | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-networksecurity/samples/generated/v1/network_security.create_url_list.js) | | delete authorization policy | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-networksecurity/samples/generated/v1/network_security.delete_authorization_policy.js) | +| delete authz policy | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-networksecurity/samples/generated/v1/network_security.delete_authz_policy.js) | +| delete backend authentication config | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-networksecurity/samples/generated/v1/network_security.delete_backend_authentication_config.js) | | delete client tls policy | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-networksecurity/samples/generated/v1/network_security.delete_client_tls_policy.js) | +| delete gateway security policy | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-networksecurity/samples/generated/v1/network_security.delete_gateway_security_policy.js) | +| delete gateway security policy rule | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-networksecurity/samples/generated/v1/network_security.delete_gateway_security_policy_rule.js) | | delete server tls policy | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-networksecurity/samples/generated/v1/network_security.delete_server_tls_policy.js) | +| delete tls inspection policy | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-networksecurity/samples/generated/v1/network_security.delete_tls_inspection_policy.js) | +| delete url list | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-networksecurity/samples/generated/v1/network_security.delete_url_list.js) | | get authorization policy | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-networksecurity/samples/generated/v1/network_security.get_authorization_policy.js) | +| get authz policy | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-networksecurity/samples/generated/v1/network_security.get_authz_policy.js) | +| get backend authentication config | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-networksecurity/samples/generated/v1/network_security.get_backend_authentication_config.js) | | get client tls policy | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-networksecurity/samples/generated/v1/network_security.get_client_tls_policy.js) | +| get gateway security policy | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-networksecurity/samples/generated/v1/network_security.get_gateway_security_policy.js) | +| get gateway security policy rule | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-networksecurity/samples/generated/v1/network_security.get_gateway_security_policy_rule.js) | | get server tls policy | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-networksecurity/samples/generated/v1/network_security.get_server_tls_policy.js) | +| get tls inspection policy | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-networksecurity/samples/generated/v1/network_security.get_tls_inspection_policy.js) | +| get url list | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-networksecurity/samples/generated/v1/network_security.get_url_list.js) | | list authorization policies | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-networksecurity/samples/generated/v1/network_security.list_authorization_policies.js) | +| list authz policies | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-networksecurity/samples/generated/v1/network_security.list_authz_policies.js) | +| list backend authentication configs | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-networksecurity/samples/generated/v1/network_security.list_backend_authentication_configs.js) | | list client tls policies | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-networksecurity/samples/generated/v1/network_security.list_client_tls_policies.js) | +| list gateway security policies | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-networksecurity/samples/generated/v1/network_security.list_gateway_security_policies.js) | +| list gateway security policy rules | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-networksecurity/samples/generated/v1/network_security.list_gateway_security_policy_rules.js) | | list server tls policies | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-networksecurity/samples/generated/v1/network_security.list_server_tls_policies.js) | +| list tls inspection policies | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-networksecurity/samples/generated/v1/network_security.list_tls_inspection_policies.js) | +| list url lists | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-networksecurity/samples/generated/v1/network_security.list_url_lists.js) | | update authorization policy | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-networksecurity/samples/generated/v1/network_security.update_authorization_policy.js) | +| update authz policy | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-networksecurity/samples/generated/v1/network_security.update_authz_policy.js) | +| update backend authentication config | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-networksecurity/samples/generated/v1/network_security.update_backend_authentication_config.js) | | update client tls policy | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-networksecurity/samples/generated/v1/network_security.update_client_tls_policy.js) | +| update gateway security policy | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-networksecurity/samples/generated/v1/network_security.update_gateway_security_policy.js) | +| update gateway security policy rule | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-networksecurity/samples/generated/v1/network_security.update_gateway_security_policy_rule.js) | | update server tls policy | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-networksecurity/samples/generated/v1/network_security.update_server_tls_policy.js) | +| update tls inspection policy | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-networksecurity/samples/generated/v1/network_security.update_tls_inspection_policy.js) | +| update url list | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-networksecurity/samples/generated/v1/network_security.update_url_list.js) | | add address group items | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-networksecurity/samples/generated/v1/organization_address_group_service.add_address_group_items.js) | | clone address group items | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-networksecurity/samples/generated/v1/organization_address_group_service.clone_address_group_items.js) | | create address group | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-networksecurity/samples/generated/v1/organization_address_group_service.create_address_group.js) | @@ -91,6 +176,16 @@ Samples are in the [`samples/`][homepage_samples] directory. Each sample's `READ | list address groups | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-networksecurity/samples/generated/v1/organization_address_group_service.list_address_groups.js) | | remove address group items | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-networksecurity/samples/generated/v1/organization_address_group_service.remove_address_group_items.js) | | update address group | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-networksecurity/samples/generated/v1/organization_address_group_service.update_address_group.js) | +| create security profile | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-networksecurity/samples/generated/v1/organization_security_profile_group_service.create_security_profile.js) | +| create security profile group | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-networksecurity/samples/generated/v1/organization_security_profile_group_service.create_security_profile_group.js) | +| delete security profile | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-networksecurity/samples/generated/v1/organization_security_profile_group_service.delete_security_profile.js) | +| delete security profile group | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-networksecurity/samples/generated/v1/organization_security_profile_group_service.delete_security_profile_group.js) | +| get security profile | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-networksecurity/samples/generated/v1/organization_security_profile_group_service.get_security_profile.js) | +| get security profile group | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-networksecurity/samples/generated/v1/organization_security_profile_group_service.get_security_profile_group.js) | +| list security profile groups | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-networksecurity/samples/generated/v1/organization_security_profile_group_service.list_security_profile_groups.js) | +| list security profiles | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-networksecurity/samples/generated/v1/organization_security_profile_group_service.list_security_profiles.js) | +| update security profile | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-networksecurity/samples/generated/v1/organization_security_profile_group_service.update_security_profile.js) | +| update security profile group | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-networksecurity/samples/generated/v1/organization_security_profile_group_service.update_security_profile_group.js) | | cloud | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-networksecurity/samples/generated/v1/snippet_metadata_google.cloud.networksecurity.v1.json) | | create dns threat detector | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-networksecurity/samples/generated/v1alpha1/dns_threat_detector_service.create_dns_threat_detector.js) | | delete dns threat detector | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-networksecurity/samples/generated/v1alpha1/dns_threat_detector_service.delete_dns_threat_detector.js) | diff --git a/packages/google-cloud-networksecurity/protos/google/cloud/networksecurity/v1/address_group.proto b/packages/google-cloud-networksecurity/protos/google/cloud/networksecurity/v1/address_group.proto index 7a6d35508a7..39bfe962050 100644 --- a/packages/google-cloud-networksecurity/protos/google/cloud/networksecurity/v1/address_group.proto +++ b/packages/google-cloud-networksecurity/protos/google/cloud/networksecurity/v1/address_group.proto @@ -1,4 +1,4 @@ -// Copyright 2025 Google LLC +// Copyright 2026 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -19,8 +19,11 @@ package google.cloud.networksecurity.v1; import "google/api/annotations.proto"; import "google/api/client.proto"; import "google/api/field_behavior.proto"; +import "google/api/field_info.proto"; import "google/api/resource.proto"; +import "google/cloud/networksecurity/v1/common.proto"; import "google/longrunning/operations.proto"; +import "google/protobuf/empty.proto"; import "google/protobuf/field_mask.proto"; import "google/protobuf/timestamp.proto"; @@ -31,10 +34,6 @@ option java_outer_classname = "AddressGroupProto"; option java_package = "com.google.cloud.networksecurity.v1"; option php_namespace = "Google\\Cloud\\NetworkSecurity\\V1"; option ruby_package = "Google::Cloud::NetworkSecurity::V1"; -option (google.api.resource_definition) = { - type: "networksecurity.googleapis.com/OrganizationLocation" - pattern: "organizations/{organization}/locations/{location}" -}; // AddressGroup is a resource that manages a collection of IP or Domain Names, // it can be used in Firewall Policy to represent allow or deny traffic from diff --git a/packages/google-cloud-networksecurity/protos/google/cloud/networksecurity/v1/authorization_policy.proto b/packages/google-cloud-networksecurity/protos/google/cloud/networksecurity/v1/authorization_policy.proto index 3c548de445b..d21d439da84 100644 --- a/packages/google-cloud-networksecurity/protos/google/cloud/networksecurity/v1/authorization_policy.proto +++ b/packages/google-cloud-networksecurity/protos/google/cloud/networksecurity/v1/authorization_policy.proto @@ -1,4 +1,4 @@ -// Copyright 2025 Google LLC +// Copyright 2026 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -43,19 +43,19 @@ message AuthorizationPolicy { message Rule { // Specification of traffic source attributes. message Source { - // Optional. List of peer identities to match for authorization. At least one - // principal should match. Each peer can be an exact match, or a prefix - // match (example, "namespace/*") or a suffix match (example, + // Optional. List of peer identities to match for authorization. At least + // one principal should match. Each peer can be an exact match, or a + // prefix match (example, "namespace/*") or a suffix match (example, // "*/service-account") or a presence match "*". Authorization based on // the principal name without certificate validation (configured by // ServerTlsPolicy resource) is considered insecure. repeated string principals = 1 [(google.api.field_behavior) = OPTIONAL]; - // Optional. List of CIDR ranges to match based on source IP address. At least one - // IP block should match. Single IP (e.g., "1.2.3.4") and CIDR (e.g., - // "1.2.3.0/24") are supported. Authorization based on source IP alone - // should be avoided. The IP addresses of any load balancers or proxies - // should be considered untrusted. + // Optional. List of CIDR ranges to match based on source IP address. At + // least one IP block should match. Single IP (e.g., "1.2.3.4") and CIDR + // (e.g., "1.2.3.0/24") are supported. Authorization based on source IP + // alone should be avoided. The IP addresses of any load balancers or + // proxies should be considered untrusted. repeated string ip_blocks = 2 [(google.api.field_behavior) = OPTIONAL]; } @@ -81,39 +81,42 @@ message AuthorizationPolicy { string header_name = 1 [(google.api.field_behavior) = REQUIRED]; } - // Required. List of host names to match. Matched against the ":authority" header in - // http requests. At least one host should match. Each host can be an - // exact match, or a prefix match (example "mydomain.*") or a suffix + // Required. List of host names to match. Matched against the ":authority" + // header in http requests. At least one host should match. Each host can + // be an exact match, or a prefix match (example "mydomain.*") or a suffix // match (example "*.myorg.com") or a presence (any) match "*". repeated string hosts = 1 [(google.api.field_behavior) = REQUIRED]; - // Required. List of destination ports to match. At least one port should match. + // Required. List of destination ports to match. At least one port should + // match. repeated uint32 ports = 2 [(google.api.field_behavior) = REQUIRED]; // Optional. A list of HTTP methods to match. At least one method should // match. Should not be set for gRPC services. repeated string methods = 4 [(google.api.field_behavior) = OPTIONAL]; - // Optional. Match against key:value pair in http header. Provides a flexible match - // based on HTTP headers, for potentially advanced use cases. At least one - // header should match. Avoid using header matches to make authorization - // decisions unless there is a strong guarantee that requests arrive - // through a trusted client or proxy. - HttpHeaderMatch http_header_match = 5 [(google.api.field_behavior) = OPTIONAL]; + // Optional. Match against key:value pair in http header. Provides a + // flexible match based on HTTP headers, for potentially advanced use + // cases. At least one header should match. Avoid using header matches to + // make authorization decisions unless there is a strong guarantee that + // requests arrive through a trusted client or proxy. + HttpHeaderMatch http_header_match = 5 + [(google.api.field_behavior) = OPTIONAL]; } - // Optional. List of attributes for the traffic source. All of the sources must match. - // A source is a match if both principals and ip_blocks match. If not set, - // the action specified in the 'action' field will be applied without any - // rule checks for the source. + // Optional. List of attributes for the traffic source. All of the sources + // must match. A source is a match if both principals and ip_blocks match. + // If not set, the action specified in the 'action' field will be applied + // without any rule checks for the source. repeated Source sources = 1 [(google.api.field_behavior) = OPTIONAL]; - // Optional. List of attributes for the traffic destination. All of the destinations - // must match. A destination is a match if a request matches all the - // specified hosts, ports, methods and headers. If not set, the + // Optional. List of attributes for the traffic destination. All of the + // destinations must match. A destination is a match if a request matches + // all the specified hosts, ports, methods and headers. If not set, the // action specified in the 'action' field will be applied without any rule // checks for the destination. - repeated Destination destinations = 2 [(google.api.field_behavior) = OPTIONAL]; + repeated Destination destinations = 2 + [(google.api.field_behavior) = OPTIONAL]; } // Possible values that define what action to take. @@ -138,22 +141,26 @@ message AuthorizationPolicy { string description = 2 [(google.api.field_behavior) = OPTIONAL]; // Output only. The timestamp when the resource was created. - google.protobuf.Timestamp create_time = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + google.protobuf.Timestamp create_time = 3 + [(google.api.field_behavior) = OUTPUT_ONLY]; // Output only. The timestamp when the resource was updated. - google.protobuf.Timestamp update_time = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + google.protobuf.Timestamp update_time = 4 + [(google.api.field_behavior) = OUTPUT_ONLY]; - // Optional. Set of label tags associated with the AuthorizationPolicy resource. + // Optional. Set of label tags associated with the AuthorizationPolicy + // resource. map labels = 5 [(google.api.field_behavior) = OPTIONAL]; // Required. The action to take when a rule match is found. Possible values // are "ALLOW" or "DENY". Action action = 6 [(google.api.field_behavior) = REQUIRED]; - // Optional. List of rules to match. Note that at least one of the rules must match in - // order for the action specified in the 'action' field to be taken. A rule is - // a match if there is a matching source and destination. If left blank, the - // action specified in the `action` field will be applied on every request. + // Optional. List of rules to match. Note that at least one of the rules must + // match in order for the action specified in the 'action' field to be taken. + // A rule is a match if there is a matching source and destination. If left + // blank, the action specified in the `action` field will be applied on every + // request. repeated Rule rules = 7 [(google.api.field_behavior) = OPTIONAL]; } @@ -220,7 +227,8 @@ message CreateAuthorizationPolicyRequest { string authorization_policy_id = 2 [(google.api.field_behavior) = REQUIRED]; // Required. AuthorizationPolicy resource to be created. - AuthorizationPolicy authorization_policy = 3 [(google.api.field_behavior) = REQUIRED]; + AuthorizationPolicy authorization_policy = 3 + [(google.api.field_behavior) = REQUIRED]; } // Request used by the UpdateAuthorizationPolicy method. @@ -230,16 +238,18 @@ message UpdateAuthorizationPolicyRequest { // The fields specified in the update_mask are relative to the resource, not // the full request. A field will be overwritten if it is in the mask. If the // user does not provide a mask then all fields will be overwritten. - google.protobuf.FieldMask update_mask = 1 [(google.api.field_behavior) = OPTIONAL]; + google.protobuf.FieldMask update_mask = 1 + [(google.api.field_behavior) = OPTIONAL]; // Required. Updated AuthorizationPolicy resource. - AuthorizationPolicy authorization_policy = 2 [(google.api.field_behavior) = REQUIRED]; + AuthorizationPolicy authorization_policy = 2 + [(google.api.field_behavior) = REQUIRED]; } // Request used by the DeleteAuthorizationPolicy method. message DeleteAuthorizationPolicyRequest { - // Required. A name of the AuthorizationPolicy to delete. Must be in the format - // `projects/{project}/locations/{location}/authorizationPolicies/*`. + // Required. A name of the AuthorizationPolicy to delete. Must be in the + // format `projects/{project}/locations/{location}/authorizationPolicies/*`. string name = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { diff --git a/packages/google-cloud-networksecurity/protos/google/cloud/networksecurity/v1/authz_policy.proto b/packages/google-cloud-networksecurity/protos/google/cloud/networksecurity/v1/authz_policy.proto new file mode 100644 index 00000000000..1a8c29bbcf3 --- /dev/null +++ b/packages/google-cloud-networksecurity/protos/google/cloud/networksecurity/v1/authz_policy.proto @@ -0,0 +1,691 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.networksecurity.v1; + +import "google/api/field_behavior.proto"; +import "google/api/field_info.proto"; +import "google/api/resource.proto"; +import "google/protobuf/field_mask.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.NetworkSecurity.V1"; +option go_package = "cloud.google.com/go/networksecurity/apiv1/networksecuritypb;networksecuritypb"; +option java_multiple_files = true; +option java_outer_classname = "AuthzPolicyProto"; +option java_package = "com.google.cloud.networksecurity.v1"; +option php_namespace = "Google\\Cloud\\NetworkSecurity\\V1"; +option ruby_package = "Google::Cloud::NetworkSecurity::V1"; + +// `AuthzPolicy` is a resource that allows to forward traffic to a +// callout backend designed to scan the traffic for security purposes. +message AuthzPolicy { + option (google.api.resource) = { + type: "networksecurity.googleapis.com/AuthzPolicy" + pattern: "projects/{project}/locations/{location}/authzPolicies/{authz_policy}" + plural: "authzPolicies" + singular: "authzPolicy" + }; + + // Specifies the set of targets to which this policy should be applied to. + message Target { + // Optional. All gateways and forwarding rules referenced by this policy and + // extensions must share the same load balancing scheme. Supported values: + // `INTERNAL_MANAGED` and `EXTERNAL_MANAGED`. For more information, refer + // to [Backend services + // overview](https://cloud.google.com/load-balancing/docs/backend-service). + LoadBalancingScheme load_balancing_scheme = 8 + [(google.api.field_behavior) = OPTIONAL]; + + // Required. A list of references to the Forwarding Rules on which this + // policy will be applied. + repeated string resources = 1 [(google.api.field_behavior) = REQUIRED]; + } + + // Conditions to match against the incoming request. + message AuthzRule { + // Determines how a string value should be matched. + message StringMatch { + oneof match_pattern { + // The input string must match exactly the string specified here. + // + // Examples: + // + // * ``abc`` only matches the value ``abc``. + string exact = 1; + + // The input string must have the prefix specified here. + // Note: empty prefix is not allowed, please use regex instead. + // + // Examples: + // + // * ``abc`` matches the value ``abc.xyz`` + string prefix = 2; + + // The input string must have the suffix specified here. + // Note: empty prefix is not allowed, please use regex instead. + // + // Examples: + // + // * ``abc`` matches the value ``xyz.abc`` + string suffix = 3; + + // The input string must have the substring specified here. + // Note: empty contains match is not allowed, please use regex instead. + // + // Examples: + // + // * ``abc`` matches the value ``xyz.abc.def`` + string contains = 4; + } + + // If true, indicates the exact/prefix/suffix/contains matching should be + // case insensitive. For example, the matcher ``data`` will match both + // input string ``Data`` and ``data`` if set to true. + bool ignore_case = 5; + } + + // Represents a range of IP Addresses. + message IpBlock { + // Required. The address prefix. + string prefix = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The length of the address range. + int32 length = 2 [(google.api.field_behavior) = REQUIRED]; + } + + // Describes the properties of a client VM resource accessing the internal + // application load balancers. + message RequestResource { + // Describes a set of resource tag value permanent IDs to match against + // the resource manager tags value associated with the source VM of a + // request. + message TagValueIdSet { + // Required. A list of resource tag value permanent IDs to match against + // the resource manager tags value associated with the source VM of a + // request. The match follows AND semantics which means all + // the ids must match. Limited to 5 ids in the Tag value id set. + repeated int64 ids = 1 [(google.api.field_behavior) = REQUIRED]; + } + + // Optional. A list of resource tag value permanent IDs to match against + // the resource manager tags value associated with the source VM of a + // request. + TagValueIdSet tag_value_id_set = 1 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. An IAM service account to match against the source + // service account of the VM sending the request. + StringMatch iam_service_account = 2 + [(google.api.field_behavior) = OPTIONAL]; + } + + // Determines how a HTTP header should be matched. + message HeaderMatch { + // Optional. Specifies the name of the header in the request. + string name = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Specifies how the header match will be performed. + StringMatch value = 2 [(google.api.field_behavior) = OPTIONAL]; + } + + // Describes the properties of a principal to be matched against. + message Principal { + // The principal value the principal rule will match against. + enum PrincipalSelector { + // Unspecified principal selector. It will be treated as + // CLIENT_CERT_URI_SAN by default. + PRINCIPAL_SELECTOR_UNSPECIFIED = 0; + + // The principal rule is matched against a list of URI SANs in the + // validated client's certificate. A match happens when there is any + // exact URI SAN value match. This is the default principal selector. + CLIENT_CERT_URI_SAN = 1; + + // The principal rule is matched against a list of DNS Name SANs in the + // validated client's certificate. A match happens when there is any + // exact DNS Name SAN value match. + // This is only applicable for Application Load Balancers + // except for classic Global External Application load balancer. + // CLIENT_CERT_DNS_NAME_SAN is not supported for INTERNAL_SELF_MANAGED + // load balancing scheme. + CLIENT_CERT_DNS_NAME_SAN = 2; + + // The principal rule is matched against the common name in the client's + // certificate. Authorization against multiple common names in the + // client certificate is not supported. Requests with multiple common + // names in the client certificate will be rejected if + // CLIENT_CERT_COMMON_NAME is set as the principal selector. A match + // happens when there is an exact common name value match. + // This is only applicable for Application Load Balancers + // except for global external Application Load Balancer and + // classic Application Load Balancer. + // CLIENT_CERT_COMMON_NAME is not supported for INTERNAL_SELF_MANAGED + // load balancing scheme. + CLIENT_CERT_COMMON_NAME = 3; + } + + // Optional. An enum to decide what principal value the principal rule + // will match against. If not specified, the PrincipalSelector is + // CLIENT_CERT_URI_SAN. + PrincipalSelector principal_selector = 1 + [(google.api.field_behavior) = OPTIONAL]; + + // Required. A non-empty string whose value is matched against the + // principal value based on the principal_selector. Only exact match can + // be applied for CLIENT_CERT_URI_SAN, CLIENT_CERT_DNS_NAME_SAN, + // CLIENT_CERT_COMMON_NAME selectors. + StringMatch principal = 2 [(google.api.field_behavior) = REQUIRED]; + } + + // Describes properties of one or more sources of a request. + message From { + // Describes the properties of a single source. + message RequestSource { + // Optional. A list of identities derived from the client's certificate. + // This field will not match on a request unless frontend mutual TLS is + // enabled for the forwarding rule or Gateway and the client certificate + // has been successfully validated by mTLS. + // Each identity is a string whose value is matched against a list of + // URI SANs, DNS Name SANs, or the common name in the client's + // certificate. A match happens when any principal matches with the + // rule. Limited to 50 principals per Authorization Policy for regional + // internal Application Load Balancers, regional external Application + // Load Balancers, cross-region internal Application Load Balancers, and + // Cloud Service Mesh. This field is not supported for global external + // Application Load Balancers. + repeated Principal principals = 1 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A list of IP addresses or IP address ranges to match + // against the source IP address of the request. Limited to 10 ip_blocks + // per Authorization Policy + repeated IpBlock ip_blocks = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A list of resources to match against the resource of the + // source VM of a request. Limited to 10 resources per Authorization + // Policy. + repeated RequestResource resources = 3 + [(google.api.field_behavior) = OPTIONAL]; + } + + // Optional. Describes the properties of a request's sources. At least one + // of sources or notSources must be specified. Limited to 1 source. + // A match occurs when ANY source (in sources or notSources) matches the + // request. Within a single source, the match follows AND semantics + // across fields and OR semantics within a single field, i.e. a match + // occurs when ANY principal matches AND ANY ipBlocks match. + repeated RequestSource sources = 1 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Describes the negated properties of request sources. Matches + // requests from sources that do not match the criteria specified in this + // field. At least one of sources or notSources must be specified. + repeated RequestSource not_sources = 2 + [(google.api.field_behavior) = OPTIONAL]; + } + + // Describes properties of one or more targets of a request. + message To { + // Describes properties of one or more targets of a request. + message RequestOperation { + // Describes a set of HTTP headers to match against. + message HeaderSet { + // Required. A list of headers to match against in http header. + // The match can be one of exact, prefix, suffix, or contains + // (substring match). The match follows AND semantics which means all + // the headers must match. Matches are always case sensitive unless + // the ignoreCase is set. Limited to 10 headers per Authorization + // Policy. + repeated HeaderMatch headers = 1 + [(google.api.field_behavior) = REQUIRED]; + } + + // Describes a set of MCP methods to match against. + message MCPMethod { + // Required. The MCP method to match against. Allowed values are as + // follows: + // 1. `tools`, `prompts`, `resources` - these will match against all + // sub methods under the respective methods. + // 2. `prompts/list`, `tools/list`, `resources/list`, + // `resources/templates/list` + // 3. `prompts/get`, `tools/call`, `resources/subscribe`, + // `resources/unsubscribe`, `resources/read` + // Params cannot be specified for categories 1 and 2. + string name = 1 [(google.api.field_behavior) = REQUIRED]; + + // Optional. A list of MCP method parameters to match against. The + // match can be one of exact, prefix, suffix, or contains (substring + // match). Matches are always case sensitive unless the ignoreCase is + // set. Limited to 10 MCP method parameters per Authorization Policy. + repeated StringMatch params = 2 + [(google.api.field_behavior) = OPTIONAL]; + } + + // Describes a set of MCP protocol attributes to match against for a + // given MCP request. + message MCP { + // Optional. If specified, matches on the MCP protocol’s non-access + // specific methods namely: + // * initialize + // * completion/ + // * logging/ + // * notifications/ + // * ping + // Defaults to SKIP_BASE_PROTOCOL_METHODS if not specified. + BaseProtocolMethodsOption base_protocol_methods_option = 1 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A list of MCP methods and associated parameters to match + // on. It is recommended to use this field to match on tools, prompts + // and resource accesses while setting the baseProtocolMethodsOption + // to MATCH_BASE_PROTOCOL_METHODS to match on all the other MCP + // protocol methods. + // Limited to 10 MCP methods per Authorization Policy. + repeated MCPMethod methods = 2 + [(google.api.field_behavior) = OPTIONAL]; + } + + // Describes the option to match against the base MCP protocol methods. + enum BaseProtocolMethodsOption { + // Unspecified option. Defaults to SKIP_BASE_PROTOCOL_METHODS. + BASE_PROTOCOL_METHODS_OPTION_UNSPECIFIED = 0; + + // Skip matching on the base MCP protocol methods. + SKIP_BASE_PROTOCOL_METHODS = 1; + + // Match on the base MCP protocol methods. + MATCH_BASE_PROTOCOL_METHODS = 2; + } + + // Optional. A list of headers to match against in http header. + HeaderSet header_set = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A list of HTTP Hosts to match against. The match can be one + // of exact, prefix, suffix, or contains (substring match). Matches are + // always case sensitive unless the ignoreCase is set. Limited to 10 + // hosts per Authorization Policy. + repeated StringMatch hosts = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A list of paths to match against. The match can be one of + // exact, prefix, suffix, or contains (substring match). Matches are + // always case sensitive unless the ignoreCase is set. Limited to 10 + // paths per Authorization Policy. + // Note that this path match includes the query parameters. For gRPC + // services, this should be a fully-qualified name of the form + // /package.service/method. + repeated StringMatch paths = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A list of HTTP methods to match against. Each entry must be + // a valid HTTP method name (GET, PUT, POST, HEAD, PATCH, DELETE, + // OPTIONS). It only allows exact match and is always case sensitive. + // Limited to 10 methods per Authorization Policy. + repeated string methods = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Defines the MCP protocol attributes to match on. If the MCP + // payload in the request body cannot be successfully parsed, the + // request will be denied. This field can be set only for AuthzPolicies + // targeting AgentGateway resources. + MCP mcp = 5 [(google.api.field_behavior) = OPTIONAL]; + } + + // Optional. Describes properties of one or more targets of a request. At + // least one of operations or notOperations must be specified. Limited to + // 1 operation. A match occurs when ANY operation (in operations or + // notOperations) matches. Within an operation, the match follows AND + // semantics across fields and OR semantics within a field, i.e. a match + // occurs when ANY path matches AND ANY header matches and ANY method + // matches. + repeated RequestOperation operations = 1 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Describes the negated properties of the targets of a request. + // Matches requests for operations that do not match the criteria + // specified in this field. At least one of operations or notOperations + // must be specified. + repeated RequestOperation not_operations = 2 + [(google.api.field_behavior) = OPTIONAL]; + } + + // Optional. Describes properties of a source of a request. + From from = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Describes properties of a target of a request. + To to = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. CEL expression that describes the conditions to be satisfied + // for the action. The result of the CEL expression is ANDed with the from + // and to. Refer to the CEL language reference for a list of available + // attributes. + string when = 3 [(google.api.field_behavior) = OPTIONAL]; + } + + // Allows delegating authorization decisions to Cloud IAP or to + // Service Extensions. + message CustomProvider { + // Optional. Delegates authorization decisions to Cloud IAP. Applicable + // only for managed load balancers. Enabling Cloud IAP at the AuthzPolicy + // level is not compatible with Cloud IAP settings in the BackendService. + // Enabling IAP in both places will result in request failure. Ensure that + // IAP is enabled in either the AuthzPolicy or the BackendService but not in + // both places. + message CloudIap {} + + // Optional. Delegate authorization decision to user authored extension. + // Only one of cloudIap or authzExtension can be specified. + message AuthzExtension { + // Required. A list of references to authorization + // extensions that will be invoked for requests matching this policy. + // Limited to 1 custom provider. + repeated string resources = 1 [(google.api.field_behavior) = REQUIRED]; + } + + // Optional. Delegates authorization decisions to Cloud IAP. Applicable + // only for managed load balancers. Enabling Cloud IAP at the AuthzPolicy + // level is not compatible with Cloud IAP settings in the BackendService. + // Enabling IAP in both places will result in request failure. Ensure that + // IAP is enabled in either the AuthzPolicy or the BackendService but not in + // both places. + CloudIap cloud_iap = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Delegate authorization decision to user authored Service + // Extension. Only one of cloudIap or authzExtension can be specified. + AuthzExtension authz_extension = 2 [(google.api.field_behavior) = OPTIONAL]; + } + + // Load balancing schemes supported by the `AuthzPolicy` resource. The valid + // values are `INTERNAL_MANAGED` and + // `EXTERNAL_MANAGED`. For more information, refer to [Backend services + // overview](https://cloud.google.com/load-balancing/docs/backend-service). + enum LoadBalancingScheme { + // Default value. Do not use. + LOAD_BALANCING_SCHEME_UNSPECIFIED = 0; + + // Signifies that this is used for Regional internal or Cross-region + // internal Application Load Balancing. + INTERNAL_MANAGED = 1; + + // Signifies that this is used for Global external or Regional external + // Application Load Balancing. + EXTERNAL_MANAGED = 2; + + // Signifies that this is used for Cloud Service Mesh. Meant for use by + // CSM GKE controller only. + INTERNAL_SELF_MANAGED = 3; + } + + // The action to be applied to this policy. Valid values are + // `ALLOW`, `DENY`, `CUSTOM`. + enum AuthzAction { + // Unspecified action. + AUTHZ_ACTION_UNSPECIFIED = 0; + + // Allow request to pass through to the backend. + ALLOW = 1; + + // Deny the request and return a HTTP 404 to the client. + DENY = 2; + + // Delegate the authorization decision to an external authorization engine. + CUSTOM = 3; + } + + // The type of authorization being performed. + // New values may be added in the future. + enum PolicyProfile { + // Unspecified policy profile. + POLICY_PROFILE_UNSPECIFIED = 0; + + // Applies to request authorization. `CUSTOM` authorization + // policies with Authz extensions will be allowed with `EXT_AUTHZ_GRPC` or + // `EXT_PROC_GRPC` protocols. Extensions are invoked only for request header + // events. + REQUEST_AUTHZ = 1; + + // Applies to content security, sanitization, etc. Only + // `CUSTOM` action is allowed in this policy profile. AuthzExtensions in the + // custom provider must support `EXT_PROC_GRPC` protocol only and be capable + // of receiving all `EXT_PROC_GRPC` events (REQUEST_HEADERS, REQUEST_BODY, + // REQUEST_TRAILERS, RESPONSE_HEADERS, RESPONSE_BODY, RESPONSE_TRAILERS) + // with `FULL_DUPLEX_STREAMED` body send mode. + CONTENT_AUTHZ = 2; + } + + // Required. Identifier. Name of the `AuthzPolicy` resource in the following + // format: + // `projects/{project}/locations/{location}/authzPolicies/{authz_policy}`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.field_behavior) = IDENTIFIER + ]; + + // Output only. The timestamp when the resource was created. + google.protobuf.Timestamp create_time = 2 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The timestamp when the resource was updated. + google.protobuf.Timestamp update_time = 3 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. A human-readable description of the resource. + string description = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Set of labels associated with the `AuthzPolicy` resource. + // + // The format must comply with [the following + // requirements](/compute/docs/labeling-resources#requirements). + map labels = 5 [(google.api.field_behavior) = OPTIONAL]; + + // Required. Specifies the set of resources to which this policy should be + // applied to. + Target target = 6 [(google.api.field_behavior) = REQUIRED]; + + // Optional. A list of authorization HTTP rules to match against the incoming + // request. A policy match occurs when at least one HTTP rule matches the + // request or when no HTTP rules are specified in the policy. + // At least one HTTP Rule is required for Allow or Deny Action. Limited + // to 5 rules. + repeated AuthzRule http_rules = 7 [(google.api.field_behavior) = OPTIONAL]; + + // Required. Can be one of `ALLOW`, `DENY`, `CUSTOM`. + // + // When the action is `CUSTOM`, `customProvider` must be specified. + // + // When the action is `ALLOW`, only requests matching the policy will + // be allowed. + // + // When the action is `DENY`, only requests matching the policy will be + // denied. + // + // When a request arrives, the policies are evaluated in the following order: + // + // 1. If there is a `CUSTOM` policy that matches the request, the `CUSTOM` + // policy is evaluated using the custom authorization providers and the + // request is denied if the provider rejects the request. + // + // 2. If there are any `DENY` policies that match the request, the request + // is denied. + // + // 3. If there are no `ALLOW` policies for the resource or if any of the + // `ALLOW` policies match the request, the request is allowed. + // + // 4. Else the request is denied by default if none of the configured + // AuthzPolicies with `ALLOW` action match the request. + AuthzAction action = 8 [(google.api.field_behavior) = REQUIRED]; + + // Optional. Required if the action is `CUSTOM`. Allows delegating + // authorization decisions to Cloud IAP or to Service Extensions. One of + // `cloudIap` or `authzExtension` must be specified. + CustomProvider custom_provider = 10 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Immutable. Defines the type of authorization being performed. + // If not specified, `REQUEST_AUTHZ` is applied. This field cannot be changed + // once AuthzPolicy is created. + PolicyProfile policy_profile = 11 [ + (google.api.field_behavior) = OPTIONAL, + (google.api.field_behavior) = IMMUTABLE + ]; +} + +// Message for creating an `AuthzPolicy` resource. +message CreateAuthzPolicyRequest { + // Required. The parent resource of the `AuthzPolicy` resource. Must be in + // the format `projects/{project}/locations/{location}`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "networksecurity.googleapis.com/AuthzPolicy" + } + ]; + + // Required. User-provided ID of the `AuthzPolicy` resource to be created. + string authz_policy_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. `AuthzPolicy` resource to be created. + AuthzPolicy authz_policy = 3 [(google.api.field_behavior) = REQUIRED]; + + // Optional. An optional request ID to identify requests. Specify a unique + // request ID so that if you must retry your request, the server can ignore + // the request if it has already been completed. The server guarantees + // that for at least 60 minutes since the first request. + // + // For example, consider a situation where you make an initial request and the + // request times out. If you make the request again with the same request + // ID, the server can check if original operation with the same request ID + // was received, and if so, ignores the second request. This prevents + // clients from accidentally creating duplicate commitments. + // + // The request ID must be a valid UUID with the exception that zero UUID is + // not supported (00000000-0000-0000-0000-000000000000). + string request_id = 4 [ + (google.api.field_info).format = UUID4, + (google.api.field_behavior) = OPTIONAL + ]; +} + +// Message for requesting list of `AuthzPolicy` resources. +message ListAuthzPoliciesRequest { + // Required. The project and location from which the `AuthzPolicy` resources + // are listed, specified in the following format: + // `projects/{project}/locations/{location}`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "networksecurity.googleapis.com/AuthzPolicy" + } + ]; + + // Optional. Requested page size. The server might return fewer items than + // requested. If unspecified, the server picks an appropriate default. + int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A token identifying a page of results that the server returns. + string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Filtering results. + string filter = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Hint for how to order the results. + string order_by = 5 [(google.api.field_behavior) = OPTIONAL]; +} + +// Message for response to listing `AuthzPolicy` resources. +message ListAuthzPoliciesResponse { + // The list of `AuthzPolicy` resources. + repeated AuthzPolicy authz_policies = 1; + + // A token identifying a page of results that the server returns. + string next_page_token = 2; + + // Locations that could not be reached. + repeated string unreachable = 3; +} + +// Message for getting a `AuthzPolicy` resource. +message GetAuthzPolicyRequest { + // Required. A name of the `AuthzPolicy` resource to get. Must be in the + // format + // `projects/{project}/locations/{location}/authzPolicies/{authz_policy}`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "networksecurity.googleapis.com/AuthzPolicy" + } + ]; +} + +// Message for updating an `AuthzPolicy` resource. +message UpdateAuthzPolicyRequest { + // Required. Used to specify the fields to be overwritten in the + // `AuthzPolicy` resource by the update. + // The fields specified in the `update_mask` are relative to the resource, not + // the full request. A field is overwritten if it is in the mask. If the + // user does not specify a mask, then all fields are overwritten. + google.protobuf.FieldMask update_mask = 1 + [(google.api.field_behavior) = REQUIRED]; + + // Required. `AuthzPolicy` resource being updated. + AuthzPolicy authz_policy = 2 [(google.api.field_behavior) = REQUIRED]; + + // Optional. An optional request ID to identify requests. Specify a unique + // request ID so that if you must retry your request, the server can ignore + // the request if it has already been completed. The server guarantees + // that for at least 60 minutes since the first request. + // + // For example, consider a situation where you make an initial request and the + // request times out. If you make the request again with the same request + // ID, the server can check if original operation with the same request ID + // was received, and if so, ignores the second request. This prevents + // clients from accidentally creating duplicate commitments. + // + // The request ID must be a valid UUID with the exception that zero UUID is + // not supported (00000000-0000-0000-0000-000000000000). + string request_id = 3 [ + (google.api.field_info).format = UUID4, + (google.api.field_behavior) = OPTIONAL + ]; +} + +// Message for deleting an `AuthzPolicy` resource. +message DeleteAuthzPolicyRequest { + // Required. The name of the `AuthzPolicy` resource to delete. Must be in + // the format + // `projects/{project}/locations/{location}/authzPolicies/{authz_policy}`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "networksecurity.googleapis.com/AuthzPolicy" + } + ]; + + // Optional. An optional request ID to identify requests. Specify a unique + // request ID so that if you must retry your request, the server can ignore + // the request if it has already been completed. The server guarantees + // that for at least 60 minutes after the first request. + // + // For example, consider a situation where you make an initial request and the + // request times out. If you make the request again with the same request + // ID, the server can check if original operation with the same request ID + // was received, and if so, ignores the second request. This prevents + // clients from accidentally creating duplicate commitments. + // + // The request ID must be a valid UUID with the exception that zero UUID is + // not supported (00000000-0000-0000-0000-000000000000). + string request_id = 2 [ + (google.api.field_info).format = UUID4, + (google.api.field_behavior) = OPTIONAL + ]; +} diff --git a/packages/google-cloud-networksecurity/protos/google/cloud/networksecurity/v1/backend_authentication_config.proto b/packages/google-cloud-networksecurity/protos/google/cloud/networksecurity/v1/backend_authentication_config.proto new file mode 100644 index 00000000000..76fc65b30ee --- /dev/null +++ b/packages/google-cloud-networksecurity/protos/google/cloud/networksecurity/v1/backend_authentication_config.proto @@ -0,0 +1,240 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.networksecurity.v1; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/protobuf/field_mask.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.NetworkSecurity.V1"; +option go_package = "cloud.google.com/go/networksecurity/apiv1/networksecuritypb;networksecuritypb"; +option java_multiple_files = true; +option java_outer_classname = "BackendAuthenticationConfigProto"; +option java_package = "com.google.cloud.networksecurity.v1"; +option php_namespace = "Google\\Cloud\\NetworkSecurity\\V1"; +option ruby_package = "Google::Cloud::NetworkSecurity::V1"; +option (google.api.resource_definition) = { + type: "certificatemanager.googleapis.com/Certificate" + pattern: "projects/{project}/locations/{location}/certificates/{certificate}" +}; +option (google.api.resource_definition) = { + type: "certificatemanager.googleapis.com/TrustConfig" + pattern: "projects/{project}/locations/{location}/trustConfigs/{trust_config}" +}; + +// BackendAuthenticationConfig message groups the TrustConfig together with +// other settings that control how the load balancer authenticates, and +// expresses its identity to, the backend: +// +// * `trustConfig` is the attached TrustConfig. +// +// * `wellKnownRoots` indicates whether the load balance should trust backend +// server certificates that are issued by public certificate authorities, in +// addition to certificates trusted by the TrustConfig. +// +// * `clientCertificate` is a client certificate that the load balancer uses to +// express its identity to the backend, if the connection to the backend uses +// mTLS. +// +// You can attach the BackendAuthenticationConfig to the load balancer's +// BackendService directly determining how that BackendService negotiates TLS. +message BackendAuthenticationConfig { + option (google.api.resource) = { + type: "networksecurity.googleapis.com/BackendAuthenticationConfig" + pattern: "projects/{project}/locations/{location}/backendAuthenticationConfigs/{backend_authentication_config}" + }; + + // Enum to specify the well known roots to use for server certificate + // validation. + enum WellKnownRoots { + // Equivalent to NONE. + WELL_KNOWN_ROOTS_UNSPECIFIED = 0; + + // The BackendService will only validate server certificates against roots + // specified in TrustConfig. + NONE = 1; + + // The BackendService uses a set of well-known public roots, in addition to + // any roots specified in the trustConfig field, when validating the server + // certificates presented by the backend. Validation with these roots is + // only considered when the TlsSettings.sni field in the BackendService is + // set. + // + // The well-known roots are a set of root CAs managed by Google. CAs in this + // set can be added or removed without notice. + PUBLIC_ROOTS = 2; + } + + // Required. Name of the BackendAuthenticationConfig resource. It matches the + // pattern + // `projects/*/locations/{location}/backendAuthenticationConfigs/{backend_authentication_config}` + string name = 1 [(google.api.field_behavior) = REQUIRED]; + + // Optional. Free-text description of the resource. + string description = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Output only. The timestamp when the resource was created. + google.protobuf.Timestamp create_time = 3 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The timestamp when the resource was updated. + google.protobuf.Timestamp update_time = 4 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Set of label tags associated with the resource. + map labels = 5; + + // Optional. A reference to a certificatemanager.googleapis.com.Certificate + // resource. This is a relative resource path following the form + // "projects/{project}/locations/{location}/certificates/{certificate}". + // + // Used by a BackendService to negotiate mTLS when the backend connection uses + // TLS and the backend requests a client certificate. Must have a CLIENT_AUTH + // scope. + string client_certificate = 6 [ + (google.api.field_behavior) = OPTIONAL, + (google.api.resource_reference) = { + type: "certificatemanager.googleapis.com/Certificate" + } + ]; + + // Optional. A reference to a TrustConfig resource from the + // certificatemanager.googleapis.com namespace. This is a relative resource + // path following the form + // "projects/{project}/locations/{location}/trustConfigs/{trust_config}". + // + // A BackendService uses the chain of trust represented by this TrustConfig, + // if specified, to validate the server certificates presented by the backend. + // Required unless wellKnownRoots is set to PUBLIC_ROOTS. + string trust_config = 7 [ + (google.api.field_behavior) = OPTIONAL, + (google.api.resource_reference) = { + type: "certificatemanager.googleapis.com/TrustConfig" + } + ]; + + // Well known roots to use for server certificate validation. + WellKnownRoots well_known_roots = 8; + + // Output only. Etag of the resource. + string etag = 9 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Request used by the ListBackendAuthenticationConfigs method. +message ListBackendAuthenticationConfigsRequest { + // Required. The project and location from which the + // BackendAuthenticationConfigs should be listed, specified in the format + // `projects/*/locations/{location}`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "locations.googleapis.com/Location" + } + ]; + + // Maximum number of BackendAuthenticationConfigs to return per call. + int32 page_size = 2; + + // The value returned by the last `ListBackendAuthenticationConfigsResponse` + // Indicates that this is a continuation of a prior + // `ListBackendAuthenticationConfigs` call, and that the system + // should return the next page of data. + string page_token = 3; +} + +// Response returned by the ListBackendAuthenticationConfigs method. +message ListBackendAuthenticationConfigsResponse { + // List of BackendAuthenticationConfig resources. + repeated BackendAuthenticationConfig backend_authentication_configs = 1; + + // If there might be more results than those appearing in this response, then + // `next_page_token` is included. To get the next set of results, call this + // method again using the value of `next_page_token` as `page_token`. + string next_page_token = 2; + + // Locations that could not be reached. + repeated string unreachable = 3; +} + +// Request used by the GetBackendAuthenticationConfig method. +message GetBackendAuthenticationConfigRequest { + // Required. A name of the BackendAuthenticationConfig to get. Must be in the + // format `projects/*/locations/{location}/backendAuthenticationConfigs/*`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "networksecurity.googleapis.com/BackendAuthenticationConfig" + } + ]; +} + +// Request used by the CreateBackendAuthenticationConfig method. +message CreateBackendAuthenticationConfigRequest { + // Required. The parent resource of the BackendAuthenticationConfig. Must be + // in the format `projects/*/locations/{location}`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "networksecurity.googleapis.com/BackendAuthenticationConfig" + } + ]; + + // Required. Short name of the BackendAuthenticationConfig resource to be + // created. This value should be 1-63 characters long, containing only + // letters, numbers, hyphens, and underscores, and should not start with a + // number. E.g. "backend-auth-config". + string backend_authentication_config_id = 2 + [(google.api.field_behavior) = REQUIRED]; + + // Required. BackendAuthenticationConfig resource to be created. + BackendAuthenticationConfig backend_authentication_config = 3 + [(google.api.field_behavior) = REQUIRED]; +} + +// Request used by UpdateBackendAuthenticationConfig method. +message UpdateBackendAuthenticationConfigRequest { + // Optional. Field mask is used to specify the fields to be overwritten in the + // BackendAuthenticationConfig resource by the update. The fields + // specified in the update_mask are relative to the resource, not + // the full request. A field will be overwritten if it is in the + // mask. If the user does not provide a mask then all fields will be + // overwritten. + google.protobuf.FieldMask update_mask = 1 + [(google.api.field_behavior) = OPTIONAL]; + + // Required. Updated BackendAuthenticationConfig resource. + BackendAuthenticationConfig backend_authentication_config = 2 + [(google.api.field_behavior) = REQUIRED]; +} + +// Request used by the DeleteBackendAuthenticationConfig method. +message DeleteBackendAuthenticationConfigRequest { + // Required. A name of the BackendAuthenticationConfig to delete. Must be in + // the format + // `projects/*/locations/{location}/backendAuthenticationConfigs/*`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "networksecurity.googleapis.com/BackendAuthenticationConfig" + } + ]; + + // Optional. Etag of the resource. + // If this is provided, it must match the server's etag. + string etag = 2 [(google.api.field_behavior) = OPTIONAL]; +} diff --git a/packages/google-cloud-networksecurity/protos/google/cloud/networksecurity/v1/client_tls_policy.proto b/packages/google-cloud-networksecurity/protos/google/cloud/networksecurity/v1/client_tls_policy.proto index e0f26ed9ed6..b5ef37c5bd8 100644 --- a/packages/google-cloud-networksecurity/protos/google/cloud/networksecurity/v1/client_tls_policy.proto +++ b/packages/google-cloud-networksecurity/protos/google/cloud/networksecurity/v1/client_tls_policy.proto @@ -1,4 +1,4 @@ -// Copyright 2025 Google LLC +// Copyright 2026 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -40,17 +40,19 @@ message ClientTlsPolicy { }; // Required. Name of the ClientTlsPolicy resource. It matches the pattern - // `projects/*/locations/{location}/clientTlsPolicies/{client_tls_policy}` + // `projects/{project}/locations/{location}/clientTlsPolicies/{client_tls_policy}` string name = 1 [(google.api.field_behavior) = REQUIRED]; // Optional. Free-text description of the resource. string description = 2 [(google.api.field_behavior) = OPTIONAL]; // Output only. The timestamp when the resource was created. - google.protobuf.Timestamp create_time = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + google.protobuf.Timestamp create_time = 3 + [(google.api.field_behavior) = OUTPUT_ONLY]; // Output only. The timestamp when the resource was updated. - google.protobuf.Timestamp update_time = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + google.protobuf.Timestamp update_time = 4 + [(google.api.field_behavior) = OUTPUT_ONLY]; // Optional. Set of label tags associated with the resource. map labels = 5 [(google.api.field_behavior) = OPTIONAL]; @@ -59,14 +61,17 @@ message ClientTlsPolicy { // handshake. E.g: "secure.example.com". string sni = 6 [(google.api.field_behavior) = OPTIONAL]; - // Optional. Defines a mechanism to provision client identity (public and private keys) - // for peer to peer authentication. The presence of this dictates mTLS. - CertificateProvider client_certificate = 7 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Defines the mechanism to obtain the Certificate Authority certificate to - // validate the server certificate. If empty, client does not validate the - // server certificate. - repeated ValidationCA server_validation_ca = 8 [(google.api.field_behavior) = OPTIONAL]; + // Optional. Defines a mechanism to provision client identity (public and + // private keys) for peer to peer authentication. The presence of this + // dictates mTLS. + CertificateProvider client_certificate = 7 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Defines the mechanism to obtain the Certificate Authority + // certificate to validate the server certificate. If empty, client does not + // validate the server certificate. + repeated ValidationCA server_validation_ca = 8 + [(google.api.field_behavior) = OPTIONAL]; } // Request used by the ListClientTlsPolicies method. @@ -124,13 +129,15 @@ message CreateClientTlsPolicyRequest { } ]; - // Required. Short name of the ClientTlsPolicy resource to be created. This value should - // be 1-63 characters long, containing only letters, numbers, hyphens, and - // underscores, and should not start with a number. E.g. "client_mtls_policy". + // Required. Short name of the ClientTlsPolicy resource to be created. This + // value should be 1-63 characters long, containing only letters, numbers, + // hyphens, and underscores, and should not start with a number. E.g. + // "client_mtls_policy". string client_tls_policy_id = 2 [(google.api.field_behavior) = REQUIRED]; // Required. ClientTlsPolicy resource to be created. - ClientTlsPolicy client_tls_policy = 3 [(google.api.field_behavior) = REQUIRED]; + ClientTlsPolicy client_tls_policy = 3 + [(google.api.field_behavior) = REQUIRED]; } // Request used by UpdateClientTlsPolicy method. @@ -141,10 +148,12 @@ message UpdateClientTlsPolicyRequest { // the full request. A field will be overwritten if it is in the // mask. If the user does not provide a mask then all fields will be // overwritten. - google.protobuf.FieldMask update_mask = 1 [(google.api.field_behavior) = OPTIONAL]; + google.protobuf.FieldMask update_mask = 1 + [(google.api.field_behavior) = OPTIONAL]; // Required. Updated ClientTlsPolicy resource. - ClientTlsPolicy client_tls_policy = 2 [(google.api.field_behavior) = REQUIRED]; + ClientTlsPolicy client_tls_policy = 2 + [(google.api.field_behavior) = REQUIRED]; } // Request used by the DeleteClientTlsPolicy method. diff --git a/packages/google-cloud-networksecurity/protos/google/cloud/networksecurity/v1/common.proto b/packages/google-cloud-networksecurity/protos/google/cloud/networksecurity/v1/common.proto index 1023840fbeb..54a6c3cb39a 100644 --- a/packages/google-cloud-networksecurity/protos/google/cloud/networksecurity/v1/common.proto +++ b/packages/google-cloud-networksecurity/protos/google/cloud/networksecurity/v1/common.proto @@ -1,4 +1,4 @@ -// Copyright 2025 Google LLC +// Copyright 2026 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -30,10 +30,12 @@ option ruby_package = "Google::Cloud::NetworkSecurity::V1"; // Represents the metadata of the long-running operation. message OperationMetadata { // Output only. The time the operation was created. - google.protobuf.Timestamp create_time = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + google.protobuf.Timestamp create_time = 1 + [(google.api.field_behavior) = OUTPUT_ONLY]; // Output only. The time the operation finished running. - google.protobuf.Timestamp end_time = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + google.protobuf.Timestamp end_time = 2 + [(google.api.field_behavior) = OUTPUT_ONLY]; // Output only. Server-defined resource path for the target of the operation. string target = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; @@ -46,8 +48,9 @@ message OperationMetadata { // Output only. Identifies whether the user has requested cancellation // of the operation. Operations that have successfully been cancelled - // have [Operation.error][] value with a [google.rpc.Status.code][google.rpc.Status.code] of 1, - // corresponding to `Code.CANCELLED`. + // have [Operation.error][] value with a + // [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to + // `Code.CANCELLED`. bool requested_cancellation = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; // Output only. API version used to start the operation. diff --git a/packages/google-cloud-networksecurity/protos/google/cloud/networksecurity/v1/dns_threat_detector.proto b/packages/google-cloud-networksecurity/protos/google/cloud/networksecurity/v1/dns_threat_detector.proto new file mode 100644 index 00000000000..86c73770f5f --- /dev/null +++ b/packages/google-cloud-networksecurity/protos/google/cloud/networksecurity/v1/dns_threat_detector.proto @@ -0,0 +1,234 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.networksecurity.v1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/protobuf/empty.proto"; +import "google/protobuf/field_mask.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.NetworkSecurity.V1"; +option go_package = "cloud.google.com/go/networksecurity/apiv1/networksecuritypb;networksecuritypb"; +option java_multiple_files = true; +option java_outer_classname = "DnsThreatDetectorProto"; +option java_package = "com.google.cloud.networksecurity.v1"; +option php_namespace = "Google\\Cloud\\NetworkSecurity\\V1"; +option ruby_package = "Google::Cloud::NetworkSecurity::V1"; +option (google.api.resource_definition) = { + type: "compute.googleapis.com/Network" + pattern: "projects/{project}/global/networks/{network}" +}; + +// The Network Security API for DNS Threat Detectors. +service DnsThreatDetectorService { + option (google.api.default_host) = "networksecurity.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform"; + + // Lists DnsThreatDetectors in a given project and location. + rpc ListDnsThreatDetectors(ListDnsThreatDetectorsRequest) + returns (ListDnsThreatDetectorsResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*}/dnsThreatDetectors" + }; + option (google.api.method_signature) = "parent"; + } + + // Gets the details of a single DnsThreatDetector. + rpc GetDnsThreatDetector(GetDnsThreatDetectorRequest) + returns (DnsThreatDetector) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/dnsThreatDetectors/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Creates a new DnsThreatDetector in a given project and location. + rpc CreateDnsThreatDetector(CreateDnsThreatDetectorRequest) + returns (DnsThreatDetector) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*}/dnsThreatDetectors" + body: "dns_threat_detector" + }; + option (google.api.method_signature) = + "parent,dns_threat_detector,dns_threat_detector_id"; + } + + // Updates a single DnsThreatDetector. + rpc UpdateDnsThreatDetector(UpdateDnsThreatDetectorRequest) + returns (DnsThreatDetector) { + option (google.api.http) = { + patch: "/v1/{dns_threat_detector.name=projects/*/locations/*/dnsThreatDetectors/*}" + body: "dns_threat_detector" + }; + option (google.api.method_signature) = "dns_threat_detector,update_mask"; + } + + // Deletes a single DnsThreatDetector. + rpc DeleteDnsThreatDetector(DeleteDnsThreatDetectorRequest) + returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/locations/*/dnsThreatDetectors/*}" + }; + option (google.api.method_signature) = "name"; + } +} + +// A DNS threat detector sends DNS query logs to a _provider_ that then +// analyzes the logs to identify threat events in the DNS queries. +// By default, all VPC networks in your projects are included. You can exclude +// specific networks by supplying `excluded_networks`. +message DnsThreatDetector { + option (google.api.resource) = { + type: "networksecurity.googleapis.com/DnsThreatDetector" + pattern: "projects/{project}/locations/{location}/dnsThreatDetectors/{dns_threat_detector}" + plural: "dnsThreatDetectors" + singular: "dnsThreatDetector" + }; + + // Name of the provider used for DNS threat analysis. + enum Provider { + // An unspecified provider. + PROVIDER_UNSPECIFIED = 0; + + // The Infoblox DNS threat detector provider. + INFOBLOX = 1; + } + + // Immutable. Identifier. Name of the DnsThreatDetector resource. + string name = 1 [ + (google.api.field_behavior) = IDENTIFIER, + (google.api.field_behavior) = IMMUTABLE + ]; + + // Output only. Create time stamp. + google.protobuf.Timestamp create_time = 2 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Update time stamp. + google.protobuf.Timestamp update_time = 3 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. Any labels associated with the DnsThreatDetector, listed as key + // value pairs. + map labels = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A list of network resource names which aren't monitored by this + // DnsThreatDetector. + // + // Example: + // `projects/PROJECT_ID/global/networks/NETWORK_NAME`. + repeated string excluded_networks = 5 [ + (google.api.field_behavior) = OPTIONAL, + (google.api.resource_reference) = { type: "compute.googleapis.com/Network" } + ]; + + // Required. The provider used for DNS threat analysis. + Provider provider = 6 [(google.api.field_behavior) = REQUIRED]; +} + +// The message for requesting a list of DnsThreatDetectors in the project. +message ListDnsThreatDetectorsRequest { + // Required. The parent value for `ListDnsThreatDetectorsRequest`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "networksecurity.googleapis.com/DnsThreatDetector" + } + ]; + + // Optional. The requested page size. The server may return fewer items than + // requested. If unspecified, the server picks an appropriate default. + int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A page token received from a previous + // `ListDnsThreatDetectorsRequest` call. Provide this to retrieve the + // subsequent page. + string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// The response message to requesting a list of DnsThreatDetectors. +message ListDnsThreatDetectorsResponse { + // The list of DnsThreatDetector resources. + repeated DnsThreatDetector dns_threat_detectors = 1; + + // A token, which can be sent as `page_token`, to retrieve the next page. + string next_page_token = 2; + + // Unordered list. Unreachable `DnsThreatDetector` resources. + repeated string unreachable = 3 + [(google.api.field_behavior) = UNORDERED_LIST]; +} + +// The message sent to get a DnsThreatDetector. +message GetDnsThreatDetectorRequest { + // Required. Name of the DnsThreatDetector resource. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "networksecurity.googleapis.com/DnsThreatDetector" + } + ]; +} + +// The message to create a DnsThreatDetector. +message CreateDnsThreatDetectorRequest { + // Required. The value for the parent of the DnsThreatDetector resource. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "networksecurity.googleapis.com/DnsThreatDetector" + } + ]; + + // Optional. The ID of the requesting DnsThreatDetector object. + // If this field is not supplied, the service generates an identifier. + string dns_threat_detector_id = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Required. The `DnsThreatDetector` resource to create. + DnsThreatDetector dns_threat_detector = 3 + [(google.api.field_behavior) = REQUIRED]; +} + +// The message for updating a DnsThreatDetector. +message UpdateDnsThreatDetectorRequest { + // Optional. The field mask is used to specify the fields to be overwritten in + // the DnsThreatDetector resource by the update. The fields specified in the + // update_mask are relative to the resource, not the full request. A field + // will be overwritten if it is in the mask. If the mask is not provided then + // all fields present in the request will be overwritten. + google.protobuf.FieldMask update_mask = 1 + [(google.api.field_behavior) = OPTIONAL]; + + // Required. The DnsThreatDetector resource being updated. + DnsThreatDetector dns_threat_detector = 2 + [(google.api.field_behavior) = REQUIRED]; +} + +// The message for deleting a DnsThreatDetector. +message DeleteDnsThreatDetectorRequest { + // Required. Name of the DnsThreatDetector resource. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "networksecurity.googleapis.com/DnsThreatDetector" + } + ]; +} diff --git a/packages/google-cloud-networksecurity/protos/google/cloud/networksecurity/v1/firewall_activation.proto b/packages/google-cloud-networksecurity/protos/google/cloud/networksecurity/v1/firewall_activation.proto new file mode 100644 index 00000000000..a965f589b76 --- /dev/null +++ b/packages/google-cloud-networksecurity/protos/google/cloud/networksecurity/v1/firewall_activation.proto @@ -0,0 +1,637 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.networksecurity.v1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/networksecurity/v1/common.proto"; +import "google/longrunning/operations.proto"; +import "google/protobuf/empty.proto"; +import "google/protobuf/field_mask.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.NetworkSecurity.V1"; +option go_package = "cloud.google.com/go/networksecurity/apiv1/networksecuritypb;networksecuritypb"; +option java_multiple_files = true; +option java_outer_classname = "FirewallActivationProto"; +option java_package = "com.google.cloud.networksecurity.v1"; +option php_namespace = "Google\\Cloud\\NetworkSecurity\\V1"; +option ruby_package = "Google::Cloud::NetworkSecurity::V1"; +option (google.api.resource_definition) = { + type: "networksecurity.googleapis.com/OrganizationLocation" + pattern: "organizations/{organization}/locations/{location}" +}; + +// Service for managing Firewall Endpoints and Associations. +service FirewallActivation { + option (google.api.default_host) = "networksecurity.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform"; + + // Lists FirewallEndpoints in a given organization and location. + rpc ListFirewallEndpoints(ListFirewallEndpointsRequest) + returns (ListFirewallEndpointsResponse) { + option (google.api.http) = { + get: "/v1/{parent=organizations/*/locations/*}/firewallEndpoints" + }; + option (google.api.method_signature) = "parent"; + } + + // Gets details of a single org Endpoint. + rpc GetFirewallEndpoint(GetFirewallEndpointRequest) + returns (FirewallEndpoint) { + option (google.api.http) = { + get: "/v1/{name=organizations/*/locations/*/firewallEndpoints/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Creates a new FirewallEndpoint in a given organization and location. + rpc CreateFirewallEndpoint(CreateFirewallEndpointRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{parent=organizations/*/locations/*}/firewallEndpoints" + body: "firewall_endpoint" + }; + option (google.api.method_signature) = + "parent,firewall_endpoint,firewall_endpoint_id"; + option (google.longrunning.operation_info) = { + response_type: "FirewallEndpoint" + metadata_type: "google.cloud.networksecurity.v1.OperationMetadata" + }; + } + + // Deletes a single org Endpoint. + rpc DeleteFirewallEndpoint(DeleteFirewallEndpointRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v1/{name=organizations/*/locations/*/firewallEndpoints/*}" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "google.cloud.networksecurity.v1.OperationMetadata" + }; + } + + // Update a single org Endpoint. + rpc UpdateFirewallEndpoint(UpdateFirewallEndpointRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + patch: "/v1/{firewall_endpoint.name=organizations/*/locations/*/firewallEndpoints/*}" + body: "firewall_endpoint" + }; + option (google.api.method_signature) = "firewall_endpoint,update_mask"; + option (google.longrunning.operation_info) = { + response_type: "FirewallEndpoint" + metadata_type: "google.cloud.networksecurity.v1.OperationMetadata" + }; + } + + // Lists Associations in a given project and location. + rpc ListFirewallEndpointAssociations(ListFirewallEndpointAssociationsRequest) + returns (ListFirewallEndpointAssociationsResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*}/firewallEndpointAssociations" + }; + option (google.api.method_signature) = "parent"; + } + + // Gets details of a single FirewallEndpointAssociation. + rpc GetFirewallEndpointAssociation(GetFirewallEndpointAssociationRequest) + returns (FirewallEndpointAssociation) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/firewallEndpointAssociations/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Creates a new FirewallEndpointAssociation in a given project and location. + rpc CreateFirewallEndpointAssociation( + CreateFirewallEndpointAssociationRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*}/firewallEndpointAssociations" + body: "firewall_endpoint_association" + }; + option (google.api.method_signature) = + "parent,firewall_endpoint_association,firewall_endpoint_association_id"; + option (google.longrunning.operation_info) = { + response_type: "FirewallEndpointAssociation" + metadata_type: "google.cloud.networksecurity.v1.OperationMetadata" + }; + } + + // Deletes a single FirewallEndpointAssociation. + rpc DeleteFirewallEndpointAssociation( + DeleteFirewallEndpointAssociationRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/locations/*/firewallEndpointAssociations/*}" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "google.cloud.networksecurity.v1.OperationMetadata" + }; + } + + // Update a single FirewallEndpointAssociation. + rpc UpdateFirewallEndpointAssociation( + UpdateFirewallEndpointAssociationRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + patch: "/v1/{firewall_endpoint_association.name=projects/*/locations/*/firewallEndpointAssociations/*}" + body: "firewall_endpoint_association" + }; + option (google.api.method_signature) = + "firewall_endpoint_association,update_mask"; + option (google.longrunning.operation_info) = { + response_type: "FirewallEndpointAssociation" + metadata_type: "google.cloud.networksecurity.v1.OperationMetadata" + }; + } +} + +// Message describing Endpoint object. +message FirewallEndpoint { + option (google.api.resource) = { + type: "networksecurity.googleapis.com/FirewallEndpoint" + pattern: "organizations/{organization}/locations/{location}/firewallEndpoints/{firewall_endpoint}" + pattern: "projects/{project}/locations/{location}/firewallEndpoints/{firewall_endpoint}" + plural: "firewallEndpoints" + singular: "firewallEndpoint" + }; + + // This is a subset of the FirewallEndpointAssociation message, containing + // fields to be used by the consumer. + message AssociationReference { + // Output only. The resource name of the FirewallEndpointAssociation. + // Format: + // projects/{project}/locations/{location}/firewallEndpointAssociations/{id} + string name = 1 [ + (google.api.field_behavior) = OUTPUT_ONLY, + (google.api.resource_reference) = { + type: "networksecurity.googleapis.com/FirewallEndpointAssociation" + } + ]; + + // Output only. The VPC network associated. Format: + // projects/{project}/global/networks/{name}. + string network = 2 [ + (google.api.field_behavior) = OUTPUT_ONLY, + (google.api.resource_reference) = { + type: "compute.googleapis.com/Network" + } + ]; + } + + // Settings for the endpoint. + message EndpointSettings { + // Optional. Immutable. Indicates whether Jumbo Frames are enabled. + // Default value is false. + bool jumbo_frames_enabled = 1 [ + (google.api.field_behavior) = OPTIONAL, + (google.api.field_behavior) = IMMUTABLE + ]; + } + + // Endpoint state. + enum State { + // Not set. + STATE_UNSPECIFIED = 0; + + // Being created. + CREATING = 1; + + // Processing configuration updates. + ACTIVE = 2; + + // Being deleted. + DELETING = 3; + + // Down or in an error state. + INACTIVE = 4; + } + + // Immutable. Identifier. Name of resource. + string name = 1 [ + (google.api.field_behavior) = IMMUTABLE, + (google.api.field_behavior) = IDENTIFIER + ]; + + // Optional. Description of the firewall endpoint. Max length 2048 + // characters. + string description = 9 [(google.api.field_behavior) = OPTIONAL]; + + // Output only. Create time stamp. + google.protobuf.Timestamp create_time = 2 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Update time stamp + google.protobuf.Timestamp update_time = 3 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. Labels as key value pairs + map labels = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Output only. Current state of the endpoint. + State state = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Whether reconciling is in progress, recommended per + // https://google.aip.dev/128. + bool reconciling = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. List of networks that are associated with this endpoint in the + // local zone. This is a projection of the FirewallEndpointAssociations + // pointing at this endpoint. A network will only appear in this list after + // traffic routing is fully configured. Format: + // projects/{project}/global/networks/{name}. + repeated string associated_networks = 7 + [deprecated = true, (google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. List of FirewallEndpointAssociations that are associated to + // this endpoint. An association will only appear in this list after traffic + // routing is fully configured. + repeated AssociationReference associations = 13 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. [Output Only] Reserved for future use. + optional bool satisfies_pzs = 14 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. [Output Only] Reserved for future use. + optional bool satisfies_pzi = 15 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. Project to charge for the deployed firewall endpoint. + // This field must be specified when creating the endpoint in the organization + // scope, and should be omitted otherwise. + string billing_project_id = 8 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Settings for the endpoint. + EndpointSettings endpoint_settings = 19 + [(google.api.field_behavior) = OPTIONAL]; +} + +// Message for requesting list of Endpoints +message ListFirewallEndpointsRequest { + // Required. Parent value for ListEndpointsRequest + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "networksecurity.googleapis.com/FirewallEndpoint" + } + ]; + + // Optional. Requested page size. Server may return fewer items than + // requested. If unspecified, server will pick an appropriate default. + int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; + + // A token identifying a page of results the server should return. + string page_token = 3; + + // Optional. Filtering results + string filter = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Hint for how to order the results + string order_by = 5; +} + +// Message for response to listing Endpoints +message ListFirewallEndpointsResponse { + // The list of Endpoint + repeated FirewallEndpoint firewall_endpoints = 1; + + // A token identifying a page of results the server should return. + string next_page_token = 2; + + // Locations that could not be reached. + repeated string unreachable = 3; +} + +// Message for getting a Endpoint +message GetFirewallEndpointRequest { + // Required. Name of the resource + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "networksecurity.googleapis.com/FirewallEndpoint" + } + ]; +} + +// Message for creating a Endpoint +message CreateFirewallEndpointRequest { + // Required. Value for parent. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "networksecurity.googleapis.com/FirewallEndpoint" + } + ]; + + // Required. Id of the requesting object. + // If auto-generating Id server-side, remove this field and + // firewall_endpoint_id from the method_signature of Create RPC. + string firewall_endpoint_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The resource being created + FirewallEndpoint firewall_endpoint = 3 + [(google.api.field_behavior) = REQUIRED]; + + // Optional. An optional request ID to identify requests. Specify a unique + // request ID so that if you must retry your request, the server will know to + // ignore the request if it has already been completed. The server will + // guarantee that for at least 60 minutes since the first request. + // + // For example, consider a situation where you make an initial request and + // the request times out. If you make the request again with the same request + // ID, the server can check if original operation with the same request ID + // was received, and if so, will ignore the second request. This prevents + // clients from accidentally creating duplicate commitments. + // + // The request ID must be a valid UUID with the exception that zero UUID is + // not supported (00000000-0000-0000-0000-000000000000). + string request_id = 4 [(google.api.field_behavior) = OPTIONAL]; +} + +// Message for updating a Endpoint +message UpdateFirewallEndpointRequest { + // Required. Field mask is used to specify the fields to be overwritten in the + // Endpoint resource by the update. + // The fields specified in the update_mask are relative to the resource, not + // the full request. A field will be overwritten if it is in the mask. If the + // user does not provide a mask then all fields will be overwritten. + google.protobuf.FieldMask update_mask = 1 + [(google.api.field_behavior) = REQUIRED]; + + // Required. The resource being updated + FirewallEndpoint firewall_endpoint = 2 + [(google.api.field_behavior) = REQUIRED]; + + // Optional. An optional request ID to identify requests. Specify a unique + // request ID so that if you must retry your request, the server will know to + // ignore the request if it has already been completed. The server will + // guarantee that for at least 60 minutes since the first request. + // + // For example, consider a situation where you make an initial request and + // the request times out. If you make the request again with the same request + // ID, the server can check if original operation with the same request ID + // was received, and if so, will ignore the second request. This prevents + // clients from accidentally creating duplicate commitments. + // + // The request ID must be a valid UUID with the exception that zero UUID is + // not supported (00000000-0000-0000-0000-000000000000). + string request_id = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// Message for deleting a Endpoint +message DeleteFirewallEndpointRequest { + // Required. Name of the resource + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "networksecurity.googleapis.com/FirewallEndpoint" + } + ]; + + // Optional. An optional request ID to identify requests. Specify a unique + // request ID so that if you must retry your request, the server will know to + // ignore the request if it has already been completed. The server will + // guarantee that for at least 60 minutes after the first request. + // + // For example, consider a situation where you make an initial request and + // the request times out. If you make the request again with the same request + // ID, the server can check if original operation with the same request ID + // was received, and if so, will ignore the second request. This prevents + // clients from accidentally creating duplicate commitments. + // + // The request ID must be a valid UUID with the exception that zero UUID is + // not supported (00000000-0000-0000-0000-000000000000). + string request_id = 2 [(google.api.field_behavior) = OPTIONAL]; +} + +// Message describing Association object +message FirewallEndpointAssociation { + option (google.api.resource) = { + type: "networksecurity.googleapis.com/FirewallEndpointAssociation" + pattern: "projects/{project}/locations/{location}/firewallEndpointAssociations/{firewall_endpoint_association}" + }; + + // Association state. + enum State { + // Not set. + STATE_UNSPECIFIED = 0; + + // Being created. + CREATING = 1; + + // Active and ready for traffic. + ACTIVE = 2; + + // Being deleted. + DELETING = 3; + + // Down or in an error state. + INACTIVE = 4; + + // The project that housed the association has been deleted. + ORPHAN = 5; + } + + // Immutable. Identifier. name of resource + string name = 1 [ + (google.api.field_behavior) = IMMUTABLE, + (google.api.field_behavior) = IDENTIFIER + ]; + + // Output only. Create time stamp + google.protobuf.Timestamp create_time = 2 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Update time stamp + google.protobuf.Timestamp update_time = 3 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. Labels as key value pairs + map labels = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Output only. Current state of the association. + State state = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Required. The URL of the network that is being associated. + string network = 6 [(google.api.field_behavior) = REQUIRED]; + + // Required. The URL of the FirewallEndpoint that is being associated. + string firewall_endpoint = 7 [(google.api.field_behavior) = REQUIRED]; + + // Optional. The URL of the TlsInspectionPolicy that is being associated. + string tls_inspection_policy = 8 [ + (google.api.field_behavior) = OPTIONAL, + (google.api.resource_reference) = { + type: "networksecurity.googleapis.com/TlsInspectionPolicy" + } + ]; + + // Output only. Whether reconciling is in progress, recommended per + // https://google.aip.dev/128. + bool reconciling = 9 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. Whether the association is disabled. + // True indicates that traffic won't be intercepted + bool disabled = 10 [(google.api.field_behavior) = OPTIONAL]; +} + +// Message for requesting list of Associations +message ListFirewallEndpointAssociationsRequest { + // Required. Parent value for ListAssociationsRequest + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "networksecurity.googleapis.com/FirewallEndpointAssociation" + } + ]; + + // Optional. Requested page size. Server may return fewer items than + // requested. If unspecified, server will pick an appropriate default. + int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; + + // A token identifying a page of results the server should return. + string page_token = 3; + + // Optional. Filtering results + string filter = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Hint for how to order the results + string order_by = 5; +} + +// Message for response to listing Associations +message ListFirewallEndpointAssociationsResponse { + // The list of Association + repeated FirewallEndpointAssociation firewall_endpoint_associations = 1; + + // A token identifying a page of results the server should return. + string next_page_token = 2; + + // Locations that could not be reached. + repeated string unreachable = 3; +} + +// Message for getting a Association +message GetFirewallEndpointAssociationRequest { + // Required. Name of the resource + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "networksecurity.googleapis.com/FirewallEndpointAssociation" + } + ]; +} + +// Message for creating a Association +message CreateFirewallEndpointAssociationRequest { + // Required. Value for parent. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "networksecurity.googleapis.com/FirewallEndpointAssociation" + } + ]; + + // Optional. Id of the requesting object. + // If auto-generating Id server-side, remove this field and + // firewall_endpoint_association_id from the method_signature of Create RPC. + string firewall_endpoint_association_id = 2 + [(google.api.field_behavior) = OPTIONAL]; + + // Required. The resource being created + FirewallEndpointAssociation firewall_endpoint_association = 3 + [(google.api.field_behavior) = REQUIRED]; + + // Optional. An optional request ID to identify requests. Specify a unique + // request ID so that if you must retry your request, the server will know to + // ignore the request if it has already been completed. The server will + // guarantee that for at least 60 minutes since the first request. + // + // For example, consider a situation where you make an initial request and + // the request times out. If you make the request again with the same request + // ID, the server can check if original operation with the same request ID + // was received, and if so, will ignore the second request. This prevents + // clients from accidentally creating duplicate commitments. + // + // The request ID must be a valid UUID with the exception that zero UUID is + // not supported (00000000-0000-0000-0000-000000000000). + string request_id = 4 [(google.api.field_behavior) = OPTIONAL]; +} + +// Message for deleting a Association +message DeleteFirewallEndpointAssociationRequest { + // Required. Name of the resource + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "networksecurity.googleapis.com/FirewallEndpointAssociation" + } + ]; + + // Optional. An optional request ID to identify requests. Specify a unique + // request ID so that if you must retry your request, the server will know to + // ignore the request if it has already been completed. The server will + // guarantee that for at least 60 minutes after the first request. + // + // For example, consider a situation where you make an initial request and + // the request times out. If you make the request again with the same request + // ID, the server can check if original operation with the same request ID + // was received, and if so, will ignore the second request. This prevents + // clients from accidentally creating duplicate commitments. + // + // The request ID must be a valid UUID with the exception that zero UUID is + // not supported (00000000-0000-0000-0000-000000000000). + string request_id = 2 [(google.api.field_behavior) = OPTIONAL]; +} + +// Message for updating an Association +message UpdateFirewallEndpointAssociationRequest { + // Required. Field mask is used to specify the fields to be overwritten in the + // Association resource by the update. + // The fields specified in the update_mask are relative to the resource, not + // the full request. A field will be overwritten if it is in the mask. If the + // user does not provide a mask then all fields will be overwritten. + google.protobuf.FieldMask update_mask = 1 + [(google.api.field_behavior) = REQUIRED]; + + // Required. The resource being updated + FirewallEndpointAssociation firewall_endpoint_association = 2 + [(google.api.field_behavior) = REQUIRED]; + + // Optional. An optional request ID to identify requests. Specify a unique + // request ID so that if you must retry your request, the server will know to + // ignore the request if it has already been completed. The server will + // guarantee that for at least 60 minutes since the first request. + // + // For example, consider a situation where you make an initial request and + // the request times out. If you make the request again with the same request + // ID, the server can check if original operation with the same request ID + // was received, and if so, will ignore the second request. This prevents + // clients from accidentally creating duplicate commitments. + // + // The request ID must be a valid UUID with the exception that zero UUID is + // not supported (00000000-0000-0000-0000-000000000000). + string request_id = 3 [(google.api.field_behavior) = OPTIONAL]; +} diff --git a/packages/google-cloud-networksecurity/protos/google/cloud/networksecurity/v1/gateway_security_policy.proto b/packages/google-cloud-networksecurity/protos/google/cloud/networksecurity/v1/gateway_security_policy.proto new file mode 100644 index 00000000000..5f174fd1285 --- /dev/null +++ b/packages/google-cloud-networksecurity/protos/google/cloud/networksecurity/v1/gateway_security_policy.proto @@ -0,0 +1,163 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.networksecurity.v1; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/protobuf/field_mask.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.NetworkSecurity.V1"; +option go_package = "cloud.google.com/go/networksecurity/apiv1/networksecuritypb;networksecuritypb"; +option java_multiple_files = true; +option java_outer_classname = "GatewaySecurityPolicyProto"; +option java_package = "com.google.cloud.networksecurity.v1"; +option php_namespace = "Google\\Cloud\\NetworkSecurity\\V1"; +option ruby_package = "Google::Cloud::NetworkSecurity::V1"; + +// The GatewaySecurityPolicy resource contains a collection of +// GatewaySecurityPolicyRules and associated metadata. +message GatewaySecurityPolicy { + option (google.api.resource) = { + type: "networksecurity.googleapis.com/GatewaySecurityPolicy" + pattern: "projects/{project}/locations/{location}/gatewaySecurityPolicies/{gateway_security_policy}" + }; + + // Required. Name of the resource. Name is of the form + // projects/{project}/locations/{location}/gatewaySecurityPolicies/{gateway_security_policy} + // gateway_security_policy should match the + // pattern:(^[a-z]([a-z0-9-]{0,61}[a-z0-9])?$). + string name = 1 [(google.api.field_behavior) = REQUIRED]; + + // Output only. The timestamp when the resource was created. + google.protobuf.Timestamp create_time = 2 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The timestamp when the resource was updated. + google.protobuf.Timestamp update_time = 3 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. Free-text description of the resource. + string description = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Name of a TLS Inspection Policy resource that defines how TLS + // inspection will be performed for any rule(s) which enables it. + string tls_inspection_policy = 5 [ + (google.api.field_behavior) = OPTIONAL, + (google.api.resource_reference) = { + type: "networksecurity.googleapis.com/TlsInspectionPolicy" + } + ]; +} + +// Request used by the CreateGatewaySecurityPolicy method. +message CreateGatewaySecurityPolicyRequest { + // Required. The parent resource of the GatewaySecurityPolicy. Must be in the + // format `projects/{project}/locations/{location}`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "networksecurity.googleapis.com/GatewaySecurityPolicy" + } + ]; + + // Required. Short name of the GatewaySecurityPolicy resource to be created. + // This value should be 1-63 characters long, containing only + // letters, numbers, hyphens, and underscores, and should not start + // with a number. E.g. "gateway_security_policy1". + string gateway_security_policy_id = 2 + [(google.api.field_behavior) = REQUIRED]; + + // Required. GatewaySecurityPolicy resource to be created. + GatewaySecurityPolicy gateway_security_policy = 3 + [(google.api.field_behavior) = REQUIRED]; +} + +// Request used with the ListGatewaySecurityPolicies method. +message ListGatewaySecurityPoliciesRequest { + // Required. The project and location from which the GatewaySecurityPolicies + // should be listed, specified in the format + // `projects/{project}/locations/{location}`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "locations.googleapis.com/Location" + } + ]; + + // Maximum number of GatewaySecurityPolicies to return per call. + int32 page_size = 2; + + // The value returned by the last + // 'ListGatewaySecurityPoliciesResponse' Indicates that this is a + // continuation of a prior 'ListGatewaySecurityPolicies' call, and + // that the system should return the next page of data. + string page_token = 3; +} + +// Response returned by the ListGatewaySecurityPolicies method. +message ListGatewaySecurityPoliciesResponse { + // List of GatewaySecurityPolicies resources. + repeated GatewaySecurityPolicy gateway_security_policies = 1; + + // If there might be more results than those appearing in this response, then + // 'next_page_token' is included. To get the next set of results, call this + // method again using the value of 'next_page_token' as 'page_token'. + string next_page_token = 2; + + // Locations that could not be reached. + repeated string unreachable = 3; +} + +// Request used by the GetGatewaySecurityPolicy method. +message GetGatewaySecurityPolicyRequest { + // Required. A name of the GatewaySecurityPolicy to get. Must be in the format + // `projects/{project}/locations/{location}/gatewaySecurityPolicies/*`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "networksecurity.googleapis.com/GatewaySecurityPolicy" + } + ]; +} + +// Request used by the DeleteGatewaySecurityPolicy method. +message DeleteGatewaySecurityPolicyRequest { + // Required. A name of the GatewaySecurityPolicy to delete. Must be in the + // format `projects/{project}/locations/{location}/gatewaySecurityPolicies/*`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "networksecurity.googleapis.com/GatewaySecurityPolicy" + } + ]; +} + +// Request used by the UpdateGatewaySecurityPolicy method. +message UpdateGatewaySecurityPolicyRequest { + // Optional. Field mask is used to specify the fields to be overwritten in the + // GatewaySecurityPolicy resource by the update. + // The fields specified in the update_mask are relative to the resource, not + // the full request. A field will be overwritten if it is in the mask. If the + // user does not provide a mask then all fields will be overwritten. + google.protobuf.FieldMask update_mask = 1 + [(google.api.field_behavior) = OPTIONAL]; + + // Required. Updated GatewaySecurityPolicy resource. + GatewaySecurityPolicy gateway_security_policy = 2 + [(google.api.field_behavior) = REQUIRED]; +} diff --git a/packages/google-cloud-networksecurity/protos/google/cloud/networksecurity/v1/gateway_security_policy_rule.proto b/packages/google-cloud-networksecurity/protos/google/cloud/networksecurity/v1/gateway_security_policy_rule.proto new file mode 100644 index 00000000000..eeedf2a4ab2 --- /dev/null +++ b/packages/google-cloud-networksecurity/protos/google/cloud/networksecurity/v1/gateway_security_policy_rule.proto @@ -0,0 +1,196 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.networksecurity.v1; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/protobuf/field_mask.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.NetworkSecurity.V1"; +option go_package = "cloud.google.com/go/networksecurity/apiv1/networksecuritypb;networksecuritypb"; +option java_multiple_files = true; +option java_outer_classname = "GatewaySecurityPolicyRuleProto"; +option java_package = "com.google.cloud.networksecurity.v1"; +option php_namespace = "Google\\Cloud\\NetworkSecurity\\V1"; +option ruby_package = "Google::Cloud::NetworkSecurity::V1"; + +// The GatewaySecurityPolicyRule resource is in a nested collection within a +// GatewaySecurityPolicy and represents a traffic matching condition and +// associated action to perform. +message GatewaySecurityPolicyRule { + option (google.api.resource) = { + type: "networksecurity.googleapis.com/GatewaySecurityPolicyRule" + pattern: "projects/{project}/locations/{location}/gatewaySecurityPolicies/{gateway_security_policy}/rules/{rule}" + }; + + // enum to define the primitive action. + enum BasicProfile { + // If there is not a mentioned action for the target. + BASIC_PROFILE_UNSPECIFIED = 0; + + // Allow the matched traffic. + ALLOW = 1; + + // Deny the matched traffic. + DENY = 2; + } + + oneof profile { + // Required. Profile which tells what the primitive action should be. + BasicProfile basic_profile = 9 [(google.api.field_behavior) = REQUIRED]; + } + + // Required. Immutable. Name of the resource. ame is the full resource name so + // projects/{project}/locations/{location}/gatewaySecurityPolicies/{gateway_security_policy}/rules/{rule} + // rule should match the + // pattern: (^[a-z]([a-z0-9-]{0,61}[a-z0-9])?$). + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.field_behavior) = IMMUTABLE + ]; + + // Output only. Time when the rule was created. + google.protobuf.Timestamp create_time = 2 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Time when the rule was updated. + google.protobuf.Timestamp update_time = 3 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Required. Whether the rule is enforced. + bool enabled = 4 [(google.api.field_behavior) = REQUIRED]; + + // Required. Priority of the rule. + // Lower number corresponds to higher precedence. + int32 priority = 5 [(google.api.field_behavior) = REQUIRED]; + + // Optional. Free-text description of the resource. + string description = 6 [(google.api.field_behavior) = OPTIONAL]; + + // Required. CEL expression for matching on session criteria. + string session_matcher = 7 [(google.api.field_behavior) = REQUIRED]; + + // Optional. CEL expression for matching on L7/application level criteria. + string application_matcher = 8 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Flag to enable TLS inspection of traffic matching on + // , can only be true if the parent GatewaySecurityPolicy + // references a TLSInspectionConfig. + bool tls_inspection_enabled = 10 [(google.api.field_behavior) = OPTIONAL]; +} + +// Methods for GatewaySecurityPolicy RULES/GatewaySecurityPolicyRules. +// Request used by the CreateGatewaySecurityPolicyRule method. +message CreateGatewaySecurityPolicyRuleRequest { + // Required. The parent where this rule will be created. + // Format : + // projects/{project}/location/{location}/gatewaySecurityPolicies/* + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "networksecurity.googleapis.com/GatewaySecurityPolicyRule" + } + ]; + + // Required. The rule to be created. + GatewaySecurityPolicyRule gateway_security_policy_rule = 2 + [(google.api.field_behavior) = REQUIRED]; + + // The ID to use for the rule, which will become the final component of + // the rule's resource name. + // This value should be 4-63 characters, and valid characters + // are /[a-z][0-9]-/. + string gateway_security_policy_rule_id = 3; +} + +// Request used by the GetGatewaySecurityPolicyRule method. +message GetGatewaySecurityPolicyRuleRequest { + // Required. The name of the GatewaySecurityPolicyRule to retrieve. + // Format: + // projects/{project}/location/{location}/gatewaySecurityPolicies/*/rules/* + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "networksecurity.googleapis.com/GatewaySecurityPolicyRule" + } + ]; +} + +// Request used by the UpdateGatewaySecurityPolicyRule method. +message UpdateGatewaySecurityPolicyRuleRequest { + // Optional. Field mask is used to specify the fields to be overwritten in the + // GatewaySecurityPolicy resource by the update. + // The fields specified in the update_mask are relative to the resource, not + // the full request. A field will be overwritten if it is in the mask. If the + // user does not provide a mask then all fields will be overwritten. + google.protobuf.FieldMask update_mask = 1 + [(google.api.field_behavior) = OPTIONAL]; + + // Required. Updated GatewaySecurityPolicyRule resource. + GatewaySecurityPolicyRule gateway_security_policy_rule = 2 + [(google.api.field_behavior) = REQUIRED]; +} + +// Request used with the ListGatewaySecurityPolicyRules method. +message ListGatewaySecurityPolicyRulesRequest { + // Required. The project, location and GatewaySecurityPolicy from which the + // GatewaySecurityPolicyRules should be listed, specified in the format + // `projects/{project}/locations/{location}/gatewaySecurityPolicies/{gatewaySecurityPolicy}`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "networksecurity.googleapis.com/GatewaySecurityPolicy" + } + ]; + + // Maximum number of GatewaySecurityPolicyRules to return per call. + int32 page_size = 2; + + // The value returned by the last + // 'ListGatewaySecurityPolicyRulesResponse' Indicates that this is a + // continuation of a prior 'ListGatewaySecurityPolicyRules' call, and + // that the system should return the next page of data. + string page_token = 3; +} + +// Response returned by the ListGatewaySecurityPolicyRules method. +message ListGatewaySecurityPolicyRulesResponse { + // List of GatewaySecurityPolicyRule resources. + repeated GatewaySecurityPolicyRule gateway_security_policy_rules = 1; + + // If there might be more results than those appearing in this response, then + // 'next_page_token' is included. To get the next set of results, call this + // method again using the value of 'next_page_token' as 'page_token'. + string next_page_token = 2; + + // Locations that could not be reached. + repeated string unreachable = 3; +} + +// Request used by the DeleteGatewaySecurityPolicyRule method. +message DeleteGatewaySecurityPolicyRuleRequest { + // Required. A name of the GatewaySecurityPolicyRule to delete. Must be in the + // format + // `projects/{project}/locations/{location}/gatewaySecurityPolicies/{gatewaySecurityPolicy}/rules/*`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "networksecurity.googleapis.com/GatewaySecurityPolicyRule" + } + ]; +} diff --git a/packages/google-cloud-networksecurity/protos/google/cloud/networksecurity/v1/intercept.proto b/packages/google-cloud-networksecurity/protos/google/cloud/networksecurity/v1/intercept.proto new file mode 100644 index 00000000000..956ec2c13f2 --- /dev/null +++ b/packages/google-cloud-networksecurity/protos/google/cloud/networksecurity/v1/intercept.proto @@ -0,0 +1,1353 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.networksecurity.v1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/field_info.proto"; +import "google/api/resource.proto"; +import "google/cloud/networksecurity/v1/common.proto"; +import "google/longrunning/operations.proto"; +import "google/protobuf/empty.proto"; +import "google/protobuf/field_mask.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.NetworkSecurity.V1"; +option go_package = "cloud.google.com/go/networksecurity/apiv1/networksecuritypb;networksecuritypb"; +option java_multiple_files = true; +option java_outer_classname = "InterceptProto"; +option java_package = "com.google.cloud.networksecurity.v1"; +option php_namespace = "Google\\Cloud\\NetworkSecurity\\V1"; +option ruby_package = "Google::Cloud::NetworkSecurity::V1"; + +// Service for Third-Party Packet Intercept (TPPI). +// TPPI is the "in-band" flavor of the Network Security Integrations product. +service Intercept { + option (google.api.default_host) = "networksecurity.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform"; + + // Lists endpoint groups in a given project and location. + // See https://google.aip.dev/132. + rpc ListInterceptEndpointGroups(ListInterceptEndpointGroupsRequest) + returns (ListInterceptEndpointGroupsResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*}/interceptEndpointGroups" + }; + option (google.api.method_signature) = "parent"; + } + + // Gets a specific endpoint group. + // See https://google.aip.dev/131. + rpc GetInterceptEndpointGroup(GetInterceptEndpointGroupRequest) + returns (InterceptEndpointGroup) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/interceptEndpointGroups/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Creates an endpoint group in a given project and location. + // See https://google.aip.dev/133. + rpc CreateInterceptEndpointGroup(CreateInterceptEndpointGroupRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*}/interceptEndpointGroups" + body: "intercept_endpoint_group" + }; + option (google.api.method_signature) = + "parent,intercept_endpoint_group,intercept_endpoint_group_id"; + option (google.longrunning.operation_info) = { + response_type: "InterceptEndpointGroup" + metadata_type: "google.cloud.networksecurity.v1.OperationMetadata" + }; + } + + // Updates an endpoint group. + // See https://google.aip.dev/134. + rpc UpdateInterceptEndpointGroup(UpdateInterceptEndpointGroupRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + patch: "/v1/{intercept_endpoint_group.name=projects/*/locations/*/interceptEndpointGroups/*}" + body: "intercept_endpoint_group" + }; + option (google.api.method_signature) = + "intercept_endpoint_group,update_mask"; + option (google.longrunning.operation_info) = { + response_type: "InterceptEndpointGroup" + metadata_type: "google.cloud.networksecurity.v1.OperationMetadata" + }; + } + + // Deletes an endpoint group. + // See https://google.aip.dev/135. + rpc DeleteInterceptEndpointGroup(DeleteInterceptEndpointGroupRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/locations/*/interceptEndpointGroups/*}" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "google.cloud.networksecurity.v1.OperationMetadata" + }; + } + + // Lists associations in a given project and location. + // See https://google.aip.dev/132. + rpc ListInterceptEndpointGroupAssociations( + ListInterceptEndpointGroupAssociationsRequest) + returns (ListInterceptEndpointGroupAssociationsResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*}/interceptEndpointGroupAssociations" + }; + option (google.api.method_signature) = "parent"; + } + + // Gets a specific association. + // See https://google.aip.dev/131. + rpc GetInterceptEndpointGroupAssociation( + GetInterceptEndpointGroupAssociationRequest) + returns (InterceptEndpointGroupAssociation) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/interceptEndpointGroupAssociations/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Creates an association in a given project and location. + // See https://google.aip.dev/133. + rpc CreateInterceptEndpointGroupAssociation( + CreateInterceptEndpointGroupAssociationRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*}/interceptEndpointGroupAssociations" + body: "intercept_endpoint_group_association" + }; + option (google.api.method_signature) = + "parent,intercept_endpoint_group_association,intercept_endpoint_group_association_id"; + option (google.longrunning.operation_info) = { + response_type: "InterceptEndpointGroupAssociation" + metadata_type: "google.cloud.networksecurity.v1.OperationMetadata" + }; + } + + // Updates an association. + // See https://google.aip.dev/134. + rpc UpdateInterceptEndpointGroupAssociation( + UpdateInterceptEndpointGroupAssociationRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + patch: "/v1/{intercept_endpoint_group_association.name=projects/*/locations/*/interceptEndpointGroupAssociations/*}" + body: "intercept_endpoint_group_association" + }; + option (google.api.method_signature) = + "intercept_endpoint_group_association,update_mask"; + option (google.longrunning.operation_info) = { + response_type: "InterceptEndpointGroupAssociation" + metadata_type: "google.cloud.networksecurity.v1.OperationMetadata" + }; + } + + // Deletes an association. + // See https://google.aip.dev/135. + rpc DeleteInterceptEndpointGroupAssociation( + DeleteInterceptEndpointGroupAssociationRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/locations/*/interceptEndpointGroupAssociations/*}" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "google.cloud.networksecurity.v1.OperationMetadata" + }; + } + + // Lists deployment groups in a given project and location. + // See https://google.aip.dev/132. + rpc ListInterceptDeploymentGroups(ListInterceptDeploymentGroupsRequest) + returns (ListInterceptDeploymentGroupsResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*}/interceptDeploymentGroups" + }; + option (google.api.method_signature) = "parent"; + } + + // Gets a specific deployment group. + // See https://google.aip.dev/131. + rpc GetInterceptDeploymentGroup(GetInterceptDeploymentGroupRequest) + returns (InterceptDeploymentGroup) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/interceptDeploymentGroups/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Creates a deployment group in a given project and location. + // See https://google.aip.dev/133. + rpc CreateInterceptDeploymentGroup(CreateInterceptDeploymentGroupRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*}/interceptDeploymentGroups" + body: "intercept_deployment_group" + }; + option (google.api.method_signature) = + "parent,intercept_deployment_group,intercept_deployment_group_id"; + option (google.longrunning.operation_info) = { + response_type: "InterceptDeploymentGroup" + metadata_type: "google.cloud.networksecurity.v1.OperationMetadata" + }; + } + + // Updates a deployment group. + // See https://google.aip.dev/134. + rpc UpdateInterceptDeploymentGroup(UpdateInterceptDeploymentGroupRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + patch: "/v1/{intercept_deployment_group.name=projects/*/locations/*/interceptDeploymentGroups/*}" + body: "intercept_deployment_group" + }; + option (google.api.method_signature) = + "intercept_deployment_group,update_mask"; + option (google.longrunning.operation_info) = { + response_type: "InterceptDeploymentGroup" + metadata_type: "google.cloud.networksecurity.v1.OperationMetadata" + }; + } + + // Deletes a deployment group. + // See https://google.aip.dev/135. + rpc DeleteInterceptDeploymentGroup(DeleteInterceptDeploymentGroupRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/locations/*/interceptDeploymentGroups/*}" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "google.cloud.networksecurity.v1.OperationMetadata" + }; + } + + // Lists deployments in a given project and location. + // See https://google.aip.dev/132. + rpc ListInterceptDeployments(ListInterceptDeploymentsRequest) + returns (ListInterceptDeploymentsResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*}/interceptDeployments" + }; + option (google.api.method_signature) = "parent"; + } + + // Gets a specific deployment. + // See https://google.aip.dev/131. + rpc GetInterceptDeployment(GetInterceptDeploymentRequest) + returns (InterceptDeployment) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/interceptDeployments/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Creates a deployment in a given project and location. + // See https://google.aip.dev/133. + rpc CreateInterceptDeployment(CreateInterceptDeploymentRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*}/interceptDeployments" + body: "intercept_deployment" + }; + option (google.api.method_signature) = + "parent,intercept_deployment,intercept_deployment_id"; + option (google.longrunning.operation_info) = { + response_type: "InterceptDeployment" + metadata_type: "google.cloud.networksecurity.v1.OperationMetadata" + }; + } + + // Updates a deployment. + // See https://google.aip.dev/134. + rpc UpdateInterceptDeployment(UpdateInterceptDeploymentRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + patch: "/v1/{intercept_deployment.name=projects/*/locations/*/interceptDeployments/*}" + body: "intercept_deployment" + }; + option (google.api.method_signature) = "intercept_deployment,update_mask"; + option (google.longrunning.operation_info) = { + response_type: "InterceptDeployment" + metadata_type: "google.cloud.networksecurity.v1.OperationMetadata" + }; + } + + // Deletes a deployment. + // See https://google.aip.dev/135. + rpc DeleteInterceptDeployment(DeleteInterceptDeploymentRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/locations/*/interceptDeployments/*}" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "google.cloud.networksecurity.v1.OperationMetadata" + }; + } +} + +// An endpoint group is a consumer frontend for a deployment group (backend). +// In order to configure intercept for a network, consumers must create: +// - An association between their network and the endpoint group. +// - A security profile that points to the endpoint group. +// - A firewall rule that references the security profile (group). +message InterceptEndpointGroup { + option (google.api.resource) = { + type: "networksecurity.googleapis.com/InterceptEndpointGroup" + pattern: "projects/{project}/locations/{location}/interceptEndpointGroups/{intercept_endpoint_group}" + plural: "interceptEndpointGroups" + singular: "interceptEndpointGroup" + }; + + // The endpoint group's view of a connected deployment group. + message ConnectedDeploymentGroup { + // Output only. The connected deployment group's resource name, for example: + // `projects/123456789/locations/global/interceptDeploymentGroups/my-dg`. + // See https://google.aip.dev/124. + string name = 1 [ + (google.api.field_behavior) = OUTPUT_ONLY, + (google.api.resource_reference) = { + type: "networksecurity.googleapis.com/InterceptDeploymentGroup" + } + ]; + + // Output only. The list of locations where the deployment group is present. + repeated InterceptLocation locations = 2 + [(google.api.field_behavior) = OUTPUT_ONLY]; + } + + // The endpoint group's view of a connected association. + message AssociationDetails { + // Output only. The connected association's resource name, for example: + // `projects/123456789/locations/global/interceptEndpointGroupAssociations/my-ega`. + // See https://google.aip.dev/124. + string name = 1 [ + (google.api.field_behavior) = OUTPUT_ONLY, + (google.api.resource_reference) = { + type: "networksecurity.googleapis.com/InterceptEndpointGroupAssociation" + } + ]; + + // Output only. The associated network, for example: + // projects/123456789/global/networks/my-network. + // See https://google.aip.dev/124. + string network = 2 [ + (google.api.field_behavior) = OUTPUT_ONLY, + (google.api.resource_reference) = { + type: "compute.googleapis.com/Network" + } + ]; + + // Output only. Most recent known state of the association. + InterceptEndpointGroupAssociation.State state = 3 + [(google.api.field_behavior) = OUTPUT_ONLY]; + } + + // Endpoint group state. + enum State { + // State not set (this is not a valid state). + STATE_UNSPECIFIED = 0; + + // The endpoint group is ready and in sync with the target deployment group. + ACTIVE = 1; + + // The deployment group backing this endpoint group has been force-deleted. + // This endpoint group cannot be used and interception is effectively + // disabled. + CLOSED = 2; + + // The endpoint group is being created. + CREATING = 3; + + // The endpoint group is being deleted. + DELETING = 4; + + // The endpoint group is out of sync with the backing deployment group. + // In most cases, this is a result of a transient issue within the system + // (e.g. an inaccessible location) and the system is expected to recover + // automatically. See the associations field for details per network and + // location. + OUT_OF_SYNC = 5; + + // An attempt to delete the endpoint group has failed. This is a terminal + // state and the endpoint group is not expected to recover. + // The only permitted operation is to retry deleting the endpoint group. + DELETE_FAILED = 6; + } + + // Immutable. Identifier. The resource name of this endpoint group, for + // example: + // `projects/123456789/locations/global/interceptEndpointGroups/my-eg`. + // See https://google.aip.dev/122 for more details. + string name = 1 [ + (google.api.field_behavior) = IDENTIFIER, + (google.api.field_behavior) = IMMUTABLE + ]; + + // Output only. The timestamp when the resource was created. + // See https://google.aip.dev/148#timestamps. + google.protobuf.Timestamp create_time = 2 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The timestamp when the resource was most recently updated. + // See https://google.aip.dev/148#timestamps. + google.protobuf.Timestamp update_time = 3 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. Labels are key/value pairs that help to organize and filter + // resources. + map labels = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Required. Immutable. The deployment group that this endpoint group is + // connected to, for example: + // `projects/123456789/locations/global/interceptDeploymentGroups/my-dg`. + // See https://google.aip.dev/124. + string intercept_deployment_group = 5 [ + (google.api.field_behavior) = REQUIRED, + (google.api.field_behavior) = IMMUTABLE, + (google.api.resource_reference) = { + type: "networksecurity.googleapis.com/InterceptDeploymentGroup" + } + ]; + + // Output only. Details about the connected deployment group to this endpoint + // group. + ConnectedDeploymentGroup connected_deployment_group = 11 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The current state of the endpoint group. + // See https://google.aip.dev/216. + State state = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The current state of the resource does not match the user's + // intended state, and the system is working to reconcile them. This is part + // of the normal operation (e.g. adding a new association to the group). See + // https://google.aip.dev/128. + bool reconciling = 8 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. List of associations to this endpoint group. + repeated AssociationDetails associations = 9 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. User-provided description of the endpoint group. + // Used as additional context for the endpoint group. + string description = 10 [(google.api.field_behavior) = OPTIONAL]; +} + +// Request message for ListInterceptEndpointGroups. +message ListInterceptEndpointGroupsRequest { + // Required. The parent, which owns this collection of endpoint groups. + // Example: `projects/123456789/locations/global`. + // See https://google.aip.dev/132 for more details. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "networksecurity.googleapis.com/InterceptEndpointGroup" + } + ]; + + // Optional. Requested page size. Server may return fewer items than + // requested. If unspecified, server will pick an appropriate default. See + // https://google.aip.dev/158 for more details. + int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A page token, received from a previous + // `ListInterceptEndpointGroups` call. Provide this to retrieve the subsequent + // page. When paginating, all other parameters provided to + // `ListInterceptEndpointGroups` must match the call that provided the page + // token. + // See https://google.aip.dev/158 for more details. + string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Filter expression. + // See https://google.aip.dev/160#filtering for more details. + string filter = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Sort expression. + // See https://google.aip.dev/132#ordering for more details. + string order_by = 5 [(google.api.field_behavior) = OPTIONAL]; +} + +// Response message for ListInterceptEndpointGroups. +message ListInterceptEndpointGroupsResponse { + // The endpoint groups from the specified parent. + repeated InterceptEndpointGroup intercept_endpoint_groups = 1; + + // A token that can be sent as `page_token` to retrieve the next page. + // If this field is omitted, there are no subsequent pages. + // See https://google.aip.dev/158 for more details. + string next_page_token = 2; +} + +// Request message for GetInterceptEndpointGroup. +message GetInterceptEndpointGroupRequest { + // Required. The name of the endpoint group to retrieve. + // Format: + // projects/{project}/locations/{location}/interceptEndpointGroups/{intercept_endpoint_group} + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "networksecurity.googleapis.com/InterceptEndpointGroup" + } + ]; +} + +// Request message for CreateInterceptEndpointGroup. +message CreateInterceptEndpointGroupRequest { + // Required. The parent resource where this endpoint group will be created. + // Format: projects/{project}/locations/{location} + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "networksecurity.googleapis.com/InterceptEndpointGroup" + } + ]; + + // Required. The ID to use for the endpoint group, which will become the final + // component of the endpoint group's resource name. + string intercept_endpoint_group_id = 2 + [(google.api.field_behavior) = REQUIRED]; + + // Required. The endpoint group to create. + InterceptEndpointGroup intercept_endpoint_group = 3 + [(google.api.field_behavior) = REQUIRED]; + + // Optional. A unique identifier for this request. Must be a UUID4. + // This request is only idempotent if a `request_id` is provided. + // See https://google.aip.dev/155 for more details. + string request_id = 4 [ + (google.api.field_info).format = UUID4, + (google.api.field_behavior) = OPTIONAL + ]; +} + +// Request message for UpdateInterceptEndpointGroup. +message UpdateInterceptEndpointGroupRequest { + // Optional. The list of fields to update. + // Fields are specified relative to the endpoint group + // (e.g. `description`; *not* `intercept_endpoint_group.description`). + // See https://google.aip.dev/161 for more details. + google.protobuf.FieldMask update_mask = 1 + [(google.api.field_behavior) = OPTIONAL]; + + // Required. The endpoint group to update. + InterceptEndpointGroup intercept_endpoint_group = 2 + [(google.api.field_behavior) = REQUIRED]; + + // Optional. A unique identifier for this request. Must be a UUID4. + // This request is only idempotent if a `request_id` is provided. + // See https://google.aip.dev/155 for more details. + string request_id = 3 [ + (google.api.field_info).format = UUID4, + (google.api.field_behavior) = OPTIONAL + ]; +} + +// Request message for DeleteInterceptEndpointGroup. +message DeleteInterceptEndpointGroupRequest { + // Required. The endpoint group to delete. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "networksecurity.googleapis.com/InterceptEndpointGroup" + } + ]; + + // Optional. A unique identifier for this request. Must be a UUID4. + // This request is only idempotent if a `request_id` is provided. + // See https://google.aip.dev/155 for more details. + string request_id = 2 [ + (google.api.field_info).format = UUID4, + (google.api.field_behavior) = OPTIONAL + ]; +} + +// An endpoint group association represents a link between a network and an +// endpoint group in the organization. +// +// Creating an association creates the networking infrastructure linking the +// network to the endpoint group, but does not enable intercept by itself. +// To enable intercept, the user must also create a network firewall policy +// containing intercept rules and associate it with the network. +message InterceptEndpointGroupAssociation { + option (google.api.resource) = { + type: "networksecurity.googleapis.com/InterceptEndpointGroupAssociation" + pattern: "projects/{project}/locations/{location}/interceptEndpointGroupAssociations/{intercept_endpoint_group_association}" + plural: "interceptEndpointGroupAssociations" + singular: "interceptEndpointGroupAssociation" + }; + + // Contains details about the state of an association in a specific cloud + // location. + message LocationDetails { + // The state of association. + enum State { + // Not set. + STATE_UNSPECIFIED = 0; + + // The association is ready and in sync with the linked endpoint group. + ACTIVE = 1; + + // The association is out of sync with the linked endpoint group. + // In most cases, this is a result of a transient issue within the system + // (e.g. an inaccessible location) and the system is expected to recover + // automatically. + OUT_OF_SYNC = 2; + } + + // Output only. The cloud location, e.g. "us-central1-a" or "asia-south1". + string location = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The current state of the association in this location. + State state = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + } + + // The state of the association. + enum State { + // Not set. + STATE_UNSPECIFIED = 0; + + // The association is ready and in sync with the linked endpoint group. + ACTIVE = 1; + + // The association is being created. + CREATING = 2; + + // The association is being deleted. + DELETING = 3; + + // The association is disabled due to a breaking change in another resource. + CLOSED = 4; + + // The association is out of sync with the linked endpoint group. + // In most cases, this is a result of a transient issue within the system + // (e.g. an inaccessible location) and the system is expected to recover + // automatically. Check the `locations_details` field for more details. + OUT_OF_SYNC = 5; + + // An attempt to delete the association has failed. This is a terminal state + // and the association is not expected to be usable as some of its resources + // have been deleted. + // The only permitted operation is to retry deleting the association. + DELETE_FAILED = 6; + } + + // Immutable. Identifier. The resource name of this endpoint group + // association, for example: + // `projects/123456789/locations/global/interceptEndpointGroupAssociations/my-eg-association`. + // See https://google.aip.dev/122 for more details. + string name = 1 [ + (google.api.field_behavior) = IDENTIFIER, + (google.api.field_behavior) = IMMUTABLE + ]; + + // Output only. The timestamp when the resource was created. + // See https://google.aip.dev/148#timestamps. + google.protobuf.Timestamp create_time = 2 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The timestamp when the resource was most recently updated. + // See https://google.aip.dev/148#timestamps. + google.protobuf.Timestamp update_time = 3 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. Labels are key/value pairs that help to organize and filter + // resources. + map labels = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Required. Immutable. The endpoint group that this association is connected + // to, for example: + // `projects/123456789/locations/global/interceptEndpointGroups/my-eg`. + // See https://google.aip.dev/124. + string intercept_endpoint_group = 5 [ + (google.api.field_behavior) = REQUIRED, + (google.api.field_behavior) = IMMUTABLE, + (google.api.resource_reference) = { + type: "networksecurity.googleapis.com/InterceptEndpointGroup" + } + ]; + + // Required. Immutable. The VPC network that is associated. for example: + // `projects/123456789/global/networks/my-network`. + // See https://google.aip.dev/124. + string network = 6 [ + (google.api.field_behavior) = REQUIRED, + (google.api.field_behavior) = IMMUTABLE, + (google.api.resource_reference) = { type: "compute.googleapis.com/Network" } + ]; + + // Output only. The list of locations where the association is present. This + // information is retrieved from the linked endpoint group, and not configured + // as part of the association itself. + repeated LocationDetails locations_details = 7 + [deprecated = true, (google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Current state of the endpoint group association. + State state = 8 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The current state of the resource does not match the user's + // intended state, and the system is working to reconcile them. This part of + // the normal operation (e.g. adding a new location to the target deployment + // group). See https://google.aip.dev/128. + bool reconciling = 9 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The list of locations where the association is configured. + // This information is retrieved from the linked endpoint group. + repeated InterceptLocation locations = 10 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Identifier used by the data-path. + // See the NSI GENEVE format for more details: + // https://docs.cloud.google.com/network-security-integration/docs/understand-geneve#network_id + uint32 network_cookie = 12 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Request message for ListInterceptEndpointGroupAssociations. +message ListInterceptEndpointGroupAssociationsRequest { + // Required. The parent, which owns this collection of associations. + // Example: `projects/123456789/locations/global`. + // See https://google.aip.dev/132 for more details. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "networksecurity.googleapis.com/InterceptEndpointGroupAssociation" + } + ]; + + // Optional. Requested page size. Server may return fewer items than + // requested. If unspecified, server will pick an appropriate default. See + // https://google.aip.dev/158 for more details. + int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A page token, received from a previous + // `ListInterceptEndpointGroups` call. Provide this to retrieve the subsequent + // page. When paginating, all other parameters provided to + // `ListInterceptEndpointGroups` must match the call that provided the page + // token. See https://google.aip.dev/158 for more details. + string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Filter expression. + // See https://google.aip.dev/160#filtering for more details. + string filter = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Sort expression. + // See https://google.aip.dev/132#ordering for more details. + string order_by = 5 [(google.api.field_behavior) = OPTIONAL]; +} + +// Response message for ListInterceptEndpointGroupAssociations. +message ListInterceptEndpointGroupAssociationsResponse { + // The associations from the specified parent. + repeated InterceptEndpointGroupAssociation + intercept_endpoint_group_associations = 1; + + // A token that can be sent as `page_token` to retrieve the next page. + // If this field is omitted, there are no subsequent pages. + // See https://google.aip.dev/158 for more details. + string next_page_token = 2; +} + +// Request message for GetInterceptEndpointGroupAssociation. +message GetInterceptEndpointGroupAssociationRequest { + // Required. The name of the association to retrieve. + // Format: + // projects/{project}/locations/{location}/interceptEndpointGroupAssociations/{intercept_endpoint_group_association} + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "networksecurity.googleapis.com/InterceptEndpointGroupAssociation" + } + ]; +} + +// Request message for CreateInterceptEndpointGroupAssociation. +message CreateInterceptEndpointGroupAssociationRequest { + // Required. The parent resource where this association will be created. + // Format: projects/{project}/locations/{location} + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "networksecurity.googleapis.com/InterceptEndpointGroupAssociation" + } + ]; + + // Optional. The ID to use for the new association, which will become the + // final component of the endpoint group's resource name. If not provided, the + // server will generate a unique ID. + string intercept_endpoint_group_association_id = 2 + [(google.api.field_behavior) = OPTIONAL]; + + // Required. The association to create. + InterceptEndpointGroupAssociation intercept_endpoint_group_association = 3 + [(google.api.field_behavior) = REQUIRED]; + + // Optional. A unique identifier for this request. Must be a UUID4. + // This request is only idempotent if a `request_id` is provided. + // See https://google.aip.dev/155 for more details. + string request_id = 4 [ + (google.api.field_info).format = UUID4, + (google.api.field_behavior) = OPTIONAL + ]; +} + +// Request message for UpdateInterceptEndpointGroupAssociation. +message UpdateInterceptEndpointGroupAssociationRequest { + // Optional. The list of fields to update. + // Fields are specified relative to the association + // (e.g. `description`; *not* + // `intercept_endpoint_group_association.description`). See + // https://google.aip.dev/161 for more details. + google.protobuf.FieldMask update_mask = 1 + [(google.api.field_behavior) = OPTIONAL]; + + // Required. The association to update. + InterceptEndpointGroupAssociation intercept_endpoint_group_association = 2 + [(google.api.field_behavior) = REQUIRED]; + + // Optional. A unique identifier for this request. Must be a UUID4. + // This request is only idempotent if a `request_id` is provided. + // See https://google.aip.dev/155 for more details. + string request_id = 3 [ + (google.api.field_info).format = UUID4, + (google.api.field_behavior) = OPTIONAL + ]; +} + +// Request message for DeleteInterceptEndpointGroupAssociation. +message DeleteInterceptEndpointGroupAssociationRequest { + // Required. The association to delete. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "networksecurity.googleapis.com/InterceptEndpointGroupAssociation" + } + ]; + + // Optional. A unique identifier for this request. Must be a UUID4. + // This request is only idempotent if a `request_id` is provided. + // See https://google.aip.dev/155 for more details. + string request_id = 2 [ + (google.api.field_info).format = UUID4, + (google.api.field_behavior) = OPTIONAL + ]; +} + +// A deployment group aggregates many zonal intercept backends (deployments) +// into a single global intercept service. Consumers can connect this service +// using an endpoint group. +message InterceptDeploymentGroup { + option (google.api.resource) = { + type: "networksecurity.googleapis.com/InterceptDeploymentGroup" + pattern: "projects/{project}/locations/{location}/interceptDeploymentGroups/{intercept_deployment_group}" + plural: "interceptDeploymentGroups" + singular: "interceptDeploymentGroup" + }; + + // An endpoint group connected to this deployment group. + message ConnectedEndpointGroup { + // Output only. The connected endpoint group's resource name, for example: + // `projects/123456789/locations/global/interceptEndpointGroups/my-eg`. + // See https://google.aip.dev/124. + string name = 1 [ + (google.api.field_behavior) = OUTPUT_ONLY, + (google.api.resource_reference) = { + type: "networksecurity.googleapis.com/InterceptEndpointGroup" + } + ]; + } + + // A deployment belonging to this deployment group. + message Deployment { + // Output only. The name of the Intercept Deployment, in the format: + // `projects/{project}/locations/{location}/interceptDeployments/{intercept_deployment}`. + string name = 1 [ + (google.api.field_behavior) = OUTPUT_ONLY, + (google.api.resource_reference) = { + type: "networksecurity.googleapis.com/InterceptDeployment" + } + ]; + + // Output only. Most recent known state of the deployment. + InterceptDeployment.State state = 2 + [(google.api.field_behavior) = OUTPUT_ONLY]; + } + + // The current state of the deployment group. + enum State { + // State not set (this is not a valid state). + STATE_UNSPECIFIED = 0; + + // The deployment group is ready. + ACTIVE = 1; + + // The deployment group is being created. + CREATING = 2; + + // The deployment group is being deleted. + DELETING = 3; + } + + // Immutable. Identifier. The resource name of this deployment group, for + // example: + // `projects/123456789/locations/global/interceptDeploymentGroups/my-dg`. + // See https://google.aip.dev/122 for more details. + string name = 1 [ + (google.api.field_behavior) = IDENTIFIER, + (google.api.field_behavior) = IMMUTABLE + ]; + + // Output only. The timestamp when the resource was created. + // See https://google.aip.dev/148#timestamps. + google.protobuf.Timestamp create_time = 2 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The timestamp when the resource was most recently updated. + // See https://google.aip.dev/148#timestamps. + google.protobuf.Timestamp update_time = 3 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. Labels are key/value pairs that help to organize and filter + // resources. + map labels = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Required. Immutable. The network that will be used for all child + // deployments, for example: `projects/{project}/global/networks/{network}`. + // See https://google.aip.dev/124. + string network = 5 [ + (google.api.field_behavior) = REQUIRED, + (google.api.field_behavior) = IMMUTABLE, + (google.api.resource_reference) = { type: "compute.googleapis.com/Network" } + ]; + + // Output only. The list of endpoint groups that are connected to this + // resource. + repeated ConnectedEndpointGroup connected_endpoint_groups = 6 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The list of Intercept Deployments that belong to this group. + repeated Deployment nested_deployments = 10 + [deprecated = true, (google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The current state of the deployment group. + // See https://google.aip.dev/216. + State state = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The current state of the resource does not match the user's + // intended state, and the system is working to reconcile them. This is part + // of the normal operation (e.g. adding a new deployment to the group) See + // https://google.aip.dev/128. + bool reconciling = 8 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. User-provided description of the deployment group. + // Used as additional context for the deployment group. + string description = 9 [(google.api.field_behavior) = OPTIONAL]; + + // Output only. The list of locations where the deployment group is present. + repeated InterceptLocation locations = 11 + [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Request message for ListInterceptDeploymentGroups. +message ListInterceptDeploymentGroupsRequest { + // Required. The parent, which owns this collection of deployment groups. + // Example: `projects/123456789/locations/global`. + // See https://google.aip.dev/132 for more details. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "networksecurity.googleapis.com/InterceptDeploymentGroup" + } + ]; + + // Optional. Requested page size. Server may return fewer items than + // requested. If unspecified, server will pick an appropriate default. See + // https://google.aip.dev/158 for more details. + int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A page token, received from a previous + // `ListInterceptDeploymentGroups` call. Provide this to retrieve the + // subsequent page. When paginating, all other parameters provided to + // `ListInterceptDeploymentGroups` must match the call that provided the page + // token. See https://google.aip.dev/158 for more details. + string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Filter expression. + // See https://google.aip.dev/160#filtering for more details. + string filter = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Sort expression. + // See https://google.aip.dev/132#ordering for more details. + string order_by = 5 [(google.api.field_behavior) = OPTIONAL]; +} + +// Response message for ListInterceptDeploymentGroups. +message ListInterceptDeploymentGroupsResponse { + // The deployment groups from the specified parent. + repeated InterceptDeploymentGroup intercept_deployment_groups = 1; + + // A token that can be sent as `page_token` to retrieve the next page. + // If this field is omitted, there are no subsequent pages. + // See https://google.aip.dev/158 for more details. + string next_page_token = 2; +} + +// Request message for GetInterceptDeploymentGroup. +message GetInterceptDeploymentGroupRequest { + // Required. The name of the deployment group to retrieve. + // Format: + // projects/{project}/locations/{location}/interceptDeploymentGroups/{intercept_deployment_group} + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "networksecurity.googleapis.com/InterceptDeploymentGroup" + } + ]; +} + +// Request message for CreateInterceptDeploymentGroup. +message CreateInterceptDeploymentGroupRequest { + // Required. The parent resource where this deployment group will be created. + // Format: projects/{project}/locations/{location} + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "networksecurity.googleapis.com/InterceptDeploymentGroup" + } + ]; + + // Required. The ID to use for the new deployment group, which will become the + // final component of the deployment group's resource name. + string intercept_deployment_group_id = 2 + [(google.api.field_behavior) = REQUIRED]; + + // Required. The deployment group to create. + InterceptDeploymentGroup intercept_deployment_group = 3 + [(google.api.field_behavior) = REQUIRED]; + + // Optional. A unique identifier for this request. Must be a UUID4. + // This request is only idempotent if a `request_id` is provided. + // See https://google.aip.dev/155 for more details. + string request_id = 4 [ + (google.api.field_info).format = UUID4, + (google.api.field_behavior) = OPTIONAL + ]; +} + +// Request message for UpdateInterceptDeploymentGroup. +message UpdateInterceptDeploymentGroupRequest { + // Optional. The list of fields to update. + // Fields are specified relative to the deployment group + // (e.g. `description`; *not* + // `intercept_deployment_group.description`). See + // https://google.aip.dev/161 for more details. + google.protobuf.FieldMask update_mask = 1 + [(google.api.field_behavior) = OPTIONAL]; + + // Required. The deployment group to update. + InterceptDeploymentGroup intercept_deployment_group = 2 + [(google.api.field_behavior) = REQUIRED]; + + // Optional. A unique identifier for this request. Must be a UUID4. + // This request is only idempotent if a `request_id` is provided. + // See https://google.aip.dev/155 for more details. + string request_id = 3 [ + (google.api.field_info).format = UUID4, + (google.api.field_behavior) = OPTIONAL + ]; +} + +// Request message for DeleteInterceptDeploymentGroup. +message DeleteInterceptDeploymentGroupRequest { + // Required. The deployment group to delete. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "networksecurity.googleapis.com/InterceptDeploymentGroup" + } + ]; + + // Optional. A unique identifier for this request. Must be a UUID4. + // This request is only idempotent if a `request_id` is provided. + // See https://google.aip.dev/155 for more details. + string request_id = 2 [ + (google.api.field_info).format = UUID4, + (google.api.field_behavior) = OPTIONAL + ]; +} + +// A deployment represents a zonal intercept backend ready to accept +// GENEVE-encapsulated traffic, e.g. a zonal instance group fronted by an +// internal passthrough load balancer. Deployments are always part of a +// global deployment group which represents a global intercept service. +message InterceptDeployment { + option (google.api.resource) = { + type: "networksecurity.googleapis.com/InterceptDeployment" + pattern: "projects/{project}/locations/{location}/interceptDeployments/{intercept_deployment}" + plural: "interceptDeployments" + singular: "interceptDeployment" + }; + + // The current state of the deployment. + enum State { + // State not set (this is not a valid state). + STATE_UNSPECIFIED = 0; + + // The deployment is ready and in sync with the parent group. + ACTIVE = 1; + + // The deployment is being created. + CREATING = 2; + + // The deployment is being deleted. + DELETING = 3; + + // The deployment is out of sync with the parent group. + // In most cases, this is a result of a transient issue within the system + // (e.g. a delayed data-path config) and the system is expected to recover + // automatically. See the parent deployment group's state for more details. + OUT_OF_SYNC = 4; + + // An attempt to delete the deployment has failed. This is a terminal state + // and the deployment is not expected to recover. The only permitted + // operation is to retry deleting the deployment. + DELETE_FAILED = 5; + } + + // Immutable. Identifier. The resource name of this deployment, for example: + // `projects/123456789/locations/us-central1-a/interceptDeployments/my-dep`. + // See https://google.aip.dev/122 for more details. + string name = 1 [ + (google.api.field_behavior) = IDENTIFIER, + (google.api.field_behavior) = IMMUTABLE + ]; + + // Output only. The timestamp when the resource was created. + // See https://google.aip.dev/148#timestamps. + google.protobuf.Timestamp create_time = 2 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The timestamp when the resource was most recently updated. + // See https://google.aip.dev/148#timestamps. + google.protobuf.Timestamp update_time = 3 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. Labels are key/value pairs that help to organize and filter + // resources. + map labels = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Required. Immutable. The regional forwarding rule that fronts the + // interceptors, for example: + // `projects/123456789/regions/us-central1/forwardingRules/my-rule`. + // See https://google.aip.dev/124. + string forwarding_rule = 5 [ + (google.api.field_behavior) = REQUIRED, + (google.api.field_behavior) = IMMUTABLE, + (google.api.resource_reference) = { + type: "compute.googleapis.com/ForwardingRule" + } + ]; + + // Required. Immutable. The deployment group that this deployment is a part + // of, for example: + // `projects/123456789/locations/global/interceptDeploymentGroups/my-dg`. + // See https://google.aip.dev/124. + string intercept_deployment_group = 6 [ + (google.api.field_behavior) = REQUIRED, + (google.api.field_behavior) = IMMUTABLE, + (google.api.resource_reference) = { + type: "networksecurity.googleapis.com/InterceptDeploymentGroup" + } + ]; + + // Output only. The current state of the deployment. + // See https://google.aip.dev/216. + State state = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The current state of the resource does not match the user's + // intended state, and the system is working to reconcile them. This part of + // the normal operation (e.g. linking a new association to the parent group). + // See https://google.aip.dev/128. + bool reconciling = 8 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. User-provided description of the deployment. + // Used as additional context for the deployment. + string description = 9 [(google.api.field_behavior) = OPTIONAL]; +} + +// Request message for ListInterceptDeployments. +message ListInterceptDeploymentsRequest { + // Required. The parent, which owns this collection of deployments. + // Example: `projects/123456789/locations/us-central1-a`. + // See https://google.aip.dev/132 for more details. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "networksecurity.googleapis.com/InterceptDeployment" + } + ]; + + // Optional. Requested page size. Server may return fewer items than + // requested. If unspecified, server will pick an appropriate default. See + // https://google.aip.dev/158 for more details. + int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A page token, received from a previous `ListInterceptDeployments` + // call. Provide this to retrieve the subsequent page. When paginating, all + // other parameters provided to `ListInterceptDeployments` must match the call + // that provided the page token. See https://google.aip.dev/158 for more + // details. + string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Filter expression. + // See https://google.aip.dev/160#filtering for more details. + string filter = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Sort expression. + // See https://google.aip.dev/132#ordering for more details. + string order_by = 5 [(google.api.field_behavior) = OPTIONAL]; +} + +// Response message for ListInterceptDeployments. +message ListInterceptDeploymentsResponse { + // The deployments from the specified parent. + repeated InterceptDeployment intercept_deployments = 1; + + // A token that can be sent as `page_token` to retrieve the next page. + // If this field is omitted, there are no subsequent pages. + // See https://google.aip.dev/158 for more details. + string next_page_token = 2; + + // Locations that could not be reached. + repeated string unreachable = 3; +} + +// Request message for GetInterceptDeployment. +message GetInterceptDeploymentRequest { + // Required. The name of the deployment to retrieve. + // Format: + // projects/{project}/locations/{location}/interceptDeployments/{intercept_deployment} + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "networksecurity.googleapis.com/InterceptDeployment" + } + ]; +} + +// Request message for CreateInterceptDeployment. +message CreateInterceptDeploymentRequest { + // Required. The parent resource where this deployment will be created. + // Format: projects/{project}/locations/{location} + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "networksecurity.googleapis.com/InterceptDeployment" + } + ]; + + // Required. The ID to use for the new deployment, which will become the final + // component of the deployment's resource name. + string intercept_deployment_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The deployment to create. + InterceptDeployment intercept_deployment = 3 + [(google.api.field_behavior) = REQUIRED]; + + // Optional. A unique identifier for this request. Must be a UUID4. + // This request is only idempotent if a `request_id` is provided. + // See https://google.aip.dev/155 for more details. + string request_id = 4 [ + (google.api.field_info).format = UUID4, + (google.api.field_behavior) = OPTIONAL + ]; +} + +// Request message for UpdateInterceptDeployment. +message UpdateInterceptDeploymentRequest { + // Optional. The list of fields to update. + // Fields are specified relative to the deployment + // (e.g. `description`; *not* `intercept_deployment.description`). + // See https://google.aip.dev/161 for more details. + google.protobuf.FieldMask update_mask = 1 + [(google.api.field_behavior) = OPTIONAL]; + + // Required. The deployment to update. + InterceptDeployment intercept_deployment = 2 + [(google.api.field_behavior) = REQUIRED]; + + // Optional. A unique identifier for this request. Must be a UUID4. + // This request is only idempotent if a `request_id` is provided. + // See https://google.aip.dev/155 for more details. + string request_id = 3 [ + (google.api.field_info).format = UUID4, + (google.api.field_behavior) = OPTIONAL + ]; +} + +// Request message for DeleteInterceptDeployment. +message DeleteInterceptDeploymentRequest { + // Required. Name of the resource + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "networksecurity.googleapis.com/InterceptDeployment" + } + ]; + + // Optional. A unique identifier for this request. Must be a UUID4. + // This request is only idempotent if a `request_id` is provided. + // See https://google.aip.dev/155 for more details. + string request_id = 2 [ + (google.api.field_info).format = UUID4, + (google.api.field_behavior) = OPTIONAL + ]; +} + +// Details about intercept in a specific cloud location. +message InterceptLocation { + // The current state of a resource in the location. + enum State { + // State not set (this is not a valid state). + STATE_UNSPECIFIED = 0; + + // The resource is ready and in sync in the location. + ACTIVE = 1; + + // The resource is out of sync in the location. + // In most cases, this is a result of a transient issue within the system + // (e.g. an inaccessible location) and the system is expected to recover + // automatically. + OUT_OF_SYNC = 2; + } + + // Output only. The cloud location, e.g. "us-central1-a" or "asia-south1". + string location = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The current state of the association in this location. + State state = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; +} diff --git a/packages/google-cloud-networksecurity/protos/google/cloud/networksecurity/v1/mirroring.proto b/packages/google-cloud-networksecurity/protos/google/cloud/networksecurity/v1/mirroring.proto new file mode 100644 index 00000000000..d797ba12718 --- /dev/null +++ b/packages/google-cloud-networksecurity/protos/google/cloud/networksecurity/v1/mirroring.proto @@ -0,0 +1,1363 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.networksecurity.v1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/field_info.proto"; +import "google/api/resource.proto"; +import "google/cloud/networksecurity/v1/common.proto"; +import "google/longrunning/operations.proto"; +import "google/protobuf/empty.proto"; +import "google/protobuf/field_mask.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.NetworkSecurity.V1"; +option go_package = "cloud.google.com/go/networksecurity/apiv1/networksecuritypb;networksecuritypb"; +option java_multiple_files = true; +option java_outer_classname = "MirroringProto"; +option java_package = "com.google.cloud.networksecurity.v1"; +option php_namespace = "Google\\Cloud\\NetworkSecurity\\V1"; +option ruby_package = "Google::Cloud::NetworkSecurity::V1"; +option (google.api.resource_definition) = { + type: "compute.googleapis.com/ForwardingRule" + pattern: "projects/{project}/global/forwardingRules/{forwarding_rule}" +}; + +// PM2 is the "out-of-band" flavor of the Network Security Integrations product. +service Mirroring { + option (google.api.default_host) = "networksecurity.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform"; + + // Lists endpoint groups in a given project and location. + // See https://google.aip.dev/132. + rpc ListMirroringEndpointGroups(ListMirroringEndpointGroupsRequest) + returns (ListMirroringEndpointGroupsResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*}/mirroringEndpointGroups" + }; + option (google.api.method_signature) = "parent"; + } + + // Gets a specific endpoint group. + // See https://google.aip.dev/131. + rpc GetMirroringEndpointGroup(GetMirroringEndpointGroupRequest) + returns (MirroringEndpointGroup) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/mirroringEndpointGroups/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Creates an endpoint group in a given project and location. + // See https://google.aip.dev/133. + rpc CreateMirroringEndpointGroup(CreateMirroringEndpointGroupRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*}/mirroringEndpointGroups" + body: "mirroring_endpoint_group" + }; + option (google.api.method_signature) = + "parent,mirroring_endpoint_group,mirroring_endpoint_group_id"; + option (google.longrunning.operation_info) = { + response_type: "MirroringEndpointGroup" + metadata_type: "google.cloud.networksecurity.v1.OperationMetadata" + }; + } + + // Updates an endpoint group. + // See https://google.aip.dev/134. + rpc UpdateMirroringEndpointGroup(UpdateMirroringEndpointGroupRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + patch: "/v1/{mirroring_endpoint_group.name=projects/*/locations/*/mirroringEndpointGroups/*}" + body: "mirroring_endpoint_group" + }; + option (google.api.method_signature) = + "mirroring_endpoint_group,update_mask"; + option (google.longrunning.operation_info) = { + response_type: "MirroringEndpointGroup" + metadata_type: "google.cloud.networksecurity.v1.OperationMetadata" + }; + } + + // Deletes an endpoint group. + // See https://google.aip.dev/135. + rpc DeleteMirroringEndpointGroup(DeleteMirroringEndpointGroupRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/locations/*/mirroringEndpointGroups/*}" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "google.cloud.networksecurity.v1.OperationMetadata" + }; + } + + // Lists associations in a given project and location. + // See https://google.aip.dev/132. + rpc ListMirroringEndpointGroupAssociations( + ListMirroringEndpointGroupAssociationsRequest) + returns (ListMirroringEndpointGroupAssociationsResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*}/mirroringEndpointGroupAssociations" + }; + option (google.api.method_signature) = "parent"; + } + + // Gets a specific association. + // See https://google.aip.dev/131. + rpc GetMirroringEndpointGroupAssociation( + GetMirroringEndpointGroupAssociationRequest) + returns (MirroringEndpointGroupAssociation) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/mirroringEndpointGroupAssociations/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Creates an association in a given project and location. + // See https://google.aip.dev/133. + rpc CreateMirroringEndpointGroupAssociation( + CreateMirroringEndpointGroupAssociationRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*}/mirroringEndpointGroupAssociations" + body: "mirroring_endpoint_group_association" + }; + option (google.api.method_signature) = + "parent,mirroring_endpoint_group_association,mirroring_endpoint_group_association_id"; + option (google.longrunning.operation_info) = { + response_type: "MirroringEndpointGroupAssociation" + metadata_type: "google.cloud.networksecurity.v1.OperationMetadata" + }; + } + + // Updates an association. + // See https://google.aip.dev/134. + rpc UpdateMirroringEndpointGroupAssociation( + UpdateMirroringEndpointGroupAssociationRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + patch: "/v1/{mirroring_endpoint_group_association.name=projects/*/locations/*/mirroringEndpointGroupAssociations/*}" + body: "mirroring_endpoint_group_association" + }; + option (google.api.method_signature) = + "mirroring_endpoint_group_association,update_mask"; + option (google.longrunning.operation_info) = { + response_type: "MirroringEndpointGroupAssociation" + metadata_type: "google.cloud.networksecurity.v1.OperationMetadata" + }; + } + + // Deletes an association. + // See https://google.aip.dev/135. + rpc DeleteMirroringEndpointGroupAssociation( + DeleteMirroringEndpointGroupAssociationRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/locations/*/mirroringEndpointGroupAssociations/*}" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "google.cloud.networksecurity.v1.OperationMetadata" + }; + } + + // Lists deployment groups in a given project and location. + // See https://google.aip.dev/132. + rpc ListMirroringDeploymentGroups(ListMirroringDeploymentGroupsRequest) + returns (ListMirroringDeploymentGroupsResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*}/mirroringDeploymentGroups" + }; + option (google.api.method_signature) = "parent"; + } + + // Gets a specific deployment group. + // See https://google.aip.dev/131. + rpc GetMirroringDeploymentGroup(GetMirroringDeploymentGroupRequest) + returns (MirroringDeploymentGroup) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/mirroringDeploymentGroups/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Creates a deployment group in a given project and location. + // See https://google.aip.dev/133. + rpc CreateMirroringDeploymentGroup(CreateMirroringDeploymentGroupRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*}/mirroringDeploymentGroups" + body: "mirroring_deployment_group" + }; + option (google.api.method_signature) = + "parent,mirroring_deployment_group,mirroring_deployment_group_id"; + option (google.longrunning.operation_info) = { + response_type: "MirroringDeploymentGroup" + metadata_type: "google.cloud.networksecurity.v1.OperationMetadata" + }; + } + + // Updates a deployment group. + // See https://google.aip.dev/134. + rpc UpdateMirroringDeploymentGroup(UpdateMirroringDeploymentGroupRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + patch: "/v1/{mirroring_deployment_group.name=projects/*/locations/*/mirroringDeploymentGroups/*}" + body: "mirroring_deployment_group" + }; + option (google.api.method_signature) = + "mirroring_deployment_group,update_mask"; + option (google.longrunning.operation_info) = { + response_type: "MirroringDeploymentGroup" + metadata_type: "google.cloud.networksecurity.v1.OperationMetadata" + }; + } + + // Deletes a deployment group. + // See https://google.aip.dev/135. + rpc DeleteMirroringDeploymentGroup(DeleteMirroringDeploymentGroupRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/locations/*/mirroringDeploymentGroups/*}" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "google.cloud.networksecurity.v1.OperationMetadata" + }; + } + + // Lists deployments in a given project and location. + // See https://google.aip.dev/132. + rpc ListMirroringDeployments(ListMirroringDeploymentsRequest) + returns (ListMirroringDeploymentsResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*}/mirroringDeployments" + }; + option (google.api.method_signature) = "parent"; + } + + // Gets a specific deployment. + // See https://google.aip.dev/131. + rpc GetMirroringDeployment(GetMirroringDeploymentRequest) + returns (MirroringDeployment) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/mirroringDeployments/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Creates a deployment in a given project and location. + // See https://google.aip.dev/133. + rpc CreateMirroringDeployment(CreateMirroringDeploymentRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*}/mirroringDeployments" + body: "mirroring_deployment" + }; + option (google.api.method_signature) = + "parent,mirroring_deployment,mirroring_deployment_id"; + option (google.longrunning.operation_info) = { + response_type: "MirroringDeployment" + metadata_type: "google.cloud.networksecurity.v1.OperationMetadata" + }; + } + + // Updates a deployment. + // See https://google.aip.dev/134. + rpc UpdateMirroringDeployment(UpdateMirroringDeploymentRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + patch: "/v1/{mirroring_deployment.name=projects/*/locations/*/mirroringDeployments/*}" + body: "mirroring_deployment" + }; + option (google.api.method_signature) = "mirroring_deployment,update_mask"; + option (google.longrunning.operation_info) = { + response_type: "MirroringDeployment" + metadata_type: "google.cloud.networksecurity.v1.OperationMetadata" + }; + } + + // Deletes a deployment. + // See https://google.aip.dev/135. + rpc DeleteMirroringDeployment(DeleteMirroringDeploymentRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/locations/*/mirroringDeployments/*}" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "google.cloud.networksecurity.v1.OperationMetadata" + }; + } +} + +// An endpoint group is a consumer frontend for a deployment group (backend). +// In order to configure mirroring for a network, consumers must create: +// - An association between their network and the endpoint group. +// - A security profile that points to the endpoint group. +// - A mirroring rule that references the security profile (group). +message MirroringEndpointGroup { + option (google.api.resource) = { + type: "networksecurity.googleapis.com/MirroringEndpointGroup" + pattern: "projects/{project}/locations/{location}/mirroringEndpointGroups/{mirroring_endpoint_group}" + plural: "mirroringEndpointGroups" + singular: "mirroringEndpointGroup" + }; + + // The endpoint group's view of a connected deployment group. + message ConnectedDeploymentGroup { + // Output only. The connected deployment group's resource name, for example: + // `projects/123456789/locations/global/mirroringDeploymentGroups/my-dg`. + // See https://google.aip.dev/124. + string name = 1 [ + (google.api.field_behavior) = OUTPUT_ONLY, + (google.api.resource_reference) = { + type: "networksecurity.googleapis.com/MirroringDeploymentGroup" + } + ]; + + // Output only. The list of locations where the deployment group is present. + repeated MirroringLocation locations = 2 + [(google.api.field_behavior) = OUTPUT_ONLY]; + } + + // The endpoint group's view of a connected association. + message AssociationDetails { + // Output only. The connected association's resource name, for example: + // `projects/123456789/locations/global/mirroringEndpointGroupAssociations/my-ega`. + // See https://google.aip.dev/124. + string name = 1 [ + (google.api.field_behavior) = OUTPUT_ONLY, + (google.api.resource_reference) = { + type: "networksecurity.googleapis.com/MirroringEndpointGroupAssociation" + } + ]; + + // Output only. The associated network, for example: + // projects/123456789/global/networks/my-network. + // See https://google.aip.dev/124. + string network = 2 [ + (google.api.field_behavior) = OUTPUT_ONLY, + (google.api.resource_reference) = { + type: "compute.googleapis.com/Network" + } + ]; + + // Output only. Most recent known state of the association. + MirroringEndpointGroupAssociation.State state = 3 + [(google.api.field_behavior) = OUTPUT_ONLY]; + } + + // The current state of the endpoint group. + enum State { + // State not set (this is not a valid state). + STATE_UNSPECIFIED = 0; + + // The endpoint group is ready and in sync with the target deployment group. + ACTIVE = 1; + + // The deployment group backing this endpoint group has been force-deleted. + // This endpoint group cannot be used and mirroring is effectively disabled. + CLOSED = 2; + + // The endpoint group is being created. + CREATING = 3; + + // The endpoint group is being deleted. + DELETING = 4; + + // The endpoint group is out of sync with the backing deployment group. + // In most cases, this is a result of a transient issue within the system + // (e.g. an inaccessible location) and the system is expected to recover + // automatically. See the associations field for details per network and + // location. + OUT_OF_SYNC = 5; + + // An attempt to delete the endpoint group has failed. This is a terminal + // state and the endpoint group is not expected to recover. + // The only permitted operation is to retry deleting the endpoint group. + DELETE_FAILED = 6; + } + + // The type of the endpoint group. + enum Type { + // Not set. + TYPE_UNSPECIFIED = 0; + + // An endpoint group that sends packets to a single deployment group. + DIRECT = 1; + } + + // Immutable. Identifier. The resource name of this endpoint group, for + // example: + // `projects/123456789/locations/global/mirroringEndpointGroups/my-eg`. + // See https://google.aip.dev/122 for more details. + string name = 1 [ + (google.api.field_behavior) = IDENTIFIER, + (google.api.field_behavior) = IMMUTABLE + ]; + + // Output only. The timestamp when the resource was created. + // See https://google.aip.dev/148#timestamps. + google.protobuf.Timestamp create_time = 2 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The timestamp when the resource was most recently updated. + // See https://google.aip.dev/148#timestamps. + google.protobuf.Timestamp update_time = 3 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. Labels are key/value pairs that help to organize and filter + // resources. + map labels = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Immutable. The deployment group that this DIRECT endpoint group is + // connected to, for example: + // `projects/123456789/locations/global/mirroringDeploymentGroups/my-dg`. + // See https://google.aip.dev/124. + string mirroring_deployment_group = 5 [ + (google.api.field_behavior) = IMMUTABLE, + (google.api.resource_reference) = { + type: "networksecurity.googleapis.com/MirroringDeploymentGroup" + } + ]; + + // Output only. List of details about the connected deployment groups to this + // endpoint group. + repeated ConnectedDeploymentGroup connected_deployment_groups = 13 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The current state of the endpoint group. + // See https://google.aip.dev/216. + State state = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The current state of the resource does not match the user's + // intended state, and the system is working to reconcile them. This is part + // of the normal operation (e.g. adding a new association to the group). See + // https://google.aip.dev/128. + bool reconciling = 8 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Immutable. The type of the endpoint group. + // If left unspecified, defaults to DIRECT. + Type type = 11 [(google.api.field_behavior) = IMMUTABLE]; + + // Output only. List of associations to this endpoint group. + repeated AssociationDetails associations = 9 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. User-provided description of the endpoint group. + // Used as additional context for the endpoint group. + string description = 10 [(google.api.field_behavior) = OPTIONAL]; +} + +// Request message for ListMirroringEndpointGroups. +message ListMirroringEndpointGroupsRequest { + // Required. The parent, which owns this collection of endpoint groups. + // Example: `projects/123456789/locations/global`. + // See https://google.aip.dev/132 for more details. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "networksecurity.googleapis.com/MirroringEndpointGroup" + } + ]; + + // Optional. Requested page size. Server may return fewer items than + // requested. If unspecified, server will pick an appropriate default. See + // https://google.aip.dev/158 for more details. + int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A page token, received from a previous + // `ListMirroringEndpointGroups` call. Provide this to retrieve the subsequent + // page. When paginating, all other parameters provided to + // `ListMirroringEndpointGroups` must match the call that provided the page + // token. + // See https://google.aip.dev/158 for more details. + string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Filter expression. + // See https://google.aip.dev/160#filtering for more details. + string filter = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Sort expression. + // See https://google.aip.dev/132#ordering for more details. + string order_by = 5 [(google.api.field_behavior) = OPTIONAL]; +} + +// Response message for ListMirroringEndpointGroups. +message ListMirroringEndpointGroupsResponse { + // The endpoint groups from the specified parent. + repeated MirroringEndpointGroup mirroring_endpoint_groups = 1; + + // A token that can be sent as `page_token` to retrieve the next page. + // If this field is omitted, there are no subsequent pages. + // See https://google.aip.dev/158 for more details. + string next_page_token = 2; +} + +// Request message for GetMirroringEndpointGroup. +message GetMirroringEndpointGroupRequest { + // Required. The name of the endpoint group to retrieve. + // Format: + // projects/{project}/locations/{location}/mirroringEndpointGroups/{mirroring_endpoint_group} + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "networksecurity.googleapis.com/MirroringEndpointGroup" + } + ]; +} + +// Request message for CreateMirroringEndpointGroup. +message CreateMirroringEndpointGroupRequest { + // Required. The parent resource where this endpoint group will be created. + // Format: projects/{project}/locations/{location} + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "networksecurity.googleapis.com/MirroringEndpointGroup" + } + ]; + + // Required. The ID to use for the endpoint group, which will become the final + // component of the endpoint group's resource name. + string mirroring_endpoint_group_id = 2 + [(google.api.field_behavior) = REQUIRED]; + + // Required. The endpoint group to create. + MirroringEndpointGroup mirroring_endpoint_group = 3 + [(google.api.field_behavior) = REQUIRED]; + + // Optional. A unique identifier for this request. Must be a UUID4. + // This request is only idempotent if a `request_id` is provided. + // See https://google.aip.dev/155 for more details. + string request_id = 4 [ + (google.api.field_info).format = UUID4, + (google.api.field_behavior) = OPTIONAL + ]; +} + +// Request message for UpdateMirroringEndpointGroup. +message UpdateMirroringEndpointGroupRequest { + // Optional. The list of fields to update. + // Fields are specified relative to the endpoint group + // (e.g. `description`; *not* `mirroring_endpoint_group.description`). + // See https://google.aip.dev/161 for more details. + google.protobuf.FieldMask update_mask = 1 + [(google.api.field_behavior) = OPTIONAL]; + + // Required. The endpoint group to update. + MirroringEndpointGroup mirroring_endpoint_group = 2 + [(google.api.field_behavior) = REQUIRED]; + + // Optional. A unique identifier for this request. Must be a UUID4. + // This request is only idempotent if a `request_id` is provided. + // See https://google.aip.dev/155 for more details. + string request_id = 3 [ + (google.api.field_info).format = UUID4, + (google.api.field_behavior) = OPTIONAL + ]; +} + +// Request message for DeleteMirroringEndpointGroup. +message DeleteMirroringEndpointGroupRequest { + // Required. The endpoint group to delete. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "networksecurity.googleapis.com/MirroringEndpointGroup" + } + ]; + + // Optional. A unique identifier for this request. Must be a UUID4. + // This request is only idempotent if a `request_id` is provided. + // See https://google.aip.dev/155 for more details. + string request_id = 2 [ + (google.api.field_info).format = UUID4, + (google.api.field_behavior) = OPTIONAL + ]; +} + +// An endpoint group association represents a link between a network and an +// endpoint group in the organization. +// +// Creating an association creates the networking infrastructure linking the +// network to the endpoint group, but does not enable mirroring by itself. +// To enable mirroring, the user must also create a network firewall policy +// containing mirroring rules and associate it with the network. +message MirroringEndpointGroupAssociation { + option (google.api.resource) = { + type: "networksecurity.googleapis.com/MirroringEndpointGroupAssociation" + pattern: "projects/{project}/locations/{location}/mirroringEndpointGroupAssociations/{mirroring_endpoint_group_association}" + plural: "mirroringEndpointGroupAssociations" + singular: "mirroringEndpointGroupAssociation" + }; + + // Contains details about the state of an association in a specific cloud + // location. + message LocationDetails { + // The state of association. + enum State { + // Not set. + STATE_UNSPECIFIED = 0; + + // The association is ready and in sync with the linked endpoint group. + ACTIVE = 1; + + // The association is out of sync with the linked endpoint group. + // In most cases, this is a result of a transient issue within the system + // (e.g. an inaccessible location) and the system is expected to recover + // automatically. + OUT_OF_SYNC = 2; + } + + // Output only. The cloud location, e.g. "us-central1-a" or "asia-south1". + string location = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The current state of the association in this location. + State state = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + } + + // The state of the association. + enum State { + // Not set. + STATE_UNSPECIFIED = 0; + + // The association is ready and in sync with the linked endpoint group. + ACTIVE = 1; + + // The association is being created. + CREATING = 3; + + // The association is being deleted. + DELETING = 4; + + // The association is disabled due to a breaking change in another resource. + CLOSED = 5; + + // The association is out of sync with the linked endpoint group. + // In most cases, this is a result of a transient issue within the system + // (e.g. an inaccessible location) and the system is expected to recover + // automatically. Check the `locations_details` field for more details. + OUT_OF_SYNC = 6; + + // An attempt to delete the association has failed. This is a terminal state + // and the association is not expected to be usable as some of its resources + // have been deleted. + // The only permitted operation is to retry deleting the association. + DELETE_FAILED = 7; + } + + // Immutable. Identifier. The resource name of this endpoint group + // association, for example: + // `projects/123456789/locations/global/mirroringEndpointGroupAssociations/my-eg-association`. + // See https://google.aip.dev/122 for more details. + string name = 1 [ + (google.api.field_behavior) = IDENTIFIER, + (google.api.field_behavior) = IMMUTABLE + ]; + + // Output only. The timestamp when the resource was created. + // See https://google.aip.dev/148#timestamps. + google.protobuf.Timestamp create_time = 2 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The timestamp when the resource was most recently updated. + // See https://google.aip.dev/148#timestamps. + google.protobuf.Timestamp update_time = 3 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. Labels are key/value pairs that help to organize and filter + // resources. + map labels = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Immutable. The endpoint group that this association is connected to, for + // example: + // `projects/123456789/locations/global/mirroringEndpointGroups/my-eg`. + // See https://google.aip.dev/124. + string mirroring_endpoint_group = 5 [ + (google.api.field_behavior) = IMMUTABLE, + (google.api.resource_reference) = { + type: "networksecurity.googleapis.com/MirroringEndpointGroup" + } + ]; + + // Immutable. The VPC network that is associated. for example: + // `projects/123456789/global/networks/my-network`. + // See https://google.aip.dev/124. + string network = 6 [ + (google.api.field_behavior) = IMMUTABLE, + (google.api.resource_reference) = { type: "compute.googleapis.com/Network" } + ]; + + // Output only. The list of locations where the association is present. This + // information is retrieved from the linked endpoint group, and not configured + // as part of the association itself. + repeated LocationDetails locations_details = 7 + [deprecated = true, (google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Current state of the endpoint group association. + State state = 8 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The current state of the resource does not match the user's + // intended state, and the system is working to reconcile them. This part of + // the normal operation (e.g. adding a new location to the target deployment + // group). See https://google.aip.dev/128. + bool reconciling = 9 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The list of locations where the association is configured. + // This information is retrieved from the linked endpoint group. + repeated MirroringLocation locations = 10 + [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Request message for ListMirroringEndpointGroupAssociations. +message ListMirroringEndpointGroupAssociationsRequest { + // Required. The parent, which owns this collection of associations. + // Example: `projects/123456789/locations/global`. + // See https://google.aip.dev/132 for more details. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "networksecurity.googleapis.com/MirroringEndpointGroupAssociation" + } + ]; + + // Optional. Requested page size. Server may return fewer items than + // requested. If unspecified, server will pick an appropriate default. See + // https://google.aip.dev/158 for more details. + int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A page token, received from a previous + // `ListMirroringEndpointGroups` call. Provide this to retrieve the subsequent + // page. When paginating, all other parameters provided to + // `ListMirroringEndpointGroups` must match the call that provided the page + // token. See https://google.aip.dev/158 for more details. + string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Filter expression. + // See https://google.aip.dev/160#filtering for more details. + string filter = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Sort expression. + // See https://google.aip.dev/132#ordering for more details. + string order_by = 5 [(google.api.field_behavior) = OPTIONAL]; +} + +// Response message for ListMirroringEndpointGroupAssociations. +message ListMirroringEndpointGroupAssociationsResponse { + // The associations from the specified parent. + repeated MirroringEndpointGroupAssociation + mirroring_endpoint_group_associations = 1; + + // A token that can be sent as `page_token` to retrieve the next page. + // If this field is omitted, there are no subsequent pages. + // See https://google.aip.dev/158 for more details. + string next_page_token = 2; +} + +// Request message for GetMirroringEndpointGroupAssociation. +message GetMirroringEndpointGroupAssociationRequest { + // Required. The name of the association to retrieve. + // Format: + // projects/{project}/locations/{location}/mirroringEndpointGroupAssociations/{mirroring_endpoint_group_association} + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "networksecurity.googleapis.com/MirroringEndpointGroupAssociation" + } + ]; +} + +// Request message for CreateMirroringEndpointGroupAssociation. +message CreateMirroringEndpointGroupAssociationRequest { + // Required. The parent resource where this association will be created. + // Format: projects/{project}/locations/{location} + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "networksecurity.googleapis.com/MirroringEndpointGroupAssociation" + } + ]; + + // Optional. The ID to use for the new association, which will become the + // final component of the endpoint group's resource name. If not provided, the + // server will generate a unique ID. + string mirroring_endpoint_group_association_id = 2 + [(google.api.field_behavior) = OPTIONAL]; + + // Required. The association to create. + MirroringEndpointGroupAssociation mirroring_endpoint_group_association = 3 + [(google.api.field_behavior) = REQUIRED]; + + // Optional. A unique identifier for this request. Must be a UUID4. + // This request is only idempotent if a `request_id` is provided. + // See https://google.aip.dev/155 for more details. + string request_id = 4 [ + (google.api.field_info).format = UUID4, + (google.api.field_behavior) = OPTIONAL + ]; +} + +// Request message for UpdateMirroringEndpointGroupAssociation. +message UpdateMirroringEndpointGroupAssociationRequest { + // Optional. The list of fields to update. + // Fields are specified relative to the association + // (e.g. `description`; *not* + // `mirroring_endpoint_group_association.description`). See + // https://google.aip.dev/161 for more details. + google.protobuf.FieldMask update_mask = 1 + [(google.api.field_behavior) = OPTIONAL]; + + // Required. The association to update. + MirroringEndpointGroupAssociation mirroring_endpoint_group_association = 2 + [(google.api.field_behavior) = REQUIRED]; + + // Optional. A unique identifier for this request. Must be a UUID4. + // This request is only idempotent if a `request_id` is provided. + // See https://google.aip.dev/155 for more details. + string request_id = 3 [ + (google.api.field_info).format = UUID4, + (google.api.field_behavior) = OPTIONAL + ]; +} + +// Request message for DeleteMirroringEndpointGroupAssociation. +message DeleteMirroringEndpointGroupAssociationRequest { + // Required. The association to delete. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "networksecurity.googleapis.com/MirroringEndpointGroupAssociation" + } + ]; + + // Optional. A unique identifier for this request. Must be a UUID4. + // This request is only idempotent if a `request_id` is provided. + // See https://google.aip.dev/155 for more details. + string request_id = 2 [ + (google.api.field_info).format = UUID4, + (google.api.field_behavior) = OPTIONAL + ]; +} + +// A deployment group aggregates many zonal mirroring backends (deployments) +// into a single global mirroring service. Consumers can connect this service +// using an endpoint group. +message MirroringDeploymentGroup { + option (google.api.resource) = { + type: "networksecurity.googleapis.com/MirroringDeploymentGroup" + pattern: "projects/{project}/locations/{location}/mirroringDeploymentGroups/{mirroring_deployment_group}" + plural: "mirroringDeploymentGroups" + singular: "mirroringDeploymentGroup" + }; + + // An endpoint group connected to this deployment group. + message ConnectedEndpointGroup { + // Output only. The connected endpoint group's resource name, for example: + // `projects/123456789/locations/global/mirroringEndpointGroups/my-eg`. + // See https://google.aip.dev/124. + string name = 1 [ + (google.api.field_behavior) = OUTPUT_ONLY, + (google.api.resource_reference) = { + type: "networksecurity.googleapis.com/MirroringEndpointGroup" + } + ]; + } + + // A deployment belonging to this deployment group. + message Deployment { + // Output only. The name of the Mirroring Deployment, in the format: + // `projects/{project}/locations/{location}/mirroringDeployments/{mirroring_deployment}`. + string name = 1 [ + (google.api.field_behavior) = OUTPUT_ONLY, + (google.api.resource_reference) = { + type: "networksecurity.googleapis.com/MirroringDeployment" + } + ]; + + // Output only. Most recent known state of the deployment. + MirroringDeployment.State state = 2 + [(google.api.field_behavior) = OUTPUT_ONLY]; + } + + // The current state of the deployment group. + enum State { + // State not set (this is not a valid state). + STATE_UNSPECIFIED = 0; + + // The deployment group is ready. + ACTIVE = 1; + + // The deployment group is being created. + CREATING = 2; + + // The deployment group is being deleted. + DELETING = 3; + + // The deployment group is being wiped out (project deleted). + CLOSED = 4; + } + + // Immutable. Identifier. The resource name of this deployment group, for + // example: + // `projects/123456789/locations/global/mirroringDeploymentGroups/my-dg`. + // See https://google.aip.dev/122 for more details. + string name = 1 [ + (google.api.field_behavior) = IDENTIFIER, + (google.api.field_behavior) = IMMUTABLE + ]; + + // Output only. The timestamp when the resource was created. + // See https://google.aip.dev/148#timestamps. + google.protobuf.Timestamp create_time = 2 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The timestamp when the resource was most recently updated. + // See https://google.aip.dev/148#timestamps. + google.protobuf.Timestamp update_time = 3 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. Labels are key/value pairs that help to organize and filter + // resources. + map labels = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Required. Immutable. The network that will be used for all child + // deployments, for example: `projects/{project}/global/networks/{network}`. + // See https://google.aip.dev/124. + string network = 5 [ + (google.api.field_behavior) = REQUIRED, + (google.api.field_behavior) = IMMUTABLE, + (google.api.resource_reference) = { type: "compute.googleapis.com/Network" } + ]; + + // Output only. The list of endpoint groups that are connected to this + // resource. + repeated ConnectedEndpointGroup connected_endpoint_groups = 6 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The list of Mirroring Deployments that belong to this group. + repeated Deployment nested_deployments = 10 + [deprecated = true, (google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The current state of the deployment group. + // See https://google.aip.dev/216. + State state = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The current state of the resource does not match the user's + // intended state, and the system is working to reconcile them. This is part + // of the normal operation (e.g. adding a new deployment to the group) See + // https://google.aip.dev/128. + bool reconciling = 8 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. User-provided description of the deployment group. + // Used as additional context for the deployment group. + string description = 9 [(google.api.field_behavior) = OPTIONAL]; + + // Output only. The list of locations where the deployment group is present. + repeated MirroringLocation locations = 11 + [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Request message for ListMirroringDeploymentGroups. +message ListMirroringDeploymentGroupsRequest { + // Required. The parent, which owns this collection of deployment groups. + // Example: `projects/123456789/locations/global`. + // See https://google.aip.dev/132 for more details. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "networksecurity.googleapis.com/MirroringDeploymentGroup" + } + ]; + + // Optional. Requested page size. Server may return fewer items than + // requested. If unspecified, server will pick an appropriate default. See + // https://google.aip.dev/158 for more details. + int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A page token, received from a previous + // `ListMirroringDeploymentGroups` call. Provide this to retrieve the + // subsequent page. When paginating, all other parameters provided to + // `ListMirroringDeploymentGroups` must match the call that provided the page + // token. See https://google.aip.dev/158 for more details. + string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Filter expression. + // See https://google.aip.dev/160#filtering for more details. + string filter = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Sort expression. + // See https://google.aip.dev/132#ordering for more details. + string order_by = 5 [(google.api.field_behavior) = OPTIONAL]; +} + +// Response message for ListMirroringDeploymentGroups. +message ListMirroringDeploymentGroupsResponse { + // The deployment groups from the specified parent. + repeated MirroringDeploymentGroup mirroring_deployment_groups = 1; + + // A token that can be sent as `page_token` to retrieve the next page. + // If this field is omitted, there are no subsequent pages. + // See https://google.aip.dev/158 for more details. + string next_page_token = 2; +} + +// Request message for GetMirroringDeploymentGroup. +message GetMirroringDeploymentGroupRequest { + // Required. The name of the deployment group to retrieve. + // Format: + // projects/{project}/locations/{location}/mirroringDeploymentGroups/{mirroring_deployment_group} + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "networksecurity.googleapis.com/MirroringDeploymentGroup" + } + ]; +} + +// Request message for CreateMirroringDeploymentGroup. +message CreateMirroringDeploymentGroupRequest { + // Required. The parent resource where this deployment group will be created. + // Format: projects/{project}/locations/{location} + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "networksecurity.googleapis.com/MirroringDeploymentGroup" + } + ]; + + // Required. The ID to use for the new deployment group, which will become the + // final component of the deployment group's resource name. + string mirroring_deployment_group_id = 2 + [(google.api.field_behavior) = REQUIRED]; + + // Required. The deployment group to create. + MirroringDeploymentGroup mirroring_deployment_group = 3 + [(google.api.field_behavior) = REQUIRED]; + + // Optional. A unique identifier for this request. Must be a UUID4. + // This request is only idempotent if a `request_id` is provided. + // See https://google.aip.dev/155 for more details. + string request_id = 4 [ + (google.api.field_info).format = UUID4, + (google.api.field_behavior) = OPTIONAL + ]; +} + +// Request message for UpdateMirroringDeploymentGroup. +message UpdateMirroringDeploymentGroupRequest { + // Optional. The list of fields to update. + // Fields are specified relative to the deployment group + // (e.g. `description`; *not* + // `mirroring_deployment_group.description`). See + // https://google.aip.dev/161 for more details. + google.protobuf.FieldMask update_mask = 1 + [(google.api.field_behavior) = OPTIONAL]; + + // Required. The deployment group to update. + MirroringDeploymentGroup mirroring_deployment_group = 2 + [(google.api.field_behavior) = REQUIRED]; + + // Optional. A unique identifier for this request. Must be a UUID4. + // This request is only idempotent if a `request_id` is provided. + // See https://google.aip.dev/155 for more details. + string request_id = 3 [ + (google.api.field_info).format = UUID4, + (google.api.field_behavior) = OPTIONAL + ]; +} + +// Request message for DeleteMirroringDeploymentGroup. +message DeleteMirroringDeploymentGroupRequest { + // Required. The deployment group to delete. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "networksecurity.googleapis.com/MirroringDeploymentGroup" + } + ]; + + // Optional. A unique identifier for this request. Must be a UUID4. + // This request is only idempotent if a `request_id` is provided. + // See https://google.aip.dev/155 for more details. + string request_id = 2 [ + (google.api.field_info).format = UUID4, + (google.api.field_behavior) = OPTIONAL + ]; +} + +// A deployment represents a zonal mirroring backend ready to accept +// GENEVE-encapsulated replica traffic, e.g. a zonal instance group fronted by +// an internal passthrough load balancer. Deployments are always part of a +// global deployment group which represents a global mirroring service. +message MirroringDeployment { + option (google.api.resource) = { + type: "networksecurity.googleapis.com/MirroringDeployment" + pattern: "projects/{project}/locations/{location}/mirroringDeployments/{mirroring_deployment}" + plural: "mirroringDeployments" + singular: "mirroringDeployment" + }; + + // The current state of the deployment. + enum State { + // State not set (this is not a valid state). + STATE_UNSPECIFIED = 0; + + // The deployment is ready and in sync with the parent group. + ACTIVE = 1; + + // The deployment is being created. + CREATING = 2; + + // The deployment is being deleted. + DELETING = 3; + + // The deployment is out of sync with the parent group. + // In most cases, this is a result of a transient issue within the system + // (e.g. a delayed data-path config) and the system is expected to recover + // automatically. See the parent deployment group's state for more details. + OUT_OF_SYNC = 4; + + // An attempt to delete the deployment has failed. This is a terminal state + // and the deployment is not expected to recover. The only permitted + // operation is to retry deleting the deployment. + DELETE_FAILED = 5; + } + + // Immutable. Identifier. The resource name of this deployment, for example: + // `projects/123456789/locations/us-central1-a/mirroringDeployments/my-dep`. + // See https://google.aip.dev/122 for more details. + string name = 1 [ + (google.api.field_behavior) = IDENTIFIER, + (google.api.field_behavior) = IMMUTABLE + ]; + + // Output only. The timestamp when the resource was created. + // See https://google.aip.dev/148#timestamps. + google.protobuf.Timestamp create_time = 2 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The timestamp when the resource was most recently updated. + // See https://google.aip.dev/148#timestamps. + google.protobuf.Timestamp update_time = 3 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. Labels are key/value pairs that help to organize and filter + // resources. + map labels = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Required. Immutable. The regional forwarding rule that fronts the mirroring + // collectors, for example: + // `projects/123456789/regions/us-central1/forwardingRules/my-rule`. See + // https://google.aip.dev/124. + string forwarding_rule = 5 [ + (google.api.field_behavior) = REQUIRED, + (google.api.field_behavior) = IMMUTABLE, + (google.api.resource_reference) = { + type: "compute.googleapis.com/ForwardingRule" + } + ]; + + // Required. Immutable. The deployment group that this deployment is a part + // of, for example: + // `projects/123456789/locations/global/mirroringDeploymentGroups/my-dg`. + // See https://google.aip.dev/124. + string mirroring_deployment_group = 6 [ + (google.api.field_behavior) = REQUIRED, + (google.api.field_behavior) = IMMUTABLE, + (google.api.resource_reference) = { + type: "networksecurity.googleapis.com/MirroringDeploymentGroup" + } + ]; + + // Output only. The current state of the deployment. + // See https://google.aip.dev/216. + State state = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The current state of the resource does not match the user's + // intended state, and the system is working to reconcile them. This part of + // the normal operation (e.g. linking a new association to the parent group). + // See https://google.aip.dev/128. + bool reconciling = 8 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. User-provided description of the deployment. + // Used as additional context for the deployment. + string description = 9 [(google.api.field_behavior) = OPTIONAL]; +} + +// Request message for ListMirroringDeployments. +message ListMirroringDeploymentsRequest { + // Required. The parent, which owns this collection of deployments. + // Example: `projects/123456789/locations/us-central1-a`. + // See https://google.aip.dev/132 for more details. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "networksecurity.googleapis.com/MirroringDeployment" + } + ]; + + // Optional. Requested page size. Server may return fewer items than + // requested. If unspecified, server will pick an appropriate default. See + // https://google.aip.dev/158 for more details. + int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A page token, received from a previous `ListMirroringDeployments` + // call. Provide this to retrieve the subsequent page. When paginating, all + // other parameters provided to `ListMirroringDeployments` must match the call + // that provided the page token. See https://google.aip.dev/158 for more + // details. + string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Filter expression. + // See https://google.aip.dev/160#filtering for more details. + string filter = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Sort expression. + // See https://google.aip.dev/132#ordering for more details. + string order_by = 5 [(google.api.field_behavior) = OPTIONAL]; +} + +// Response message for ListMirroringDeployments. +message ListMirroringDeploymentsResponse { + // The deployments from the specified parent. + repeated MirroringDeployment mirroring_deployments = 1; + + // A token that can be sent as `page_token` to retrieve the next page. + // If this field is omitted, there are no subsequent pages. + // See https://google.aip.dev/158 for more details. + string next_page_token = 2; + + // Locations that could not be reached. + repeated string unreachable = 3; +} + +// Request message for GetMirroringDeployment. +message GetMirroringDeploymentRequest { + // Required. The name of the deployment to retrieve. + // Format: + // projects/{project}/locations/{location}/mirroringDeployments/{mirroring_deployment} + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "networksecurity.googleapis.com/MirroringDeployment" + } + ]; +} + +// Request message for CreateMirroringDeployment. +message CreateMirroringDeploymentRequest { + // Required. The parent resource where this deployment will be created. + // Format: projects/{project}/locations/{location} + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "networksecurity.googleapis.com/MirroringDeployment" + } + ]; + + // Required. The ID to use for the new deployment, which will become the final + // component of the deployment's resource name. + string mirroring_deployment_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The deployment to create. + MirroringDeployment mirroring_deployment = 3 + [(google.api.field_behavior) = REQUIRED]; + + // Optional. A unique identifier for this request. Must be a UUID4. + // This request is only idempotent if a `request_id` is provided. + // See https://google.aip.dev/155 for more details. + string request_id = 4 [ + (google.api.field_info).format = UUID4, + (google.api.field_behavior) = OPTIONAL + ]; +} + +// Request message for UpdateMirroringDeployment. +message UpdateMirroringDeploymentRequest { + // Optional. The list of fields to update. + // Fields are specified relative to the deployment + // (e.g. `description`; *not* `mirroring_deployment.description`). + // See https://google.aip.dev/161 for more details. + google.protobuf.FieldMask update_mask = 1 + [(google.api.field_behavior) = OPTIONAL]; + + // Required. The deployment to update. + MirroringDeployment mirroring_deployment = 2 + [(google.api.field_behavior) = REQUIRED]; + + // Optional. A unique identifier for this request. Must be a UUID4. + // This request is only idempotent if a `request_id` is provided. + // See https://google.aip.dev/155 for more details. + string request_id = 3 [ + (google.api.field_info).format = UUID4, + (google.api.field_behavior) = OPTIONAL + ]; +} + +// Request message for DeleteMirroringDeployment. +message DeleteMirroringDeploymentRequest { + // Required. Name of the resource + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "networksecurity.googleapis.com/MirroringDeployment" + } + ]; + + // Optional. A unique identifier for this request. Must be a UUID4. + // This request is only idempotent if a `request_id` is provided. + // See https://google.aip.dev/155 for more details. + string request_id = 2 [ + (google.api.field_info).format = UUID4, + (google.api.field_behavior) = OPTIONAL + ]; +} + +// Details about mirroring in a specific cloud location. +message MirroringLocation { + // The current state of a resource in the location. + enum State { + // State not set (this is not a valid state). + STATE_UNSPECIFIED = 0; + + // The resource is ready and in sync in the location. + ACTIVE = 1; + + // The resource is out of sync in the location. + // In most cases, this is a result of a transient issue within the system + // (e.g. an inaccessible location) and the system is expected to recover + // automatically. + OUT_OF_SYNC = 2; + } + + // Output only. The cloud location, e.g. "us-central1-a" or "asia-south1". + string location = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The current state of the association in this location. + State state = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; +} diff --git a/packages/google-cloud-networksecurity/protos/google/cloud/networksecurity/v1/network_security.proto b/packages/google-cloud-networksecurity/protos/google/cloud/networksecurity/v1/network_security.proto index 95419b571b9..b8f3ed26785 100644 --- a/packages/google-cloud-networksecurity/protos/google/cloud/networksecurity/v1/network_security.proto +++ b/packages/google-cloud-networksecurity/protos/google/cloud/networksecurity/v1/network_security.proto @@ -1,4 +1,4 @@ -// Copyright 2025 Google LLC +// Copyright 2026 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -19,9 +19,17 @@ package google.cloud.networksecurity.v1; import "google/api/annotations.proto"; import "google/api/client.proto"; import "google/cloud/networksecurity/v1/authorization_policy.proto"; +import "google/cloud/networksecurity/v1/authz_policy.proto"; +import "google/cloud/networksecurity/v1/backend_authentication_config.proto"; import "google/cloud/networksecurity/v1/client_tls_policy.proto"; +import "google/cloud/networksecurity/v1/common.proto"; +import "google/cloud/networksecurity/v1/gateway_security_policy.proto"; +import "google/cloud/networksecurity/v1/gateway_security_policy_rule.proto"; import "google/cloud/networksecurity/v1/server_tls_policy.proto"; +import "google/cloud/networksecurity/v1/tls_inspection_policy.proto"; +import "google/cloud/networksecurity/v1/url_list.proto"; import "google/longrunning/operations.proto"; +import "google/protobuf/empty.proto"; option csharp_namespace = "Google.Cloud.NetworkSecurity.V1"; option go_package = "cloud.google.com/go/networksecurity/apiv1/networksecuritypb;networksecuritypb"; @@ -35,10 +43,12 @@ option ruby_package = "Google::Cloud::NetworkSecurity::V1"; // information. service NetworkSecurity { option (google.api.default_host) = "networksecurity.googleapis.com"; - option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform"; // Lists AuthorizationPolicies in a given project and location. - rpc ListAuthorizationPolicies(ListAuthorizationPoliciesRequest) returns (ListAuthorizationPoliciesResponse) { + rpc ListAuthorizationPolicies(ListAuthorizationPoliciesRequest) + returns (ListAuthorizationPoliciesResponse) { option (google.api.http) = { get: "/v1/{parent=projects/*/locations/*}/authorizationPolicies" }; @@ -46,7 +56,8 @@ service NetworkSecurity { } // Gets details of a single AuthorizationPolicy. - rpc GetAuthorizationPolicy(GetAuthorizationPolicyRequest) returns (AuthorizationPolicy) { + rpc GetAuthorizationPolicy(GetAuthorizationPolicyRequest) + returns (AuthorizationPolicy) { option (google.api.http) = { get: "/v1/{name=projects/*/locations/*/authorizationPolicies/*}" }; @@ -54,12 +65,14 @@ service NetworkSecurity { } // Creates a new AuthorizationPolicy in a given project and location. - rpc CreateAuthorizationPolicy(CreateAuthorizationPolicyRequest) returns (google.longrunning.Operation) { + rpc CreateAuthorizationPolicy(CreateAuthorizationPolicyRequest) + returns (google.longrunning.Operation) { option (google.api.http) = { post: "/v1/{parent=projects/*/locations/*}/authorizationPolicies" body: "authorization_policy" }; - option (google.api.method_signature) = "parent,authorization_policy,authorization_policy_id"; + option (google.api.method_signature) = + "parent,authorization_policy,authorization_policy_id"; option (google.longrunning.operation_info) = { response_type: "AuthorizationPolicy" metadata_type: "google.cloud.networksecurity.v1.OperationMetadata" @@ -67,7 +80,8 @@ service NetworkSecurity { } // Updates the parameters of a single AuthorizationPolicy. - rpc UpdateAuthorizationPolicy(UpdateAuthorizationPolicyRequest) returns (google.longrunning.Operation) { + rpc UpdateAuthorizationPolicy(UpdateAuthorizationPolicyRequest) + returns (google.longrunning.Operation) { option (google.api.http) = { patch: "/v1/{authorization_policy.name=projects/*/locations/*/authorizationPolicies/*}" body: "authorization_policy" @@ -80,7 +94,8 @@ service NetworkSecurity { } // Deletes a single AuthorizationPolicy. - rpc DeleteAuthorizationPolicy(DeleteAuthorizationPolicyRequest) returns (google.longrunning.Operation) { + rpc DeleteAuthorizationPolicy(DeleteAuthorizationPolicyRequest) + returns (google.longrunning.Operation) { option (google.api.http) = { delete: "/v1/{name=projects/*/locations/*/authorizationPolicies/*}" }; @@ -91,8 +106,76 @@ service NetworkSecurity { }; } + // Lists BackendAuthenticationConfigs in a given project and location. + rpc ListBackendAuthenticationConfigs(ListBackendAuthenticationConfigsRequest) + returns (ListBackendAuthenticationConfigsResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*}/backendAuthenticationConfigs" + }; + option (google.api.method_signature) = "parent"; + } + + // Gets details of a single BackendAuthenticationConfig to + // BackendAuthenticationConfig. + rpc GetBackendAuthenticationConfig(GetBackendAuthenticationConfigRequest) + returns (BackendAuthenticationConfig) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/backendAuthenticationConfigs/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Creates a new BackendAuthenticationConfig in a given project and location. + rpc CreateBackendAuthenticationConfig( + CreateBackendAuthenticationConfigRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*}/backendAuthenticationConfigs" + body: "backend_authentication_config" + }; + option (google.api.method_signature) = + "parent,backend_authentication_config,backend_authentication_config_id"; + option (google.longrunning.operation_info) = { + response_type: "BackendAuthenticationConfig" + metadata_type: "google.cloud.networksecurity.v1.OperationMetadata" + }; + } + + // Updates the parameters of a single BackendAuthenticationConfig to + // BackendAuthenticationConfig. + rpc UpdateBackendAuthenticationConfig( + UpdateBackendAuthenticationConfigRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + patch: "/v1/{backend_authentication_config.name=projects/*/locations/*/backendAuthenticationConfigs/*}" + body: "backend_authentication_config" + }; + option (google.api.method_signature) = + "backend_authentication_config,update_mask"; + option (google.longrunning.operation_info) = { + response_type: "BackendAuthenticationConfig" + metadata_type: "google.cloud.networksecurity.v1.OperationMetadata" + }; + } + + // Deletes a single BackendAuthenticationConfig to + // BackendAuthenticationConfig. + rpc DeleteBackendAuthenticationConfig( + DeleteBackendAuthenticationConfigRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/locations/*/backendAuthenticationConfigs/*}" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "google.cloud.networksecurity.v1.OperationMetadata" + }; + } + // Lists ServerTlsPolicies in a given project and location. - rpc ListServerTlsPolicies(ListServerTlsPoliciesRequest) returns (ListServerTlsPoliciesResponse) { + rpc ListServerTlsPolicies(ListServerTlsPoliciesRequest) + returns (ListServerTlsPoliciesResponse) { option (google.api.http) = { get: "/v1/{parent=projects/*/locations/*}/serverTlsPolicies" }; @@ -108,12 +191,14 @@ service NetworkSecurity { } // Creates a new ServerTlsPolicy in a given project and location. - rpc CreateServerTlsPolicy(CreateServerTlsPolicyRequest) returns (google.longrunning.Operation) { + rpc CreateServerTlsPolicy(CreateServerTlsPolicyRequest) + returns (google.longrunning.Operation) { option (google.api.http) = { post: "/v1/{parent=projects/*/locations/*}/serverTlsPolicies" body: "server_tls_policy" }; - option (google.api.method_signature) = "parent,server_tls_policy,server_tls_policy_id"; + option (google.api.method_signature) = + "parent,server_tls_policy,server_tls_policy_id"; option (google.longrunning.operation_info) = { response_type: "ServerTlsPolicy" metadata_type: "google.cloud.networksecurity.v1.OperationMetadata" @@ -121,7 +206,8 @@ service NetworkSecurity { } // Updates the parameters of a single ServerTlsPolicy. - rpc UpdateServerTlsPolicy(UpdateServerTlsPolicyRequest) returns (google.longrunning.Operation) { + rpc UpdateServerTlsPolicy(UpdateServerTlsPolicyRequest) + returns (google.longrunning.Operation) { option (google.api.http) = { patch: "/v1/{server_tls_policy.name=projects/*/locations/*/serverTlsPolicies/*}" body: "server_tls_policy" @@ -134,7 +220,8 @@ service NetworkSecurity { } // Deletes a single ServerTlsPolicy. - rpc DeleteServerTlsPolicy(DeleteServerTlsPolicyRequest) returns (google.longrunning.Operation) { + rpc DeleteServerTlsPolicy(DeleteServerTlsPolicyRequest) + returns (google.longrunning.Operation) { option (google.api.http) = { delete: "/v1/{name=projects/*/locations/*/serverTlsPolicies/*}" }; @@ -146,7 +233,8 @@ service NetworkSecurity { } // Lists ClientTlsPolicies in a given project and location. - rpc ListClientTlsPolicies(ListClientTlsPoliciesRequest) returns (ListClientTlsPoliciesResponse) { + rpc ListClientTlsPolicies(ListClientTlsPoliciesRequest) + returns (ListClientTlsPoliciesResponse) { option (google.api.http) = { get: "/v1/{parent=projects/*/locations/*}/clientTlsPolicies" }; @@ -162,12 +250,14 @@ service NetworkSecurity { } // Creates a new ClientTlsPolicy in a given project and location. - rpc CreateClientTlsPolicy(CreateClientTlsPolicyRequest) returns (google.longrunning.Operation) { + rpc CreateClientTlsPolicy(CreateClientTlsPolicyRequest) + returns (google.longrunning.Operation) { option (google.api.http) = { post: "/v1/{parent=projects/*/locations/*}/clientTlsPolicies" body: "client_tls_policy" }; - option (google.api.method_signature) = "parent,client_tls_policy,client_tls_policy_id"; + option (google.api.method_signature) = + "parent,client_tls_policy,client_tls_policy_id"; option (google.longrunning.operation_info) = { response_type: "ClientTlsPolicy" metadata_type: "google.cloud.networksecurity.v1.OperationMetadata" @@ -175,7 +265,8 @@ service NetworkSecurity { } // Updates the parameters of a single ClientTlsPolicy. - rpc UpdateClientTlsPolicy(UpdateClientTlsPolicyRequest) returns (google.longrunning.Operation) { + rpc UpdateClientTlsPolicy(UpdateClientTlsPolicyRequest) + returns (google.longrunning.Operation) { option (google.api.http) = { patch: "/v1/{client_tls_policy.name=projects/*/locations/*/clientTlsPolicies/*}" body: "client_tls_policy" @@ -188,7 +279,8 @@ service NetworkSecurity { } // Deletes a single ClientTlsPolicy. - rpc DeleteClientTlsPolicy(DeleteClientTlsPolicyRequest) returns (google.longrunning.Operation) { + rpc DeleteClientTlsPolicy(DeleteClientTlsPolicyRequest) + returns (google.longrunning.Operation) { option (google.api.http) = { delete: "/v1/{name=projects/*/locations/*/clientTlsPolicies/*}" }; @@ -198,4 +290,302 @@ service NetworkSecurity { metadata_type: "google.cloud.networksecurity.v1.OperationMetadata" }; } + + // Lists GatewaySecurityPolicies in a given project and location. + rpc ListGatewaySecurityPolicies(ListGatewaySecurityPoliciesRequest) + returns (ListGatewaySecurityPoliciesResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*}/gatewaySecurityPolicies" + }; + option (google.api.method_signature) = "parent"; + } + + // Gets details of a single GatewaySecurityPolicy. + rpc GetGatewaySecurityPolicy(GetGatewaySecurityPolicyRequest) + returns (GatewaySecurityPolicy) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/gatewaySecurityPolicies/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Creates a new GatewaySecurityPolicy in a given project and location. + rpc CreateGatewaySecurityPolicy(CreateGatewaySecurityPolicyRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*}/gatewaySecurityPolicies" + body: "gateway_security_policy" + }; + option (google.api.method_signature) = + "parent,gateway_security_policy,gateway_security_policy_id"; + option (google.longrunning.operation_info) = { + response_type: "GatewaySecurityPolicy" + metadata_type: "google.cloud.networksecurity.v1.OperationMetadata" + }; + } + + // Updates the parameters of a single GatewaySecurityPolicy. + rpc UpdateGatewaySecurityPolicy(UpdateGatewaySecurityPolicyRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + patch: "/v1/{gateway_security_policy.name=projects/*/locations/*/gatewaySecurityPolicies/*}" + body: "gateway_security_policy" + }; + option (google.api.method_signature) = + "gateway_security_policy,update_mask"; + option (google.longrunning.operation_info) = { + response_type: "GatewaySecurityPolicy" + metadata_type: "google.cloud.networksecurity.v1.OperationMetadata" + }; + } + + // Deletes a single GatewaySecurityPolicy. + rpc DeleteGatewaySecurityPolicy(DeleteGatewaySecurityPolicyRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/locations/*/gatewaySecurityPolicies/*}" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "google.cloud.networksecurity.v1.OperationMetadata" + }; + } + + // Lists GatewaySecurityPolicyRules in a given project and location. + rpc ListGatewaySecurityPolicyRules(ListGatewaySecurityPolicyRulesRequest) + returns (ListGatewaySecurityPolicyRulesResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*/gatewaySecurityPolicies/*}/rules" + }; + option (google.api.method_signature) = "parent"; + } + + // Gets details of a single GatewaySecurityPolicyRule. + rpc GetGatewaySecurityPolicyRule(GetGatewaySecurityPolicyRuleRequest) + returns (GatewaySecurityPolicyRule) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/gatewaySecurityPolicies/*/rules/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Creates a new GatewaySecurityPolicy in a given project and location. + rpc CreateGatewaySecurityPolicyRule(CreateGatewaySecurityPolicyRuleRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*/gatewaySecurityPolicies/*}/rules" + body: "gateway_security_policy_rule" + }; + option (google.api.method_signature) = + "parent,gateway_security_policy_rule,gateway_security_policy_rule_id"; + option (google.longrunning.operation_info) = { + response_type: "GatewaySecurityPolicyRule" + metadata_type: "google.cloud.networksecurity.v1.OperationMetadata" + }; + } + + // Updates the parameters of a single GatewaySecurityPolicyRule. + rpc UpdateGatewaySecurityPolicyRule(UpdateGatewaySecurityPolicyRuleRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + patch: "/v1/{gateway_security_policy_rule.name=projects/*/locations/*/gatewaySecurityPolicies/*/rules/*}" + body: "gateway_security_policy_rule" + }; + option (google.api.method_signature) = + "gateway_security_policy_rule,update_mask"; + option (google.longrunning.operation_info) = { + response_type: "GatewaySecurityPolicyRule" + metadata_type: "google.cloud.networksecurity.v1.OperationMetadata" + }; + } + + // Deletes a single GatewaySecurityPolicyRule. + rpc DeleteGatewaySecurityPolicyRule(DeleteGatewaySecurityPolicyRuleRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/locations/*/gatewaySecurityPolicies/*/rules/*}" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "google.cloud.networksecurity.v1.OperationMetadata" + }; + } + + // Lists UrlLists in a given project and location. + rpc ListUrlLists(ListUrlListsRequest) returns (ListUrlListsResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*}/urlLists" + }; + option (google.api.method_signature) = "parent"; + } + + // Gets details of a single UrlList. + rpc GetUrlList(GetUrlListRequest) returns (UrlList) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/urlLists/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Creates a new UrlList in a given project and location. + rpc CreateUrlList(CreateUrlListRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*}/urlLists" + body: "url_list" + }; + option (google.api.method_signature) = "parent,url_list,url_list_id"; + option (google.longrunning.operation_info) = { + response_type: "UrlList" + metadata_type: "google.cloud.networksecurity.v1.OperationMetadata" + }; + } + + // Updates the parameters of a single UrlList. + rpc UpdateUrlList(UpdateUrlListRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + patch: "/v1/{url_list.name=projects/*/locations/*/urlLists/*}" + body: "url_list" + }; + option (google.api.method_signature) = "url_list,update_mask"; + option (google.longrunning.operation_info) = { + response_type: "UrlList" + metadata_type: "google.cloud.networksecurity.v1.OperationMetadata" + }; + } + + // Deletes a single UrlList. + rpc DeleteUrlList(DeleteUrlListRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/locations/*/urlLists/*}" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "google.cloud.networksecurity.v1.OperationMetadata" + }; + } + + // Lists TlsInspectionPolicies in a given project and location. + rpc ListTlsInspectionPolicies(ListTlsInspectionPoliciesRequest) + returns (ListTlsInspectionPoliciesResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*}/tlsInspectionPolicies" + }; + option (google.api.method_signature) = "parent"; + } + + // Gets details of a single TlsInspectionPolicy. + rpc GetTlsInspectionPolicy(GetTlsInspectionPolicyRequest) + returns (TlsInspectionPolicy) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/tlsInspectionPolicies/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Creates a new TlsInspectionPolicy in a given project and location. + rpc CreateTlsInspectionPolicy(CreateTlsInspectionPolicyRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*}/tlsInspectionPolicies" + body: "tls_inspection_policy" + }; + option (google.api.method_signature) = + "parent,tls_inspection_policy,tls_inspection_policy_id"; + option (google.longrunning.operation_info) = { + response_type: "TlsInspectionPolicy" + metadata_type: "google.cloud.networksecurity.v1.OperationMetadata" + }; + } + + // Updates the parameters of a single TlsInspectionPolicy. + rpc UpdateTlsInspectionPolicy(UpdateTlsInspectionPolicyRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + patch: "/v1/{tls_inspection_policy.name=projects/*/locations/*/tlsInspectionPolicies/*}" + body: "tls_inspection_policy" + }; + option (google.api.method_signature) = "tls_inspection_policy,update_mask"; + option (google.longrunning.operation_info) = { + response_type: "TlsInspectionPolicy" + metadata_type: "google.cloud.networksecurity.v1.OperationMetadata" + }; + } + + // Deletes a single TlsInspectionPolicy. + rpc DeleteTlsInspectionPolicy(DeleteTlsInspectionPolicyRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/locations/*/tlsInspectionPolicies/*}" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "google.cloud.networksecurity.v1.OperationMetadata" + }; + } + + // Lists AuthzPolicies in a given project and location. + rpc ListAuthzPolicies(ListAuthzPoliciesRequest) + returns (ListAuthzPoliciesResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*}/authzPolicies" + }; + option (google.api.method_signature) = "parent"; + } + + // Gets details of a single AuthzPolicy. + rpc GetAuthzPolicy(GetAuthzPolicyRequest) returns (AuthzPolicy) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/authzPolicies/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Creates a new AuthzPolicy in a given project and location. + rpc CreateAuthzPolicy(CreateAuthzPolicyRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*}/authzPolicies" + body: "authz_policy" + }; + option (google.api.method_signature) = + "parent,authz_policy,authz_policy_id"; + option (google.longrunning.operation_info) = { + response_type: "AuthzPolicy" + metadata_type: "google.cloud.networksecurity.v1.OperationMetadata" + }; + } + + // Updates the parameters of a single AuthzPolicy. + rpc UpdateAuthzPolicy(UpdateAuthzPolicyRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + patch: "/v1/{authz_policy.name=projects/*/locations/*/authzPolicies/*}" + body: "authz_policy" + }; + option (google.api.method_signature) = "authz_policy,update_mask"; + option (google.longrunning.operation_info) = { + response_type: "AuthzPolicy" + metadata_type: "google.cloud.networksecurity.v1.OperationMetadata" + }; + } + + // Deletes a single AuthzPolicy. + rpc DeleteAuthzPolicy(DeleteAuthzPolicyRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/locations/*/authzPolicies/*}" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "google.cloud.networksecurity.v1.OperationMetadata" + }; + } } diff --git a/packages/google-cloud-networksecurity/protos/google/cloud/networksecurity/v1/security_profile_group.proto b/packages/google-cloud-networksecurity/protos/google/cloud/networksecurity/v1/security_profile_group.proto new file mode 100644 index 00000000000..0bb45bfb8c4 --- /dev/null +++ b/packages/google-cloud-networksecurity/protos/google/cloud/networksecurity/v1/security_profile_group.proto @@ -0,0 +1,188 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.networksecurity.v1; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/networksecurity/v1/security_profile_group_intercept.proto"; +import "google/cloud/networksecurity/v1/security_profile_group_mirroring.proto"; +import "google/cloud/networksecurity/v1/security_profile_group_threatprevention.proto"; +import "google/cloud/networksecurity/v1/security_profile_group_urlfiltering.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.NetworkSecurity.V1"; +option go_package = "cloud.google.com/go/networksecurity/apiv1/networksecuritypb;networksecuritypb"; +option java_multiple_files = true; +option java_outer_classname = "SecurityProfileGroupProto"; +option java_package = "com.google.cloud.networksecurity.v1"; +option php_namespace = "Google\\Cloud\\NetworkSecurity\\V1"; +option ruby_package = "Google::Cloud::NetworkSecurity::V1"; + +// SecurityProfileGroup is a resource that defines the behavior for various +// ProfileTypes. +message SecurityProfileGroup { + option (google.api.resource) = { + type: "networksecurity.googleapis.com/SecurityProfileGroup" + pattern: "organizations/{organization}/locations/{location}/securityProfileGroups/{security_profile_group}" + pattern: "projects/{project}/locations/{location}/securityProfileGroups/{security_profile_group}" + }; + + // Immutable. Identifier. Name of the SecurityProfileGroup resource. It + // matches pattern + // `projects|organizations/*/locations/{location}/securityProfileGroups/{security_profile_group}`. + string name = 1 [ + (google.api.field_behavior) = IMMUTABLE, + (google.api.field_behavior) = IDENTIFIER + ]; + + // Optional. An optional description of the profile group. Max length 2048 + // characters. + string description = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Output only. Resource creation timestamp. + google.protobuf.Timestamp create_time = 3 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Last resource update timestamp. + google.protobuf.Timestamp update_time = 4 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. This checksum is computed by the server based on the value of + // other fields, and may be sent on update and delete requests to ensure the + // client has an up-to-date value before proceeding. + string etag = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Identifier used by the data-path. Unique within {container, + // location}. + uint64 data_path_id = 12 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. Labels as key value pairs. + map labels = 7 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Reference to a SecurityProfile with the ThreatPrevention + // configuration. + string threat_prevention_profile = 6 [ + (google.api.field_behavior) = OPTIONAL, + (google.api.resource_reference) = { + type: "networksecurity.googleapis.com/SecurityProfile" + } + ]; + + // Optional. Reference to a SecurityProfile with the CustomMirroring + // configuration. + string custom_mirroring_profile = 8 [ + (google.api.field_behavior) = OPTIONAL, + (google.api.resource_reference) = { + type: "networksecurity.googleapis.com/SecurityProfile" + } + ]; + + // Optional. Reference to a SecurityProfile with the CustomIntercept + // configuration. + string custom_intercept_profile = 9 [ + (google.api.field_behavior) = OPTIONAL, + (google.api.resource_reference) = { + type: "networksecurity.googleapis.com/SecurityProfile" + } + ]; + + // Optional. Reference to a SecurityProfile with the UrlFiltering + // configuration. + string url_filtering_profile = 11 [ + (google.api.field_behavior) = OPTIONAL, + (google.api.resource_reference) = { + type: "networksecurity.googleapis.com/SecurityProfile" + } + ]; +} + +// SecurityProfile is a resource that defines the behavior for one of many +// ProfileTypes. +message SecurityProfile { + option (google.api.resource) = { + type: "networksecurity.googleapis.com/SecurityProfile" + pattern: "organizations/{organization}/locations/{location}/securityProfiles/{security_profile}" + pattern: "projects/{project}/locations/{location}/securityProfiles/{security_profile}" + }; + + // The possible types that the SecurityProfile resource can configure. + enum ProfileType { + // Profile type not specified. + PROFILE_TYPE_UNSPECIFIED = 0; + + // Profile type for threat prevention. + THREAT_PREVENTION = 1; + + // Profile type for packet mirroring v2 + CUSTOM_MIRRORING = 2; + + // Profile type for TPPI. + CUSTOM_INTERCEPT = 3; + + // Profile type for URL filtering. + URL_FILTERING = 5; + } + + // The behavior for the ProfileType that the SecurityProfile resource is meant + // to configure. This field must correspond to the ProfileType of the + // SecurityProfile. + oneof profile { + // The threat prevention configuration for the SecurityProfile. + ThreatPreventionProfile threat_prevention_profile = 7; + + // The custom Packet Mirroring v2 configuration for the SecurityProfile. + CustomMirroringProfile custom_mirroring_profile = 9; + + // The custom TPPI configuration for the SecurityProfile. + CustomInterceptProfile custom_intercept_profile = 10; + + // The URL filtering configuration for the SecurityProfile. + UrlFilteringProfile url_filtering_profile = 12; + } + + // Immutable. Identifier. Name of the SecurityProfile resource. It matches + // pattern + // `projects|organizations/*/locations/{location}/securityProfiles/{security_profile}`. + string name = 1 [ + (google.api.field_behavior) = IMMUTABLE, + (google.api.field_behavior) = IDENTIFIER + ]; + + // Optional. An optional description of the profile. Max length 512 + // characters. + string description = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Output only. Resource creation timestamp. + google.protobuf.Timestamp create_time = 3 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Last resource update timestamp. + google.protobuf.Timestamp update_time = 4 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. This checksum is computed by the server based on the value of + // other fields, and may be sent on update and delete requests to ensure the + // client has an up-to-date value before proceeding. + string etag = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. Labels as key value pairs. + map labels = 8 [(google.api.field_behavior) = OPTIONAL]; + + // Immutable. The single ProfileType that the SecurityProfile resource + // configures. + ProfileType type = 6 [(google.api.field_behavior) = IMMUTABLE]; +} diff --git a/packages/google-cloud-networksecurity/protos/google/cloud/networksecurity/v1/security_profile_group_intercept.proto b/packages/google-cloud-networksecurity/protos/google/cloud/networksecurity/v1/security_profile_group_intercept.proto new file mode 100644 index 00000000000..8088353a802 --- /dev/null +++ b/packages/google-cloud-networksecurity/protos/google/cloud/networksecurity/v1/security_profile_group_intercept.proto @@ -0,0 +1,42 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.networksecurity.v1; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; + +option csharp_namespace = "Google.Cloud.NetworkSecurity.V1"; +option go_package = "cloud.google.com/go/networksecurity/apiv1/networksecuritypb;networksecuritypb"; +option java_multiple_files = true; +option java_outer_classname = "SecurityProfileGroupInterceptProto"; +option java_package = "com.google.cloud.networksecurity.v1"; +option php_namespace = "Google\\Cloud\\NetworkSecurity\\V1"; +option ruby_package = "Google::Cloud::NetworkSecurity::V1"; + +// CustomInterceptProfile defines in-band integration behavior (intercept). +// It is used by firewall rules with an APPLY_SECURITY_PROFILE_GROUP action. +message CustomInterceptProfile { + // Required. The target InterceptEndpointGroup. + // When a firewall rule with this security profile attached matches a packet, + // the packet will be intercepted to the location-local target in this group. + string intercept_endpoint_group = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "networksecurity.googleapis.com/InterceptEndpointGroup" + } + ]; +} diff --git a/packages/google-cloud-networksecurity/protos/google/cloud/networksecurity/v1/security_profile_group_mirroring.proto b/packages/google-cloud-networksecurity/protos/google/cloud/networksecurity/v1/security_profile_group_mirroring.proto new file mode 100644 index 00000000000..b4d0c4ae985 --- /dev/null +++ b/packages/google-cloud-networksecurity/protos/google/cloud/networksecurity/v1/security_profile_group_mirroring.proto @@ -0,0 +1,43 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.networksecurity.v1; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; + +option csharp_namespace = "Google.Cloud.NetworkSecurity.V1"; +option go_package = "cloud.google.com/go/networksecurity/apiv1/networksecuritypb;networksecuritypb"; +option java_multiple_files = true; +option java_outer_classname = "SecurityProfileGroupMirroringProto"; +option java_package = "com.google.cloud.networksecurity.v1"; +option php_namespace = "Google\\Cloud\\NetworkSecurity\\V1"; +option ruby_package = "Google::Cloud::NetworkSecurity::V1"; + +// CustomMirroringProfile defines out-of-band integration behavior (mirroring). +// It is used by mirroring rules with a MIRROR action. +message CustomMirroringProfile { + // Required. Immutable. The target MirroringEndpointGroup. + // When a mirroring rule with this security profile attached matches a packet, + // a replica will be mirrored to the location-local target in this group. + string mirroring_endpoint_group = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.field_behavior) = IMMUTABLE, + (google.api.resource_reference) = { + type: "networksecurity.googleapis.com/MirroringEndpointGroup" + } + ]; +} diff --git a/packages/google-cloud-networksecurity/protos/google/cloud/networksecurity/v1/security_profile_group_service.proto b/packages/google-cloud-networksecurity/protos/google/cloud/networksecurity/v1/security_profile_group_service.proto new file mode 100644 index 00000000000..3ed94a75518 --- /dev/null +++ b/packages/google-cloud-networksecurity/protos/google/cloud/networksecurity/v1/security_profile_group_service.proto @@ -0,0 +1,354 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.networksecurity.v1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/networksecurity/v1/common.proto"; +import "google/cloud/networksecurity/v1/security_profile_group.proto"; +import "google/longrunning/operations.proto"; +import "google/protobuf/empty.proto"; +import "google/protobuf/field_mask.proto"; + +option csharp_namespace = "Google.Cloud.NetworkSecurity.V1"; +option go_package = "cloud.google.com/go/networksecurity/apiv1/networksecuritypb;networksecuritypb"; +option java_multiple_files = true; +option java_outer_classname = "SecurityProfileGroupServiceProto"; +option java_package = "com.google.cloud.networksecurity.v1"; +option php_namespace = "Google\\Cloud\\NetworkSecurity\\V1"; +option ruby_package = "Google::Cloud::NetworkSecurity::V1"; + +// Organization SecurityProfileGroup is created under organization. +service OrganizationSecurityProfileGroupService { + option (google.api.default_host) = "networksecurity.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform"; + + // Lists SecurityProfileGroups in a given organization and location. + rpc ListSecurityProfileGroups(ListSecurityProfileGroupsRequest) + returns (ListSecurityProfileGroupsResponse) { + option (google.api.http) = { + get: "/v1/{parent=organizations/*/locations/*}/securityProfileGroups" + }; + option (google.api.method_signature) = "parent"; + } + + // Gets details of a single SecurityProfileGroup. + rpc GetSecurityProfileGroup(GetSecurityProfileGroupRequest) + returns (SecurityProfileGroup) { + option (google.api.http) = { + get: "/v1/{name=organizations/*/locations/*/securityProfileGroups/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Creates a new SecurityProfileGroup in a given organization and location. + rpc CreateSecurityProfileGroup(CreateSecurityProfileGroupRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{parent=organizations/*/locations/*}/securityProfileGroups" + body: "security_profile_group" + }; + option (google.api.method_signature) = + "parent,security_profile_group,security_profile_group_id"; + option (google.longrunning.operation_info) = { + response_type: "SecurityProfileGroup" + metadata_type: "google.cloud.networksecurity.v1.OperationMetadata" + }; + } + + // Updates the parameters of a single SecurityProfileGroup. + rpc UpdateSecurityProfileGroup(UpdateSecurityProfileGroupRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + patch: "/v1/{security_profile_group.name=organizations/*/locations/*/securityProfileGroups/*}" + body: "security_profile_group" + }; + option (google.api.method_signature) = "security_profile_group,update_mask"; + option (google.longrunning.operation_info) = { + response_type: "SecurityProfileGroup" + metadata_type: "google.cloud.networksecurity.v1.OperationMetadata" + }; + } + + // Deletes a single SecurityProfileGroup. + rpc DeleteSecurityProfileGroup(DeleteSecurityProfileGroupRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v1/{name=organizations/*/locations/*/securityProfileGroups/*}" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "google.cloud.networksecurity.v1.OperationMetadata" + }; + } + + // Lists SecurityProfiles in a given organization and location. + rpc ListSecurityProfiles(ListSecurityProfilesRequest) + returns (ListSecurityProfilesResponse) { + option (google.api.http) = { + get: "/v1/{parent=organizations/*/locations/*}/securityProfiles" + }; + option (google.api.method_signature) = "parent"; + } + + // Gets details of a single SecurityProfile. + rpc GetSecurityProfile(GetSecurityProfileRequest) returns (SecurityProfile) { + option (google.api.http) = { + get: "/v1/{name=organizations/*/locations/*/securityProfiles/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Creates a new SecurityProfile in a given organization and location. + rpc CreateSecurityProfile(CreateSecurityProfileRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{parent=organizations/*/locations/*}/securityProfiles" + body: "security_profile" + }; + option (google.api.method_signature) = + "parent,security_profile,security_profile_id"; + option (google.longrunning.operation_info) = { + response_type: "SecurityProfile" + metadata_type: "google.cloud.networksecurity.v1.OperationMetadata" + }; + } + + // Updates the parameters of a single SecurityProfile. + rpc UpdateSecurityProfile(UpdateSecurityProfileRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + patch: "/v1/{security_profile.name=organizations/*/locations/*/securityProfiles/*}" + body: "security_profile" + }; + option (google.api.method_signature) = "security_profile,update_mask"; + option (google.longrunning.operation_info) = { + response_type: "SecurityProfile" + metadata_type: "google.cloud.networksecurity.v1.OperationMetadata" + }; + } + + // Deletes a single SecurityProfile. + rpc DeleteSecurityProfile(DeleteSecurityProfileRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v1/{name=organizations/*/locations/*/securityProfiles/*}" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "google.cloud.networksecurity.v1.OperationMetadata" + }; + } +} + +// Request used with the ListSecurityProfileGroups method. +message ListSecurityProfileGroupsRequest { + // Required. The project or organization and location from which the + // SecurityProfileGroups should be listed, specified in the format + // `projects|organizations/*/locations/{location}`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "networksecurity.googleapis.com/SecurityProfileGroup" + } + ]; + + // Optional. Maximum number of SecurityProfileGroups to return per call. + int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The value returned by the last + // `ListSecurityProfileGroupsResponse` Indicates that this is a + // continuation of a prior `ListSecurityProfileGroups` call, and + // that the system should return the next page of data. + string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// Response returned by the ListSecurityProfileGroups method. +message ListSecurityProfileGroupsResponse { + // List of SecurityProfileGroups resources. + repeated SecurityProfileGroup security_profile_groups = 1; + + // If there might be more results than those appearing in this response, then + // `next_page_token` is included. To get the next set of results, call this + // method again using the value of `next_page_token` as `page_token`. + string next_page_token = 2; +} + +// Request used by the GetSecurityProfileGroup method. +message GetSecurityProfileGroupRequest { + // Required. A name of the SecurityProfileGroup to get. Must be in the format + // `projects|organizations/*/locations/{location}/securityProfileGroups/{security_profile_group}`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "networksecurity.googleapis.com/SecurityProfileGroup" + } + ]; +} + +// Request used by the CreateSecurityProfileGroup method. +message CreateSecurityProfileGroupRequest { + // Required. The parent resource of the SecurityProfileGroup. Must be in the + // format `projects|organizations/*/locations/{location}`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "networksecurity.googleapis.com/SecurityProfileGroup" + } + ]; + + // Required. Short name of the SecurityProfileGroup resource to be created. + // This value should be 1-63 characters long, containing only + // letters, numbers, hyphens, and underscores, and should not start + // with a number. E.g. "security_profile_group1". + string security_profile_group_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. SecurityProfileGroup resource to be created. + SecurityProfileGroup security_profile_group = 3 + [(google.api.field_behavior) = REQUIRED]; +} + +// Request used by the UpdateSecurityProfileGroup method. +message UpdateSecurityProfileGroupRequest { + // Required. Field mask is used to specify the fields to be overwritten in the + // SecurityProfileGroup resource by the update. + // The fields specified in the update_mask are relative to the resource, not + // the full request. A field will be overwritten if it is in the mask. + google.protobuf.FieldMask update_mask = 1 + [(google.api.field_behavior) = REQUIRED]; + + // Required. Updated SecurityProfileGroup resource. + SecurityProfileGroup security_profile_group = 2 + [(google.api.field_behavior) = REQUIRED]; +} + +// Request used by the DeleteSecurityProfileGroup method. +message DeleteSecurityProfileGroupRequest { + // Required. A name of the SecurityProfileGroup to delete. Must be in the + // format + // `projects|organizations/*/locations/{location}/securityProfileGroups/{security_profile_group}`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "networksecurity.googleapis.com/SecurityProfileGroup" + } + ]; + + // Optional. If client provided etag is out of date, delete will return + // FAILED_PRECONDITION error. + string etag = 2 [(google.api.field_behavior) = OPTIONAL]; +} + +// Request used with the ListSecurityProfiles method. +message ListSecurityProfilesRequest { + // Required. The project or organization and location from which the + // SecurityProfiles should be listed, specified in the format + // `projects|organizations/*/locations/{location}`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "networksecurity.googleapis.com/SecurityProfile" + } + ]; + + // Optional. Maximum number of SecurityProfiles to return per call. + int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The value returned by the last + // `ListSecurityProfilesResponse` Indicates that this is a continuation of a + // prior `ListSecurityProfiles` call, and that the system should return the + // next page of data. + string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// Response returned by the ListSecurityProfiles method. +message ListSecurityProfilesResponse { + // List of SecurityProfile resources. + repeated SecurityProfile security_profiles = 1; + + // If there might be more results than those appearing in this response, then + // `next_page_token` is included. To get the next set of results, call this + // method again using the value of `next_page_token` as `page_token`. + string next_page_token = 2; +} + +// Request used by the GetSecurityProfile method. +message GetSecurityProfileRequest { + // Required. A name of the SecurityProfile to get. Must be in the format + // `projects|organizations/*/locations/{location}/securityProfiles/{security_profile_id}`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "networksecurity.googleapis.com/SecurityProfile" + } + ]; +} + +// Request used by the CreateSecurityProfile method. +message CreateSecurityProfileRequest { + // Required. The parent resource of the SecurityProfile. Must be in the format + // `projects|organizations/*/locations/{location}`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "networksecurity.googleapis.com/SecurityProfile" + } + ]; + + // Required. Short name of the SecurityProfile resource to be created. This + // value should be 1-63 characters long, containing only letters, numbers, + // hyphens, and underscores, and should not start with a number. E.g. + // "security_profile1". + string security_profile_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. SecurityProfile resource to be created. + SecurityProfile security_profile = 3 [(google.api.field_behavior) = REQUIRED]; +} + +// Request used by the UpdateSecurityProfile method. +message UpdateSecurityProfileRequest { + // Required. Field mask is used to specify the fields to be overwritten in the + // SecurityProfile resource by the update. + // The fields specified in the update_mask are relative to the resource, not + // the full request. A field will be overwritten if it is in the mask. + google.protobuf.FieldMask update_mask = 1 + [(google.api.field_behavior) = REQUIRED]; + + // Required. Updated SecurityProfile resource. + SecurityProfile security_profile = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Request used by the DeleteSecurityProfile method. +message DeleteSecurityProfileRequest { + // Required. A name of the SecurityProfile to delete. Must be in the format + // `projects|organizations/*/locations/{location}/securityProfiles/{security_profile_id}`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "networksecurity.googleapis.com/SecurityProfile" + } + ]; + + // Optional. If client provided etag is out of date, delete will return + // FAILED_PRECONDITION error. + string etag = 2 [(google.api.field_behavior) = OPTIONAL]; +} diff --git a/packages/google-cloud-networksecurity/protos/google/cloud/networksecurity/v1/security_profile_group_threatprevention.proto b/packages/google-cloud-networksecurity/protos/google/cloud/networksecurity/v1/security_profile_group_threatprevention.proto new file mode 100644 index 00000000000..a378de843a4 --- /dev/null +++ b/packages/google-cloud-networksecurity/protos/google/cloud/networksecurity/v1/security_profile_group_threatprevention.proto @@ -0,0 +1,185 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.networksecurity.v1; + +import "google/api/field_behavior.proto"; + +option csharp_namespace = "Google.Cloud.NetworkSecurity.V1"; +option go_package = "cloud.google.com/go/networksecurity/apiv1/networksecuritypb;networksecuritypb"; +option java_multiple_files = true; +option java_outer_classname = "SecurityProfileGroupThreatPreventionProto"; +option java_package = "com.google.cloud.networksecurity.v1"; +option php_namespace = "Google\\Cloud\\NetworkSecurity\\V1"; +option ruby_package = "Google::Cloud::NetworkSecurity::V1"; + +// Severity level. +enum Severity { + // Severity level not specified. + SEVERITY_UNSPECIFIED = 0; + + // Suspicious events that do not pose an immediate threat, but that are + // reported to call attention to deeper problems that could possibly exist. + INFORMATIONAL = 1; + + // Warning-level threats that have very little impact on an organization's + // infrastructure. They usually require local or physical system access and + // may often result in victim privacy issues and information leakage. + LOW = 2; + + // Minor threats in which impact is minimized, that do not compromise the + // target or exploits that require an attacker to reside on the same local + // network as the victim, affect only non-standard configurations or obscure + // applications, or provide very limited access. + MEDIUM = 3; + + // Threats that have the ability to become critical but have mitigating + // factors; for example, they may be difficult to exploit, do not result in + // elevated privileges, or do not have a large victim pool. + HIGH = 4; + + // Serious threats, such as those that affect default installations of widely + // deployed software, result in root compromise of servers, and the exploit + // code is widely available to attackers. The attacker usually does not need + // any special authentication credentials or knowledge about the individual + // victims and the target does not need to be manipulated into performing any + // special functions. + CRITICAL = 5; +} + +// Type of threat. +enum ThreatType { + // Type of threat not specified. + THREAT_TYPE_UNSPECIFIED = 0; + + // Type of threat is not derivable from threat ID. An override will be + // created for all types. Firewall will ignore overridden signature ID's + // that don't exist in the specific type. + UNKNOWN = 1; + + // Threats related to system flaws that an attacker might otherwise attempt + // to exploit. + VULNERABILITY = 2; + + // Threats related to viruses and malware found in executables and file + // types. + ANTIVIRUS = 3; + + // Threats related to command-and-control (C2) activity, where spyware on an + // infected client is collecting data without the user's consent and/or + // communicating with a remote attacker. + SPYWARE = 4; + + // Threats related to DNS. + DNS = 5; +} + +// Threat action override. +enum ThreatAction { + // Threat action not specified. + THREAT_ACTION_UNSPECIFIED = 0; + + // The default action (as specified by the vendor) is taken. + DEFAULT_ACTION = 4; + + // The packet matching this rule will be allowed to transmit. + ALLOW = 1; + + // The packet matching this rule will be allowed to transmit, but a threat_log + // entry will be sent to the consumer project. + ALERT = 2; + + // The packet matching this rule will be dropped, and a threat_log entry will + // be sent to the consumer project. + DENY = 3; +} + +// Antivirus protocol. +enum Protocol { + // Protocol not specified. + PROTOCOL_UNSPECIFIED = 0; + + // SMTP protocol + SMTP = 1; + + // SMB protocol + SMB = 2; + + // POP3 protocol + POP3 = 3; + + // IMAP protocol + IMAP = 4; + + // HTTP2 protocol + HTTP2 = 5; + + // HTTP protocol + HTTP = 6; + + // FTP protocol + FTP = 7; +} + +// ThreatPreventionProfile defines an action for specific threat signatures or +// severity levels. +message ThreatPreventionProfile { + // Optional. Configuration for overriding threats actions by severity match. + repeated SeverityOverride severity_overrides = 1 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Configuration for overriding threats actions by threat_id match. + // If a threat is matched both by configuration provided in severity_overrides + // and threat_overrides, the threat_overrides action is applied. + repeated ThreatOverride threat_overrides = 2 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Configuration for overriding antivirus actions per protocol. + repeated AntivirusOverride antivirus_overrides = 4 + [(google.api.field_behavior) = OPTIONAL]; +} + +// Defines what action to take for a specific severity match. +message SeverityOverride { + // Required. Severity level to match. + Severity severity = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. Threat action override. + ThreatAction action = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Defines what action to take for a specific threat_id match. +message ThreatOverride { + // Required. Vendor-specific ID of a threat to override. + string threat_id = 1 [(google.api.field_behavior) = REQUIRED]; + + // Output only. Type of the threat (read only). + ThreatType type = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Required. Threat action override. For some threat types, only a subset of + // actions applies. + ThreatAction action = 3 [(google.api.field_behavior) = REQUIRED]; +} + +// Defines what action to take for antivirus threats per protocol. +message AntivirusOverride { + // Required. Protocol to match. + Protocol protocol = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. Threat action override. For some threat types, only a subset of + // actions applies. + ThreatAction action = 2 [(google.api.field_behavior) = REQUIRED]; +} diff --git a/packages/google-cloud-networksecurity/protos/google/cloud/networksecurity/v1/security_profile_group_urlfiltering.proto b/packages/google-cloud-networksecurity/protos/google/cloud/networksecurity/v1/security_profile_group_urlfiltering.proto new file mode 100644 index 00000000000..a1ac0d841ce --- /dev/null +++ b/packages/google-cloud-networksecurity/protos/google/cloud/networksecurity/v1/security_profile_group_urlfiltering.proto @@ -0,0 +1,62 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.networksecurity.v1; + +import "google/api/field_behavior.proto"; + +option csharp_namespace = "Google.Cloud.NetworkSecurity.V1"; +option go_package = "cloud.google.com/go/networksecurity/apiv1/networksecuritypb;networksecuritypb"; +option java_multiple_files = true; +option java_outer_classname = "SecurityProfileGroupUrlFilteringProto"; +option java_package = "com.google.cloud.networksecurity.v1"; +option php_namespace = "Google\\Cloud\\NetworkSecurity\\V1"; +option ruby_package = "Google::Cloud::NetworkSecurity::V1"; + +// UrlFilteringProfile defines filters based on URL. +message UrlFilteringProfile { + // Optional. The list of filtering configs in which each config defines an + // action to take for some URL match. + repeated UrlFilter url_filters = 1 [(google.api.field_behavior) = OPTIONAL]; +} + +// A URL filter defines an action to take for some URL match. +message UrlFilter { + // Action to be taken when a URL matches a filter. + enum UrlFilteringAction { + // Filtering action not specified. + URL_FILTERING_ACTION_UNSPECIFIED = 0; + + // The connection matching this filter will be allowed to transmit. + ALLOW = 1; + + // The connection matching this filter will be dropped. + DENY = 2; + } + + // Required. The action taken when this filter is applied. + UrlFilteringAction filtering_action = 1 + [(google.api.field_behavior) = REQUIRED]; + + // Required. The list of strings that a URL must match with for this filter to + // be applied. + repeated string urls = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The priority of this filter within the URL Filtering Profile. + // Lower integers indicate higher priorities. The priority of a filter must be + // unique within a URL Filtering Profile. + optional int32 priority = 3 [(google.api.field_behavior) = REQUIRED]; +} diff --git a/packages/google-cloud-networksecurity/protos/google/cloud/networksecurity/v1/server_tls_policy.proto b/packages/google-cloud-networksecurity/protos/google/cloud/networksecurity/v1/server_tls_policy.proto index 8913a259cca..92c57617fe7 100644 --- a/packages/google-cloud-networksecurity/protos/google/cloud/networksecurity/v1/server_tls_policy.proto +++ b/packages/google-cloud-networksecurity/protos/google/cloud/networksecurity/v1/server_tls_policy.proto @@ -1,4 +1,4 @@ -// Copyright 2025 Google LLC +// Copyright 2026 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -32,7 +32,13 @@ option ruby_package = "Google::Cloud::NetworkSecurity::V1"; // ServerTlsPolicy is a resource that specifies how a server should authenticate // incoming requests. This resource itself does not affect configuration unless -// it is attached to a target https proxy or endpoint config selector resource. +// it is attached to a target HTTPS proxy or endpoint config selector resource. +// +// ServerTlsPolicy in the form accepted by Application Load Balancers can +// be attached only to TargetHttpsProxy with an `EXTERNAL`, `EXTERNAL_MANAGED` +// or `INTERNAL_MANAGED` load balancing scheme. Traffic Director compatible +// ServerTlsPolicies can be attached to EndpointPolicy and TargetHttpsProxy with +// Traffic Director `INTERNAL_SELF_MANAGED` load balancing scheme. message ServerTlsPolicy { option (google.api.resource) = { type: "networksecurity.googleapis.com/ServerTlsPolicy" @@ -41,10 +47,55 @@ message ServerTlsPolicy { // Specification of the MTLSPolicy. message MTLSPolicy { + // Mutual TLS certificate validation mode. + enum ClientValidationMode { + // Not allowed. + CLIENT_VALIDATION_MODE_UNSPECIFIED = 0; + + // Allow connection even if certificate chain validation + // of the client certificate failed or no client certificate was + // presented. The proof of possession of the private key is always checked + // if client certificate was presented. This mode requires the backend to + // implement processing of data extracted from a client certificate to + // authenticate the peer, or to reject connections if the client + // certificate fingerprint is missing. + ALLOW_INVALID_OR_MISSING_CLIENT_CERT = 1; + + // Require a client certificate and allow connection to the backend only + // if validation of the client certificate passed. + // + // If set, requires a reference to non-empty TrustConfig specified in + // `client_validation_trust_config`. + REJECT_INVALID = 2; + } + + // When the client presents an invalid certificate or no certificate to the + // load balancer, the `client_validation_mode` specifies how the client + // connection is handled. + // + // Required if the policy is to be used with the Application Load + // Balancers. For Traffic Director it must be empty. + ClientValidationMode client_validation_mode = 2; + + // Required if the policy is to be used with Traffic Director. For + // Application Load Balancers it must be empty. // // Defines the mechanism to obtain the Certificate Authority certificate to // validate the client certificate. repeated ValidationCA client_validation_ca = 1; + + // Reference to the TrustConfig from certificatemanager.googleapis.com + // namespace. + // + // If specified, the chain validation will be performed against certificates + // configured in the given TrustConfig. + // + // Allowed only if the policy is to be used with Application Load + // Balancers. + string client_validation_trust_config = 4 + [(google.api.resource_reference) = { + type: "certificatemanager.googleapis.com/TrustConfig" + }]; } // Required. Name of the ServerTlsPolicy resource. It matches the pattern @@ -55,14 +106,18 @@ message ServerTlsPolicy { string description = 2; // Output only. The timestamp when the resource was created. - google.protobuf.Timestamp create_time = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + google.protobuf.Timestamp create_time = 3 + [(google.api.field_behavior) = OUTPUT_ONLY]; // Output only. The timestamp when the resource was updated. - google.protobuf.Timestamp update_time = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + google.protobuf.Timestamp update_time = 4 + [(google.api.field_behavior) = OUTPUT_ONLY]; // Set of label tags associated with the resource. map labels = 5; + // This field applies only for Traffic Director policies. It is must be set to + // false for Application Load Balancer policies. // // Determines if server allows plaintext connections. If set to true, server // allows plain text connections. By default, it is set to false. This setting @@ -75,12 +130,16 @@ message ServerTlsPolicy { // while having mixed TLS and non-TLS traffic reaching port :80. bool allow_open = 6; + // Optional if policy is to be used with Traffic Director. For Application + // Load Balancers must be empty. // // Defines a mechanism to provision server identity (public and private keys). // Cannot be combined with `allow_open` as a permissive mode that allows both // plain text and TLS is not supported. CertificateProvider server_certificate = 7; + // This field is required if the policy is used with Application Load + // Balancers. This field can be empty for Traffic Director. // // Defines a mechanism to provision peer validation certificates for peer to // peer authentication (Mutual TLS - mTLS). If not specified, client @@ -109,6 +168,13 @@ message ListServerTlsPoliciesRequest { // `ListServerTlsPolicies` call, and that the system // should return the next page of data. string page_token = 3; + + // Optional. Setting this field to `true` will opt the request into returning + // the resources that are reachable, and into including the names of those + // that were unreachable in the [ListServerTlsPoliciesResponse.unreachable] + // field. This can only be `true` when reading across collections e.g. when + // `parent` is set to `"projects/example/locations/-"`. + bool return_partial_success = 4 [(google.api.field_behavior) = OPTIONAL]; } // Response returned by the ListServerTlsPolicies method. @@ -120,6 +186,11 @@ message ListServerTlsPoliciesResponse { // `next_page_token` is included. To get the next set of results, call this // method again using the value of `next_page_token` as `page_token`. string next_page_token = 2; + + // Unreachable resources. Populated when the request opts into + // `return_partial_success` and reading across collections e.g. when + // attempting to list all resources across all supported locations. + repeated string unreachable = 3; } // Request used by the GetServerTlsPolicy method. @@ -145,13 +216,15 @@ message CreateServerTlsPolicyRequest { } ]; - // Required. Short name of the ServerTlsPolicy resource to be created. This value should - // be 1-63 characters long, containing only letters, numbers, hyphens, and - // underscores, and should not start with a number. E.g. "server_mtls_policy". + // Required. Short name of the ServerTlsPolicy resource to be created. This + // value should be 1-63 characters long, containing only letters, numbers, + // hyphens, and underscores, and should not start with a number. E.g. + // "server_mtls_policy". string server_tls_policy_id = 2 [(google.api.field_behavior) = REQUIRED]; // Required. ServerTlsPolicy resource to be created. - ServerTlsPolicy server_tls_policy = 3 [(google.api.field_behavior) = REQUIRED]; + ServerTlsPolicy server_tls_policy = 3 + [(google.api.field_behavior) = REQUIRED]; } // Request used by UpdateServerTlsPolicy method. @@ -162,10 +235,12 @@ message UpdateServerTlsPolicyRequest { // the full request. A field will be overwritten if it is in the // mask. If the user does not provide a mask then all fields will be // overwritten. - google.protobuf.FieldMask update_mask = 1 [(google.api.field_behavior) = OPTIONAL]; + google.protobuf.FieldMask update_mask = 1 + [(google.api.field_behavior) = OPTIONAL]; // Required. Updated ServerTlsPolicy resource. - ServerTlsPolicy server_tls_policy = 2 [(google.api.field_behavior) = REQUIRED]; + ServerTlsPolicy server_tls_policy = 2 + [(google.api.field_behavior) = REQUIRED]; } // Request used by the DeleteServerTlsPolicy method. diff --git a/packages/google-cloud-networksecurity/protos/google/cloud/networksecurity/v1/tls.proto b/packages/google-cloud-networksecurity/protos/google/cloud/networksecurity/v1/tls.proto index 78aef5bc0b7..5bd72eb23af 100644 --- a/packages/google-cloud-networksecurity/protos/google/cloud/networksecurity/v1/tls.proto +++ b/packages/google-cloud-networksecurity/protos/google/cloud/networksecurity/v1/tls.proto @@ -1,4 +1,4 @@ -// Copyright 2025 Google LLC +// Copyright 2026 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -28,8 +28,8 @@ option ruby_package = "Google::Cloud::NetworkSecurity::V1"; // Specification of the GRPC Endpoint. message GrpcEndpoint { - // Required. The target URI of the gRPC endpoint. Only UDS path is supported, and - // should start with "unix:". + // Required. The target URI of the gRPC endpoint. Only UDS path is supported, + // and should start with "unix:". string target_uri = 1 [(google.api.field_behavior) = REQUIRED]; } @@ -54,9 +54,9 @@ message ValidationCA { // and configured by specifying this message. Workloads use the values from this // message to locate and load the CertificateProvider instance configuration. message CertificateProviderInstance { - // Required. Plugin instance name, used to locate and load CertificateProvider instance - // configuration. Set to "google_cloud_private_spiffe" to use Certificate - // Authority Service certificate provider instance. + // Required. Plugin instance name, used to locate and load CertificateProvider + // instance configuration. Set to "google_cloud_private_spiffe" to use + // Certificate Authority Service certificate provider instance. string plugin_instance = 1 [(google.api.field_behavior) = REQUIRED]; } diff --git a/packages/google-cloud-networksecurity/protos/google/cloud/networksecurity/v1/tls_inspection_policy.proto b/packages/google-cloud-networksecurity/protos/google/cloud/networksecurity/v1/tls_inspection_policy.proto new file mode 100644 index 00000000000..938e9b6404e --- /dev/null +++ b/packages/google-cloud-networksecurity/protos/google/cloud/networksecurity/v1/tls_inspection_policy.proto @@ -0,0 +1,268 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.networksecurity.v1; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/protobuf/field_mask.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.NetworkSecurity.V1"; +option go_package = "cloud.google.com/go/networksecurity/apiv1/networksecuritypb;networksecuritypb"; +option java_multiple_files = true; +option java_outer_classname = "TlsInspectionPolicyProto"; +option java_package = "com.google.cloud.networksecurity.v1"; +option php_namespace = "Google\\Cloud\\NetworkSecurity\\V1"; +option ruby_package = "Google::Cloud::NetworkSecurity::V1"; +option (google.api.resource_definition) = { + type: "privateca.googleapis.com/CaPool" + pattern: "projects/{project}/locations/{location}/caPools/{ca_pool}" +}; + +// The TlsInspectionPolicy resource contains references to CA pools in +// Certificate Authority Service and associated metadata. +message TlsInspectionPolicy { + option (google.api.resource) = { + type: "networksecurity.googleapis.com/TlsInspectionPolicy" + pattern: "projects/{project}/locations/{location}/tlsInspectionPolicies/{tls_inspection_policy}" + }; + + // The minimum version of TLS protocol that can be used by clients or servers + // to establish a connection with the TLS inspection proxy. + enum TlsVersion { + // Indicates no TLS version was specified. + TLS_VERSION_UNSPECIFIED = 0; + + // TLS 1.0 + TLS_1_0 = 1; + + // TLS 1.1 + TLS_1_1 = 2; + + // TLS 1.2 + TLS_1_2 = 3; + + // TLS 1.3 + TLS_1_3 = 4; + } + + // Profile specifies the set of TLS cipher suites (and possibly + // other features in the future) that can be used by the firewall when + // negotiating TLS connections with clients and servers. The meaning of these + // fields is identical to the load balancers' SSLPolicy resource. + enum Profile { + // Indicates no profile was specified. + PROFILE_UNSPECIFIED = 0; + + // Compatible profile. Allows the broadest set of clients, even those + // which support only out-of-date SSL features to negotiate with the TLS + // inspection proxy. + PROFILE_COMPATIBLE = 1; + + // Modern profile. Supports a wide set of SSL features, allowing modern + // clients to negotiate SSL with the TLS inspection proxy. + PROFILE_MODERN = 2; + + // Restricted profile. Supports a reduced set of SSL features, intended to + // meet stricter compliance requirements. + PROFILE_RESTRICTED = 3; + + // Custom profile. Allow only the set of allowed SSL features specified in + // the custom_features field of SslPolicy. + PROFILE_CUSTOM = 4; + } + + // Required. Name of the resource. Name is of the form + // projects/{project}/locations/{location}/tlsInspectionPolicies/{tls_inspection_policy} + // tls_inspection_policy should match the + // pattern:(^[a-z]([a-z0-9-]{0,61}[a-z0-9])?$). + string name = 1 [(google.api.field_behavior) = REQUIRED]; + + // Optional. Free-text description of the resource. + string description = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Output only. The timestamp when the resource was created. + google.protobuf.Timestamp create_time = 3 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The timestamp when the resource was updated. + google.protobuf.Timestamp update_time = 4 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Required. A CA pool resource used to issue interception certificates. + // The CA pool string has a relative resource path following the form + // "projects/{project}/locations/{location}/caPools/{ca_pool}". + string ca_pool = 5 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "privateca.googleapis.com/CaPool" + } + ]; + + // Optional. A TrustConfig resource used when making a connection to the TLS + // server. This is a relative resource path following the form + // "projects/{project}/locations/{location}/trustConfigs/{trust_config}". This + // is necessary to intercept TLS connections to servers with certificates + // signed by a private CA or self-signed certificates. + // Note that Secure Web Proxy does not yet honor this field. + string trust_config = 6 [ + (google.api.field_behavior) = OPTIONAL, + (google.api.resource_reference) = { + type: "certificatemanager.googleapis.com/TrustConfig" + } + ]; + + // Optional. If FALSE (the default), use our default set of public CAs in + // addition to any CAs specified in trust_config. These public CAs are + // currently based on the Mozilla Root Program and are subject to change over + // time. If TRUE, do not accept our default set of public CAs. Only CAs + // specified in trust_config will be accepted. This defaults to FALSE (use + // public CAs in addition to trust_config) for backwards compatibility, but + // trusting public root CAs is *not recommended* unless the traffic in + // question is outbound to public web servers. When possible, prefer setting + // this to "false" and explicitly specifying trusted CAs and certificates in a + // TrustConfig. Note that Secure Web Proxy does not yet honor this field. + optional bool exclude_public_ca_set = 7 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Minimum TLS version that the firewall should use when negotiating + // connections with both clients and servers. If this is not set, then the + // default value is to allow the broadest set of clients and servers (TLS 1.0 + // or higher). Setting this to more restrictive values may improve security, + // but may also prevent the firewall from connecting to some clients or + // servers. + // Note that Secure Web Proxy does not yet honor this field. + TlsVersion min_tls_version = 8 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The selected Profile. If this is not set, then the default value + // is to allow the broadest set of clients and servers ("PROFILE_COMPATIBLE"). + // Setting this to more restrictive values may improve security, but may also + // prevent the TLS inspection proxy from connecting to some clients or + // servers. Note that Secure Web Proxy does not yet honor this field. + Profile tls_feature_profile = 9 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. List of custom TLS cipher suites selected. + // This field is valid only if the selected tls_feature_profile is CUSTOM. + // The [compute.SslPoliciesService.ListAvailableFeatures][] method returns the + // set of features that can be specified in this list. + // Note that Secure Web Proxy does not yet honor this field. + repeated string custom_tls_features = 10 + [(google.api.field_behavior) = OPTIONAL]; +} + +// Request used by the CreateTlsInspectionPolicy method. +message CreateTlsInspectionPolicyRequest { + // Required. The parent resource of the TlsInspectionPolicy. Must be in the + // format `projects/{project}/locations/{location}`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "networksecurity.googleapis.com/TlsInspectionPolicy" + } + ]; + + // Required. Short name of the TlsInspectionPolicy resource to be created. + // This value should be 1-63 characters long, containing only + // letters, numbers, hyphens, and underscores, and should not start + // with a number. E.g. "tls_inspection_policy1". + string tls_inspection_policy_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. TlsInspectionPolicy resource to be created. + TlsInspectionPolicy tls_inspection_policy = 3 + [(google.api.field_behavior) = REQUIRED]; +} + +// Request used with the ListTlsInspectionPolicies method. +message ListTlsInspectionPoliciesRequest { + // Required. The project and location from which the TlsInspectionPolicies + // should be listed, specified in the format + // `projects/{project}/locations/{location}`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "locations.googleapis.com/Location" + } + ]; + + // Maximum number of TlsInspectionPolicies to return per call. + int32 page_size = 2; + + // The value returned by the last + // 'ListTlsInspectionPoliciesResponse' Indicates that this is a + // continuation of a prior 'ListTlsInspectionPolicies' call, and + // that the system should return the next page of data. + string page_token = 3; +} + +// Response returned by the ListTlsInspectionPolicies method. +message ListTlsInspectionPoliciesResponse { + // List of TlsInspectionPolicies resources. + repeated TlsInspectionPolicy tls_inspection_policies = 1; + + // If there might be more results than those appearing in this response, then + // 'next_page_token' is included. To get the next set of results, call this + // method again using the value of 'next_page_token' as 'page_token'. + string next_page_token = 2; + + // Locations that could not be reached. + repeated string unreachable = 3; +} + +// Request used by the GetTlsInspectionPolicy method. +message GetTlsInspectionPolicyRequest { + // Required. A name of the TlsInspectionPolicy to get. Must be in the format + // `projects/{project}/locations/{location}/tlsInspectionPolicies/{tls_inspection_policy}`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "networksecurity.googleapis.com/TlsInspectionPolicy" + } + ]; +} + +// Request used by the DeleteTlsInspectionPolicy method. +message DeleteTlsInspectionPolicyRequest { + // Required. A name of the TlsInspectionPolicy to delete. Must be in the + // format + // `projects/{project}/locations/{location}/tlsInspectionPolicies/{tls_inspection_policy}`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "networksecurity.googleapis.com/TlsInspectionPolicy" + } + ]; + + // If set to true, any rules for this TlsInspectionPolicy will also be + // deleted. (Otherwise, the request will only work if the TlsInspectionPolicy + // has no rules.) + bool force = 2; +} + +// Request used by the UpdateTlsInspectionPolicy method. +message UpdateTlsInspectionPolicyRequest { + // Optional. Field mask is used to specify the fields to be overwritten in the + // TlsInspectionPolicy resource by the update. + // The fields specified in the update_mask are relative to the resource, not + // the full request. A field will be overwritten if it is in the mask. If the + // user does not provide a mask then all fields will be overwritten. + google.protobuf.FieldMask update_mask = 1 + [(google.api.field_behavior) = OPTIONAL]; + + // Required. Updated TlsInspectionPolicy resource. + TlsInspectionPolicy tls_inspection_policy = 2 + [(google.api.field_behavior) = REQUIRED]; +} diff --git a/packages/google-cloud-networksecurity/protos/google/cloud/networksecurity/v1/url_list.proto b/packages/google-cloud-networksecurity/protos/google/cloud/networksecurity/v1/url_list.proto new file mode 100644 index 00000000000..9ed9e8ea850 --- /dev/null +++ b/packages/google-cloud-networksecurity/protos/google/cloud/networksecurity/v1/url_list.proto @@ -0,0 +1,155 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.networksecurity.v1; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/protobuf/field_mask.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.NetworkSecurity.V1"; +option go_package = "cloud.google.com/go/networksecurity/apiv1/networksecuritypb;networksecuritypb"; +option java_multiple_files = true; +option java_outer_classname = "UrlListProto"; +option java_package = "com.google.cloud.networksecurity.v1"; +option php_namespace = "Google\\Cloud\\NetworkSecurity\\V1"; +option ruby_package = "Google::Cloud::NetworkSecurity::V1"; + +// UrlList proto helps users to set reusable, independently manageable lists +// of hosts, host patterns, URLs, URL patterns. +message UrlList { + option (google.api.resource) = { + type: "networksecurity.googleapis.com/UrlList" + pattern: "projects/{project}/locations/{location}/urlLists/{url_list}" + }; + + // Required. Name of the resource provided by the user. + // Name is of the form + // projects/{project}/locations/{location}/urlLists/{url_list} + // url_list should match the + // pattern:(^[a-z]([a-z0-9-]{0,61}[a-z0-9])?$). + string name = 1 [(google.api.field_behavior) = REQUIRED]; + + // Output only. Time when the security policy was created. + google.protobuf.Timestamp create_time = 2 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Time when the security policy was updated. + google.protobuf.Timestamp update_time = 3 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. Free-text description of the resource. + string description = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Required. FQDNs and URLs. + repeated string values = 5 [(google.api.field_behavior) = REQUIRED]; +} + +// Request used by the ListUrlList method. +message ListUrlListsRequest { + // Required. The project and location from which the UrlLists should + // be listed, specified in the format + // `projects/{project}/locations/{location}`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "locations.googleapis.com/Location" + } + ]; + + // Maximum number of UrlLists to return per call. + int32 page_size = 2; + + // The value returned by the last `ListUrlListsResponse` + // Indicates that this is a continuation of a prior + // `ListUrlLists` call, and that the system + // should return the next page of data. + string page_token = 3; +} + +// Response returned by the ListUrlLists method. +message ListUrlListsResponse { + // List of UrlList resources. + repeated UrlList url_lists = 1; + + // If there might be more results than those appearing in this response, then + // `next_page_token` is included. To get the next set of results, call this + // method again using the value of `next_page_token` as `page_token`. + string next_page_token = 2; + + // Locations that could not be reached. + repeated string unreachable = 3; +} + +// Request used by the GetUrlList method. +message GetUrlListRequest { + // Required. A name of the UrlList to get. Must be in the format + // `projects/*/locations/{location}/urlLists/*`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "networksecurity.googleapis.com/UrlList" + } + ]; +} + +// Request used by the CreateUrlList method. +message CreateUrlListRequest { + // Required. The parent resource of the UrlList. Must be in + // the format `projects/*/locations/{location}`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "networksecurity.googleapis.com/UrlList" + } + ]; + + // Required. Short name of the UrlList resource to be created. This value + // should be 1-63 characters long, containing only letters, numbers, hyphens, + // and underscores, and should not start with a number. E.g. "url_list". + string url_list_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. UrlList resource to be created. + UrlList url_list = 3 [(google.api.field_behavior) = REQUIRED]; +} + +// Request used by UpdateUrlList method. +message UpdateUrlListRequest { + // Optional. Field mask is used to specify the fields to be overwritten in the + // UrlList resource by the update. The fields + // specified in the update_mask are relative to the resource, not + // the full request. A field will be overwritten if it is in the + // mask. If the user does not provide a mask then all fields will be + // overwritten. + google.protobuf.FieldMask update_mask = 1 + [(google.api.field_behavior) = OPTIONAL]; + + // Required. Updated UrlList resource. + UrlList url_list = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Request used by the DeleteUrlList method. +message DeleteUrlListRequest { + // Required. A name of the UrlList to delete. Must be in + // the format `projects/*/locations/{location}/urlLists/*`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "networksecurity.googleapis.com/UrlList" + } + ]; +} diff --git a/packages/google-cloud-networksecurity/protos/protos.d.ts b/packages/google-cloud-networksecurity/protos/protos.d.ts index bb4039079bb..00adf3f790a 100644 --- a/packages/google-cloud-networksecurity/protos/protos.d.ts +++ b/packages/google-cloud-networksecurity/protos/protos.d.ts @@ -1919,6 +1919,139 @@ export namespace google { } } + /** Properties of an OperationMetadata. */ + interface IOperationMetadata { + + /** OperationMetadata createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** OperationMetadata endTime */ + endTime?: (google.protobuf.ITimestamp|null); + + /** OperationMetadata target */ + target?: (string|null); + + /** OperationMetadata verb */ + verb?: (string|null); + + /** OperationMetadata statusMessage */ + statusMessage?: (string|null); + + /** OperationMetadata requestedCancellation */ + requestedCancellation?: (boolean|null); + + /** OperationMetadata apiVersion */ + apiVersion?: (string|null); + } + + /** Represents an OperationMetadata. */ + class OperationMetadata implements IOperationMetadata { + + /** + * Constructs a new OperationMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.networksecurity.v1.IOperationMetadata); + + /** OperationMetadata createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** OperationMetadata endTime. */ + public endTime?: (google.protobuf.ITimestamp|null); + + /** OperationMetadata target. */ + public target: string; + + /** OperationMetadata verb. */ + public verb: string; + + /** OperationMetadata statusMessage. */ + public statusMessage: string; + + /** OperationMetadata requestedCancellation. */ + public requestedCancellation: boolean; + + /** OperationMetadata apiVersion. */ + public apiVersion: string; + + /** + * Creates a new OperationMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns OperationMetadata instance + */ + public static create(properties?: google.cloud.networksecurity.v1.IOperationMetadata): google.cloud.networksecurity.v1.OperationMetadata; + + /** + * Encodes the specified OperationMetadata message. Does not implicitly {@link google.cloud.networksecurity.v1.OperationMetadata.verify|verify} messages. + * @param message OperationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.networksecurity.v1.IOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OperationMetadata message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.OperationMetadata.verify|verify} messages. + * @param message OperationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.networksecurity.v1.IOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OperationMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.networksecurity.v1.OperationMetadata; + + /** + * Decodes an OperationMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.networksecurity.v1.OperationMetadata; + + /** + * Verifies an OperationMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an OperationMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OperationMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.networksecurity.v1.OperationMetadata; + + /** + * Creates a plain object from an OperationMetadata message. Also converts values to other types if specified. + * @param message OperationMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.networksecurity.v1.OperationMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OperationMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OperationMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + /** Properties of an AuthorizationPolicy. */ interface IAuthorizationPolicy { @@ -3113,1307 +3246,22512 @@ export namespace google { public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a ClientTlsPolicy. */ - interface IClientTlsPolicy { + /** Properties of an AuthzPolicy. */ + interface IAuthzPolicy { - /** ClientTlsPolicy name */ + /** AuthzPolicy name */ name?: (string|null); - /** ClientTlsPolicy description */ - description?: (string|null); - - /** ClientTlsPolicy createTime */ + /** AuthzPolicy createTime */ createTime?: (google.protobuf.ITimestamp|null); - /** ClientTlsPolicy updateTime */ + /** AuthzPolicy updateTime */ updateTime?: (google.protobuf.ITimestamp|null); - /** ClientTlsPolicy labels */ + /** AuthzPolicy description */ + description?: (string|null); + + /** AuthzPolicy labels */ labels?: ({ [k: string]: string }|null); - /** ClientTlsPolicy sni */ - sni?: (string|null); + /** AuthzPolicy target */ + target?: (google.cloud.networksecurity.v1.AuthzPolicy.ITarget|null); - /** ClientTlsPolicy clientCertificate */ - clientCertificate?: (google.cloud.networksecurity.v1.ICertificateProvider|null); + /** AuthzPolicy httpRules */ + httpRules?: (google.cloud.networksecurity.v1.AuthzPolicy.IAuthzRule[]|null); - /** ClientTlsPolicy serverValidationCa */ - serverValidationCa?: (google.cloud.networksecurity.v1.IValidationCA[]|null); + /** AuthzPolicy action */ + action?: (google.cloud.networksecurity.v1.AuthzPolicy.AuthzAction|keyof typeof google.cloud.networksecurity.v1.AuthzPolicy.AuthzAction|null); + + /** AuthzPolicy customProvider */ + customProvider?: (google.cloud.networksecurity.v1.AuthzPolicy.ICustomProvider|null); + + /** AuthzPolicy policyProfile */ + policyProfile?: (google.cloud.networksecurity.v1.AuthzPolicy.PolicyProfile|keyof typeof google.cloud.networksecurity.v1.AuthzPolicy.PolicyProfile|null); } - /** Represents a ClientTlsPolicy. */ - class ClientTlsPolicy implements IClientTlsPolicy { + /** Represents an AuthzPolicy. */ + class AuthzPolicy implements IAuthzPolicy { /** - * Constructs a new ClientTlsPolicy. + * Constructs a new AuthzPolicy. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.networksecurity.v1.IClientTlsPolicy); + constructor(properties?: google.cloud.networksecurity.v1.IAuthzPolicy); - /** ClientTlsPolicy name. */ + /** AuthzPolicy name. */ public name: string; - /** ClientTlsPolicy description. */ - public description: string; - - /** ClientTlsPolicy createTime. */ + /** AuthzPolicy createTime. */ public createTime?: (google.protobuf.ITimestamp|null); - /** ClientTlsPolicy updateTime. */ + /** AuthzPolicy updateTime. */ public updateTime?: (google.protobuf.ITimestamp|null); - /** ClientTlsPolicy labels. */ + /** AuthzPolicy description. */ + public description: string; + + /** AuthzPolicy labels. */ public labels: { [k: string]: string }; - /** ClientTlsPolicy sni. */ - public sni: string; + /** AuthzPolicy target. */ + public target?: (google.cloud.networksecurity.v1.AuthzPolicy.ITarget|null); - /** ClientTlsPolicy clientCertificate. */ - public clientCertificate?: (google.cloud.networksecurity.v1.ICertificateProvider|null); + /** AuthzPolicy httpRules. */ + public httpRules: google.cloud.networksecurity.v1.AuthzPolicy.IAuthzRule[]; - /** ClientTlsPolicy serverValidationCa. */ - public serverValidationCa: google.cloud.networksecurity.v1.IValidationCA[]; + /** AuthzPolicy action. */ + public action: (google.cloud.networksecurity.v1.AuthzPolicy.AuthzAction|keyof typeof google.cloud.networksecurity.v1.AuthzPolicy.AuthzAction); + + /** AuthzPolicy customProvider. */ + public customProvider?: (google.cloud.networksecurity.v1.AuthzPolicy.ICustomProvider|null); + + /** AuthzPolicy policyProfile. */ + public policyProfile: (google.cloud.networksecurity.v1.AuthzPolicy.PolicyProfile|keyof typeof google.cloud.networksecurity.v1.AuthzPolicy.PolicyProfile); /** - * Creates a new ClientTlsPolicy instance using the specified properties. + * Creates a new AuthzPolicy instance using the specified properties. * @param [properties] Properties to set - * @returns ClientTlsPolicy instance + * @returns AuthzPolicy instance */ - public static create(properties?: google.cloud.networksecurity.v1.IClientTlsPolicy): google.cloud.networksecurity.v1.ClientTlsPolicy; + public static create(properties?: google.cloud.networksecurity.v1.IAuthzPolicy): google.cloud.networksecurity.v1.AuthzPolicy; /** - * Encodes the specified ClientTlsPolicy message. Does not implicitly {@link google.cloud.networksecurity.v1.ClientTlsPolicy.verify|verify} messages. - * @param message ClientTlsPolicy message or plain object to encode + * Encodes the specified AuthzPolicy message. Does not implicitly {@link google.cloud.networksecurity.v1.AuthzPolicy.verify|verify} messages. + * @param message AuthzPolicy message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.networksecurity.v1.IClientTlsPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.networksecurity.v1.IAuthzPolicy, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified ClientTlsPolicy message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.ClientTlsPolicy.verify|verify} messages. - * @param message ClientTlsPolicy message or plain object to encode + * Encodes the specified AuthzPolicy message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.AuthzPolicy.verify|verify} messages. + * @param message AuthzPolicy message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.networksecurity.v1.IClientTlsPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.networksecurity.v1.IAuthzPolicy, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a ClientTlsPolicy message from the specified reader or buffer. + * Decodes an AuthzPolicy message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns ClientTlsPolicy + * @returns AuthzPolicy * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.networksecurity.v1.ClientTlsPolicy; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.networksecurity.v1.AuthzPolicy; /** - * Decodes a ClientTlsPolicy message from the specified reader or buffer, length delimited. + * Decodes an AuthzPolicy message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ClientTlsPolicy + * @returns AuthzPolicy * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.networksecurity.v1.ClientTlsPolicy; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.networksecurity.v1.AuthzPolicy; /** - * Verifies a ClientTlsPolicy message. + * Verifies an AuthzPolicy message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a ClientTlsPolicy message from a plain object. Also converts values to their respective internal types. + * Creates an AuthzPolicy message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ClientTlsPolicy + * @returns AuthzPolicy */ - public static fromObject(object: { [k: string]: any }): google.cloud.networksecurity.v1.ClientTlsPolicy; + public static fromObject(object: { [k: string]: any }): google.cloud.networksecurity.v1.AuthzPolicy; /** - * Creates a plain object from a ClientTlsPolicy message. Also converts values to other types if specified. - * @param message ClientTlsPolicy + * Creates a plain object from an AuthzPolicy message. Also converts values to other types if specified. + * @param message AuthzPolicy * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.networksecurity.v1.ClientTlsPolicy, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.networksecurity.v1.AuthzPolicy, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ClientTlsPolicy to JSON. + * Converts this AuthzPolicy to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for ClientTlsPolicy + * Gets the default type url for AuthzPolicy * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a ListClientTlsPoliciesRequest. */ - interface IListClientTlsPoliciesRequest { + namespace AuthzPolicy { - /** ListClientTlsPoliciesRequest parent */ - parent?: (string|null); + /** Properties of a Target. */ + interface ITarget { - /** ListClientTlsPoliciesRequest pageSize */ - pageSize?: (number|null); + /** Target loadBalancingScheme */ + loadBalancingScheme?: (google.cloud.networksecurity.v1.AuthzPolicy.LoadBalancingScheme|keyof typeof google.cloud.networksecurity.v1.AuthzPolicy.LoadBalancingScheme|null); - /** ListClientTlsPoliciesRequest pageToken */ - pageToken?: (string|null); - } + /** Target resources */ + resources?: (string[]|null); + } - /** Represents a ListClientTlsPoliciesRequest. */ - class ListClientTlsPoliciesRequest implements IListClientTlsPoliciesRequest { + /** Represents a Target. */ + class Target implements ITarget { - /** - * Constructs a new ListClientTlsPoliciesRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.networksecurity.v1.IListClientTlsPoliciesRequest); + /** + * Constructs a new Target. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.networksecurity.v1.AuthzPolicy.ITarget); - /** ListClientTlsPoliciesRequest parent. */ - public parent: string; + /** Target loadBalancingScheme. */ + public loadBalancingScheme: (google.cloud.networksecurity.v1.AuthzPolicy.LoadBalancingScheme|keyof typeof google.cloud.networksecurity.v1.AuthzPolicy.LoadBalancingScheme); - /** ListClientTlsPoliciesRequest pageSize. */ - public pageSize: number; + /** Target resources. */ + public resources: string[]; - /** ListClientTlsPoliciesRequest pageToken. */ - public pageToken: string; + /** + * Creates a new Target instance using the specified properties. + * @param [properties] Properties to set + * @returns Target instance + */ + public static create(properties?: google.cloud.networksecurity.v1.AuthzPolicy.ITarget): google.cloud.networksecurity.v1.AuthzPolicy.Target; - /** - * Creates a new ListClientTlsPoliciesRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns ListClientTlsPoliciesRequest instance - */ - public static create(properties?: google.cloud.networksecurity.v1.IListClientTlsPoliciesRequest): google.cloud.networksecurity.v1.ListClientTlsPoliciesRequest; + /** + * Encodes the specified Target message. Does not implicitly {@link google.cloud.networksecurity.v1.AuthzPolicy.Target.verify|verify} messages. + * @param message Target message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.networksecurity.v1.AuthzPolicy.ITarget, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Encodes the specified ListClientTlsPoliciesRequest message. Does not implicitly {@link google.cloud.networksecurity.v1.ListClientTlsPoliciesRequest.verify|verify} messages. - * @param message ListClientTlsPoliciesRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.networksecurity.v1.IListClientTlsPoliciesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Encodes the specified Target message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.AuthzPolicy.Target.verify|verify} messages. + * @param message Target message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.networksecurity.v1.AuthzPolicy.ITarget, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Encodes the specified ListClientTlsPoliciesRequest message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.ListClientTlsPoliciesRequest.verify|verify} messages. - * @param message ListClientTlsPoliciesRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.networksecurity.v1.IListClientTlsPoliciesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Decodes a Target message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Target + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.networksecurity.v1.AuthzPolicy.Target; - /** - * Decodes a ListClientTlsPoliciesRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListClientTlsPoliciesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.networksecurity.v1.ListClientTlsPoliciesRequest; + /** + * Decodes a Target message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Target + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.networksecurity.v1.AuthzPolicy.Target; - /** - * Decodes a ListClientTlsPoliciesRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListClientTlsPoliciesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.networksecurity.v1.ListClientTlsPoliciesRequest; + /** + * Verifies a Target message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** - * Verifies a ListClientTlsPoliciesRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** + * Creates a Target message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Target + */ + public static fromObject(object: { [k: string]: any }): google.cloud.networksecurity.v1.AuthzPolicy.Target; - /** - * Creates a ListClientTlsPoliciesRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListClientTlsPoliciesRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.networksecurity.v1.ListClientTlsPoliciesRequest; + /** + * Creates a plain object from a Target message. Also converts values to other types if specified. + * @param message Target + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.networksecurity.v1.AuthzPolicy.Target, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** - * Creates a plain object from a ListClientTlsPoliciesRequest message. Also converts values to other types if specified. - * @param message ListClientTlsPoliciesRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.networksecurity.v1.ListClientTlsPoliciesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** + * Converts this Target to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; - /** - * Converts this ListClientTlsPoliciesRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; + /** + * Gets the default type url for Target + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } - /** - * Gets the default type url for ListClientTlsPoliciesRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } + /** Properties of an AuthzRule. */ + interface IAuthzRule { - /** Properties of a ListClientTlsPoliciesResponse. */ - interface IListClientTlsPoliciesResponse { + /** AuthzRule from */ + from?: (google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.IFrom|null); - /** ListClientTlsPoliciesResponse clientTlsPolicies */ - clientTlsPolicies?: (google.cloud.networksecurity.v1.IClientTlsPolicy[]|null); + /** AuthzRule to */ + to?: (google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.ITo|null); - /** ListClientTlsPoliciesResponse nextPageToken */ - nextPageToken?: (string|null); - } + /** AuthzRule when */ + when?: (string|null); + } - /** Represents a ListClientTlsPoliciesResponse. */ - class ListClientTlsPoliciesResponse implements IListClientTlsPoliciesResponse { + /** Represents an AuthzRule. */ + class AuthzRule implements IAuthzRule { - /** - * Constructs a new ListClientTlsPoliciesResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.networksecurity.v1.IListClientTlsPoliciesResponse); + /** + * Constructs a new AuthzRule. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.networksecurity.v1.AuthzPolicy.IAuthzRule); - /** ListClientTlsPoliciesResponse clientTlsPolicies. */ - public clientTlsPolicies: google.cloud.networksecurity.v1.IClientTlsPolicy[]; + /** AuthzRule from. */ + public from?: (google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.IFrom|null); - /** ListClientTlsPoliciesResponse nextPageToken. */ - public nextPageToken: string; + /** AuthzRule to. */ + public to?: (google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.ITo|null); - /** - * Creates a new ListClientTlsPoliciesResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns ListClientTlsPoliciesResponse instance - */ - public static create(properties?: google.cloud.networksecurity.v1.IListClientTlsPoliciesResponse): google.cloud.networksecurity.v1.ListClientTlsPoliciesResponse; + /** AuthzRule when. */ + public when: string; - /** - * Encodes the specified ListClientTlsPoliciesResponse message. Does not implicitly {@link google.cloud.networksecurity.v1.ListClientTlsPoliciesResponse.verify|verify} messages. - * @param message ListClientTlsPoliciesResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.networksecurity.v1.IListClientTlsPoliciesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Creates a new AuthzRule instance using the specified properties. + * @param [properties] Properties to set + * @returns AuthzRule instance + */ + public static create(properties?: google.cloud.networksecurity.v1.AuthzPolicy.IAuthzRule): google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule; - /** - * Encodes the specified ListClientTlsPoliciesResponse message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.ListClientTlsPoliciesResponse.verify|verify} messages. - * @param message ListClientTlsPoliciesResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.networksecurity.v1.IListClientTlsPoliciesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Encodes the specified AuthzRule message. Does not implicitly {@link google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.verify|verify} messages. + * @param message AuthzRule message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.networksecurity.v1.AuthzPolicy.IAuthzRule, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Decodes a ListClientTlsPoliciesResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListClientTlsPoliciesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.networksecurity.v1.ListClientTlsPoliciesResponse; + /** + * Encodes the specified AuthzRule message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.verify|verify} messages. + * @param message AuthzRule message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.networksecurity.v1.AuthzPolicy.IAuthzRule, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Decodes a ListClientTlsPoliciesResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListClientTlsPoliciesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.networksecurity.v1.ListClientTlsPoliciesResponse; + /** + * Decodes an AuthzRule message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AuthzRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule; - /** - * Verifies a ListClientTlsPoliciesResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** + * Decodes an AuthzRule message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AuthzRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule; - /** - * Creates a ListClientTlsPoliciesResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListClientTlsPoliciesResponse + /** + * Verifies an AuthzRule message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AuthzRule message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AuthzRule + */ + public static fromObject(object: { [k: string]: any }): google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule; + + /** + * Creates a plain object from an AuthzRule message. Also converts values to other types if specified. + * @param message AuthzRule + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AuthzRule to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AuthzRule + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace AuthzRule { + + /** Properties of a StringMatch. */ + interface IStringMatch { + + /** StringMatch exact */ + exact?: (string|null); + + /** StringMatch prefix */ + prefix?: (string|null); + + /** StringMatch suffix */ + suffix?: (string|null); + + /** StringMatch contains */ + contains?: (string|null); + + /** StringMatch ignoreCase */ + ignoreCase?: (boolean|null); + } + + /** Represents a StringMatch. */ + class StringMatch implements IStringMatch { + + /** + * Constructs a new StringMatch. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.IStringMatch); + + /** StringMatch exact. */ + public exact?: (string|null); + + /** StringMatch prefix. */ + public prefix?: (string|null); + + /** StringMatch suffix. */ + public suffix?: (string|null); + + /** StringMatch contains. */ + public contains?: (string|null); + + /** StringMatch ignoreCase. */ + public ignoreCase: boolean; + + /** StringMatch matchPattern. */ + public matchPattern?: ("exact"|"prefix"|"suffix"|"contains"); + + /** + * Creates a new StringMatch instance using the specified properties. + * @param [properties] Properties to set + * @returns StringMatch instance + */ + public static create(properties?: google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.IStringMatch): google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.StringMatch; + + /** + * Encodes the specified StringMatch message. Does not implicitly {@link google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.StringMatch.verify|verify} messages. + * @param message StringMatch message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.IStringMatch, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified StringMatch message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.StringMatch.verify|verify} messages. + * @param message StringMatch message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.IStringMatch, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StringMatch message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns StringMatch + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.StringMatch; + + /** + * Decodes a StringMatch message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns StringMatch + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.StringMatch; + + /** + * Verifies a StringMatch message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a StringMatch message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns StringMatch + */ + public static fromObject(object: { [k: string]: any }): google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.StringMatch; + + /** + * Creates a plain object from a StringMatch message. Also converts values to other types if specified. + * @param message StringMatch + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.StringMatch, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this StringMatch to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for StringMatch + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an IpBlock. */ + interface IIpBlock { + + /** IpBlock prefix */ + prefix?: (string|null); + + /** IpBlock length */ + length?: (number|null); + } + + /** Represents an IpBlock. */ + class IpBlock implements IIpBlock { + + /** + * Constructs a new IpBlock. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.IIpBlock); + + /** IpBlock prefix. */ + public prefix: string; + + /** IpBlock length. */ + public length: number; + + /** + * Creates a new IpBlock instance using the specified properties. + * @param [properties] Properties to set + * @returns IpBlock instance + */ + public static create(properties?: google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.IIpBlock): google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.IpBlock; + + /** + * Encodes the specified IpBlock message. Does not implicitly {@link google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.IpBlock.verify|verify} messages. + * @param message IpBlock message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.IIpBlock, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified IpBlock message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.IpBlock.verify|verify} messages. + * @param message IpBlock message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.IIpBlock, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an IpBlock message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns IpBlock + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.IpBlock; + + /** + * Decodes an IpBlock message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns IpBlock + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.IpBlock; + + /** + * Verifies an IpBlock message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an IpBlock message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns IpBlock + */ + public static fromObject(object: { [k: string]: any }): google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.IpBlock; + + /** + * Creates a plain object from an IpBlock message. Also converts values to other types if specified. + * @param message IpBlock + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.IpBlock, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this IpBlock to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for IpBlock + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RequestResource. */ + interface IRequestResource { + + /** RequestResource tagValueIdSet */ + tagValueIdSet?: (google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.RequestResource.ITagValueIdSet|null); + + /** RequestResource iamServiceAccount */ + iamServiceAccount?: (google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.IStringMatch|null); + } + + /** Represents a RequestResource. */ + class RequestResource implements IRequestResource { + + /** + * Constructs a new RequestResource. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.IRequestResource); + + /** RequestResource tagValueIdSet. */ + public tagValueIdSet?: (google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.RequestResource.ITagValueIdSet|null); + + /** RequestResource iamServiceAccount. */ + public iamServiceAccount?: (google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.IStringMatch|null); + + /** + * Creates a new RequestResource instance using the specified properties. + * @param [properties] Properties to set + * @returns RequestResource instance + */ + public static create(properties?: google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.IRequestResource): google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.RequestResource; + + /** + * Encodes the specified RequestResource message. Does not implicitly {@link google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.RequestResource.verify|verify} messages. + * @param message RequestResource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.IRequestResource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RequestResource message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.RequestResource.verify|verify} messages. + * @param message RequestResource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.IRequestResource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RequestResource message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RequestResource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.RequestResource; + + /** + * Decodes a RequestResource message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RequestResource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.RequestResource; + + /** + * Verifies a RequestResource message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RequestResource message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RequestResource + */ + public static fromObject(object: { [k: string]: any }): google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.RequestResource; + + /** + * Creates a plain object from a RequestResource message. Also converts values to other types if specified. + * @param message RequestResource + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.RequestResource, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RequestResource to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RequestResource + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace RequestResource { + + /** Properties of a TagValueIdSet. */ + interface ITagValueIdSet { + + /** TagValueIdSet ids */ + ids?: ((number|Long|string)[]|null); + } + + /** Represents a TagValueIdSet. */ + class TagValueIdSet implements ITagValueIdSet { + + /** + * Constructs a new TagValueIdSet. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.RequestResource.ITagValueIdSet); + + /** TagValueIdSet ids. */ + public ids: (number|Long|string)[]; + + /** + * Creates a new TagValueIdSet instance using the specified properties. + * @param [properties] Properties to set + * @returns TagValueIdSet instance + */ + public static create(properties?: google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.RequestResource.ITagValueIdSet): google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.RequestResource.TagValueIdSet; + + /** + * Encodes the specified TagValueIdSet message. Does not implicitly {@link google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.RequestResource.TagValueIdSet.verify|verify} messages. + * @param message TagValueIdSet message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.RequestResource.ITagValueIdSet, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TagValueIdSet message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.RequestResource.TagValueIdSet.verify|verify} messages. + * @param message TagValueIdSet message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.RequestResource.ITagValueIdSet, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TagValueIdSet message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TagValueIdSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.RequestResource.TagValueIdSet; + + /** + * Decodes a TagValueIdSet message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TagValueIdSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.RequestResource.TagValueIdSet; + + /** + * Verifies a TagValueIdSet message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TagValueIdSet message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TagValueIdSet + */ + public static fromObject(object: { [k: string]: any }): google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.RequestResource.TagValueIdSet; + + /** + * Creates a plain object from a TagValueIdSet message. Also converts values to other types if specified. + * @param message TagValueIdSet + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.RequestResource.TagValueIdSet, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TagValueIdSet to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TagValueIdSet + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a HeaderMatch. */ + interface IHeaderMatch { + + /** HeaderMatch name */ + name?: (string|null); + + /** HeaderMatch value */ + value?: (google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.IStringMatch|null); + } + + /** Represents a HeaderMatch. */ + class HeaderMatch implements IHeaderMatch { + + /** + * Constructs a new HeaderMatch. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.IHeaderMatch); + + /** HeaderMatch name. */ + public name: string; + + /** HeaderMatch value. */ + public value?: (google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.IStringMatch|null); + + /** + * Creates a new HeaderMatch instance using the specified properties. + * @param [properties] Properties to set + * @returns HeaderMatch instance + */ + public static create(properties?: google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.IHeaderMatch): google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.HeaderMatch; + + /** + * Encodes the specified HeaderMatch message. Does not implicitly {@link google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.HeaderMatch.verify|verify} messages. + * @param message HeaderMatch message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.IHeaderMatch, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified HeaderMatch message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.HeaderMatch.verify|verify} messages. + * @param message HeaderMatch message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.IHeaderMatch, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a HeaderMatch message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns HeaderMatch + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.HeaderMatch; + + /** + * Decodes a HeaderMatch message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns HeaderMatch + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.HeaderMatch; + + /** + * Verifies a HeaderMatch message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a HeaderMatch message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns HeaderMatch + */ + public static fromObject(object: { [k: string]: any }): google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.HeaderMatch; + + /** + * Creates a plain object from a HeaderMatch message. Also converts values to other types if specified. + * @param message HeaderMatch + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.HeaderMatch, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this HeaderMatch to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for HeaderMatch + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Principal. */ + interface IPrincipal { + + /** Principal principalSelector */ + principalSelector?: (google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.Principal.PrincipalSelector|keyof typeof google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.Principal.PrincipalSelector|null); + + /** Principal principal */ + principal?: (google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.IStringMatch|null); + } + + /** Represents a Principal. */ + class Principal implements IPrincipal { + + /** + * Constructs a new Principal. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.IPrincipal); + + /** Principal principalSelector. */ + public principalSelector: (google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.Principal.PrincipalSelector|keyof typeof google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.Principal.PrincipalSelector); + + /** Principal principal. */ + public principal?: (google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.IStringMatch|null); + + /** + * Creates a new Principal instance using the specified properties. + * @param [properties] Properties to set + * @returns Principal instance + */ + public static create(properties?: google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.IPrincipal): google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.Principal; + + /** + * Encodes the specified Principal message. Does not implicitly {@link google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.Principal.verify|verify} messages. + * @param message Principal message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.IPrincipal, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Principal message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.Principal.verify|verify} messages. + * @param message Principal message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.IPrincipal, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Principal message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Principal + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.Principal; + + /** + * Decodes a Principal message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Principal + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.Principal; + + /** + * Verifies a Principal message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Principal message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Principal + */ + public static fromObject(object: { [k: string]: any }): google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.Principal; + + /** + * Creates a plain object from a Principal message. Also converts values to other types if specified. + * @param message Principal + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.Principal, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Principal to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Principal + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Principal { + + /** PrincipalSelector enum. */ + enum PrincipalSelector { + PRINCIPAL_SELECTOR_UNSPECIFIED = 0, + CLIENT_CERT_URI_SAN = 1, + CLIENT_CERT_DNS_NAME_SAN = 2, + CLIENT_CERT_COMMON_NAME = 3 + } + } + + /** Properties of a From. */ + interface IFrom { + + /** From sources */ + sources?: (google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.From.IRequestSource[]|null); + + /** From notSources */ + notSources?: (google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.From.IRequestSource[]|null); + } + + /** Represents a From. */ + class From implements IFrom { + + /** + * Constructs a new From. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.IFrom); + + /** From sources. */ + public sources: google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.From.IRequestSource[]; + + /** From notSources. */ + public notSources: google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.From.IRequestSource[]; + + /** + * Creates a new From instance using the specified properties. + * @param [properties] Properties to set + * @returns From instance + */ + public static create(properties?: google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.IFrom): google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.From; + + /** + * Encodes the specified From message. Does not implicitly {@link google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.From.verify|verify} messages. + * @param message From message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.IFrom, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified From message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.From.verify|verify} messages. + * @param message From message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.IFrom, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a From message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns From + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.From; + + /** + * Decodes a From message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns From + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.From; + + /** + * Verifies a From message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a From message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns From + */ + public static fromObject(object: { [k: string]: any }): google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.From; + + /** + * Creates a plain object from a From message. Also converts values to other types if specified. + * @param message From + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.From, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this From to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for From + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace From { + + /** Properties of a RequestSource. */ + interface IRequestSource { + + /** RequestSource principals */ + principals?: (google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.IPrincipal[]|null); + + /** RequestSource ipBlocks */ + ipBlocks?: (google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.IIpBlock[]|null); + + /** RequestSource resources */ + resources?: (google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.IRequestResource[]|null); + } + + /** Represents a RequestSource. */ + class RequestSource implements IRequestSource { + + /** + * Constructs a new RequestSource. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.From.IRequestSource); + + /** RequestSource principals. */ + public principals: google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.IPrincipal[]; + + /** RequestSource ipBlocks. */ + public ipBlocks: google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.IIpBlock[]; + + /** RequestSource resources. */ + public resources: google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.IRequestResource[]; + + /** + * Creates a new RequestSource instance using the specified properties. + * @param [properties] Properties to set + * @returns RequestSource instance + */ + public static create(properties?: google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.From.IRequestSource): google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.From.RequestSource; + + /** + * Encodes the specified RequestSource message. Does not implicitly {@link google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.From.RequestSource.verify|verify} messages. + * @param message RequestSource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.From.IRequestSource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RequestSource message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.From.RequestSource.verify|verify} messages. + * @param message RequestSource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.From.IRequestSource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RequestSource message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RequestSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.From.RequestSource; + + /** + * Decodes a RequestSource message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RequestSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.From.RequestSource; + + /** + * Verifies a RequestSource message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RequestSource message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RequestSource + */ + public static fromObject(object: { [k: string]: any }): google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.From.RequestSource; + + /** + * Creates a plain object from a RequestSource message. Also converts values to other types if specified. + * @param message RequestSource + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.From.RequestSource, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RequestSource to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RequestSource + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a To. */ + interface ITo { + + /** To operations */ + operations?: (google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.To.IRequestOperation[]|null); + + /** To notOperations */ + notOperations?: (google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.To.IRequestOperation[]|null); + } + + /** Represents a To. */ + class To implements ITo { + + /** + * Constructs a new To. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.ITo); + + /** To operations. */ + public operations: google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.To.IRequestOperation[]; + + /** To notOperations. */ + public notOperations: google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.To.IRequestOperation[]; + + /** + * Creates a new To instance using the specified properties. + * @param [properties] Properties to set + * @returns To instance + */ + public static create(properties?: google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.ITo): google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.To; + + /** + * Encodes the specified To message. Does not implicitly {@link google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.To.verify|verify} messages. + * @param message To message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.ITo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified To message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.To.verify|verify} messages. + * @param message To message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.ITo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a To message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns To + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.To; + + /** + * Decodes a To message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns To + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.To; + + /** + * Verifies a To message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a To message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns To + */ + public static fromObject(object: { [k: string]: any }): google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.To; + + /** + * Creates a plain object from a To message. Also converts values to other types if specified. + * @param message To + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.To, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this To to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for To + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace To { + + /** Properties of a RequestOperation. */ + interface IRequestOperation { + + /** RequestOperation headerSet */ + headerSet?: (google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.To.RequestOperation.IHeaderSet|null); + + /** RequestOperation hosts */ + hosts?: (google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.IStringMatch[]|null); + + /** RequestOperation paths */ + paths?: (google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.IStringMatch[]|null); + + /** RequestOperation methods */ + methods?: (string[]|null); + + /** RequestOperation mcp */ + mcp?: (google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.To.RequestOperation.IMCP|null); + } + + /** Represents a RequestOperation. */ + class RequestOperation implements IRequestOperation { + + /** + * Constructs a new RequestOperation. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.To.IRequestOperation); + + /** RequestOperation headerSet. */ + public headerSet?: (google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.To.RequestOperation.IHeaderSet|null); + + /** RequestOperation hosts. */ + public hosts: google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.IStringMatch[]; + + /** RequestOperation paths. */ + public paths: google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.IStringMatch[]; + + /** RequestOperation methods. */ + public methods: string[]; + + /** RequestOperation mcp. */ + public mcp?: (google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.To.RequestOperation.IMCP|null); + + /** + * Creates a new RequestOperation instance using the specified properties. + * @param [properties] Properties to set + * @returns RequestOperation instance + */ + public static create(properties?: google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.To.IRequestOperation): google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.To.RequestOperation; + + /** + * Encodes the specified RequestOperation message. Does not implicitly {@link google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.To.RequestOperation.verify|verify} messages. + * @param message RequestOperation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.To.IRequestOperation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RequestOperation message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.To.RequestOperation.verify|verify} messages. + * @param message RequestOperation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.To.IRequestOperation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RequestOperation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RequestOperation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.To.RequestOperation; + + /** + * Decodes a RequestOperation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RequestOperation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.To.RequestOperation; + + /** + * Verifies a RequestOperation message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RequestOperation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RequestOperation + */ + public static fromObject(object: { [k: string]: any }): google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.To.RequestOperation; + + /** + * Creates a plain object from a RequestOperation message. Also converts values to other types if specified. + * @param message RequestOperation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.To.RequestOperation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RequestOperation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RequestOperation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace RequestOperation { + + /** Properties of a HeaderSet. */ + interface IHeaderSet { + + /** HeaderSet headers */ + headers?: (google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.IHeaderMatch[]|null); + } + + /** Represents a HeaderSet. */ + class HeaderSet implements IHeaderSet { + + /** + * Constructs a new HeaderSet. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.To.RequestOperation.IHeaderSet); + + /** HeaderSet headers. */ + public headers: google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.IHeaderMatch[]; + + /** + * Creates a new HeaderSet instance using the specified properties. + * @param [properties] Properties to set + * @returns HeaderSet instance + */ + public static create(properties?: google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.To.RequestOperation.IHeaderSet): google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.To.RequestOperation.HeaderSet; + + /** + * Encodes the specified HeaderSet message. Does not implicitly {@link google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.To.RequestOperation.HeaderSet.verify|verify} messages. + * @param message HeaderSet message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.To.RequestOperation.IHeaderSet, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified HeaderSet message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.To.RequestOperation.HeaderSet.verify|verify} messages. + * @param message HeaderSet message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.To.RequestOperation.IHeaderSet, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a HeaderSet message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns HeaderSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.To.RequestOperation.HeaderSet; + + /** + * Decodes a HeaderSet message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns HeaderSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.To.RequestOperation.HeaderSet; + + /** + * Verifies a HeaderSet message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a HeaderSet message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns HeaderSet + */ + public static fromObject(object: { [k: string]: any }): google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.To.RequestOperation.HeaderSet; + + /** + * Creates a plain object from a HeaderSet message. Also converts values to other types if specified. + * @param message HeaderSet + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.To.RequestOperation.HeaderSet, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this HeaderSet to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for HeaderSet + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a MCPMethod. */ + interface IMCPMethod { + + /** MCPMethod name */ + name?: (string|null); + + /** MCPMethod params */ + params?: (google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.IStringMatch[]|null); + } + + /** Represents a MCPMethod. */ + class MCPMethod implements IMCPMethod { + + /** + * Constructs a new MCPMethod. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.To.RequestOperation.IMCPMethod); + + /** MCPMethod name. */ + public name: string; + + /** MCPMethod params. */ + public params: google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.IStringMatch[]; + + /** + * Creates a new MCPMethod instance using the specified properties. + * @param [properties] Properties to set + * @returns MCPMethod instance + */ + public static create(properties?: google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.To.RequestOperation.IMCPMethod): google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.To.RequestOperation.MCPMethod; + + /** + * Encodes the specified MCPMethod message. Does not implicitly {@link google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.To.RequestOperation.MCPMethod.verify|verify} messages. + * @param message MCPMethod message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.To.RequestOperation.IMCPMethod, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MCPMethod message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.To.RequestOperation.MCPMethod.verify|verify} messages. + * @param message MCPMethod message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.To.RequestOperation.IMCPMethod, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MCPMethod message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MCPMethod + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.To.RequestOperation.MCPMethod; + + /** + * Decodes a MCPMethod message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MCPMethod + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.To.RequestOperation.MCPMethod; + + /** + * Verifies a MCPMethod message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MCPMethod message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MCPMethod + */ + public static fromObject(object: { [k: string]: any }): google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.To.RequestOperation.MCPMethod; + + /** + * Creates a plain object from a MCPMethod message. Also converts values to other types if specified. + * @param message MCPMethod + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.To.RequestOperation.MCPMethod, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MCPMethod to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MCPMethod + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a MCP. */ + interface IMCP { + + /** MCP baseProtocolMethodsOption */ + baseProtocolMethodsOption?: (google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.To.RequestOperation.BaseProtocolMethodsOption|keyof typeof google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.To.RequestOperation.BaseProtocolMethodsOption|null); + + /** MCP methods */ + methods?: (google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.To.RequestOperation.IMCPMethod[]|null); + } + + /** Represents a MCP. */ + class MCP implements IMCP { + + /** + * Constructs a new MCP. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.To.RequestOperation.IMCP); + + /** MCP baseProtocolMethodsOption. */ + public baseProtocolMethodsOption: (google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.To.RequestOperation.BaseProtocolMethodsOption|keyof typeof google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.To.RequestOperation.BaseProtocolMethodsOption); + + /** MCP methods. */ + public methods: google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.To.RequestOperation.IMCPMethod[]; + + /** + * Creates a new MCP instance using the specified properties. + * @param [properties] Properties to set + * @returns MCP instance + */ + public static create(properties?: google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.To.RequestOperation.IMCP): google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.To.RequestOperation.MCP; + + /** + * Encodes the specified MCP message. Does not implicitly {@link google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.To.RequestOperation.MCP.verify|verify} messages. + * @param message MCP message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.To.RequestOperation.IMCP, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MCP message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.To.RequestOperation.MCP.verify|verify} messages. + * @param message MCP message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.To.RequestOperation.IMCP, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MCP message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MCP + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.To.RequestOperation.MCP; + + /** + * Decodes a MCP message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MCP + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.To.RequestOperation.MCP; + + /** + * Verifies a MCP message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MCP message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MCP + */ + public static fromObject(object: { [k: string]: any }): google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.To.RequestOperation.MCP; + + /** + * Creates a plain object from a MCP message. Also converts values to other types if specified. + * @param message MCP + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.To.RequestOperation.MCP, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MCP to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MCP + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** BaseProtocolMethodsOption enum. */ + enum BaseProtocolMethodsOption { + BASE_PROTOCOL_METHODS_OPTION_UNSPECIFIED = 0, + SKIP_BASE_PROTOCOL_METHODS = 1, + MATCH_BASE_PROTOCOL_METHODS = 2 + } + } + } + } + + /** Properties of a CustomProvider. */ + interface ICustomProvider { + + /** CustomProvider cloudIap */ + cloudIap?: (google.cloud.networksecurity.v1.AuthzPolicy.CustomProvider.ICloudIap|null); + + /** CustomProvider authzExtension */ + authzExtension?: (google.cloud.networksecurity.v1.AuthzPolicy.CustomProvider.IAuthzExtension|null); + } + + /** Represents a CustomProvider. */ + class CustomProvider implements ICustomProvider { + + /** + * Constructs a new CustomProvider. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.networksecurity.v1.AuthzPolicy.ICustomProvider); + + /** CustomProvider cloudIap. */ + public cloudIap?: (google.cloud.networksecurity.v1.AuthzPolicy.CustomProvider.ICloudIap|null); + + /** CustomProvider authzExtension. */ + public authzExtension?: (google.cloud.networksecurity.v1.AuthzPolicy.CustomProvider.IAuthzExtension|null); + + /** + * Creates a new CustomProvider instance using the specified properties. + * @param [properties] Properties to set + * @returns CustomProvider instance + */ + public static create(properties?: google.cloud.networksecurity.v1.AuthzPolicy.ICustomProvider): google.cloud.networksecurity.v1.AuthzPolicy.CustomProvider; + + /** + * Encodes the specified CustomProvider message. Does not implicitly {@link google.cloud.networksecurity.v1.AuthzPolicy.CustomProvider.verify|verify} messages. + * @param message CustomProvider message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.networksecurity.v1.AuthzPolicy.ICustomProvider, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CustomProvider message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.AuthzPolicy.CustomProvider.verify|verify} messages. + * @param message CustomProvider message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.networksecurity.v1.AuthzPolicy.ICustomProvider, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CustomProvider message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CustomProvider + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.networksecurity.v1.AuthzPolicy.CustomProvider; + + /** + * Decodes a CustomProvider message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CustomProvider + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.networksecurity.v1.AuthzPolicy.CustomProvider; + + /** + * Verifies a CustomProvider message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CustomProvider message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CustomProvider + */ + public static fromObject(object: { [k: string]: any }): google.cloud.networksecurity.v1.AuthzPolicy.CustomProvider; + + /** + * Creates a plain object from a CustomProvider message. Also converts values to other types if specified. + * @param message CustomProvider + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.networksecurity.v1.AuthzPolicy.CustomProvider, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CustomProvider to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CustomProvider + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace CustomProvider { + + /** Properties of a CloudIap. */ + interface ICloudIap { + } + + /** Represents a CloudIap. */ + class CloudIap implements ICloudIap { + + /** + * Constructs a new CloudIap. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.networksecurity.v1.AuthzPolicy.CustomProvider.ICloudIap); + + /** + * Creates a new CloudIap instance using the specified properties. + * @param [properties] Properties to set + * @returns CloudIap instance + */ + public static create(properties?: google.cloud.networksecurity.v1.AuthzPolicy.CustomProvider.ICloudIap): google.cloud.networksecurity.v1.AuthzPolicy.CustomProvider.CloudIap; + + /** + * Encodes the specified CloudIap message. Does not implicitly {@link google.cloud.networksecurity.v1.AuthzPolicy.CustomProvider.CloudIap.verify|verify} messages. + * @param message CloudIap message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.networksecurity.v1.AuthzPolicy.CustomProvider.ICloudIap, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CloudIap message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.AuthzPolicy.CustomProvider.CloudIap.verify|verify} messages. + * @param message CloudIap message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.networksecurity.v1.AuthzPolicy.CustomProvider.ICloudIap, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CloudIap message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CloudIap + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.networksecurity.v1.AuthzPolicy.CustomProvider.CloudIap; + + /** + * Decodes a CloudIap message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CloudIap + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.networksecurity.v1.AuthzPolicy.CustomProvider.CloudIap; + + /** + * Verifies a CloudIap message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CloudIap message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CloudIap + */ + public static fromObject(object: { [k: string]: any }): google.cloud.networksecurity.v1.AuthzPolicy.CustomProvider.CloudIap; + + /** + * Creates a plain object from a CloudIap message. Also converts values to other types if specified. + * @param message CloudIap + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.networksecurity.v1.AuthzPolicy.CustomProvider.CloudIap, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CloudIap to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CloudIap + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AuthzExtension. */ + interface IAuthzExtension { + + /** AuthzExtension resources */ + resources?: (string[]|null); + } + + /** Represents an AuthzExtension. */ + class AuthzExtension implements IAuthzExtension { + + /** + * Constructs a new AuthzExtension. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.networksecurity.v1.AuthzPolicy.CustomProvider.IAuthzExtension); + + /** AuthzExtension resources. */ + public resources: string[]; + + /** + * Creates a new AuthzExtension instance using the specified properties. + * @param [properties] Properties to set + * @returns AuthzExtension instance + */ + public static create(properties?: google.cloud.networksecurity.v1.AuthzPolicy.CustomProvider.IAuthzExtension): google.cloud.networksecurity.v1.AuthzPolicy.CustomProvider.AuthzExtension; + + /** + * Encodes the specified AuthzExtension message. Does not implicitly {@link google.cloud.networksecurity.v1.AuthzPolicy.CustomProvider.AuthzExtension.verify|verify} messages. + * @param message AuthzExtension message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.networksecurity.v1.AuthzPolicy.CustomProvider.IAuthzExtension, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AuthzExtension message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.AuthzPolicy.CustomProvider.AuthzExtension.verify|verify} messages. + * @param message AuthzExtension message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.networksecurity.v1.AuthzPolicy.CustomProvider.IAuthzExtension, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AuthzExtension message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AuthzExtension + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.networksecurity.v1.AuthzPolicy.CustomProvider.AuthzExtension; + + /** + * Decodes an AuthzExtension message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AuthzExtension + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.networksecurity.v1.AuthzPolicy.CustomProvider.AuthzExtension; + + /** + * Verifies an AuthzExtension message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AuthzExtension message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AuthzExtension + */ + public static fromObject(object: { [k: string]: any }): google.cloud.networksecurity.v1.AuthzPolicy.CustomProvider.AuthzExtension; + + /** + * Creates a plain object from an AuthzExtension message. Also converts values to other types if specified. + * @param message AuthzExtension + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.networksecurity.v1.AuthzPolicy.CustomProvider.AuthzExtension, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AuthzExtension to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AuthzExtension + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** LoadBalancingScheme enum. */ + enum LoadBalancingScheme { + LOAD_BALANCING_SCHEME_UNSPECIFIED = 0, + INTERNAL_MANAGED = 1, + EXTERNAL_MANAGED = 2, + INTERNAL_SELF_MANAGED = 3 + } + + /** AuthzAction enum. */ + enum AuthzAction { + AUTHZ_ACTION_UNSPECIFIED = 0, + ALLOW = 1, + DENY = 2, + CUSTOM = 3 + } + + /** PolicyProfile enum. */ + enum PolicyProfile { + POLICY_PROFILE_UNSPECIFIED = 0, + REQUEST_AUTHZ = 1, + CONTENT_AUTHZ = 2 + } + } + + /** Properties of a CreateAuthzPolicyRequest. */ + interface ICreateAuthzPolicyRequest { + + /** CreateAuthzPolicyRequest parent */ + parent?: (string|null); + + /** CreateAuthzPolicyRequest authzPolicyId */ + authzPolicyId?: (string|null); + + /** CreateAuthzPolicyRequest authzPolicy */ + authzPolicy?: (google.cloud.networksecurity.v1.IAuthzPolicy|null); + + /** CreateAuthzPolicyRequest requestId */ + requestId?: (string|null); + } + + /** Represents a CreateAuthzPolicyRequest. */ + class CreateAuthzPolicyRequest implements ICreateAuthzPolicyRequest { + + /** + * Constructs a new CreateAuthzPolicyRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.networksecurity.v1.ICreateAuthzPolicyRequest); + + /** CreateAuthzPolicyRequest parent. */ + public parent: string; + + /** CreateAuthzPolicyRequest authzPolicyId. */ + public authzPolicyId: string; + + /** CreateAuthzPolicyRequest authzPolicy. */ + public authzPolicy?: (google.cloud.networksecurity.v1.IAuthzPolicy|null); + + /** CreateAuthzPolicyRequest requestId. */ + public requestId: string; + + /** + * Creates a new CreateAuthzPolicyRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateAuthzPolicyRequest instance + */ + public static create(properties?: google.cloud.networksecurity.v1.ICreateAuthzPolicyRequest): google.cloud.networksecurity.v1.CreateAuthzPolicyRequest; + + /** + * Encodes the specified CreateAuthzPolicyRequest message. Does not implicitly {@link google.cloud.networksecurity.v1.CreateAuthzPolicyRequest.verify|verify} messages. + * @param message CreateAuthzPolicyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.networksecurity.v1.ICreateAuthzPolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateAuthzPolicyRequest message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.CreateAuthzPolicyRequest.verify|verify} messages. + * @param message CreateAuthzPolicyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.networksecurity.v1.ICreateAuthzPolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateAuthzPolicyRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateAuthzPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.networksecurity.v1.CreateAuthzPolicyRequest; + + /** + * Decodes a CreateAuthzPolicyRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateAuthzPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.networksecurity.v1.CreateAuthzPolicyRequest; + + /** + * Verifies a CreateAuthzPolicyRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateAuthzPolicyRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateAuthzPolicyRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.networksecurity.v1.CreateAuthzPolicyRequest; + + /** + * Creates a plain object from a CreateAuthzPolicyRequest message. Also converts values to other types if specified. + * @param message CreateAuthzPolicyRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.networksecurity.v1.CreateAuthzPolicyRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateAuthzPolicyRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateAuthzPolicyRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListAuthzPoliciesRequest. */ + interface IListAuthzPoliciesRequest { + + /** ListAuthzPoliciesRequest parent */ + parent?: (string|null); + + /** ListAuthzPoliciesRequest pageSize */ + pageSize?: (number|null); + + /** ListAuthzPoliciesRequest pageToken */ + pageToken?: (string|null); + + /** ListAuthzPoliciesRequest filter */ + filter?: (string|null); + + /** ListAuthzPoliciesRequest orderBy */ + orderBy?: (string|null); + } + + /** Represents a ListAuthzPoliciesRequest. */ + class ListAuthzPoliciesRequest implements IListAuthzPoliciesRequest { + + /** + * Constructs a new ListAuthzPoliciesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.networksecurity.v1.IListAuthzPoliciesRequest); + + /** ListAuthzPoliciesRequest parent. */ + public parent: string; + + /** ListAuthzPoliciesRequest pageSize. */ + public pageSize: number; + + /** ListAuthzPoliciesRequest pageToken. */ + public pageToken: string; + + /** ListAuthzPoliciesRequest filter. */ + public filter: string; + + /** ListAuthzPoliciesRequest orderBy. */ + public orderBy: string; + + /** + * Creates a new ListAuthzPoliciesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListAuthzPoliciesRequest instance + */ + public static create(properties?: google.cloud.networksecurity.v1.IListAuthzPoliciesRequest): google.cloud.networksecurity.v1.ListAuthzPoliciesRequest; + + /** + * Encodes the specified ListAuthzPoliciesRequest message. Does not implicitly {@link google.cloud.networksecurity.v1.ListAuthzPoliciesRequest.verify|verify} messages. + * @param message ListAuthzPoliciesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.networksecurity.v1.IListAuthzPoliciesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListAuthzPoliciesRequest message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.ListAuthzPoliciesRequest.verify|verify} messages. + * @param message ListAuthzPoliciesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.networksecurity.v1.IListAuthzPoliciesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListAuthzPoliciesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListAuthzPoliciesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.networksecurity.v1.ListAuthzPoliciesRequest; + + /** + * Decodes a ListAuthzPoliciesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListAuthzPoliciesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.networksecurity.v1.ListAuthzPoliciesRequest; + + /** + * Verifies a ListAuthzPoliciesRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListAuthzPoliciesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListAuthzPoliciesRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.networksecurity.v1.ListAuthzPoliciesRequest; + + /** + * Creates a plain object from a ListAuthzPoliciesRequest message. Also converts values to other types if specified. + * @param message ListAuthzPoliciesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.networksecurity.v1.ListAuthzPoliciesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListAuthzPoliciesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListAuthzPoliciesRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListAuthzPoliciesResponse. */ + interface IListAuthzPoliciesResponse { + + /** ListAuthzPoliciesResponse authzPolicies */ + authzPolicies?: (google.cloud.networksecurity.v1.IAuthzPolicy[]|null); + + /** ListAuthzPoliciesResponse nextPageToken */ + nextPageToken?: (string|null); + + /** ListAuthzPoliciesResponse unreachable */ + unreachable?: (string[]|null); + } + + /** Represents a ListAuthzPoliciesResponse. */ + class ListAuthzPoliciesResponse implements IListAuthzPoliciesResponse { + + /** + * Constructs a new ListAuthzPoliciesResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.networksecurity.v1.IListAuthzPoliciesResponse); + + /** ListAuthzPoliciesResponse authzPolicies. */ + public authzPolicies: google.cloud.networksecurity.v1.IAuthzPolicy[]; + + /** ListAuthzPoliciesResponse nextPageToken. */ + public nextPageToken: string; + + /** ListAuthzPoliciesResponse unreachable. */ + public unreachable: string[]; + + /** + * Creates a new ListAuthzPoliciesResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListAuthzPoliciesResponse instance + */ + public static create(properties?: google.cloud.networksecurity.v1.IListAuthzPoliciesResponse): google.cloud.networksecurity.v1.ListAuthzPoliciesResponse; + + /** + * Encodes the specified ListAuthzPoliciesResponse message. Does not implicitly {@link google.cloud.networksecurity.v1.ListAuthzPoliciesResponse.verify|verify} messages. + * @param message ListAuthzPoliciesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.networksecurity.v1.IListAuthzPoliciesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListAuthzPoliciesResponse message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.ListAuthzPoliciesResponse.verify|verify} messages. + * @param message ListAuthzPoliciesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.networksecurity.v1.IListAuthzPoliciesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListAuthzPoliciesResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListAuthzPoliciesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.networksecurity.v1.ListAuthzPoliciesResponse; + + /** + * Decodes a ListAuthzPoliciesResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListAuthzPoliciesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.networksecurity.v1.ListAuthzPoliciesResponse; + + /** + * Verifies a ListAuthzPoliciesResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListAuthzPoliciesResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListAuthzPoliciesResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.networksecurity.v1.ListAuthzPoliciesResponse; + + /** + * Creates a plain object from a ListAuthzPoliciesResponse message. Also converts values to other types if specified. + * @param message ListAuthzPoliciesResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.networksecurity.v1.ListAuthzPoliciesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListAuthzPoliciesResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListAuthzPoliciesResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetAuthzPolicyRequest. */ + interface IGetAuthzPolicyRequest { + + /** GetAuthzPolicyRequest name */ + name?: (string|null); + } + + /** Represents a GetAuthzPolicyRequest. */ + class GetAuthzPolicyRequest implements IGetAuthzPolicyRequest { + + /** + * Constructs a new GetAuthzPolicyRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.networksecurity.v1.IGetAuthzPolicyRequest); + + /** GetAuthzPolicyRequest name. */ + public name: string; + + /** + * Creates a new GetAuthzPolicyRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetAuthzPolicyRequest instance + */ + public static create(properties?: google.cloud.networksecurity.v1.IGetAuthzPolicyRequest): google.cloud.networksecurity.v1.GetAuthzPolicyRequest; + + /** + * Encodes the specified GetAuthzPolicyRequest message. Does not implicitly {@link google.cloud.networksecurity.v1.GetAuthzPolicyRequest.verify|verify} messages. + * @param message GetAuthzPolicyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.networksecurity.v1.IGetAuthzPolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetAuthzPolicyRequest message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.GetAuthzPolicyRequest.verify|verify} messages. + * @param message GetAuthzPolicyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.networksecurity.v1.IGetAuthzPolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetAuthzPolicyRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetAuthzPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.networksecurity.v1.GetAuthzPolicyRequest; + + /** + * Decodes a GetAuthzPolicyRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetAuthzPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.networksecurity.v1.GetAuthzPolicyRequest; + + /** + * Verifies a GetAuthzPolicyRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetAuthzPolicyRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetAuthzPolicyRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.networksecurity.v1.GetAuthzPolicyRequest; + + /** + * Creates a plain object from a GetAuthzPolicyRequest message. Also converts values to other types if specified. + * @param message GetAuthzPolicyRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.networksecurity.v1.GetAuthzPolicyRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetAuthzPolicyRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetAuthzPolicyRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateAuthzPolicyRequest. */ + interface IUpdateAuthzPolicyRequest { + + /** UpdateAuthzPolicyRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateAuthzPolicyRequest authzPolicy */ + authzPolicy?: (google.cloud.networksecurity.v1.IAuthzPolicy|null); + + /** UpdateAuthzPolicyRequest requestId */ + requestId?: (string|null); + } + + /** Represents an UpdateAuthzPolicyRequest. */ + class UpdateAuthzPolicyRequest implements IUpdateAuthzPolicyRequest { + + /** + * Constructs a new UpdateAuthzPolicyRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.networksecurity.v1.IUpdateAuthzPolicyRequest); + + /** UpdateAuthzPolicyRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateAuthzPolicyRequest authzPolicy. */ + public authzPolicy?: (google.cloud.networksecurity.v1.IAuthzPolicy|null); + + /** UpdateAuthzPolicyRequest requestId. */ + public requestId: string; + + /** + * Creates a new UpdateAuthzPolicyRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateAuthzPolicyRequest instance + */ + public static create(properties?: google.cloud.networksecurity.v1.IUpdateAuthzPolicyRequest): google.cloud.networksecurity.v1.UpdateAuthzPolicyRequest; + + /** + * Encodes the specified UpdateAuthzPolicyRequest message. Does not implicitly {@link google.cloud.networksecurity.v1.UpdateAuthzPolicyRequest.verify|verify} messages. + * @param message UpdateAuthzPolicyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.networksecurity.v1.IUpdateAuthzPolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateAuthzPolicyRequest message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.UpdateAuthzPolicyRequest.verify|verify} messages. + * @param message UpdateAuthzPolicyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.networksecurity.v1.IUpdateAuthzPolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateAuthzPolicyRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateAuthzPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.networksecurity.v1.UpdateAuthzPolicyRequest; + + /** + * Decodes an UpdateAuthzPolicyRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateAuthzPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.networksecurity.v1.UpdateAuthzPolicyRequest; + + /** + * Verifies an UpdateAuthzPolicyRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UpdateAuthzPolicyRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateAuthzPolicyRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.networksecurity.v1.UpdateAuthzPolicyRequest; + + /** + * Creates a plain object from an UpdateAuthzPolicyRequest message. Also converts values to other types if specified. + * @param message UpdateAuthzPolicyRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.networksecurity.v1.UpdateAuthzPolicyRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateAuthzPolicyRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateAuthzPolicyRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteAuthzPolicyRequest. */ + interface IDeleteAuthzPolicyRequest { + + /** DeleteAuthzPolicyRequest name */ + name?: (string|null); + + /** DeleteAuthzPolicyRequest requestId */ + requestId?: (string|null); + } + + /** Represents a DeleteAuthzPolicyRequest. */ + class DeleteAuthzPolicyRequest implements IDeleteAuthzPolicyRequest { + + /** + * Constructs a new DeleteAuthzPolicyRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.networksecurity.v1.IDeleteAuthzPolicyRequest); + + /** DeleteAuthzPolicyRequest name. */ + public name: string; + + /** DeleteAuthzPolicyRequest requestId. */ + public requestId: string; + + /** + * Creates a new DeleteAuthzPolicyRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteAuthzPolicyRequest instance + */ + public static create(properties?: google.cloud.networksecurity.v1.IDeleteAuthzPolicyRequest): google.cloud.networksecurity.v1.DeleteAuthzPolicyRequest; + + /** + * Encodes the specified DeleteAuthzPolicyRequest message. Does not implicitly {@link google.cloud.networksecurity.v1.DeleteAuthzPolicyRequest.verify|verify} messages. + * @param message DeleteAuthzPolicyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.networksecurity.v1.IDeleteAuthzPolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteAuthzPolicyRequest message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.DeleteAuthzPolicyRequest.verify|verify} messages. + * @param message DeleteAuthzPolicyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.networksecurity.v1.IDeleteAuthzPolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteAuthzPolicyRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteAuthzPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.networksecurity.v1.DeleteAuthzPolicyRequest; + + /** + * Decodes a DeleteAuthzPolicyRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteAuthzPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.networksecurity.v1.DeleteAuthzPolicyRequest; + + /** + * Verifies a DeleteAuthzPolicyRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteAuthzPolicyRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteAuthzPolicyRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.networksecurity.v1.DeleteAuthzPolicyRequest; + + /** + * Creates a plain object from a DeleteAuthzPolicyRequest message. Also converts values to other types if specified. + * @param message DeleteAuthzPolicyRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.networksecurity.v1.DeleteAuthzPolicyRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteAuthzPolicyRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteAuthzPolicyRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BackendAuthenticationConfig. */ + interface IBackendAuthenticationConfig { + + /** BackendAuthenticationConfig name */ + name?: (string|null); + + /** BackendAuthenticationConfig description */ + description?: (string|null); + + /** BackendAuthenticationConfig createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** BackendAuthenticationConfig updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** BackendAuthenticationConfig labels */ + labels?: ({ [k: string]: string }|null); + + /** BackendAuthenticationConfig clientCertificate */ + clientCertificate?: (string|null); + + /** BackendAuthenticationConfig trustConfig */ + trustConfig?: (string|null); + + /** BackendAuthenticationConfig wellKnownRoots */ + wellKnownRoots?: (google.cloud.networksecurity.v1.BackendAuthenticationConfig.WellKnownRoots|keyof typeof google.cloud.networksecurity.v1.BackendAuthenticationConfig.WellKnownRoots|null); + + /** BackendAuthenticationConfig etag */ + etag?: (string|null); + } + + /** Represents a BackendAuthenticationConfig. */ + class BackendAuthenticationConfig implements IBackendAuthenticationConfig { + + /** + * Constructs a new BackendAuthenticationConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.networksecurity.v1.IBackendAuthenticationConfig); + + /** BackendAuthenticationConfig name. */ + public name: string; + + /** BackendAuthenticationConfig description. */ + public description: string; + + /** BackendAuthenticationConfig createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** BackendAuthenticationConfig updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** BackendAuthenticationConfig labels. */ + public labels: { [k: string]: string }; + + /** BackendAuthenticationConfig clientCertificate. */ + public clientCertificate: string; + + /** BackendAuthenticationConfig trustConfig. */ + public trustConfig: string; + + /** BackendAuthenticationConfig wellKnownRoots. */ + public wellKnownRoots: (google.cloud.networksecurity.v1.BackendAuthenticationConfig.WellKnownRoots|keyof typeof google.cloud.networksecurity.v1.BackendAuthenticationConfig.WellKnownRoots); + + /** BackendAuthenticationConfig etag. */ + public etag: string; + + /** + * Creates a new BackendAuthenticationConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns BackendAuthenticationConfig instance + */ + public static create(properties?: google.cloud.networksecurity.v1.IBackendAuthenticationConfig): google.cloud.networksecurity.v1.BackendAuthenticationConfig; + + /** + * Encodes the specified BackendAuthenticationConfig message. Does not implicitly {@link google.cloud.networksecurity.v1.BackendAuthenticationConfig.verify|verify} messages. + * @param message BackendAuthenticationConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.networksecurity.v1.IBackendAuthenticationConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BackendAuthenticationConfig message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.BackendAuthenticationConfig.verify|verify} messages. + * @param message BackendAuthenticationConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.networksecurity.v1.IBackendAuthenticationConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BackendAuthenticationConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BackendAuthenticationConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.networksecurity.v1.BackendAuthenticationConfig; + + /** + * Decodes a BackendAuthenticationConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BackendAuthenticationConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.networksecurity.v1.BackendAuthenticationConfig; + + /** + * Verifies a BackendAuthenticationConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BackendAuthenticationConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BackendAuthenticationConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.networksecurity.v1.BackendAuthenticationConfig; + + /** + * Creates a plain object from a BackendAuthenticationConfig message. Also converts values to other types if specified. + * @param message BackendAuthenticationConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.networksecurity.v1.BackendAuthenticationConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BackendAuthenticationConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BackendAuthenticationConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace BackendAuthenticationConfig { + + /** WellKnownRoots enum. */ + enum WellKnownRoots { + WELL_KNOWN_ROOTS_UNSPECIFIED = 0, + NONE = 1, + PUBLIC_ROOTS = 2 + } + } + + /** Properties of a ListBackendAuthenticationConfigsRequest. */ + interface IListBackendAuthenticationConfigsRequest { + + /** ListBackendAuthenticationConfigsRequest parent */ + parent?: (string|null); + + /** ListBackendAuthenticationConfigsRequest pageSize */ + pageSize?: (number|null); + + /** ListBackendAuthenticationConfigsRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListBackendAuthenticationConfigsRequest. */ + class ListBackendAuthenticationConfigsRequest implements IListBackendAuthenticationConfigsRequest { + + /** + * Constructs a new ListBackendAuthenticationConfigsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.networksecurity.v1.IListBackendAuthenticationConfigsRequest); + + /** ListBackendAuthenticationConfigsRequest parent. */ + public parent: string; + + /** ListBackendAuthenticationConfigsRequest pageSize. */ + public pageSize: number; + + /** ListBackendAuthenticationConfigsRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListBackendAuthenticationConfigsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListBackendAuthenticationConfigsRequest instance + */ + public static create(properties?: google.cloud.networksecurity.v1.IListBackendAuthenticationConfigsRequest): google.cloud.networksecurity.v1.ListBackendAuthenticationConfigsRequest; + + /** + * Encodes the specified ListBackendAuthenticationConfigsRequest message. Does not implicitly {@link google.cloud.networksecurity.v1.ListBackendAuthenticationConfigsRequest.verify|verify} messages. + * @param message ListBackendAuthenticationConfigsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.networksecurity.v1.IListBackendAuthenticationConfigsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListBackendAuthenticationConfigsRequest message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.ListBackendAuthenticationConfigsRequest.verify|verify} messages. + * @param message ListBackendAuthenticationConfigsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.networksecurity.v1.IListBackendAuthenticationConfigsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListBackendAuthenticationConfigsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListBackendAuthenticationConfigsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.networksecurity.v1.ListBackendAuthenticationConfigsRequest; + + /** + * Decodes a ListBackendAuthenticationConfigsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListBackendAuthenticationConfigsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.networksecurity.v1.ListBackendAuthenticationConfigsRequest; + + /** + * Verifies a ListBackendAuthenticationConfigsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListBackendAuthenticationConfigsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListBackendAuthenticationConfigsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.networksecurity.v1.ListBackendAuthenticationConfigsRequest; + + /** + * Creates a plain object from a ListBackendAuthenticationConfigsRequest message. Also converts values to other types if specified. + * @param message ListBackendAuthenticationConfigsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.networksecurity.v1.ListBackendAuthenticationConfigsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListBackendAuthenticationConfigsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListBackendAuthenticationConfigsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListBackendAuthenticationConfigsResponse. */ + interface IListBackendAuthenticationConfigsResponse { + + /** ListBackendAuthenticationConfigsResponse backendAuthenticationConfigs */ + backendAuthenticationConfigs?: (google.cloud.networksecurity.v1.IBackendAuthenticationConfig[]|null); + + /** ListBackendAuthenticationConfigsResponse nextPageToken */ + nextPageToken?: (string|null); + + /** ListBackendAuthenticationConfigsResponse unreachable */ + unreachable?: (string[]|null); + } + + /** Represents a ListBackendAuthenticationConfigsResponse. */ + class ListBackendAuthenticationConfigsResponse implements IListBackendAuthenticationConfigsResponse { + + /** + * Constructs a new ListBackendAuthenticationConfigsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.networksecurity.v1.IListBackendAuthenticationConfigsResponse); + + /** ListBackendAuthenticationConfigsResponse backendAuthenticationConfigs. */ + public backendAuthenticationConfigs: google.cloud.networksecurity.v1.IBackendAuthenticationConfig[]; + + /** ListBackendAuthenticationConfigsResponse nextPageToken. */ + public nextPageToken: string; + + /** ListBackendAuthenticationConfigsResponse unreachable. */ + public unreachable: string[]; + + /** + * Creates a new ListBackendAuthenticationConfigsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListBackendAuthenticationConfigsResponse instance + */ + public static create(properties?: google.cloud.networksecurity.v1.IListBackendAuthenticationConfigsResponse): google.cloud.networksecurity.v1.ListBackendAuthenticationConfigsResponse; + + /** + * Encodes the specified ListBackendAuthenticationConfigsResponse message. Does not implicitly {@link google.cloud.networksecurity.v1.ListBackendAuthenticationConfigsResponse.verify|verify} messages. + * @param message ListBackendAuthenticationConfigsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.networksecurity.v1.IListBackendAuthenticationConfigsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListBackendAuthenticationConfigsResponse message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.ListBackendAuthenticationConfigsResponse.verify|verify} messages. + * @param message ListBackendAuthenticationConfigsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.networksecurity.v1.IListBackendAuthenticationConfigsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListBackendAuthenticationConfigsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListBackendAuthenticationConfigsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.networksecurity.v1.ListBackendAuthenticationConfigsResponse; + + /** + * Decodes a ListBackendAuthenticationConfigsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListBackendAuthenticationConfigsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.networksecurity.v1.ListBackendAuthenticationConfigsResponse; + + /** + * Verifies a ListBackendAuthenticationConfigsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListBackendAuthenticationConfigsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListBackendAuthenticationConfigsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.networksecurity.v1.ListBackendAuthenticationConfigsResponse; + + /** + * Creates a plain object from a ListBackendAuthenticationConfigsResponse message. Also converts values to other types if specified. + * @param message ListBackendAuthenticationConfigsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.networksecurity.v1.ListBackendAuthenticationConfigsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListBackendAuthenticationConfigsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListBackendAuthenticationConfigsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetBackendAuthenticationConfigRequest. */ + interface IGetBackendAuthenticationConfigRequest { + + /** GetBackendAuthenticationConfigRequest name */ + name?: (string|null); + } + + /** Represents a GetBackendAuthenticationConfigRequest. */ + class GetBackendAuthenticationConfigRequest implements IGetBackendAuthenticationConfigRequest { + + /** + * Constructs a new GetBackendAuthenticationConfigRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.networksecurity.v1.IGetBackendAuthenticationConfigRequest); + + /** GetBackendAuthenticationConfigRequest name. */ + public name: string; + + /** + * Creates a new GetBackendAuthenticationConfigRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetBackendAuthenticationConfigRequest instance + */ + public static create(properties?: google.cloud.networksecurity.v1.IGetBackendAuthenticationConfigRequest): google.cloud.networksecurity.v1.GetBackendAuthenticationConfigRequest; + + /** + * Encodes the specified GetBackendAuthenticationConfigRequest message. Does not implicitly {@link google.cloud.networksecurity.v1.GetBackendAuthenticationConfigRequest.verify|verify} messages. + * @param message GetBackendAuthenticationConfigRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.networksecurity.v1.IGetBackendAuthenticationConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetBackendAuthenticationConfigRequest message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.GetBackendAuthenticationConfigRequest.verify|verify} messages. + * @param message GetBackendAuthenticationConfigRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.networksecurity.v1.IGetBackendAuthenticationConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetBackendAuthenticationConfigRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetBackendAuthenticationConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.networksecurity.v1.GetBackendAuthenticationConfigRequest; + + /** + * Decodes a GetBackendAuthenticationConfigRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetBackendAuthenticationConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.networksecurity.v1.GetBackendAuthenticationConfigRequest; + + /** + * Verifies a GetBackendAuthenticationConfigRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetBackendAuthenticationConfigRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetBackendAuthenticationConfigRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.networksecurity.v1.GetBackendAuthenticationConfigRequest; + + /** + * Creates a plain object from a GetBackendAuthenticationConfigRequest message. Also converts values to other types if specified. + * @param message GetBackendAuthenticationConfigRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.networksecurity.v1.GetBackendAuthenticationConfigRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetBackendAuthenticationConfigRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetBackendAuthenticationConfigRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateBackendAuthenticationConfigRequest. */ + interface ICreateBackendAuthenticationConfigRequest { + + /** CreateBackendAuthenticationConfigRequest parent */ + parent?: (string|null); + + /** CreateBackendAuthenticationConfigRequest backendAuthenticationConfigId */ + backendAuthenticationConfigId?: (string|null); + + /** CreateBackendAuthenticationConfigRequest backendAuthenticationConfig */ + backendAuthenticationConfig?: (google.cloud.networksecurity.v1.IBackendAuthenticationConfig|null); + } + + /** Represents a CreateBackendAuthenticationConfigRequest. */ + class CreateBackendAuthenticationConfigRequest implements ICreateBackendAuthenticationConfigRequest { + + /** + * Constructs a new CreateBackendAuthenticationConfigRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.networksecurity.v1.ICreateBackendAuthenticationConfigRequest); + + /** CreateBackendAuthenticationConfigRequest parent. */ + public parent: string; + + /** CreateBackendAuthenticationConfigRequest backendAuthenticationConfigId. */ + public backendAuthenticationConfigId: string; + + /** CreateBackendAuthenticationConfigRequest backendAuthenticationConfig. */ + public backendAuthenticationConfig?: (google.cloud.networksecurity.v1.IBackendAuthenticationConfig|null); + + /** + * Creates a new CreateBackendAuthenticationConfigRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateBackendAuthenticationConfigRequest instance + */ + public static create(properties?: google.cloud.networksecurity.v1.ICreateBackendAuthenticationConfigRequest): google.cloud.networksecurity.v1.CreateBackendAuthenticationConfigRequest; + + /** + * Encodes the specified CreateBackendAuthenticationConfigRequest message. Does not implicitly {@link google.cloud.networksecurity.v1.CreateBackendAuthenticationConfigRequest.verify|verify} messages. + * @param message CreateBackendAuthenticationConfigRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.networksecurity.v1.ICreateBackendAuthenticationConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateBackendAuthenticationConfigRequest message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.CreateBackendAuthenticationConfigRequest.verify|verify} messages. + * @param message CreateBackendAuthenticationConfigRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.networksecurity.v1.ICreateBackendAuthenticationConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateBackendAuthenticationConfigRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateBackendAuthenticationConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.networksecurity.v1.CreateBackendAuthenticationConfigRequest; + + /** + * Decodes a CreateBackendAuthenticationConfigRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateBackendAuthenticationConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.networksecurity.v1.CreateBackendAuthenticationConfigRequest; + + /** + * Verifies a CreateBackendAuthenticationConfigRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateBackendAuthenticationConfigRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateBackendAuthenticationConfigRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.networksecurity.v1.CreateBackendAuthenticationConfigRequest; + + /** + * Creates a plain object from a CreateBackendAuthenticationConfigRequest message. Also converts values to other types if specified. + * @param message CreateBackendAuthenticationConfigRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.networksecurity.v1.CreateBackendAuthenticationConfigRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateBackendAuthenticationConfigRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateBackendAuthenticationConfigRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateBackendAuthenticationConfigRequest. */ + interface IUpdateBackendAuthenticationConfigRequest { + + /** UpdateBackendAuthenticationConfigRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateBackendAuthenticationConfigRequest backendAuthenticationConfig */ + backendAuthenticationConfig?: (google.cloud.networksecurity.v1.IBackendAuthenticationConfig|null); + } + + /** Represents an UpdateBackendAuthenticationConfigRequest. */ + class UpdateBackendAuthenticationConfigRequest implements IUpdateBackendAuthenticationConfigRequest { + + /** + * Constructs a new UpdateBackendAuthenticationConfigRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.networksecurity.v1.IUpdateBackendAuthenticationConfigRequest); + + /** UpdateBackendAuthenticationConfigRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateBackendAuthenticationConfigRequest backendAuthenticationConfig. */ + public backendAuthenticationConfig?: (google.cloud.networksecurity.v1.IBackendAuthenticationConfig|null); + + /** + * Creates a new UpdateBackendAuthenticationConfigRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateBackendAuthenticationConfigRequest instance + */ + public static create(properties?: google.cloud.networksecurity.v1.IUpdateBackendAuthenticationConfigRequest): google.cloud.networksecurity.v1.UpdateBackendAuthenticationConfigRequest; + + /** + * Encodes the specified UpdateBackendAuthenticationConfigRequest message. Does not implicitly {@link google.cloud.networksecurity.v1.UpdateBackendAuthenticationConfigRequest.verify|verify} messages. + * @param message UpdateBackendAuthenticationConfigRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.networksecurity.v1.IUpdateBackendAuthenticationConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateBackendAuthenticationConfigRequest message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.UpdateBackendAuthenticationConfigRequest.verify|verify} messages. + * @param message UpdateBackendAuthenticationConfigRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.networksecurity.v1.IUpdateBackendAuthenticationConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateBackendAuthenticationConfigRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateBackendAuthenticationConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.networksecurity.v1.UpdateBackendAuthenticationConfigRequest; + + /** + * Decodes an UpdateBackendAuthenticationConfigRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateBackendAuthenticationConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.networksecurity.v1.UpdateBackendAuthenticationConfigRequest; + + /** + * Verifies an UpdateBackendAuthenticationConfigRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UpdateBackendAuthenticationConfigRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateBackendAuthenticationConfigRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.networksecurity.v1.UpdateBackendAuthenticationConfigRequest; + + /** + * Creates a plain object from an UpdateBackendAuthenticationConfigRequest message. Also converts values to other types if specified. + * @param message UpdateBackendAuthenticationConfigRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.networksecurity.v1.UpdateBackendAuthenticationConfigRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateBackendAuthenticationConfigRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateBackendAuthenticationConfigRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteBackendAuthenticationConfigRequest. */ + interface IDeleteBackendAuthenticationConfigRequest { + + /** DeleteBackendAuthenticationConfigRequest name */ + name?: (string|null); + + /** DeleteBackendAuthenticationConfigRequest etag */ + etag?: (string|null); + } + + /** Represents a DeleteBackendAuthenticationConfigRequest. */ + class DeleteBackendAuthenticationConfigRequest implements IDeleteBackendAuthenticationConfigRequest { + + /** + * Constructs a new DeleteBackendAuthenticationConfigRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.networksecurity.v1.IDeleteBackendAuthenticationConfigRequest); + + /** DeleteBackendAuthenticationConfigRequest name. */ + public name: string; + + /** DeleteBackendAuthenticationConfigRequest etag. */ + public etag: string; + + /** + * Creates a new DeleteBackendAuthenticationConfigRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteBackendAuthenticationConfigRequest instance + */ + public static create(properties?: google.cloud.networksecurity.v1.IDeleteBackendAuthenticationConfigRequest): google.cloud.networksecurity.v1.DeleteBackendAuthenticationConfigRequest; + + /** + * Encodes the specified DeleteBackendAuthenticationConfigRequest message. Does not implicitly {@link google.cloud.networksecurity.v1.DeleteBackendAuthenticationConfigRequest.verify|verify} messages. + * @param message DeleteBackendAuthenticationConfigRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.networksecurity.v1.IDeleteBackendAuthenticationConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteBackendAuthenticationConfigRequest message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.DeleteBackendAuthenticationConfigRequest.verify|verify} messages. + * @param message DeleteBackendAuthenticationConfigRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.networksecurity.v1.IDeleteBackendAuthenticationConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteBackendAuthenticationConfigRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteBackendAuthenticationConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.networksecurity.v1.DeleteBackendAuthenticationConfigRequest; + + /** + * Decodes a DeleteBackendAuthenticationConfigRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteBackendAuthenticationConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.networksecurity.v1.DeleteBackendAuthenticationConfigRequest; + + /** + * Verifies a DeleteBackendAuthenticationConfigRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteBackendAuthenticationConfigRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteBackendAuthenticationConfigRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.networksecurity.v1.DeleteBackendAuthenticationConfigRequest; + + /** + * Creates a plain object from a DeleteBackendAuthenticationConfigRequest message. Also converts values to other types if specified. + * @param message DeleteBackendAuthenticationConfigRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.networksecurity.v1.DeleteBackendAuthenticationConfigRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteBackendAuthenticationConfigRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteBackendAuthenticationConfigRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ClientTlsPolicy. */ + interface IClientTlsPolicy { + + /** ClientTlsPolicy name */ + name?: (string|null); + + /** ClientTlsPolicy description */ + description?: (string|null); + + /** ClientTlsPolicy createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** ClientTlsPolicy updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** ClientTlsPolicy labels */ + labels?: ({ [k: string]: string }|null); + + /** ClientTlsPolicy sni */ + sni?: (string|null); + + /** ClientTlsPolicy clientCertificate */ + clientCertificate?: (google.cloud.networksecurity.v1.ICertificateProvider|null); + + /** ClientTlsPolicy serverValidationCa */ + serverValidationCa?: (google.cloud.networksecurity.v1.IValidationCA[]|null); + } + + /** Represents a ClientTlsPolicy. */ + class ClientTlsPolicy implements IClientTlsPolicy { + + /** + * Constructs a new ClientTlsPolicy. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.networksecurity.v1.IClientTlsPolicy); + + /** ClientTlsPolicy name. */ + public name: string; + + /** ClientTlsPolicy description. */ + public description: string; + + /** ClientTlsPolicy createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** ClientTlsPolicy updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** ClientTlsPolicy labels. */ + public labels: { [k: string]: string }; + + /** ClientTlsPolicy sni. */ + public sni: string; + + /** ClientTlsPolicy clientCertificate. */ + public clientCertificate?: (google.cloud.networksecurity.v1.ICertificateProvider|null); + + /** ClientTlsPolicy serverValidationCa. */ + public serverValidationCa: google.cloud.networksecurity.v1.IValidationCA[]; + + /** + * Creates a new ClientTlsPolicy instance using the specified properties. + * @param [properties] Properties to set + * @returns ClientTlsPolicy instance + */ + public static create(properties?: google.cloud.networksecurity.v1.IClientTlsPolicy): google.cloud.networksecurity.v1.ClientTlsPolicy; + + /** + * Encodes the specified ClientTlsPolicy message. Does not implicitly {@link google.cloud.networksecurity.v1.ClientTlsPolicy.verify|verify} messages. + * @param message ClientTlsPolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.networksecurity.v1.IClientTlsPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ClientTlsPolicy message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.ClientTlsPolicy.verify|verify} messages. + * @param message ClientTlsPolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.networksecurity.v1.IClientTlsPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ClientTlsPolicy message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ClientTlsPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.networksecurity.v1.ClientTlsPolicy; + + /** + * Decodes a ClientTlsPolicy message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ClientTlsPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.networksecurity.v1.ClientTlsPolicy; + + /** + * Verifies a ClientTlsPolicy message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ClientTlsPolicy message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ClientTlsPolicy + */ + public static fromObject(object: { [k: string]: any }): google.cloud.networksecurity.v1.ClientTlsPolicy; + + /** + * Creates a plain object from a ClientTlsPolicy message. Also converts values to other types if specified. + * @param message ClientTlsPolicy + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.networksecurity.v1.ClientTlsPolicy, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ClientTlsPolicy to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ClientTlsPolicy + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListClientTlsPoliciesRequest. */ + interface IListClientTlsPoliciesRequest { + + /** ListClientTlsPoliciesRequest parent */ + parent?: (string|null); + + /** ListClientTlsPoliciesRequest pageSize */ + pageSize?: (number|null); + + /** ListClientTlsPoliciesRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListClientTlsPoliciesRequest. */ + class ListClientTlsPoliciesRequest implements IListClientTlsPoliciesRequest { + + /** + * Constructs a new ListClientTlsPoliciesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.networksecurity.v1.IListClientTlsPoliciesRequest); + + /** ListClientTlsPoliciesRequest parent. */ + public parent: string; + + /** ListClientTlsPoliciesRequest pageSize. */ + public pageSize: number; + + /** ListClientTlsPoliciesRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListClientTlsPoliciesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListClientTlsPoliciesRequest instance + */ + public static create(properties?: google.cloud.networksecurity.v1.IListClientTlsPoliciesRequest): google.cloud.networksecurity.v1.ListClientTlsPoliciesRequest; + + /** + * Encodes the specified ListClientTlsPoliciesRequest message. Does not implicitly {@link google.cloud.networksecurity.v1.ListClientTlsPoliciesRequest.verify|verify} messages. + * @param message ListClientTlsPoliciesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.networksecurity.v1.IListClientTlsPoliciesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListClientTlsPoliciesRequest message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.ListClientTlsPoliciesRequest.verify|verify} messages. + * @param message ListClientTlsPoliciesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.networksecurity.v1.IListClientTlsPoliciesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListClientTlsPoliciesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListClientTlsPoliciesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.networksecurity.v1.ListClientTlsPoliciesRequest; + + /** + * Decodes a ListClientTlsPoliciesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListClientTlsPoliciesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.networksecurity.v1.ListClientTlsPoliciesRequest; + + /** + * Verifies a ListClientTlsPoliciesRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListClientTlsPoliciesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListClientTlsPoliciesRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.networksecurity.v1.ListClientTlsPoliciesRequest; + + /** + * Creates a plain object from a ListClientTlsPoliciesRequest message. Also converts values to other types if specified. + * @param message ListClientTlsPoliciesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.networksecurity.v1.ListClientTlsPoliciesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListClientTlsPoliciesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListClientTlsPoliciesRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListClientTlsPoliciesResponse. */ + interface IListClientTlsPoliciesResponse { + + /** ListClientTlsPoliciesResponse clientTlsPolicies */ + clientTlsPolicies?: (google.cloud.networksecurity.v1.IClientTlsPolicy[]|null); + + /** ListClientTlsPoliciesResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListClientTlsPoliciesResponse. */ + class ListClientTlsPoliciesResponse implements IListClientTlsPoliciesResponse { + + /** + * Constructs a new ListClientTlsPoliciesResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.networksecurity.v1.IListClientTlsPoliciesResponse); + + /** ListClientTlsPoliciesResponse clientTlsPolicies. */ + public clientTlsPolicies: google.cloud.networksecurity.v1.IClientTlsPolicy[]; + + /** ListClientTlsPoliciesResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListClientTlsPoliciesResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListClientTlsPoliciesResponse instance + */ + public static create(properties?: google.cloud.networksecurity.v1.IListClientTlsPoliciesResponse): google.cloud.networksecurity.v1.ListClientTlsPoliciesResponse; + + /** + * Encodes the specified ListClientTlsPoliciesResponse message. Does not implicitly {@link google.cloud.networksecurity.v1.ListClientTlsPoliciesResponse.verify|verify} messages. + * @param message ListClientTlsPoliciesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.networksecurity.v1.IListClientTlsPoliciesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListClientTlsPoliciesResponse message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.ListClientTlsPoliciesResponse.verify|verify} messages. + * @param message ListClientTlsPoliciesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.networksecurity.v1.IListClientTlsPoliciesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListClientTlsPoliciesResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListClientTlsPoliciesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.networksecurity.v1.ListClientTlsPoliciesResponse; + + /** + * Decodes a ListClientTlsPoliciesResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListClientTlsPoliciesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.networksecurity.v1.ListClientTlsPoliciesResponse; + + /** + * Verifies a ListClientTlsPoliciesResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListClientTlsPoliciesResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListClientTlsPoliciesResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.networksecurity.v1.ListClientTlsPoliciesResponse; + + /** + * Creates a plain object from a ListClientTlsPoliciesResponse message. Also converts values to other types if specified. + * @param message ListClientTlsPoliciesResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.networksecurity.v1.ListClientTlsPoliciesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListClientTlsPoliciesResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListClientTlsPoliciesResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetClientTlsPolicyRequest. */ + interface IGetClientTlsPolicyRequest { + + /** GetClientTlsPolicyRequest name */ + name?: (string|null); + } + + /** Represents a GetClientTlsPolicyRequest. */ + class GetClientTlsPolicyRequest implements IGetClientTlsPolicyRequest { + + /** + * Constructs a new GetClientTlsPolicyRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.networksecurity.v1.IGetClientTlsPolicyRequest); + + /** GetClientTlsPolicyRequest name. */ + public name: string; + + /** + * Creates a new GetClientTlsPolicyRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetClientTlsPolicyRequest instance + */ + public static create(properties?: google.cloud.networksecurity.v1.IGetClientTlsPolicyRequest): google.cloud.networksecurity.v1.GetClientTlsPolicyRequest; + + /** + * Encodes the specified GetClientTlsPolicyRequest message. Does not implicitly {@link google.cloud.networksecurity.v1.GetClientTlsPolicyRequest.verify|verify} messages. + * @param message GetClientTlsPolicyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.networksecurity.v1.IGetClientTlsPolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetClientTlsPolicyRequest message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.GetClientTlsPolicyRequest.verify|verify} messages. + * @param message GetClientTlsPolicyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.networksecurity.v1.IGetClientTlsPolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetClientTlsPolicyRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetClientTlsPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.networksecurity.v1.GetClientTlsPolicyRequest; + + /** + * Decodes a GetClientTlsPolicyRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetClientTlsPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.networksecurity.v1.GetClientTlsPolicyRequest; + + /** + * Verifies a GetClientTlsPolicyRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetClientTlsPolicyRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetClientTlsPolicyRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.networksecurity.v1.GetClientTlsPolicyRequest; + + /** + * Creates a plain object from a GetClientTlsPolicyRequest message. Also converts values to other types if specified. + * @param message GetClientTlsPolicyRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.networksecurity.v1.GetClientTlsPolicyRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetClientTlsPolicyRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetClientTlsPolicyRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateClientTlsPolicyRequest. */ + interface ICreateClientTlsPolicyRequest { + + /** CreateClientTlsPolicyRequest parent */ + parent?: (string|null); + + /** CreateClientTlsPolicyRequest clientTlsPolicyId */ + clientTlsPolicyId?: (string|null); + + /** CreateClientTlsPolicyRequest clientTlsPolicy */ + clientTlsPolicy?: (google.cloud.networksecurity.v1.IClientTlsPolicy|null); + } + + /** Represents a CreateClientTlsPolicyRequest. */ + class CreateClientTlsPolicyRequest implements ICreateClientTlsPolicyRequest { + + /** + * Constructs a new CreateClientTlsPolicyRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.networksecurity.v1.ICreateClientTlsPolicyRequest); + + /** CreateClientTlsPolicyRequest parent. */ + public parent: string; + + /** CreateClientTlsPolicyRequest clientTlsPolicyId. */ + public clientTlsPolicyId: string; + + /** CreateClientTlsPolicyRequest clientTlsPolicy. */ + public clientTlsPolicy?: (google.cloud.networksecurity.v1.IClientTlsPolicy|null); + + /** + * Creates a new CreateClientTlsPolicyRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateClientTlsPolicyRequest instance + */ + public static create(properties?: google.cloud.networksecurity.v1.ICreateClientTlsPolicyRequest): google.cloud.networksecurity.v1.CreateClientTlsPolicyRequest; + + /** + * Encodes the specified CreateClientTlsPolicyRequest message. Does not implicitly {@link google.cloud.networksecurity.v1.CreateClientTlsPolicyRequest.verify|verify} messages. + * @param message CreateClientTlsPolicyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.networksecurity.v1.ICreateClientTlsPolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateClientTlsPolicyRequest message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.CreateClientTlsPolicyRequest.verify|verify} messages. + * @param message CreateClientTlsPolicyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.networksecurity.v1.ICreateClientTlsPolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateClientTlsPolicyRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateClientTlsPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.networksecurity.v1.CreateClientTlsPolicyRequest; + + /** + * Decodes a CreateClientTlsPolicyRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateClientTlsPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.networksecurity.v1.CreateClientTlsPolicyRequest; + + /** + * Verifies a CreateClientTlsPolicyRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateClientTlsPolicyRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateClientTlsPolicyRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.networksecurity.v1.CreateClientTlsPolicyRequest; + + /** + * Creates a plain object from a CreateClientTlsPolicyRequest message. Also converts values to other types if specified. + * @param message CreateClientTlsPolicyRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.networksecurity.v1.CreateClientTlsPolicyRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateClientTlsPolicyRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateClientTlsPolicyRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateClientTlsPolicyRequest. */ + interface IUpdateClientTlsPolicyRequest { + + /** UpdateClientTlsPolicyRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateClientTlsPolicyRequest clientTlsPolicy */ + clientTlsPolicy?: (google.cloud.networksecurity.v1.IClientTlsPolicy|null); + } + + /** Represents an UpdateClientTlsPolicyRequest. */ + class UpdateClientTlsPolicyRequest implements IUpdateClientTlsPolicyRequest { + + /** + * Constructs a new UpdateClientTlsPolicyRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.networksecurity.v1.IUpdateClientTlsPolicyRequest); + + /** UpdateClientTlsPolicyRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateClientTlsPolicyRequest clientTlsPolicy. */ + public clientTlsPolicy?: (google.cloud.networksecurity.v1.IClientTlsPolicy|null); + + /** + * Creates a new UpdateClientTlsPolicyRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateClientTlsPolicyRequest instance + */ + public static create(properties?: google.cloud.networksecurity.v1.IUpdateClientTlsPolicyRequest): google.cloud.networksecurity.v1.UpdateClientTlsPolicyRequest; + + /** + * Encodes the specified UpdateClientTlsPolicyRequest message. Does not implicitly {@link google.cloud.networksecurity.v1.UpdateClientTlsPolicyRequest.verify|verify} messages. + * @param message UpdateClientTlsPolicyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.networksecurity.v1.IUpdateClientTlsPolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateClientTlsPolicyRequest message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.UpdateClientTlsPolicyRequest.verify|verify} messages. + * @param message UpdateClientTlsPolicyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.networksecurity.v1.IUpdateClientTlsPolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateClientTlsPolicyRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateClientTlsPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.networksecurity.v1.UpdateClientTlsPolicyRequest; + + /** + * Decodes an UpdateClientTlsPolicyRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateClientTlsPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.networksecurity.v1.UpdateClientTlsPolicyRequest; + + /** + * Verifies an UpdateClientTlsPolicyRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UpdateClientTlsPolicyRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateClientTlsPolicyRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.networksecurity.v1.UpdateClientTlsPolicyRequest; + + /** + * Creates a plain object from an UpdateClientTlsPolicyRequest message. Also converts values to other types if specified. + * @param message UpdateClientTlsPolicyRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.networksecurity.v1.UpdateClientTlsPolicyRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateClientTlsPolicyRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateClientTlsPolicyRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteClientTlsPolicyRequest. */ + interface IDeleteClientTlsPolicyRequest { + + /** DeleteClientTlsPolicyRequest name */ + name?: (string|null); + } + + /** Represents a DeleteClientTlsPolicyRequest. */ + class DeleteClientTlsPolicyRequest implements IDeleteClientTlsPolicyRequest { + + /** + * Constructs a new DeleteClientTlsPolicyRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.networksecurity.v1.IDeleteClientTlsPolicyRequest); + + /** DeleteClientTlsPolicyRequest name. */ + public name: string; + + /** + * Creates a new DeleteClientTlsPolicyRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteClientTlsPolicyRequest instance + */ + public static create(properties?: google.cloud.networksecurity.v1.IDeleteClientTlsPolicyRequest): google.cloud.networksecurity.v1.DeleteClientTlsPolicyRequest; + + /** + * Encodes the specified DeleteClientTlsPolicyRequest message. Does not implicitly {@link google.cloud.networksecurity.v1.DeleteClientTlsPolicyRequest.verify|verify} messages. + * @param message DeleteClientTlsPolicyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.networksecurity.v1.IDeleteClientTlsPolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteClientTlsPolicyRequest message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.DeleteClientTlsPolicyRequest.verify|verify} messages. + * @param message DeleteClientTlsPolicyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.networksecurity.v1.IDeleteClientTlsPolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteClientTlsPolicyRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteClientTlsPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.networksecurity.v1.DeleteClientTlsPolicyRequest; + + /** + * Decodes a DeleteClientTlsPolicyRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteClientTlsPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.networksecurity.v1.DeleteClientTlsPolicyRequest; + + /** + * Verifies a DeleteClientTlsPolicyRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteClientTlsPolicyRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteClientTlsPolicyRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.networksecurity.v1.DeleteClientTlsPolicyRequest; + + /** + * Creates a plain object from a DeleteClientTlsPolicyRequest message. Also converts values to other types if specified. + * @param message DeleteClientTlsPolicyRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.networksecurity.v1.DeleteClientTlsPolicyRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteClientTlsPolicyRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteClientTlsPolicyRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GrpcEndpoint. */ + interface IGrpcEndpoint { + + /** GrpcEndpoint targetUri */ + targetUri?: (string|null); + } + + /** Represents a GrpcEndpoint. */ + class GrpcEndpoint implements IGrpcEndpoint { + + /** + * Constructs a new GrpcEndpoint. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.networksecurity.v1.IGrpcEndpoint); + + /** GrpcEndpoint targetUri. */ + public targetUri: string; + + /** + * Creates a new GrpcEndpoint instance using the specified properties. + * @param [properties] Properties to set + * @returns GrpcEndpoint instance + */ + public static create(properties?: google.cloud.networksecurity.v1.IGrpcEndpoint): google.cloud.networksecurity.v1.GrpcEndpoint; + + /** + * Encodes the specified GrpcEndpoint message. Does not implicitly {@link google.cloud.networksecurity.v1.GrpcEndpoint.verify|verify} messages. + * @param message GrpcEndpoint message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.networksecurity.v1.IGrpcEndpoint, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GrpcEndpoint message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.GrpcEndpoint.verify|verify} messages. + * @param message GrpcEndpoint message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.networksecurity.v1.IGrpcEndpoint, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GrpcEndpoint message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GrpcEndpoint + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.networksecurity.v1.GrpcEndpoint; + + /** + * Decodes a GrpcEndpoint message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GrpcEndpoint + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.networksecurity.v1.GrpcEndpoint; + + /** + * Verifies a GrpcEndpoint message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GrpcEndpoint message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GrpcEndpoint + */ + public static fromObject(object: { [k: string]: any }): google.cloud.networksecurity.v1.GrpcEndpoint; + + /** + * Creates a plain object from a GrpcEndpoint message. Also converts values to other types if specified. + * @param message GrpcEndpoint + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.networksecurity.v1.GrpcEndpoint, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GrpcEndpoint to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GrpcEndpoint + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ValidationCA. */ + interface IValidationCA { + + /** ValidationCA grpcEndpoint */ + grpcEndpoint?: (google.cloud.networksecurity.v1.IGrpcEndpoint|null); + + /** ValidationCA certificateProviderInstance */ + certificateProviderInstance?: (google.cloud.networksecurity.v1.ICertificateProviderInstance|null); + } + + /** Represents a ValidationCA. */ + class ValidationCA implements IValidationCA { + + /** + * Constructs a new ValidationCA. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.networksecurity.v1.IValidationCA); + + /** ValidationCA grpcEndpoint. */ + public grpcEndpoint?: (google.cloud.networksecurity.v1.IGrpcEndpoint|null); + + /** ValidationCA certificateProviderInstance. */ + public certificateProviderInstance?: (google.cloud.networksecurity.v1.ICertificateProviderInstance|null); + + /** ValidationCA type. */ + public type?: ("grpcEndpoint"|"certificateProviderInstance"); + + /** + * Creates a new ValidationCA instance using the specified properties. + * @param [properties] Properties to set + * @returns ValidationCA instance + */ + public static create(properties?: google.cloud.networksecurity.v1.IValidationCA): google.cloud.networksecurity.v1.ValidationCA; + + /** + * Encodes the specified ValidationCA message. Does not implicitly {@link google.cloud.networksecurity.v1.ValidationCA.verify|verify} messages. + * @param message ValidationCA message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.networksecurity.v1.IValidationCA, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ValidationCA message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.ValidationCA.verify|verify} messages. + * @param message ValidationCA message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.networksecurity.v1.IValidationCA, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ValidationCA message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ValidationCA + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.networksecurity.v1.ValidationCA; + + /** + * Decodes a ValidationCA message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ValidationCA + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.networksecurity.v1.ValidationCA; + + /** + * Verifies a ValidationCA message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ValidationCA message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ValidationCA + */ + public static fromObject(object: { [k: string]: any }): google.cloud.networksecurity.v1.ValidationCA; + + /** + * Creates a plain object from a ValidationCA message. Also converts values to other types if specified. + * @param message ValidationCA + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.networksecurity.v1.ValidationCA, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ValidationCA to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ValidationCA + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CertificateProviderInstance. */ + interface ICertificateProviderInstance { + + /** CertificateProviderInstance pluginInstance */ + pluginInstance?: (string|null); + } + + /** Represents a CertificateProviderInstance. */ + class CertificateProviderInstance implements ICertificateProviderInstance { + + /** + * Constructs a new CertificateProviderInstance. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.networksecurity.v1.ICertificateProviderInstance); + + /** CertificateProviderInstance pluginInstance. */ + public pluginInstance: string; + + /** + * Creates a new CertificateProviderInstance instance using the specified properties. + * @param [properties] Properties to set + * @returns CertificateProviderInstance instance + */ + public static create(properties?: google.cloud.networksecurity.v1.ICertificateProviderInstance): google.cloud.networksecurity.v1.CertificateProviderInstance; + + /** + * Encodes the specified CertificateProviderInstance message. Does not implicitly {@link google.cloud.networksecurity.v1.CertificateProviderInstance.verify|verify} messages. + * @param message CertificateProviderInstance message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.networksecurity.v1.ICertificateProviderInstance, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CertificateProviderInstance message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.CertificateProviderInstance.verify|verify} messages. + * @param message CertificateProviderInstance message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.networksecurity.v1.ICertificateProviderInstance, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CertificateProviderInstance message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CertificateProviderInstance + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.networksecurity.v1.CertificateProviderInstance; + + /** + * Decodes a CertificateProviderInstance message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CertificateProviderInstance + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.networksecurity.v1.CertificateProviderInstance; + + /** + * Verifies a CertificateProviderInstance message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CertificateProviderInstance message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CertificateProviderInstance + */ + public static fromObject(object: { [k: string]: any }): google.cloud.networksecurity.v1.CertificateProviderInstance; + + /** + * Creates a plain object from a CertificateProviderInstance message. Also converts values to other types if specified. + * @param message CertificateProviderInstance + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.networksecurity.v1.CertificateProviderInstance, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CertificateProviderInstance to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CertificateProviderInstance + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CertificateProvider. */ + interface ICertificateProvider { + + /** CertificateProvider grpcEndpoint */ + grpcEndpoint?: (google.cloud.networksecurity.v1.IGrpcEndpoint|null); + + /** CertificateProvider certificateProviderInstance */ + certificateProviderInstance?: (google.cloud.networksecurity.v1.ICertificateProviderInstance|null); + } + + /** Represents a CertificateProvider. */ + class CertificateProvider implements ICertificateProvider { + + /** + * Constructs a new CertificateProvider. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.networksecurity.v1.ICertificateProvider); + + /** CertificateProvider grpcEndpoint. */ + public grpcEndpoint?: (google.cloud.networksecurity.v1.IGrpcEndpoint|null); + + /** CertificateProvider certificateProviderInstance. */ + public certificateProviderInstance?: (google.cloud.networksecurity.v1.ICertificateProviderInstance|null); + + /** CertificateProvider type. */ + public type?: ("grpcEndpoint"|"certificateProviderInstance"); + + /** + * Creates a new CertificateProvider instance using the specified properties. + * @param [properties] Properties to set + * @returns CertificateProvider instance + */ + public static create(properties?: google.cloud.networksecurity.v1.ICertificateProvider): google.cloud.networksecurity.v1.CertificateProvider; + + /** + * Encodes the specified CertificateProvider message. Does not implicitly {@link google.cloud.networksecurity.v1.CertificateProvider.verify|verify} messages. + * @param message CertificateProvider message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.networksecurity.v1.ICertificateProvider, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CertificateProvider message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.CertificateProvider.verify|verify} messages. + * @param message CertificateProvider message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.networksecurity.v1.ICertificateProvider, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CertificateProvider message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CertificateProvider + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.networksecurity.v1.CertificateProvider; + + /** + * Decodes a CertificateProvider message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CertificateProvider + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.networksecurity.v1.CertificateProvider; + + /** + * Verifies a CertificateProvider message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CertificateProvider message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CertificateProvider + */ + public static fromObject(object: { [k: string]: any }): google.cloud.networksecurity.v1.CertificateProvider; + + /** + * Creates a plain object from a CertificateProvider message. Also converts values to other types if specified. + * @param message CertificateProvider + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.networksecurity.v1.CertificateProvider, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CertificateProvider to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CertificateProvider + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Represents a DnsThreatDetectorService */ + class DnsThreatDetectorService extends $protobuf.rpc.Service { + + /** + * Constructs a new DnsThreatDetectorService service. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + */ + constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); + + /** + * Creates new DnsThreatDetectorService service using the specified rpc implementation. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + * @returns RPC service. Useful where requests and/or responses are streamed. + */ + public static create(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean): DnsThreatDetectorService; + + /** + * Calls ListDnsThreatDetectors. + * @param request ListDnsThreatDetectorsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListDnsThreatDetectorsResponse + */ + public listDnsThreatDetectors(request: google.cloud.networksecurity.v1.IListDnsThreatDetectorsRequest, callback: google.cloud.networksecurity.v1.DnsThreatDetectorService.ListDnsThreatDetectorsCallback): void; + + /** + * Calls ListDnsThreatDetectors. + * @param request ListDnsThreatDetectorsRequest message or plain object + * @returns Promise + */ + public listDnsThreatDetectors(request: google.cloud.networksecurity.v1.IListDnsThreatDetectorsRequest): Promise; + + /** + * Calls GetDnsThreatDetector. + * @param request GetDnsThreatDetectorRequest message or plain object + * @param callback Node-style callback called with the error, if any, and DnsThreatDetector + */ + public getDnsThreatDetector(request: google.cloud.networksecurity.v1.IGetDnsThreatDetectorRequest, callback: google.cloud.networksecurity.v1.DnsThreatDetectorService.GetDnsThreatDetectorCallback): void; + + /** + * Calls GetDnsThreatDetector. + * @param request GetDnsThreatDetectorRequest message or plain object + * @returns Promise + */ + public getDnsThreatDetector(request: google.cloud.networksecurity.v1.IGetDnsThreatDetectorRequest): Promise; + + /** + * Calls CreateDnsThreatDetector. + * @param request CreateDnsThreatDetectorRequest message or plain object + * @param callback Node-style callback called with the error, if any, and DnsThreatDetector + */ + public createDnsThreatDetector(request: google.cloud.networksecurity.v1.ICreateDnsThreatDetectorRequest, callback: google.cloud.networksecurity.v1.DnsThreatDetectorService.CreateDnsThreatDetectorCallback): void; + + /** + * Calls CreateDnsThreatDetector. + * @param request CreateDnsThreatDetectorRequest message or plain object + * @returns Promise + */ + public createDnsThreatDetector(request: google.cloud.networksecurity.v1.ICreateDnsThreatDetectorRequest): Promise; + + /** + * Calls UpdateDnsThreatDetector. + * @param request UpdateDnsThreatDetectorRequest message or plain object + * @param callback Node-style callback called with the error, if any, and DnsThreatDetector + */ + public updateDnsThreatDetector(request: google.cloud.networksecurity.v1.IUpdateDnsThreatDetectorRequest, callback: google.cloud.networksecurity.v1.DnsThreatDetectorService.UpdateDnsThreatDetectorCallback): void; + + /** + * Calls UpdateDnsThreatDetector. + * @param request UpdateDnsThreatDetectorRequest message or plain object + * @returns Promise + */ + public updateDnsThreatDetector(request: google.cloud.networksecurity.v1.IUpdateDnsThreatDetectorRequest): Promise; + + /** + * Calls DeleteDnsThreatDetector. + * @param request DeleteDnsThreatDetectorRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteDnsThreatDetector(request: google.cloud.networksecurity.v1.IDeleteDnsThreatDetectorRequest, callback: google.cloud.networksecurity.v1.DnsThreatDetectorService.DeleteDnsThreatDetectorCallback): void; + + /** + * Calls DeleteDnsThreatDetector. + * @param request DeleteDnsThreatDetectorRequest message or plain object + * @returns Promise + */ + public deleteDnsThreatDetector(request: google.cloud.networksecurity.v1.IDeleteDnsThreatDetectorRequest): Promise; + } + + namespace DnsThreatDetectorService { + + /** + * Callback as used by {@link google.cloud.networksecurity.v1.DnsThreatDetectorService|listDnsThreatDetectors}. + * @param error Error, if any + * @param [response] ListDnsThreatDetectorsResponse + */ + type ListDnsThreatDetectorsCallback = (error: (Error|null), response?: google.cloud.networksecurity.v1.ListDnsThreatDetectorsResponse) => void; + + /** + * Callback as used by {@link google.cloud.networksecurity.v1.DnsThreatDetectorService|getDnsThreatDetector}. + * @param error Error, if any + * @param [response] DnsThreatDetector + */ + type GetDnsThreatDetectorCallback = (error: (Error|null), response?: google.cloud.networksecurity.v1.DnsThreatDetector) => void; + + /** + * Callback as used by {@link google.cloud.networksecurity.v1.DnsThreatDetectorService|createDnsThreatDetector}. + * @param error Error, if any + * @param [response] DnsThreatDetector + */ + type CreateDnsThreatDetectorCallback = (error: (Error|null), response?: google.cloud.networksecurity.v1.DnsThreatDetector) => void; + + /** + * Callback as used by {@link google.cloud.networksecurity.v1.DnsThreatDetectorService|updateDnsThreatDetector}. + * @param error Error, if any + * @param [response] DnsThreatDetector + */ + type UpdateDnsThreatDetectorCallback = (error: (Error|null), response?: google.cloud.networksecurity.v1.DnsThreatDetector) => void; + + /** + * Callback as used by {@link google.cloud.networksecurity.v1.DnsThreatDetectorService|deleteDnsThreatDetector}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteDnsThreatDetectorCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + } + + /** Properties of a DnsThreatDetector. */ + interface IDnsThreatDetector { + + /** DnsThreatDetector name */ + name?: (string|null); + + /** DnsThreatDetector createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** DnsThreatDetector updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** DnsThreatDetector labels */ + labels?: ({ [k: string]: string }|null); + + /** DnsThreatDetector excludedNetworks */ + excludedNetworks?: (string[]|null); + + /** DnsThreatDetector provider */ + provider?: (google.cloud.networksecurity.v1.DnsThreatDetector.Provider|keyof typeof google.cloud.networksecurity.v1.DnsThreatDetector.Provider|null); + } + + /** Represents a DnsThreatDetector. */ + class DnsThreatDetector implements IDnsThreatDetector { + + /** + * Constructs a new DnsThreatDetector. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.networksecurity.v1.IDnsThreatDetector); + + /** DnsThreatDetector name. */ + public name: string; + + /** DnsThreatDetector createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** DnsThreatDetector updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** DnsThreatDetector labels. */ + public labels: { [k: string]: string }; + + /** DnsThreatDetector excludedNetworks. */ + public excludedNetworks: string[]; + + /** DnsThreatDetector provider. */ + public provider: (google.cloud.networksecurity.v1.DnsThreatDetector.Provider|keyof typeof google.cloud.networksecurity.v1.DnsThreatDetector.Provider); + + /** + * Creates a new DnsThreatDetector instance using the specified properties. + * @param [properties] Properties to set + * @returns DnsThreatDetector instance + */ + public static create(properties?: google.cloud.networksecurity.v1.IDnsThreatDetector): google.cloud.networksecurity.v1.DnsThreatDetector; + + /** + * Encodes the specified DnsThreatDetector message. Does not implicitly {@link google.cloud.networksecurity.v1.DnsThreatDetector.verify|verify} messages. + * @param message DnsThreatDetector message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.networksecurity.v1.IDnsThreatDetector, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DnsThreatDetector message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.DnsThreatDetector.verify|verify} messages. + * @param message DnsThreatDetector message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.networksecurity.v1.IDnsThreatDetector, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DnsThreatDetector message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DnsThreatDetector + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.networksecurity.v1.DnsThreatDetector; + + /** + * Decodes a DnsThreatDetector message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DnsThreatDetector + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.networksecurity.v1.DnsThreatDetector; + + /** + * Verifies a DnsThreatDetector message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DnsThreatDetector message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DnsThreatDetector + */ + public static fromObject(object: { [k: string]: any }): google.cloud.networksecurity.v1.DnsThreatDetector; + + /** + * Creates a plain object from a DnsThreatDetector message. Also converts values to other types if specified. + * @param message DnsThreatDetector + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.networksecurity.v1.DnsThreatDetector, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DnsThreatDetector to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DnsThreatDetector + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace DnsThreatDetector { + + /** Provider enum. */ + enum Provider { + PROVIDER_UNSPECIFIED = 0, + INFOBLOX = 1 + } + } + + /** Properties of a ListDnsThreatDetectorsRequest. */ + interface IListDnsThreatDetectorsRequest { + + /** ListDnsThreatDetectorsRequest parent */ + parent?: (string|null); + + /** ListDnsThreatDetectorsRequest pageSize */ + pageSize?: (number|null); + + /** ListDnsThreatDetectorsRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListDnsThreatDetectorsRequest. */ + class ListDnsThreatDetectorsRequest implements IListDnsThreatDetectorsRequest { + + /** + * Constructs a new ListDnsThreatDetectorsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.networksecurity.v1.IListDnsThreatDetectorsRequest); + + /** ListDnsThreatDetectorsRequest parent. */ + public parent: string; + + /** ListDnsThreatDetectorsRequest pageSize. */ + public pageSize: number; + + /** ListDnsThreatDetectorsRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListDnsThreatDetectorsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListDnsThreatDetectorsRequest instance + */ + public static create(properties?: google.cloud.networksecurity.v1.IListDnsThreatDetectorsRequest): google.cloud.networksecurity.v1.ListDnsThreatDetectorsRequest; + + /** + * Encodes the specified ListDnsThreatDetectorsRequest message. Does not implicitly {@link google.cloud.networksecurity.v1.ListDnsThreatDetectorsRequest.verify|verify} messages. + * @param message ListDnsThreatDetectorsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.networksecurity.v1.IListDnsThreatDetectorsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListDnsThreatDetectorsRequest message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.ListDnsThreatDetectorsRequest.verify|verify} messages. + * @param message ListDnsThreatDetectorsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.networksecurity.v1.IListDnsThreatDetectorsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListDnsThreatDetectorsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListDnsThreatDetectorsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.networksecurity.v1.ListDnsThreatDetectorsRequest; + + /** + * Decodes a ListDnsThreatDetectorsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListDnsThreatDetectorsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.networksecurity.v1.ListDnsThreatDetectorsRequest; + + /** + * Verifies a ListDnsThreatDetectorsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListDnsThreatDetectorsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListDnsThreatDetectorsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.networksecurity.v1.ListDnsThreatDetectorsRequest; + + /** + * Creates a plain object from a ListDnsThreatDetectorsRequest message. Also converts values to other types if specified. + * @param message ListDnsThreatDetectorsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.networksecurity.v1.ListDnsThreatDetectorsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListDnsThreatDetectorsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListDnsThreatDetectorsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListDnsThreatDetectorsResponse. */ + interface IListDnsThreatDetectorsResponse { + + /** ListDnsThreatDetectorsResponse dnsThreatDetectors */ + dnsThreatDetectors?: (google.cloud.networksecurity.v1.IDnsThreatDetector[]|null); + + /** ListDnsThreatDetectorsResponse nextPageToken */ + nextPageToken?: (string|null); + + /** ListDnsThreatDetectorsResponse unreachable */ + unreachable?: (string[]|null); + } + + /** Represents a ListDnsThreatDetectorsResponse. */ + class ListDnsThreatDetectorsResponse implements IListDnsThreatDetectorsResponse { + + /** + * Constructs a new ListDnsThreatDetectorsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.networksecurity.v1.IListDnsThreatDetectorsResponse); + + /** ListDnsThreatDetectorsResponse dnsThreatDetectors. */ + public dnsThreatDetectors: google.cloud.networksecurity.v1.IDnsThreatDetector[]; + + /** ListDnsThreatDetectorsResponse nextPageToken. */ + public nextPageToken: string; + + /** ListDnsThreatDetectorsResponse unreachable. */ + public unreachable: string[]; + + /** + * Creates a new ListDnsThreatDetectorsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListDnsThreatDetectorsResponse instance + */ + public static create(properties?: google.cloud.networksecurity.v1.IListDnsThreatDetectorsResponse): google.cloud.networksecurity.v1.ListDnsThreatDetectorsResponse; + + /** + * Encodes the specified ListDnsThreatDetectorsResponse message. Does not implicitly {@link google.cloud.networksecurity.v1.ListDnsThreatDetectorsResponse.verify|verify} messages. + * @param message ListDnsThreatDetectorsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.networksecurity.v1.IListDnsThreatDetectorsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListDnsThreatDetectorsResponse message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.ListDnsThreatDetectorsResponse.verify|verify} messages. + * @param message ListDnsThreatDetectorsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.networksecurity.v1.IListDnsThreatDetectorsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListDnsThreatDetectorsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListDnsThreatDetectorsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.networksecurity.v1.ListDnsThreatDetectorsResponse; + + /** + * Decodes a ListDnsThreatDetectorsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListDnsThreatDetectorsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.networksecurity.v1.ListDnsThreatDetectorsResponse; + + /** + * Verifies a ListDnsThreatDetectorsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListDnsThreatDetectorsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListDnsThreatDetectorsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.networksecurity.v1.ListDnsThreatDetectorsResponse; + + /** + * Creates a plain object from a ListDnsThreatDetectorsResponse message. Also converts values to other types if specified. + * @param message ListDnsThreatDetectorsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.networksecurity.v1.ListDnsThreatDetectorsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListDnsThreatDetectorsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListDnsThreatDetectorsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetDnsThreatDetectorRequest. */ + interface IGetDnsThreatDetectorRequest { + + /** GetDnsThreatDetectorRequest name */ + name?: (string|null); + } + + /** Represents a GetDnsThreatDetectorRequest. */ + class GetDnsThreatDetectorRequest implements IGetDnsThreatDetectorRequest { + + /** + * Constructs a new GetDnsThreatDetectorRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.networksecurity.v1.IGetDnsThreatDetectorRequest); + + /** GetDnsThreatDetectorRequest name. */ + public name: string; + + /** + * Creates a new GetDnsThreatDetectorRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetDnsThreatDetectorRequest instance + */ + public static create(properties?: google.cloud.networksecurity.v1.IGetDnsThreatDetectorRequest): google.cloud.networksecurity.v1.GetDnsThreatDetectorRequest; + + /** + * Encodes the specified GetDnsThreatDetectorRequest message. Does not implicitly {@link google.cloud.networksecurity.v1.GetDnsThreatDetectorRequest.verify|verify} messages. + * @param message GetDnsThreatDetectorRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.networksecurity.v1.IGetDnsThreatDetectorRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetDnsThreatDetectorRequest message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.GetDnsThreatDetectorRequest.verify|verify} messages. + * @param message GetDnsThreatDetectorRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.networksecurity.v1.IGetDnsThreatDetectorRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetDnsThreatDetectorRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetDnsThreatDetectorRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.networksecurity.v1.GetDnsThreatDetectorRequest; + + /** + * Decodes a GetDnsThreatDetectorRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetDnsThreatDetectorRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.networksecurity.v1.GetDnsThreatDetectorRequest; + + /** + * Verifies a GetDnsThreatDetectorRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetDnsThreatDetectorRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetDnsThreatDetectorRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.networksecurity.v1.GetDnsThreatDetectorRequest; + + /** + * Creates a plain object from a GetDnsThreatDetectorRequest message. Also converts values to other types if specified. + * @param message GetDnsThreatDetectorRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.networksecurity.v1.GetDnsThreatDetectorRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetDnsThreatDetectorRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetDnsThreatDetectorRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateDnsThreatDetectorRequest. */ + interface ICreateDnsThreatDetectorRequest { + + /** CreateDnsThreatDetectorRequest parent */ + parent?: (string|null); + + /** CreateDnsThreatDetectorRequest dnsThreatDetectorId */ + dnsThreatDetectorId?: (string|null); + + /** CreateDnsThreatDetectorRequest dnsThreatDetector */ + dnsThreatDetector?: (google.cloud.networksecurity.v1.IDnsThreatDetector|null); + } + + /** Represents a CreateDnsThreatDetectorRequest. */ + class CreateDnsThreatDetectorRequest implements ICreateDnsThreatDetectorRequest { + + /** + * Constructs a new CreateDnsThreatDetectorRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.networksecurity.v1.ICreateDnsThreatDetectorRequest); + + /** CreateDnsThreatDetectorRequest parent. */ + public parent: string; + + /** CreateDnsThreatDetectorRequest dnsThreatDetectorId. */ + public dnsThreatDetectorId: string; + + /** CreateDnsThreatDetectorRequest dnsThreatDetector. */ + public dnsThreatDetector?: (google.cloud.networksecurity.v1.IDnsThreatDetector|null); + + /** + * Creates a new CreateDnsThreatDetectorRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateDnsThreatDetectorRequest instance + */ + public static create(properties?: google.cloud.networksecurity.v1.ICreateDnsThreatDetectorRequest): google.cloud.networksecurity.v1.CreateDnsThreatDetectorRequest; + + /** + * Encodes the specified CreateDnsThreatDetectorRequest message. Does not implicitly {@link google.cloud.networksecurity.v1.CreateDnsThreatDetectorRequest.verify|verify} messages. + * @param message CreateDnsThreatDetectorRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.networksecurity.v1.ICreateDnsThreatDetectorRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateDnsThreatDetectorRequest message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.CreateDnsThreatDetectorRequest.verify|verify} messages. + * @param message CreateDnsThreatDetectorRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.networksecurity.v1.ICreateDnsThreatDetectorRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateDnsThreatDetectorRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateDnsThreatDetectorRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.networksecurity.v1.CreateDnsThreatDetectorRequest; + + /** + * Decodes a CreateDnsThreatDetectorRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateDnsThreatDetectorRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.networksecurity.v1.CreateDnsThreatDetectorRequest; + + /** + * Verifies a CreateDnsThreatDetectorRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateDnsThreatDetectorRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateDnsThreatDetectorRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.networksecurity.v1.CreateDnsThreatDetectorRequest; + + /** + * Creates a plain object from a CreateDnsThreatDetectorRequest message. Also converts values to other types if specified. + * @param message CreateDnsThreatDetectorRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.networksecurity.v1.CreateDnsThreatDetectorRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateDnsThreatDetectorRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateDnsThreatDetectorRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateDnsThreatDetectorRequest. */ + interface IUpdateDnsThreatDetectorRequest { + + /** UpdateDnsThreatDetectorRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateDnsThreatDetectorRequest dnsThreatDetector */ + dnsThreatDetector?: (google.cloud.networksecurity.v1.IDnsThreatDetector|null); + } + + /** Represents an UpdateDnsThreatDetectorRequest. */ + class UpdateDnsThreatDetectorRequest implements IUpdateDnsThreatDetectorRequest { + + /** + * Constructs a new UpdateDnsThreatDetectorRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.networksecurity.v1.IUpdateDnsThreatDetectorRequest); + + /** UpdateDnsThreatDetectorRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateDnsThreatDetectorRequest dnsThreatDetector. */ + public dnsThreatDetector?: (google.cloud.networksecurity.v1.IDnsThreatDetector|null); + + /** + * Creates a new UpdateDnsThreatDetectorRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateDnsThreatDetectorRequest instance + */ + public static create(properties?: google.cloud.networksecurity.v1.IUpdateDnsThreatDetectorRequest): google.cloud.networksecurity.v1.UpdateDnsThreatDetectorRequest; + + /** + * Encodes the specified UpdateDnsThreatDetectorRequest message. Does not implicitly {@link google.cloud.networksecurity.v1.UpdateDnsThreatDetectorRequest.verify|verify} messages. + * @param message UpdateDnsThreatDetectorRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.networksecurity.v1.IUpdateDnsThreatDetectorRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateDnsThreatDetectorRequest message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.UpdateDnsThreatDetectorRequest.verify|verify} messages. + * @param message UpdateDnsThreatDetectorRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.networksecurity.v1.IUpdateDnsThreatDetectorRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateDnsThreatDetectorRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateDnsThreatDetectorRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.networksecurity.v1.UpdateDnsThreatDetectorRequest; + + /** + * Decodes an UpdateDnsThreatDetectorRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateDnsThreatDetectorRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.networksecurity.v1.UpdateDnsThreatDetectorRequest; + + /** + * Verifies an UpdateDnsThreatDetectorRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UpdateDnsThreatDetectorRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateDnsThreatDetectorRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.networksecurity.v1.UpdateDnsThreatDetectorRequest; + + /** + * Creates a plain object from an UpdateDnsThreatDetectorRequest message. Also converts values to other types if specified. + * @param message UpdateDnsThreatDetectorRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.networksecurity.v1.UpdateDnsThreatDetectorRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateDnsThreatDetectorRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateDnsThreatDetectorRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteDnsThreatDetectorRequest. */ + interface IDeleteDnsThreatDetectorRequest { + + /** DeleteDnsThreatDetectorRequest name */ + name?: (string|null); + } + + /** Represents a DeleteDnsThreatDetectorRequest. */ + class DeleteDnsThreatDetectorRequest implements IDeleteDnsThreatDetectorRequest { + + /** + * Constructs a new DeleteDnsThreatDetectorRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.networksecurity.v1.IDeleteDnsThreatDetectorRequest); + + /** DeleteDnsThreatDetectorRequest name. */ + public name: string; + + /** + * Creates a new DeleteDnsThreatDetectorRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteDnsThreatDetectorRequest instance + */ + public static create(properties?: google.cloud.networksecurity.v1.IDeleteDnsThreatDetectorRequest): google.cloud.networksecurity.v1.DeleteDnsThreatDetectorRequest; + + /** + * Encodes the specified DeleteDnsThreatDetectorRequest message. Does not implicitly {@link google.cloud.networksecurity.v1.DeleteDnsThreatDetectorRequest.verify|verify} messages. + * @param message DeleteDnsThreatDetectorRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.networksecurity.v1.IDeleteDnsThreatDetectorRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteDnsThreatDetectorRequest message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.DeleteDnsThreatDetectorRequest.verify|verify} messages. + * @param message DeleteDnsThreatDetectorRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.networksecurity.v1.IDeleteDnsThreatDetectorRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteDnsThreatDetectorRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteDnsThreatDetectorRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.networksecurity.v1.DeleteDnsThreatDetectorRequest; + + /** + * Decodes a DeleteDnsThreatDetectorRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteDnsThreatDetectorRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.networksecurity.v1.DeleteDnsThreatDetectorRequest; + + /** + * Verifies a DeleteDnsThreatDetectorRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteDnsThreatDetectorRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteDnsThreatDetectorRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.networksecurity.v1.DeleteDnsThreatDetectorRequest; + + /** + * Creates a plain object from a DeleteDnsThreatDetectorRequest message. Also converts values to other types if specified. + * @param message DeleteDnsThreatDetectorRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.networksecurity.v1.DeleteDnsThreatDetectorRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteDnsThreatDetectorRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteDnsThreatDetectorRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Represents a FirewallActivation */ + class FirewallActivation extends $protobuf.rpc.Service { + + /** + * Constructs a new FirewallActivation service. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + */ + constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); + + /** + * Creates new FirewallActivation service using the specified rpc implementation. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + * @returns RPC service. Useful where requests and/or responses are streamed. + */ + public static create(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean): FirewallActivation; + + /** + * Calls ListFirewallEndpoints. + * @param request ListFirewallEndpointsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListFirewallEndpointsResponse + */ + public listFirewallEndpoints(request: google.cloud.networksecurity.v1.IListFirewallEndpointsRequest, callback: google.cloud.networksecurity.v1.FirewallActivation.ListFirewallEndpointsCallback): void; + + /** + * Calls ListFirewallEndpoints. + * @param request ListFirewallEndpointsRequest message or plain object + * @returns Promise + */ + public listFirewallEndpoints(request: google.cloud.networksecurity.v1.IListFirewallEndpointsRequest): Promise; + + /** + * Calls GetFirewallEndpoint. + * @param request GetFirewallEndpointRequest message or plain object + * @param callback Node-style callback called with the error, if any, and FirewallEndpoint + */ + public getFirewallEndpoint(request: google.cloud.networksecurity.v1.IGetFirewallEndpointRequest, callback: google.cloud.networksecurity.v1.FirewallActivation.GetFirewallEndpointCallback): void; + + /** + * Calls GetFirewallEndpoint. + * @param request GetFirewallEndpointRequest message or plain object + * @returns Promise + */ + public getFirewallEndpoint(request: google.cloud.networksecurity.v1.IGetFirewallEndpointRequest): Promise; + + /** + * Calls CreateFirewallEndpoint. + * @param request CreateFirewallEndpointRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public createFirewallEndpoint(request: google.cloud.networksecurity.v1.ICreateFirewallEndpointRequest, callback: google.cloud.networksecurity.v1.FirewallActivation.CreateFirewallEndpointCallback): void; + + /** + * Calls CreateFirewallEndpoint. + * @param request CreateFirewallEndpointRequest message or plain object + * @returns Promise + */ + public createFirewallEndpoint(request: google.cloud.networksecurity.v1.ICreateFirewallEndpointRequest): Promise; + + /** + * Calls DeleteFirewallEndpoint. + * @param request DeleteFirewallEndpointRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public deleteFirewallEndpoint(request: google.cloud.networksecurity.v1.IDeleteFirewallEndpointRequest, callback: google.cloud.networksecurity.v1.FirewallActivation.DeleteFirewallEndpointCallback): void; + + /** + * Calls DeleteFirewallEndpoint. + * @param request DeleteFirewallEndpointRequest message or plain object + * @returns Promise + */ + public deleteFirewallEndpoint(request: google.cloud.networksecurity.v1.IDeleteFirewallEndpointRequest): Promise; + + /** + * Calls UpdateFirewallEndpoint. + * @param request UpdateFirewallEndpointRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public updateFirewallEndpoint(request: google.cloud.networksecurity.v1.IUpdateFirewallEndpointRequest, callback: google.cloud.networksecurity.v1.FirewallActivation.UpdateFirewallEndpointCallback): void; + + /** + * Calls UpdateFirewallEndpoint. + * @param request UpdateFirewallEndpointRequest message or plain object + * @returns Promise + */ + public updateFirewallEndpoint(request: google.cloud.networksecurity.v1.IUpdateFirewallEndpointRequest): Promise; + + /** + * Calls ListFirewallEndpointAssociations. + * @param request ListFirewallEndpointAssociationsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListFirewallEndpointAssociationsResponse + */ + public listFirewallEndpointAssociations(request: google.cloud.networksecurity.v1.IListFirewallEndpointAssociationsRequest, callback: google.cloud.networksecurity.v1.FirewallActivation.ListFirewallEndpointAssociationsCallback): void; + + /** + * Calls ListFirewallEndpointAssociations. + * @param request ListFirewallEndpointAssociationsRequest message or plain object + * @returns Promise + */ + public listFirewallEndpointAssociations(request: google.cloud.networksecurity.v1.IListFirewallEndpointAssociationsRequest): Promise; + + /** + * Calls GetFirewallEndpointAssociation. + * @param request GetFirewallEndpointAssociationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and FirewallEndpointAssociation + */ + public getFirewallEndpointAssociation(request: google.cloud.networksecurity.v1.IGetFirewallEndpointAssociationRequest, callback: google.cloud.networksecurity.v1.FirewallActivation.GetFirewallEndpointAssociationCallback): void; + + /** + * Calls GetFirewallEndpointAssociation. + * @param request GetFirewallEndpointAssociationRequest message or plain object + * @returns Promise + */ + public getFirewallEndpointAssociation(request: google.cloud.networksecurity.v1.IGetFirewallEndpointAssociationRequest): Promise; + + /** + * Calls CreateFirewallEndpointAssociation. + * @param request CreateFirewallEndpointAssociationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public createFirewallEndpointAssociation(request: google.cloud.networksecurity.v1.ICreateFirewallEndpointAssociationRequest, callback: google.cloud.networksecurity.v1.FirewallActivation.CreateFirewallEndpointAssociationCallback): void; + + /** + * Calls CreateFirewallEndpointAssociation. + * @param request CreateFirewallEndpointAssociationRequest message or plain object + * @returns Promise + */ + public createFirewallEndpointAssociation(request: google.cloud.networksecurity.v1.ICreateFirewallEndpointAssociationRequest): Promise; + + /** + * Calls DeleteFirewallEndpointAssociation. + * @param request DeleteFirewallEndpointAssociationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public deleteFirewallEndpointAssociation(request: google.cloud.networksecurity.v1.IDeleteFirewallEndpointAssociationRequest, callback: google.cloud.networksecurity.v1.FirewallActivation.DeleteFirewallEndpointAssociationCallback): void; + + /** + * Calls DeleteFirewallEndpointAssociation. + * @param request DeleteFirewallEndpointAssociationRequest message or plain object + * @returns Promise + */ + public deleteFirewallEndpointAssociation(request: google.cloud.networksecurity.v1.IDeleteFirewallEndpointAssociationRequest): Promise; + + /** + * Calls UpdateFirewallEndpointAssociation. + * @param request UpdateFirewallEndpointAssociationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public updateFirewallEndpointAssociation(request: google.cloud.networksecurity.v1.IUpdateFirewallEndpointAssociationRequest, callback: google.cloud.networksecurity.v1.FirewallActivation.UpdateFirewallEndpointAssociationCallback): void; + + /** + * Calls UpdateFirewallEndpointAssociation. + * @param request UpdateFirewallEndpointAssociationRequest message or plain object + * @returns Promise + */ + public updateFirewallEndpointAssociation(request: google.cloud.networksecurity.v1.IUpdateFirewallEndpointAssociationRequest): Promise; + } + + namespace FirewallActivation { + + /** + * Callback as used by {@link google.cloud.networksecurity.v1.FirewallActivation|listFirewallEndpoints}. + * @param error Error, if any + * @param [response] ListFirewallEndpointsResponse + */ + type ListFirewallEndpointsCallback = (error: (Error|null), response?: google.cloud.networksecurity.v1.ListFirewallEndpointsResponse) => void; + + /** + * Callback as used by {@link google.cloud.networksecurity.v1.FirewallActivation|getFirewallEndpoint}. + * @param error Error, if any + * @param [response] FirewallEndpoint + */ + type GetFirewallEndpointCallback = (error: (Error|null), response?: google.cloud.networksecurity.v1.FirewallEndpoint) => void; + + /** + * Callback as used by {@link google.cloud.networksecurity.v1.FirewallActivation|createFirewallEndpoint}. + * @param error Error, if any + * @param [response] Operation + */ + type CreateFirewallEndpointCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.networksecurity.v1.FirewallActivation|deleteFirewallEndpoint}. + * @param error Error, if any + * @param [response] Operation + */ + type DeleteFirewallEndpointCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.networksecurity.v1.FirewallActivation|updateFirewallEndpoint}. + * @param error Error, if any + * @param [response] Operation + */ + type UpdateFirewallEndpointCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.networksecurity.v1.FirewallActivation|listFirewallEndpointAssociations}. + * @param error Error, if any + * @param [response] ListFirewallEndpointAssociationsResponse + */ + type ListFirewallEndpointAssociationsCallback = (error: (Error|null), response?: google.cloud.networksecurity.v1.ListFirewallEndpointAssociationsResponse) => void; + + /** + * Callback as used by {@link google.cloud.networksecurity.v1.FirewallActivation|getFirewallEndpointAssociation}. + * @param error Error, if any + * @param [response] FirewallEndpointAssociation + */ + type GetFirewallEndpointAssociationCallback = (error: (Error|null), response?: google.cloud.networksecurity.v1.FirewallEndpointAssociation) => void; + + /** + * Callback as used by {@link google.cloud.networksecurity.v1.FirewallActivation|createFirewallEndpointAssociation}. + * @param error Error, if any + * @param [response] Operation + */ + type CreateFirewallEndpointAssociationCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.networksecurity.v1.FirewallActivation|deleteFirewallEndpointAssociation}. + * @param error Error, if any + * @param [response] Operation + */ + type DeleteFirewallEndpointAssociationCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.networksecurity.v1.FirewallActivation|updateFirewallEndpointAssociation}. + * @param error Error, if any + * @param [response] Operation + */ + type UpdateFirewallEndpointAssociationCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + } + + /** Properties of a FirewallEndpoint. */ + interface IFirewallEndpoint { + + /** FirewallEndpoint name */ + name?: (string|null); + + /** FirewallEndpoint description */ + description?: (string|null); + + /** FirewallEndpoint createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** FirewallEndpoint updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** FirewallEndpoint labels */ + labels?: ({ [k: string]: string }|null); + + /** FirewallEndpoint state */ + state?: (google.cloud.networksecurity.v1.FirewallEndpoint.State|keyof typeof google.cloud.networksecurity.v1.FirewallEndpoint.State|null); + + /** FirewallEndpoint reconciling */ + reconciling?: (boolean|null); + + /** FirewallEndpoint associatedNetworks */ + associatedNetworks?: (string[]|null); + + /** FirewallEndpoint associations */ + associations?: (google.cloud.networksecurity.v1.FirewallEndpoint.IAssociationReference[]|null); + + /** FirewallEndpoint satisfiesPzs */ + satisfiesPzs?: (boolean|null); + + /** FirewallEndpoint satisfiesPzi */ + satisfiesPzi?: (boolean|null); + + /** FirewallEndpoint billingProjectId */ + billingProjectId?: (string|null); + + /** FirewallEndpoint endpointSettings */ + endpointSettings?: (google.cloud.networksecurity.v1.FirewallEndpoint.IEndpointSettings|null); + } + + /** Represents a FirewallEndpoint. */ + class FirewallEndpoint implements IFirewallEndpoint { + + /** + * Constructs a new FirewallEndpoint. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.networksecurity.v1.IFirewallEndpoint); + + /** FirewallEndpoint name. */ + public name: string; + + /** FirewallEndpoint description. */ + public description: string; + + /** FirewallEndpoint createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** FirewallEndpoint updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** FirewallEndpoint labels. */ + public labels: { [k: string]: string }; + + /** FirewallEndpoint state. */ + public state: (google.cloud.networksecurity.v1.FirewallEndpoint.State|keyof typeof google.cloud.networksecurity.v1.FirewallEndpoint.State); + + /** FirewallEndpoint reconciling. */ + public reconciling: boolean; + + /** FirewallEndpoint associatedNetworks. */ + public associatedNetworks: string[]; + + /** FirewallEndpoint associations. */ + public associations: google.cloud.networksecurity.v1.FirewallEndpoint.IAssociationReference[]; + + /** FirewallEndpoint satisfiesPzs. */ + public satisfiesPzs?: (boolean|null); + + /** FirewallEndpoint satisfiesPzi. */ + public satisfiesPzi?: (boolean|null); + + /** FirewallEndpoint billingProjectId. */ + public billingProjectId: string; + + /** FirewallEndpoint endpointSettings. */ + public endpointSettings?: (google.cloud.networksecurity.v1.FirewallEndpoint.IEndpointSettings|null); + + /** + * Creates a new FirewallEndpoint instance using the specified properties. + * @param [properties] Properties to set + * @returns FirewallEndpoint instance + */ + public static create(properties?: google.cloud.networksecurity.v1.IFirewallEndpoint): google.cloud.networksecurity.v1.FirewallEndpoint; + + /** + * Encodes the specified FirewallEndpoint message. Does not implicitly {@link google.cloud.networksecurity.v1.FirewallEndpoint.verify|verify} messages. + * @param message FirewallEndpoint message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.networksecurity.v1.IFirewallEndpoint, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FirewallEndpoint message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.FirewallEndpoint.verify|verify} messages. + * @param message FirewallEndpoint message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.networksecurity.v1.IFirewallEndpoint, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FirewallEndpoint message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FirewallEndpoint + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.networksecurity.v1.FirewallEndpoint; + + /** + * Decodes a FirewallEndpoint message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FirewallEndpoint + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.networksecurity.v1.FirewallEndpoint; + + /** + * Verifies a FirewallEndpoint message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FirewallEndpoint message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FirewallEndpoint + */ + public static fromObject(object: { [k: string]: any }): google.cloud.networksecurity.v1.FirewallEndpoint; + + /** + * Creates a plain object from a FirewallEndpoint message. Also converts values to other types if specified. + * @param message FirewallEndpoint + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.networksecurity.v1.FirewallEndpoint, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FirewallEndpoint to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FirewallEndpoint + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace FirewallEndpoint { + + /** Properties of an AssociationReference. */ + interface IAssociationReference { + + /** AssociationReference name */ + name?: (string|null); + + /** AssociationReference network */ + network?: (string|null); + } + + /** Represents an AssociationReference. */ + class AssociationReference implements IAssociationReference { + + /** + * Constructs a new AssociationReference. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.networksecurity.v1.FirewallEndpoint.IAssociationReference); + + /** AssociationReference name. */ + public name: string; + + /** AssociationReference network. */ + public network: string; + + /** + * Creates a new AssociationReference instance using the specified properties. + * @param [properties] Properties to set + * @returns AssociationReference instance + */ + public static create(properties?: google.cloud.networksecurity.v1.FirewallEndpoint.IAssociationReference): google.cloud.networksecurity.v1.FirewallEndpoint.AssociationReference; + + /** + * Encodes the specified AssociationReference message. Does not implicitly {@link google.cloud.networksecurity.v1.FirewallEndpoint.AssociationReference.verify|verify} messages. + * @param message AssociationReference message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.networksecurity.v1.FirewallEndpoint.IAssociationReference, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AssociationReference message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.FirewallEndpoint.AssociationReference.verify|verify} messages. + * @param message AssociationReference message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.networksecurity.v1.FirewallEndpoint.IAssociationReference, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AssociationReference message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AssociationReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.networksecurity.v1.FirewallEndpoint.AssociationReference; + + /** + * Decodes an AssociationReference message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AssociationReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.networksecurity.v1.FirewallEndpoint.AssociationReference; + + /** + * Verifies an AssociationReference message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AssociationReference message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AssociationReference + */ + public static fromObject(object: { [k: string]: any }): google.cloud.networksecurity.v1.FirewallEndpoint.AssociationReference; + + /** + * Creates a plain object from an AssociationReference message. Also converts values to other types if specified. + * @param message AssociationReference + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.networksecurity.v1.FirewallEndpoint.AssociationReference, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AssociationReference to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AssociationReference + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an EndpointSettings. */ + interface IEndpointSettings { + + /** EndpointSettings jumboFramesEnabled */ + jumboFramesEnabled?: (boolean|null); + } + + /** Represents an EndpointSettings. */ + class EndpointSettings implements IEndpointSettings { + + /** + * Constructs a new EndpointSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.networksecurity.v1.FirewallEndpoint.IEndpointSettings); + + /** EndpointSettings jumboFramesEnabled. */ + public jumboFramesEnabled: boolean; + + /** + * Creates a new EndpointSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns EndpointSettings instance + */ + public static create(properties?: google.cloud.networksecurity.v1.FirewallEndpoint.IEndpointSettings): google.cloud.networksecurity.v1.FirewallEndpoint.EndpointSettings; + + /** + * Encodes the specified EndpointSettings message. Does not implicitly {@link google.cloud.networksecurity.v1.FirewallEndpoint.EndpointSettings.verify|verify} messages. + * @param message EndpointSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.networksecurity.v1.FirewallEndpoint.IEndpointSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EndpointSettings message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.FirewallEndpoint.EndpointSettings.verify|verify} messages. + * @param message EndpointSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.networksecurity.v1.FirewallEndpoint.IEndpointSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EndpointSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EndpointSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.networksecurity.v1.FirewallEndpoint.EndpointSettings; + + /** + * Decodes an EndpointSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EndpointSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.networksecurity.v1.FirewallEndpoint.EndpointSettings; + + /** + * Verifies an EndpointSettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EndpointSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EndpointSettings + */ + public static fromObject(object: { [k: string]: any }): google.cloud.networksecurity.v1.FirewallEndpoint.EndpointSettings; + + /** + * Creates a plain object from an EndpointSettings message. Also converts values to other types if specified. + * @param message EndpointSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.networksecurity.v1.FirewallEndpoint.EndpointSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EndpointSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EndpointSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** State enum. */ + enum State { + STATE_UNSPECIFIED = 0, + CREATING = 1, + ACTIVE = 2, + DELETING = 3, + INACTIVE = 4 + } + } + + /** Properties of a ListFirewallEndpointsRequest. */ + interface IListFirewallEndpointsRequest { + + /** ListFirewallEndpointsRequest parent */ + parent?: (string|null); + + /** ListFirewallEndpointsRequest pageSize */ + pageSize?: (number|null); + + /** ListFirewallEndpointsRequest pageToken */ + pageToken?: (string|null); + + /** ListFirewallEndpointsRequest filter */ + filter?: (string|null); + + /** ListFirewallEndpointsRequest orderBy */ + orderBy?: (string|null); + } + + /** Represents a ListFirewallEndpointsRequest. */ + class ListFirewallEndpointsRequest implements IListFirewallEndpointsRequest { + + /** + * Constructs a new ListFirewallEndpointsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.networksecurity.v1.IListFirewallEndpointsRequest); + + /** ListFirewallEndpointsRequest parent. */ + public parent: string; + + /** ListFirewallEndpointsRequest pageSize. */ + public pageSize: number; + + /** ListFirewallEndpointsRequest pageToken. */ + public pageToken: string; + + /** ListFirewallEndpointsRequest filter. */ + public filter: string; + + /** ListFirewallEndpointsRequest orderBy. */ + public orderBy: string; + + /** + * Creates a new ListFirewallEndpointsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListFirewallEndpointsRequest instance + */ + public static create(properties?: google.cloud.networksecurity.v1.IListFirewallEndpointsRequest): google.cloud.networksecurity.v1.ListFirewallEndpointsRequest; + + /** + * Encodes the specified ListFirewallEndpointsRequest message. Does not implicitly {@link google.cloud.networksecurity.v1.ListFirewallEndpointsRequest.verify|verify} messages. + * @param message ListFirewallEndpointsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.networksecurity.v1.IListFirewallEndpointsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListFirewallEndpointsRequest message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.ListFirewallEndpointsRequest.verify|verify} messages. + * @param message ListFirewallEndpointsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.networksecurity.v1.IListFirewallEndpointsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListFirewallEndpointsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListFirewallEndpointsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.networksecurity.v1.ListFirewallEndpointsRequest; + + /** + * Decodes a ListFirewallEndpointsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListFirewallEndpointsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.networksecurity.v1.ListFirewallEndpointsRequest; + + /** + * Verifies a ListFirewallEndpointsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListFirewallEndpointsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListFirewallEndpointsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.networksecurity.v1.ListFirewallEndpointsRequest; + + /** + * Creates a plain object from a ListFirewallEndpointsRequest message. Also converts values to other types if specified. + * @param message ListFirewallEndpointsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.networksecurity.v1.ListFirewallEndpointsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListFirewallEndpointsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListFirewallEndpointsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListFirewallEndpointsResponse. */ + interface IListFirewallEndpointsResponse { + + /** ListFirewallEndpointsResponse firewallEndpoints */ + firewallEndpoints?: (google.cloud.networksecurity.v1.IFirewallEndpoint[]|null); + + /** ListFirewallEndpointsResponse nextPageToken */ + nextPageToken?: (string|null); + + /** ListFirewallEndpointsResponse unreachable */ + unreachable?: (string[]|null); + } + + /** Represents a ListFirewallEndpointsResponse. */ + class ListFirewallEndpointsResponse implements IListFirewallEndpointsResponse { + + /** + * Constructs a new ListFirewallEndpointsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.networksecurity.v1.IListFirewallEndpointsResponse); + + /** ListFirewallEndpointsResponse firewallEndpoints. */ + public firewallEndpoints: google.cloud.networksecurity.v1.IFirewallEndpoint[]; + + /** ListFirewallEndpointsResponse nextPageToken. */ + public nextPageToken: string; + + /** ListFirewallEndpointsResponse unreachable. */ + public unreachable: string[]; + + /** + * Creates a new ListFirewallEndpointsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListFirewallEndpointsResponse instance + */ + public static create(properties?: google.cloud.networksecurity.v1.IListFirewallEndpointsResponse): google.cloud.networksecurity.v1.ListFirewallEndpointsResponse; + + /** + * Encodes the specified ListFirewallEndpointsResponse message. Does not implicitly {@link google.cloud.networksecurity.v1.ListFirewallEndpointsResponse.verify|verify} messages. + * @param message ListFirewallEndpointsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.networksecurity.v1.IListFirewallEndpointsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListFirewallEndpointsResponse message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.ListFirewallEndpointsResponse.verify|verify} messages. + * @param message ListFirewallEndpointsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.networksecurity.v1.IListFirewallEndpointsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListFirewallEndpointsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListFirewallEndpointsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.networksecurity.v1.ListFirewallEndpointsResponse; + + /** + * Decodes a ListFirewallEndpointsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListFirewallEndpointsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.networksecurity.v1.ListFirewallEndpointsResponse; + + /** + * Verifies a ListFirewallEndpointsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListFirewallEndpointsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListFirewallEndpointsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.networksecurity.v1.ListFirewallEndpointsResponse; + + /** + * Creates a plain object from a ListFirewallEndpointsResponse message. Also converts values to other types if specified. + * @param message ListFirewallEndpointsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.networksecurity.v1.ListFirewallEndpointsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListFirewallEndpointsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListFirewallEndpointsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetFirewallEndpointRequest. */ + interface IGetFirewallEndpointRequest { + + /** GetFirewallEndpointRequest name */ + name?: (string|null); + } + + /** Represents a GetFirewallEndpointRequest. */ + class GetFirewallEndpointRequest implements IGetFirewallEndpointRequest { + + /** + * Constructs a new GetFirewallEndpointRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.networksecurity.v1.IGetFirewallEndpointRequest); + + /** GetFirewallEndpointRequest name. */ + public name: string; + + /** + * Creates a new GetFirewallEndpointRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetFirewallEndpointRequest instance + */ + public static create(properties?: google.cloud.networksecurity.v1.IGetFirewallEndpointRequest): google.cloud.networksecurity.v1.GetFirewallEndpointRequest; + + /** + * Encodes the specified GetFirewallEndpointRequest message. Does not implicitly {@link google.cloud.networksecurity.v1.GetFirewallEndpointRequest.verify|verify} messages. + * @param message GetFirewallEndpointRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.networksecurity.v1.IGetFirewallEndpointRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetFirewallEndpointRequest message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.GetFirewallEndpointRequest.verify|verify} messages. + * @param message GetFirewallEndpointRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.networksecurity.v1.IGetFirewallEndpointRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetFirewallEndpointRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetFirewallEndpointRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.networksecurity.v1.GetFirewallEndpointRequest; + + /** + * Decodes a GetFirewallEndpointRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetFirewallEndpointRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.networksecurity.v1.GetFirewallEndpointRequest; + + /** + * Verifies a GetFirewallEndpointRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetFirewallEndpointRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetFirewallEndpointRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.networksecurity.v1.GetFirewallEndpointRequest; + + /** + * Creates a plain object from a GetFirewallEndpointRequest message. Also converts values to other types if specified. + * @param message GetFirewallEndpointRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.networksecurity.v1.GetFirewallEndpointRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetFirewallEndpointRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetFirewallEndpointRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateFirewallEndpointRequest. */ + interface ICreateFirewallEndpointRequest { + + /** CreateFirewallEndpointRequest parent */ + parent?: (string|null); + + /** CreateFirewallEndpointRequest firewallEndpointId */ + firewallEndpointId?: (string|null); + + /** CreateFirewallEndpointRequest firewallEndpoint */ + firewallEndpoint?: (google.cloud.networksecurity.v1.IFirewallEndpoint|null); + + /** CreateFirewallEndpointRequest requestId */ + requestId?: (string|null); + } + + /** Represents a CreateFirewallEndpointRequest. */ + class CreateFirewallEndpointRequest implements ICreateFirewallEndpointRequest { + + /** + * Constructs a new CreateFirewallEndpointRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.networksecurity.v1.ICreateFirewallEndpointRequest); + + /** CreateFirewallEndpointRequest parent. */ + public parent: string; + + /** CreateFirewallEndpointRequest firewallEndpointId. */ + public firewallEndpointId: string; + + /** CreateFirewallEndpointRequest firewallEndpoint. */ + public firewallEndpoint?: (google.cloud.networksecurity.v1.IFirewallEndpoint|null); + + /** CreateFirewallEndpointRequest requestId. */ + public requestId: string; + + /** + * Creates a new CreateFirewallEndpointRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateFirewallEndpointRequest instance + */ + public static create(properties?: google.cloud.networksecurity.v1.ICreateFirewallEndpointRequest): google.cloud.networksecurity.v1.CreateFirewallEndpointRequest; + + /** + * Encodes the specified CreateFirewallEndpointRequest message. Does not implicitly {@link google.cloud.networksecurity.v1.CreateFirewallEndpointRequest.verify|verify} messages. + * @param message CreateFirewallEndpointRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.networksecurity.v1.ICreateFirewallEndpointRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateFirewallEndpointRequest message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.CreateFirewallEndpointRequest.verify|verify} messages. + * @param message CreateFirewallEndpointRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.networksecurity.v1.ICreateFirewallEndpointRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateFirewallEndpointRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateFirewallEndpointRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.networksecurity.v1.CreateFirewallEndpointRequest; + + /** + * Decodes a CreateFirewallEndpointRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateFirewallEndpointRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.networksecurity.v1.CreateFirewallEndpointRequest; + + /** + * Verifies a CreateFirewallEndpointRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateFirewallEndpointRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateFirewallEndpointRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.networksecurity.v1.CreateFirewallEndpointRequest; + + /** + * Creates a plain object from a CreateFirewallEndpointRequest message. Also converts values to other types if specified. + * @param message CreateFirewallEndpointRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.networksecurity.v1.CreateFirewallEndpointRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateFirewallEndpointRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateFirewallEndpointRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateFirewallEndpointRequest. */ + interface IUpdateFirewallEndpointRequest { + + /** UpdateFirewallEndpointRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateFirewallEndpointRequest firewallEndpoint */ + firewallEndpoint?: (google.cloud.networksecurity.v1.IFirewallEndpoint|null); + + /** UpdateFirewallEndpointRequest requestId */ + requestId?: (string|null); + } + + /** Represents an UpdateFirewallEndpointRequest. */ + class UpdateFirewallEndpointRequest implements IUpdateFirewallEndpointRequest { + + /** + * Constructs a new UpdateFirewallEndpointRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.networksecurity.v1.IUpdateFirewallEndpointRequest); + + /** UpdateFirewallEndpointRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateFirewallEndpointRequest firewallEndpoint. */ + public firewallEndpoint?: (google.cloud.networksecurity.v1.IFirewallEndpoint|null); + + /** UpdateFirewallEndpointRequest requestId. */ + public requestId: string; + + /** + * Creates a new UpdateFirewallEndpointRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateFirewallEndpointRequest instance + */ + public static create(properties?: google.cloud.networksecurity.v1.IUpdateFirewallEndpointRequest): google.cloud.networksecurity.v1.UpdateFirewallEndpointRequest; + + /** + * Encodes the specified UpdateFirewallEndpointRequest message. Does not implicitly {@link google.cloud.networksecurity.v1.UpdateFirewallEndpointRequest.verify|verify} messages. + * @param message UpdateFirewallEndpointRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.networksecurity.v1.IUpdateFirewallEndpointRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateFirewallEndpointRequest message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.UpdateFirewallEndpointRequest.verify|verify} messages. + * @param message UpdateFirewallEndpointRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.networksecurity.v1.IUpdateFirewallEndpointRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateFirewallEndpointRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateFirewallEndpointRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.networksecurity.v1.UpdateFirewallEndpointRequest; + + /** + * Decodes an UpdateFirewallEndpointRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateFirewallEndpointRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.networksecurity.v1.UpdateFirewallEndpointRequest; + + /** + * Verifies an UpdateFirewallEndpointRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UpdateFirewallEndpointRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateFirewallEndpointRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.networksecurity.v1.UpdateFirewallEndpointRequest; + + /** + * Creates a plain object from an UpdateFirewallEndpointRequest message. Also converts values to other types if specified. + * @param message UpdateFirewallEndpointRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.networksecurity.v1.UpdateFirewallEndpointRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateFirewallEndpointRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateFirewallEndpointRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteFirewallEndpointRequest. */ + interface IDeleteFirewallEndpointRequest { + + /** DeleteFirewallEndpointRequest name */ + name?: (string|null); + + /** DeleteFirewallEndpointRequest requestId */ + requestId?: (string|null); + } + + /** Represents a DeleteFirewallEndpointRequest. */ + class DeleteFirewallEndpointRequest implements IDeleteFirewallEndpointRequest { + + /** + * Constructs a new DeleteFirewallEndpointRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.networksecurity.v1.IDeleteFirewallEndpointRequest); + + /** DeleteFirewallEndpointRequest name. */ + public name: string; + + /** DeleteFirewallEndpointRequest requestId. */ + public requestId: string; + + /** + * Creates a new DeleteFirewallEndpointRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteFirewallEndpointRequest instance + */ + public static create(properties?: google.cloud.networksecurity.v1.IDeleteFirewallEndpointRequest): google.cloud.networksecurity.v1.DeleteFirewallEndpointRequest; + + /** + * Encodes the specified DeleteFirewallEndpointRequest message. Does not implicitly {@link google.cloud.networksecurity.v1.DeleteFirewallEndpointRequest.verify|verify} messages. + * @param message DeleteFirewallEndpointRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.networksecurity.v1.IDeleteFirewallEndpointRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteFirewallEndpointRequest message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.DeleteFirewallEndpointRequest.verify|verify} messages. + * @param message DeleteFirewallEndpointRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.networksecurity.v1.IDeleteFirewallEndpointRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteFirewallEndpointRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteFirewallEndpointRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.networksecurity.v1.DeleteFirewallEndpointRequest; + + /** + * Decodes a DeleteFirewallEndpointRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteFirewallEndpointRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.networksecurity.v1.DeleteFirewallEndpointRequest; + + /** + * Verifies a DeleteFirewallEndpointRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteFirewallEndpointRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteFirewallEndpointRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.networksecurity.v1.DeleteFirewallEndpointRequest; + + /** + * Creates a plain object from a DeleteFirewallEndpointRequest message. Also converts values to other types if specified. + * @param message DeleteFirewallEndpointRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.networksecurity.v1.DeleteFirewallEndpointRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteFirewallEndpointRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteFirewallEndpointRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FirewallEndpointAssociation. */ + interface IFirewallEndpointAssociation { + + /** FirewallEndpointAssociation name */ + name?: (string|null); + + /** FirewallEndpointAssociation createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** FirewallEndpointAssociation updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** FirewallEndpointAssociation labels */ + labels?: ({ [k: string]: string }|null); + + /** FirewallEndpointAssociation state */ + state?: (google.cloud.networksecurity.v1.FirewallEndpointAssociation.State|keyof typeof google.cloud.networksecurity.v1.FirewallEndpointAssociation.State|null); + + /** FirewallEndpointAssociation network */ + network?: (string|null); + + /** FirewallEndpointAssociation firewallEndpoint */ + firewallEndpoint?: (string|null); + + /** FirewallEndpointAssociation tlsInspectionPolicy */ + tlsInspectionPolicy?: (string|null); + + /** FirewallEndpointAssociation reconciling */ + reconciling?: (boolean|null); + + /** FirewallEndpointAssociation disabled */ + disabled?: (boolean|null); + } + + /** Represents a FirewallEndpointAssociation. */ + class FirewallEndpointAssociation implements IFirewallEndpointAssociation { + + /** + * Constructs a new FirewallEndpointAssociation. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.networksecurity.v1.IFirewallEndpointAssociation); + + /** FirewallEndpointAssociation name. */ + public name: string; + + /** FirewallEndpointAssociation createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** FirewallEndpointAssociation updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** FirewallEndpointAssociation labels. */ + public labels: { [k: string]: string }; + + /** FirewallEndpointAssociation state. */ + public state: (google.cloud.networksecurity.v1.FirewallEndpointAssociation.State|keyof typeof google.cloud.networksecurity.v1.FirewallEndpointAssociation.State); + + /** FirewallEndpointAssociation network. */ + public network: string; + + /** FirewallEndpointAssociation firewallEndpoint. */ + public firewallEndpoint: string; + + /** FirewallEndpointAssociation tlsInspectionPolicy. */ + public tlsInspectionPolicy: string; + + /** FirewallEndpointAssociation reconciling. */ + public reconciling: boolean; + + /** FirewallEndpointAssociation disabled. */ + public disabled: boolean; + + /** + * Creates a new FirewallEndpointAssociation instance using the specified properties. + * @param [properties] Properties to set + * @returns FirewallEndpointAssociation instance + */ + public static create(properties?: google.cloud.networksecurity.v1.IFirewallEndpointAssociation): google.cloud.networksecurity.v1.FirewallEndpointAssociation; + + /** + * Encodes the specified FirewallEndpointAssociation message. Does not implicitly {@link google.cloud.networksecurity.v1.FirewallEndpointAssociation.verify|verify} messages. + * @param message FirewallEndpointAssociation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.networksecurity.v1.IFirewallEndpointAssociation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FirewallEndpointAssociation message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.FirewallEndpointAssociation.verify|verify} messages. + * @param message FirewallEndpointAssociation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.networksecurity.v1.IFirewallEndpointAssociation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FirewallEndpointAssociation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FirewallEndpointAssociation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.networksecurity.v1.FirewallEndpointAssociation; + + /** + * Decodes a FirewallEndpointAssociation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FirewallEndpointAssociation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.networksecurity.v1.FirewallEndpointAssociation; + + /** + * Verifies a FirewallEndpointAssociation message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FirewallEndpointAssociation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FirewallEndpointAssociation + */ + public static fromObject(object: { [k: string]: any }): google.cloud.networksecurity.v1.FirewallEndpointAssociation; + + /** + * Creates a plain object from a FirewallEndpointAssociation message. Also converts values to other types if specified. + * @param message FirewallEndpointAssociation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.networksecurity.v1.FirewallEndpointAssociation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FirewallEndpointAssociation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FirewallEndpointAssociation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace FirewallEndpointAssociation { + + /** State enum. */ + enum State { + STATE_UNSPECIFIED = 0, + CREATING = 1, + ACTIVE = 2, + DELETING = 3, + INACTIVE = 4, + ORPHAN = 5 + } + } + + /** Properties of a ListFirewallEndpointAssociationsRequest. */ + interface IListFirewallEndpointAssociationsRequest { + + /** ListFirewallEndpointAssociationsRequest parent */ + parent?: (string|null); + + /** ListFirewallEndpointAssociationsRequest pageSize */ + pageSize?: (number|null); + + /** ListFirewallEndpointAssociationsRequest pageToken */ + pageToken?: (string|null); + + /** ListFirewallEndpointAssociationsRequest filter */ + filter?: (string|null); + + /** ListFirewallEndpointAssociationsRequest orderBy */ + orderBy?: (string|null); + } + + /** Represents a ListFirewallEndpointAssociationsRequest. */ + class ListFirewallEndpointAssociationsRequest implements IListFirewallEndpointAssociationsRequest { + + /** + * Constructs a new ListFirewallEndpointAssociationsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.networksecurity.v1.IListFirewallEndpointAssociationsRequest); + + /** ListFirewallEndpointAssociationsRequest parent. */ + public parent: string; + + /** ListFirewallEndpointAssociationsRequest pageSize. */ + public pageSize: number; + + /** ListFirewallEndpointAssociationsRequest pageToken. */ + public pageToken: string; + + /** ListFirewallEndpointAssociationsRequest filter. */ + public filter: string; + + /** ListFirewallEndpointAssociationsRequest orderBy. */ + public orderBy: string; + + /** + * Creates a new ListFirewallEndpointAssociationsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListFirewallEndpointAssociationsRequest instance + */ + public static create(properties?: google.cloud.networksecurity.v1.IListFirewallEndpointAssociationsRequest): google.cloud.networksecurity.v1.ListFirewallEndpointAssociationsRequest; + + /** + * Encodes the specified ListFirewallEndpointAssociationsRequest message. Does not implicitly {@link google.cloud.networksecurity.v1.ListFirewallEndpointAssociationsRequest.verify|verify} messages. + * @param message ListFirewallEndpointAssociationsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.networksecurity.v1.IListFirewallEndpointAssociationsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListFirewallEndpointAssociationsRequest message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.ListFirewallEndpointAssociationsRequest.verify|verify} messages. + * @param message ListFirewallEndpointAssociationsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.networksecurity.v1.IListFirewallEndpointAssociationsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListFirewallEndpointAssociationsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListFirewallEndpointAssociationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.networksecurity.v1.ListFirewallEndpointAssociationsRequest; + + /** + * Decodes a ListFirewallEndpointAssociationsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListFirewallEndpointAssociationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.networksecurity.v1.ListFirewallEndpointAssociationsRequest; + + /** + * Verifies a ListFirewallEndpointAssociationsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListFirewallEndpointAssociationsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListFirewallEndpointAssociationsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.networksecurity.v1.ListFirewallEndpointAssociationsRequest; + + /** + * Creates a plain object from a ListFirewallEndpointAssociationsRequest message. Also converts values to other types if specified. + * @param message ListFirewallEndpointAssociationsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.networksecurity.v1.ListFirewallEndpointAssociationsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListFirewallEndpointAssociationsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListFirewallEndpointAssociationsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListFirewallEndpointAssociationsResponse. */ + interface IListFirewallEndpointAssociationsResponse { + + /** ListFirewallEndpointAssociationsResponse firewallEndpointAssociations */ + firewallEndpointAssociations?: (google.cloud.networksecurity.v1.IFirewallEndpointAssociation[]|null); + + /** ListFirewallEndpointAssociationsResponse nextPageToken */ + nextPageToken?: (string|null); + + /** ListFirewallEndpointAssociationsResponse unreachable */ + unreachable?: (string[]|null); + } + + /** Represents a ListFirewallEndpointAssociationsResponse. */ + class ListFirewallEndpointAssociationsResponse implements IListFirewallEndpointAssociationsResponse { + + /** + * Constructs a new ListFirewallEndpointAssociationsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.networksecurity.v1.IListFirewallEndpointAssociationsResponse); + + /** ListFirewallEndpointAssociationsResponse firewallEndpointAssociations. */ + public firewallEndpointAssociations: google.cloud.networksecurity.v1.IFirewallEndpointAssociation[]; + + /** ListFirewallEndpointAssociationsResponse nextPageToken. */ + public nextPageToken: string; + + /** ListFirewallEndpointAssociationsResponse unreachable. */ + public unreachable: string[]; + + /** + * Creates a new ListFirewallEndpointAssociationsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListFirewallEndpointAssociationsResponse instance + */ + public static create(properties?: google.cloud.networksecurity.v1.IListFirewallEndpointAssociationsResponse): google.cloud.networksecurity.v1.ListFirewallEndpointAssociationsResponse; + + /** + * Encodes the specified ListFirewallEndpointAssociationsResponse message. Does not implicitly {@link google.cloud.networksecurity.v1.ListFirewallEndpointAssociationsResponse.verify|verify} messages. + * @param message ListFirewallEndpointAssociationsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.networksecurity.v1.IListFirewallEndpointAssociationsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListFirewallEndpointAssociationsResponse message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.ListFirewallEndpointAssociationsResponse.verify|verify} messages. + * @param message ListFirewallEndpointAssociationsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.networksecurity.v1.IListFirewallEndpointAssociationsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListFirewallEndpointAssociationsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListFirewallEndpointAssociationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.networksecurity.v1.ListFirewallEndpointAssociationsResponse; + + /** + * Decodes a ListFirewallEndpointAssociationsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListFirewallEndpointAssociationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.networksecurity.v1.ListFirewallEndpointAssociationsResponse; + + /** + * Verifies a ListFirewallEndpointAssociationsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListFirewallEndpointAssociationsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListFirewallEndpointAssociationsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.networksecurity.v1.ListFirewallEndpointAssociationsResponse; + + /** + * Creates a plain object from a ListFirewallEndpointAssociationsResponse message. Also converts values to other types if specified. + * @param message ListFirewallEndpointAssociationsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.networksecurity.v1.ListFirewallEndpointAssociationsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListFirewallEndpointAssociationsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListFirewallEndpointAssociationsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetFirewallEndpointAssociationRequest. */ + interface IGetFirewallEndpointAssociationRequest { + + /** GetFirewallEndpointAssociationRequest name */ + name?: (string|null); + } + + /** Represents a GetFirewallEndpointAssociationRequest. */ + class GetFirewallEndpointAssociationRequest implements IGetFirewallEndpointAssociationRequest { + + /** + * Constructs a new GetFirewallEndpointAssociationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.networksecurity.v1.IGetFirewallEndpointAssociationRequest); + + /** GetFirewallEndpointAssociationRequest name. */ + public name: string; + + /** + * Creates a new GetFirewallEndpointAssociationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetFirewallEndpointAssociationRequest instance + */ + public static create(properties?: google.cloud.networksecurity.v1.IGetFirewallEndpointAssociationRequest): google.cloud.networksecurity.v1.GetFirewallEndpointAssociationRequest; + + /** + * Encodes the specified GetFirewallEndpointAssociationRequest message. Does not implicitly {@link google.cloud.networksecurity.v1.GetFirewallEndpointAssociationRequest.verify|verify} messages. + * @param message GetFirewallEndpointAssociationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.networksecurity.v1.IGetFirewallEndpointAssociationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetFirewallEndpointAssociationRequest message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.GetFirewallEndpointAssociationRequest.verify|verify} messages. + * @param message GetFirewallEndpointAssociationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.networksecurity.v1.IGetFirewallEndpointAssociationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetFirewallEndpointAssociationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetFirewallEndpointAssociationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.networksecurity.v1.GetFirewallEndpointAssociationRequest; + + /** + * Decodes a GetFirewallEndpointAssociationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetFirewallEndpointAssociationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.networksecurity.v1.GetFirewallEndpointAssociationRequest; + + /** + * Verifies a GetFirewallEndpointAssociationRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetFirewallEndpointAssociationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetFirewallEndpointAssociationRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.networksecurity.v1.GetFirewallEndpointAssociationRequest; + + /** + * Creates a plain object from a GetFirewallEndpointAssociationRequest message. Also converts values to other types if specified. + * @param message GetFirewallEndpointAssociationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.networksecurity.v1.GetFirewallEndpointAssociationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetFirewallEndpointAssociationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetFirewallEndpointAssociationRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateFirewallEndpointAssociationRequest. */ + interface ICreateFirewallEndpointAssociationRequest { + + /** CreateFirewallEndpointAssociationRequest parent */ + parent?: (string|null); + + /** CreateFirewallEndpointAssociationRequest firewallEndpointAssociationId */ + firewallEndpointAssociationId?: (string|null); + + /** CreateFirewallEndpointAssociationRequest firewallEndpointAssociation */ + firewallEndpointAssociation?: (google.cloud.networksecurity.v1.IFirewallEndpointAssociation|null); + + /** CreateFirewallEndpointAssociationRequest requestId */ + requestId?: (string|null); + } + + /** Represents a CreateFirewallEndpointAssociationRequest. */ + class CreateFirewallEndpointAssociationRequest implements ICreateFirewallEndpointAssociationRequest { + + /** + * Constructs a new CreateFirewallEndpointAssociationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.networksecurity.v1.ICreateFirewallEndpointAssociationRequest); + + /** CreateFirewallEndpointAssociationRequest parent. */ + public parent: string; + + /** CreateFirewallEndpointAssociationRequest firewallEndpointAssociationId. */ + public firewallEndpointAssociationId: string; + + /** CreateFirewallEndpointAssociationRequest firewallEndpointAssociation. */ + public firewallEndpointAssociation?: (google.cloud.networksecurity.v1.IFirewallEndpointAssociation|null); + + /** CreateFirewallEndpointAssociationRequest requestId. */ + public requestId: string; + + /** + * Creates a new CreateFirewallEndpointAssociationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateFirewallEndpointAssociationRequest instance + */ + public static create(properties?: google.cloud.networksecurity.v1.ICreateFirewallEndpointAssociationRequest): google.cloud.networksecurity.v1.CreateFirewallEndpointAssociationRequest; + + /** + * Encodes the specified CreateFirewallEndpointAssociationRequest message. Does not implicitly {@link google.cloud.networksecurity.v1.CreateFirewallEndpointAssociationRequest.verify|verify} messages. + * @param message CreateFirewallEndpointAssociationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.networksecurity.v1.ICreateFirewallEndpointAssociationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateFirewallEndpointAssociationRequest message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.CreateFirewallEndpointAssociationRequest.verify|verify} messages. + * @param message CreateFirewallEndpointAssociationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.networksecurity.v1.ICreateFirewallEndpointAssociationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateFirewallEndpointAssociationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateFirewallEndpointAssociationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.networksecurity.v1.CreateFirewallEndpointAssociationRequest; + + /** + * Decodes a CreateFirewallEndpointAssociationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateFirewallEndpointAssociationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.networksecurity.v1.CreateFirewallEndpointAssociationRequest; + + /** + * Verifies a CreateFirewallEndpointAssociationRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateFirewallEndpointAssociationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateFirewallEndpointAssociationRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.networksecurity.v1.CreateFirewallEndpointAssociationRequest; + + /** + * Creates a plain object from a CreateFirewallEndpointAssociationRequest message. Also converts values to other types if specified. + * @param message CreateFirewallEndpointAssociationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.networksecurity.v1.CreateFirewallEndpointAssociationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateFirewallEndpointAssociationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateFirewallEndpointAssociationRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteFirewallEndpointAssociationRequest. */ + interface IDeleteFirewallEndpointAssociationRequest { + + /** DeleteFirewallEndpointAssociationRequest name */ + name?: (string|null); + + /** DeleteFirewallEndpointAssociationRequest requestId */ + requestId?: (string|null); + } + + /** Represents a DeleteFirewallEndpointAssociationRequest. */ + class DeleteFirewallEndpointAssociationRequest implements IDeleteFirewallEndpointAssociationRequest { + + /** + * Constructs a new DeleteFirewallEndpointAssociationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.networksecurity.v1.IDeleteFirewallEndpointAssociationRequest); + + /** DeleteFirewallEndpointAssociationRequest name. */ + public name: string; + + /** DeleteFirewallEndpointAssociationRequest requestId. */ + public requestId: string; + + /** + * Creates a new DeleteFirewallEndpointAssociationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteFirewallEndpointAssociationRequest instance + */ + public static create(properties?: google.cloud.networksecurity.v1.IDeleteFirewallEndpointAssociationRequest): google.cloud.networksecurity.v1.DeleteFirewallEndpointAssociationRequest; + + /** + * Encodes the specified DeleteFirewallEndpointAssociationRequest message. Does not implicitly {@link google.cloud.networksecurity.v1.DeleteFirewallEndpointAssociationRequest.verify|verify} messages. + * @param message DeleteFirewallEndpointAssociationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.networksecurity.v1.IDeleteFirewallEndpointAssociationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteFirewallEndpointAssociationRequest message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.DeleteFirewallEndpointAssociationRequest.verify|verify} messages. + * @param message DeleteFirewallEndpointAssociationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.networksecurity.v1.IDeleteFirewallEndpointAssociationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteFirewallEndpointAssociationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteFirewallEndpointAssociationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.networksecurity.v1.DeleteFirewallEndpointAssociationRequest; + + /** + * Decodes a DeleteFirewallEndpointAssociationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteFirewallEndpointAssociationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.networksecurity.v1.DeleteFirewallEndpointAssociationRequest; + + /** + * Verifies a DeleteFirewallEndpointAssociationRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteFirewallEndpointAssociationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteFirewallEndpointAssociationRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.networksecurity.v1.DeleteFirewallEndpointAssociationRequest; + + /** + * Creates a plain object from a DeleteFirewallEndpointAssociationRequest message. Also converts values to other types if specified. + * @param message DeleteFirewallEndpointAssociationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.networksecurity.v1.DeleteFirewallEndpointAssociationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteFirewallEndpointAssociationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteFirewallEndpointAssociationRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateFirewallEndpointAssociationRequest. */ + interface IUpdateFirewallEndpointAssociationRequest { + + /** UpdateFirewallEndpointAssociationRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateFirewallEndpointAssociationRequest firewallEndpointAssociation */ + firewallEndpointAssociation?: (google.cloud.networksecurity.v1.IFirewallEndpointAssociation|null); + + /** UpdateFirewallEndpointAssociationRequest requestId */ + requestId?: (string|null); + } + + /** Represents an UpdateFirewallEndpointAssociationRequest. */ + class UpdateFirewallEndpointAssociationRequest implements IUpdateFirewallEndpointAssociationRequest { + + /** + * Constructs a new UpdateFirewallEndpointAssociationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.networksecurity.v1.IUpdateFirewallEndpointAssociationRequest); + + /** UpdateFirewallEndpointAssociationRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateFirewallEndpointAssociationRequest firewallEndpointAssociation. */ + public firewallEndpointAssociation?: (google.cloud.networksecurity.v1.IFirewallEndpointAssociation|null); + + /** UpdateFirewallEndpointAssociationRequest requestId. */ + public requestId: string; + + /** + * Creates a new UpdateFirewallEndpointAssociationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateFirewallEndpointAssociationRequest instance + */ + public static create(properties?: google.cloud.networksecurity.v1.IUpdateFirewallEndpointAssociationRequest): google.cloud.networksecurity.v1.UpdateFirewallEndpointAssociationRequest; + + /** + * Encodes the specified UpdateFirewallEndpointAssociationRequest message. Does not implicitly {@link google.cloud.networksecurity.v1.UpdateFirewallEndpointAssociationRequest.verify|verify} messages. + * @param message UpdateFirewallEndpointAssociationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.networksecurity.v1.IUpdateFirewallEndpointAssociationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateFirewallEndpointAssociationRequest message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.UpdateFirewallEndpointAssociationRequest.verify|verify} messages. + * @param message UpdateFirewallEndpointAssociationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.networksecurity.v1.IUpdateFirewallEndpointAssociationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateFirewallEndpointAssociationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateFirewallEndpointAssociationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.networksecurity.v1.UpdateFirewallEndpointAssociationRequest; + + /** + * Decodes an UpdateFirewallEndpointAssociationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateFirewallEndpointAssociationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.networksecurity.v1.UpdateFirewallEndpointAssociationRequest; + + /** + * Verifies an UpdateFirewallEndpointAssociationRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UpdateFirewallEndpointAssociationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateFirewallEndpointAssociationRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.networksecurity.v1.UpdateFirewallEndpointAssociationRequest; + + /** + * Creates a plain object from an UpdateFirewallEndpointAssociationRequest message. Also converts values to other types if specified. + * @param message UpdateFirewallEndpointAssociationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.networksecurity.v1.UpdateFirewallEndpointAssociationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateFirewallEndpointAssociationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateFirewallEndpointAssociationRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GatewaySecurityPolicy. */ + interface IGatewaySecurityPolicy { + + /** GatewaySecurityPolicy name */ + name?: (string|null); + + /** GatewaySecurityPolicy createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** GatewaySecurityPolicy updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** GatewaySecurityPolicy description */ + description?: (string|null); + + /** GatewaySecurityPolicy tlsInspectionPolicy */ + tlsInspectionPolicy?: (string|null); + } + + /** Represents a GatewaySecurityPolicy. */ + class GatewaySecurityPolicy implements IGatewaySecurityPolicy { + + /** + * Constructs a new GatewaySecurityPolicy. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.networksecurity.v1.IGatewaySecurityPolicy); + + /** GatewaySecurityPolicy name. */ + public name: string; + + /** GatewaySecurityPolicy createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** GatewaySecurityPolicy updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** GatewaySecurityPolicy description. */ + public description: string; + + /** GatewaySecurityPolicy tlsInspectionPolicy. */ + public tlsInspectionPolicy: string; + + /** + * Creates a new GatewaySecurityPolicy instance using the specified properties. + * @param [properties] Properties to set + * @returns GatewaySecurityPolicy instance + */ + public static create(properties?: google.cloud.networksecurity.v1.IGatewaySecurityPolicy): google.cloud.networksecurity.v1.GatewaySecurityPolicy; + + /** + * Encodes the specified GatewaySecurityPolicy message. Does not implicitly {@link google.cloud.networksecurity.v1.GatewaySecurityPolicy.verify|verify} messages. + * @param message GatewaySecurityPolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.networksecurity.v1.IGatewaySecurityPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GatewaySecurityPolicy message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.GatewaySecurityPolicy.verify|verify} messages. + * @param message GatewaySecurityPolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.networksecurity.v1.IGatewaySecurityPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GatewaySecurityPolicy message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GatewaySecurityPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.networksecurity.v1.GatewaySecurityPolicy; + + /** + * Decodes a GatewaySecurityPolicy message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GatewaySecurityPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.networksecurity.v1.GatewaySecurityPolicy; + + /** + * Verifies a GatewaySecurityPolicy message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GatewaySecurityPolicy message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GatewaySecurityPolicy + */ + public static fromObject(object: { [k: string]: any }): google.cloud.networksecurity.v1.GatewaySecurityPolicy; + + /** + * Creates a plain object from a GatewaySecurityPolicy message. Also converts values to other types if specified. + * @param message GatewaySecurityPolicy + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.networksecurity.v1.GatewaySecurityPolicy, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GatewaySecurityPolicy to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GatewaySecurityPolicy + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateGatewaySecurityPolicyRequest. */ + interface ICreateGatewaySecurityPolicyRequest { + + /** CreateGatewaySecurityPolicyRequest parent */ + parent?: (string|null); + + /** CreateGatewaySecurityPolicyRequest gatewaySecurityPolicyId */ + gatewaySecurityPolicyId?: (string|null); + + /** CreateGatewaySecurityPolicyRequest gatewaySecurityPolicy */ + gatewaySecurityPolicy?: (google.cloud.networksecurity.v1.IGatewaySecurityPolicy|null); + } + + /** Represents a CreateGatewaySecurityPolicyRequest. */ + class CreateGatewaySecurityPolicyRequest implements ICreateGatewaySecurityPolicyRequest { + + /** + * Constructs a new CreateGatewaySecurityPolicyRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.networksecurity.v1.ICreateGatewaySecurityPolicyRequest); + + /** CreateGatewaySecurityPolicyRequest parent. */ + public parent: string; + + /** CreateGatewaySecurityPolicyRequest gatewaySecurityPolicyId. */ + public gatewaySecurityPolicyId: string; + + /** CreateGatewaySecurityPolicyRequest gatewaySecurityPolicy. */ + public gatewaySecurityPolicy?: (google.cloud.networksecurity.v1.IGatewaySecurityPolicy|null); + + /** + * Creates a new CreateGatewaySecurityPolicyRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateGatewaySecurityPolicyRequest instance + */ + public static create(properties?: google.cloud.networksecurity.v1.ICreateGatewaySecurityPolicyRequest): google.cloud.networksecurity.v1.CreateGatewaySecurityPolicyRequest; + + /** + * Encodes the specified CreateGatewaySecurityPolicyRequest message. Does not implicitly {@link google.cloud.networksecurity.v1.CreateGatewaySecurityPolicyRequest.verify|verify} messages. + * @param message CreateGatewaySecurityPolicyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.networksecurity.v1.ICreateGatewaySecurityPolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateGatewaySecurityPolicyRequest message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.CreateGatewaySecurityPolicyRequest.verify|verify} messages. + * @param message CreateGatewaySecurityPolicyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.networksecurity.v1.ICreateGatewaySecurityPolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateGatewaySecurityPolicyRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateGatewaySecurityPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.networksecurity.v1.CreateGatewaySecurityPolicyRequest; + + /** + * Decodes a CreateGatewaySecurityPolicyRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateGatewaySecurityPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.networksecurity.v1.CreateGatewaySecurityPolicyRequest; + + /** + * Verifies a CreateGatewaySecurityPolicyRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateGatewaySecurityPolicyRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateGatewaySecurityPolicyRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.networksecurity.v1.CreateGatewaySecurityPolicyRequest; + + /** + * Creates a plain object from a CreateGatewaySecurityPolicyRequest message. Also converts values to other types if specified. + * @param message CreateGatewaySecurityPolicyRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.networksecurity.v1.CreateGatewaySecurityPolicyRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateGatewaySecurityPolicyRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateGatewaySecurityPolicyRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListGatewaySecurityPoliciesRequest. */ + interface IListGatewaySecurityPoliciesRequest { + + /** ListGatewaySecurityPoliciesRequest parent */ + parent?: (string|null); + + /** ListGatewaySecurityPoliciesRequest pageSize */ + pageSize?: (number|null); + + /** ListGatewaySecurityPoliciesRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListGatewaySecurityPoliciesRequest. */ + class ListGatewaySecurityPoliciesRequest implements IListGatewaySecurityPoliciesRequest { + + /** + * Constructs a new ListGatewaySecurityPoliciesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.networksecurity.v1.IListGatewaySecurityPoliciesRequest); + + /** ListGatewaySecurityPoliciesRequest parent. */ + public parent: string; + + /** ListGatewaySecurityPoliciesRequest pageSize. */ + public pageSize: number; + + /** ListGatewaySecurityPoliciesRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListGatewaySecurityPoliciesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListGatewaySecurityPoliciesRequest instance + */ + public static create(properties?: google.cloud.networksecurity.v1.IListGatewaySecurityPoliciesRequest): google.cloud.networksecurity.v1.ListGatewaySecurityPoliciesRequest; + + /** + * Encodes the specified ListGatewaySecurityPoliciesRequest message. Does not implicitly {@link google.cloud.networksecurity.v1.ListGatewaySecurityPoliciesRequest.verify|verify} messages. + * @param message ListGatewaySecurityPoliciesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.networksecurity.v1.IListGatewaySecurityPoliciesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListGatewaySecurityPoliciesRequest message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.ListGatewaySecurityPoliciesRequest.verify|verify} messages. + * @param message ListGatewaySecurityPoliciesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.networksecurity.v1.IListGatewaySecurityPoliciesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListGatewaySecurityPoliciesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListGatewaySecurityPoliciesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.networksecurity.v1.ListGatewaySecurityPoliciesRequest; + + /** + * Decodes a ListGatewaySecurityPoliciesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListGatewaySecurityPoliciesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.networksecurity.v1.ListGatewaySecurityPoliciesRequest; + + /** + * Verifies a ListGatewaySecurityPoliciesRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListGatewaySecurityPoliciesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListGatewaySecurityPoliciesRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.networksecurity.v1.ListGatewaySecurityPoliciesRequest; + + /** + * Creates a plain object from a ListGatewaySecurityPoliciesRequest message. Also converts values to other types if specified. + * @param message ListGatewaySecurityPoliciesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.networksecurity.v1.ListGatewaySecurityPoliciesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListGatewaySecurityPoliciesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListGatewaySecurityPoliciesRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListGatewaySecurityPoliciesResponse. */ + interface IListGatewaySecurityPoliciesResponse { + + /** ListGatewaySecurityPoliciesResponse gatewaySecurityPolicies */ + gatewaySecurityPolicies?: (google.cloud.networksecurity.v1.IGatewaySecurityPolicy[]|null); + + /** ListGatewaySecurityPoliciesResponse nextPageToken */ + nextPageToken?: (string|null); + + /** ListGatewaySecurityPoliciesResponse unreachable */ + unreachable?: (string[]|null); + } + + /** Represents a ListGatewaySecurityPoliciesResponse. */ + class ListGatewaySecurityPoliciesResponse implements IListGatewaySecurityPoliciesResponse { + + /** + * Constructs a new ListGatewaySecurityPoliciesResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.networksecurity.v1.IListGatewaySecurityPoliciesResponse); + + /** ListGatewaySecurityPoliciesResponse gatewaySecurityPolicies. */ + public gatewaySecurityPolicies: google.cloud.networksecurity.v1.IGatewaySecurityPolicy[]; + + /** ListGatewaySecurityPoliciesResponse nextPageToken. */ + public nextPageToken: string; + + /** ListGatewaySecurityPoliciesResponse unreachable. */ + public unreachable: string[]; + + /** + * Creates a new ListGatewaySecurityPoliciesResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListGatewaySecurityPoliciesResponse instance + */ + public static create(properties?: google.cloud.networksecurity.v1.IListGatewaySecurityPoliciesResponse): google.cloud.networksecurity.v1.ListGatewaySecurityPoliciesResponse; + + /** + * Encodes the specified ListGatewaySecurityPoliciesResponse message. Does not implicitly {@link google.cloud.networksecurity.v1.ListGatewaySecurityPoliciesResponse.verify|verify} messages. + * @param message ListGatewaySecurityPoliciesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.networksecurity.v1.IListGatewaySecurityPoliciesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListGatewaySecurityPoliciesResponse message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.ListGatewaySecurityPoliciesResponse.verify|verify} messages. + * @param message ListGatewaySecurityPoliciesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.networksecurity.v1.IListGatewaySecurityPoliciesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListGatewaySecurityPoliciesResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListGatewaySecurityPoliciesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.networksecurity.v1.ListGatewaySecurityPoliciesResponse; + + /** + * Decodes a ListGatewaySecurityPoliciesResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListGatewaySecurityPoliciesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.networksecurity.v1.ListGatewaySecurityPoliciesResponse; + + /** + * Verifies a ListGatewaySecurityPoliciesResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListGatewaySecurityPoliciesResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListGatewaySecurityPoliciesResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.networksecurity.v1.ListGatewaySecurityPoliciesResponse; + + /** + * Creates a plain object from a ListGatewaySecurityPoliciesResponse message. Also converts values to other types if specified. + * @param message ListGatewaySecurityPoliciesResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.networksecurity.v1.ListGatewaySecurityPoliciesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListGatewaySecurityPoliciesResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListGatewaySecurityPoliciesResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetGatewaySecurityPolicyRequest. */ + interface IGetGatewaySecurityPolicyRequest { + + /** GetGatewaySecurityPolicyRequest name */ + name?: (string|null); + } + + /** Represents a GetGatewaySecurityPolicyRequest. */ + class GetGatewaySecurityPolicyRequest implements IGetGatewaySecurityPolicyRequest { + + /** + * Constructs a new GetGatewaySecurityPolicyRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.networksecurity.v1.IGetGatewaySecurityPolicyRequest); + + /** GetGatewaySecurityPolicyRequest name. */ + public name: string; + + /** + * Creates a new GetGatewaySecurityPolicyRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetGatewaySecurityPolicyRequest instance + */ + public static create(properties?: google.cloud.networksecurity.v1.IGetGatewaySecurityPolicyRequest): google.cloud.networksecurity.v1.GetGatewaySecurityPolicyRequest; + + /** + * Encodes the specified GetGatewaySecurityPolicyRequest message. Does not implicitly {@link google.cloud.networksecurity.v1.GetGatewaySecurityPolicyRequest.verify|verify} messages. + * @param message GetGatewaySecurityPolicyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.networksecurity.v1.IGetGatewaySecurityPolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetGatewaySecurityPolicyRequest message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.GetGatewaySecurityPolicyRequest.verify|verify} messages. + * @param message GetGatewaySecurityPolicyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.networksecurity.v1.IGetGatewaySecurityPolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetGatewaySecurityPolicyRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetGatewaySecurityPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.networksecurity.v1.GetGatewaySecurityPolicyRequest; + + /** + * Decodes a GetGatewaySecurityPolicyRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetGatewaySecurityPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.networksecurity.v1.GetGatewaySecurityPolicyRequest; + + /** + * Verifies a GetGatewaySecurityPolicyRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetGatewaySecurityPolicyRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetGatewaySecurityPolicyRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.networksecurity.v1.GetGatewaySecurityPolicyRequest; + + /** + * Creates a plain object from a GetGatewaySecurityPolicyRequest message. Also converts values to other types if specified. + * @param message GetGatewaySecurityPolicyRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.networksecurity.v1.GetGatewaySecurityPolicyRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetGatewaySecurityPolicyRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetGatewaySecurityPolicyRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteGatewaySecurityPolicyRequest. */ + interface IDeleteGatewaySecurityPolicyRequest { + + /** DeleteGatewaySecurityPolicyRequest name */ + name?: (string|null); + } + + /** Represents a DeleteGatewaySecurityPolicyRequest. */ + class DeleteGatewaySecurityPolicyRequest implements IDeleteGatewaySecurityPolicyRequest { + + /** + * Constructs a new DeleteGatewaySecurityPolicyRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.networksecurity.v1.IDeleteGatewaySecurityPolicyRequest); + + /** DeleteGatewaySecurityPolicyRequest name. */ + public name: string; + + /** + * Creates a new DeleteGatewaySecurityPolicyRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteGatewaySecurityPolicyRequest instance + */ + public static create(properties?: google.cloud.networksecurity.v1.IDeleteGatewaySecurityPolicyRequest): google.cloud.networksecurity.v1.DeleteGatewaySecurityPolicyRequest; + + /** + * Encodes the specified DeleteGatewaySecurityPolicyRequest message. Does not implicitly {@link google.cloud.networksecurity.v1.DeleteGatewaySecurityPolicyRequest.verify|verify} messages. + * @param message DeleteGatewaySecurityPolicyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.networksecurity.v1.IDeleteGatewaySecurityPolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteGatewaySecurityPolicyRequest message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.DeleteGatewaySecurityPolicyRequest.verify|verify} messages. + * @param message DeleteGatewaySecurityPolicyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.networksecurity.v1.IDeleteGatewaySecurityPolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteGatewaySecurityPolicyRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteGatewaySecurityPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.networksecurity.v1.DeleteGatewaySecurityPolicyRequest; + + /** + * Decodes a DeleteGatewaySecurityPolicyRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteGatewaySecurityPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.networksecurity.v1.DeleteGatewaySecurityPolicyRequest; + + /** + * Verifies a DeleteGatewaySecurityPolicyRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteGatewaySecurityPolicyRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteGatewaySecurityPolicyRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.networksecurity.v1.DeleteGatewaySecurityPolicyRequest; + + /** + * Creates a plain object from a DeleteGatewaySecurityPolicyRequest message. Also converts values to other types if specified. + * @param message DeleteGatewaySecurityPolicyRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.networksecurity.v1.DeleteGatewaySecurityPolicyRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteGatewaySecurityPolicyRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteGatewaySecurityPolicyRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateGatewaySecurityPolicyRequest. */ + interface IUpdateGatewaySecurityPolicyRequest { + + /** UpdateGatewaySecurityPolicyRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateGatewaySecurityPolicyRequest gatewaySecurityPolicy */ + gatewaySecurityPolicy?: (google.cloud.networksecurity.v1.IGatewaySecurityPolicy|null); + } + + /** Represents an UpdateGatewaySecurityPolicyRequest. */ + class UpdateGatewaySecurityPolicyRequest implements IUpdateGatewaySecurityPolicyRequest { + + /** + * Constructs a new UpdateGatewaySecurityPolicyRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.networksecurity.v1.IUpdateGatewaySecurityPolicyRequest); + + /** UpdateGatewaySecurityPolicyRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateGatewaySecurityPolicyRequest gatewaySecurityPolicy. */ + public gatewaySecurityPolicy?: (google.cloud.networksecurity.v1.IGatewaySecurityPolicy|null); + + /** + * Creates a new UpdateGatewaySecurityPolicyRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateGatewaySecurityPolicyRequest instance + */ + public static create(properties?: google.cloud.networksecurity.v1.IUpdateGatewaySecurityPolicyRequest): google.cloud.networksecurity.v1.UpdateGatewaySecurityPolicyRequest; + + /** + * Encodes the specified UpdateGatewaySecurityPolicyRequest message. Does not implicitly {@link google.cloud.networksecurity.v1.UpdateGatewaySecurityPolicyRequest.verify|verify} messages. + * @param message UpdateGatewaySecurityPolicyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.networksecurity.v1.IUpdateGatewaySecurityPolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateGatewaySecurityPolicyRequest message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.UpdateGatewaySecurityPolicyRequest.verify|verify} messages. + * @param message UpdateGatewaySecurityPolicyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.networksecurity.v1.IUpdateGatewaySecurityPolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateGatewaySecurityPolicyRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateGatewaySecurityPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.networksecurity.v1.UpdateGatewaySecurityPolicyRequest; + + /** + * Decodes an UpdateGatewaySecurityPolicyRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateGatewaySecurityPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.networksecurity.v1.UpdateGatewaySecurityPolicyRequest; + + /** + * Verifies an UpdateGatewaySecurityPolicyRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UpdateGatewaySecurityPolicyRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateGatewaySecurityPolicyRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.networksecurity.v1.UpdateGatewaySecurityPolicyRequest; + + /** + * Creates a plain object from an UpdateGatewaySecurityPolicyRequest message. Also converts values to other types if specified. + * @param message UpdateGatewaySecurityPolicyRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.networksecurity.v1.UpdateGatewaySecurityPolicyRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateGatewaySecurityPolicyRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateGatewaySecurityPolicyRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GatewaySecurityPolicyRule. */ + interface IGatewaySecurityPolicyRule { + + /** GatewaySecurityPolicyRule basicProfile */ + basicProfile?: (google.cloud.networksecurity.v1.GatewaySecurityPolicyRule.BasicProfile|keyof typeof google.cloud.networksecurity.v1.GatewaySecurityPolicyRule.BasicProfile|null); + + /** GatewaySecurityPolicyRule name */ + name?: (string|null); + + /** GatewaySecurityPolicyRule createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** GatewaySecurityPolicyRule updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** GatewaySecurityPolicyRule enabled */ + enabled?: (boolean|null); + + /** GatewaySecurityPolicyRule priority */ + priority?: (number|null); + + /** GatewaySecurityPolicyRule description */ + description?: (string|null); + + /** GatewaySecurityPolicyRule sessionMatcher */ + sessionMatcher?: (string|null); + + /** GatewaySecurityPolicyRule applicationMatcher */ + applicationMatcher?: (string|null); + + /** GatewaySecurityPolicyRule tlsInspectionEnabled */ + tlsInspectionEnabled?: (boolean|null); + } + + /** Represents a GatewaySecurityPolicyRule. */ + class GatewaySecurityPolicyRule implements IGatewaySecurityPolicyRule { + + /** + * Constructs a new GatewaySecurityPolicyRule. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.networksecurity.v1.IGatewaySecurityPolicyRule); + + /** GatewaySecurityPolicyRule basicProfile. */ + public basicProfile?: (google.cloud.networksecurity.v1.GatewaySecurityPolicyRule.BasicProfile|keyof typeof google.cloud.networksecurity.v1.GatewaySecurityPolicyRule.BasicProfile|null); + + /** GatewaySecurityPolicyRule name. */ + public name: string; + + /** GatewaySecurityPolicyRule createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** GatewaySecurityPolicyRule updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** GatewaySecurityPolicyRule enabled. */ + public enabled: boolean; + + /** GatewaySecurityPolicyRule priority. */ + public priority: number; + + /** GatewaySecurityPolicyRule description. */ + public description: string; + + /** GatewaySecurityPolicyRule sessionMatcher. */ + public sessionMatcher: string; + + /** GatewaySecurityPolicyRule applicationMatcher. */ + public applicationMatcher: string; + + /** GatewaySecurityPolicyRule tlsInspectionEnabled. */ + public tlsInspectionEnabled: boolean; + + /** GatewaySecurityPolicyRule profile. */ + public profile?: "basicProfile"; + + /** + * Creates a new GatewaySecurityPolicyRule instance using the specified properties. + * @param [properties] Properties to set + * @returns GatewaySecurityPolicyRule instance + */ + public static create(properties?: google.cloud.networksecurity.v1.IGatewaySecurityPolicyRule): google.cloud.networksecurity.v1.GatewaySecurityPolicyRule; + + /** + * Encodes the specified GatewaySecurityPolicyRule message. Does not implicitly {@link google.cloud.networksecurity.v1.GatewaySecurityPolicyRule.verify|verify} messages. + * @param message GatewaySecurityPolicyRule message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.networksecurity.v1.IGatewaySecurityPolicyRule, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GatewaySecurityPolicyRule message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.GatewaySecurityPolicyRule.verify|verify} messages. + * @param message GatewaySecurityPolicyRule message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.networksecurity.v1.IGatewaySecurityPolicyRule, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GatewaySecurityPolicyRule message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GatewaySecurityPolicyRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.networksecurity.v1.GatewaySecurityPolicyRule; + + /** + * Decodes a GatewaySecurityPolicyRule message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GatewaySecurityPolicyRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.networksecurity.v1.GatewaySecurityPolicyRule; + + /** + * Verifies a GatewaySecurityPolicyRule message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GatewaySecurityPolicyRule message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GatewaySecurityPolicyRule + */ + public static fromObject(object: { [k: string]: any }): google.cloud.networksecurity.v1.GatewaySecurityPolicyRule; + + /** + * Creates a plain object from a GatewaySecurityPolicyRule message. Also converts values to other types if specified. + * @param message GatewaySecurityPolicyRule + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.networksecurity.v1.GatewaySecurityPolicyRule, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GatewaySecurityPolicyRule to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GatewaySecurityPolicyRule + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace GatewaySecurityPolicyRule { + + /** BasicProfile enum. */ + enum BasicProfile { + BASIC_PROFILE_UNSPECIFIED = 0, + ALLOW = 1, + DENY = 2 + } + } + + /** Properties of a CreateGatewaySecurityPolicyRuleRequest. */ + interface ICreateGatewaySecurityPolicyRuleRequest { + + /** CreateGatewaySecurityPolicyRuleRequest parent */ + parent?: (string|null); + + /** CreateGatewaySecurityPolicyRuleRequest gatewaySecurityPolicyRule */ + gatewaySecurityPolicyRule?: (google.cloud.networksecurity.v1.IGatewaySecurityPolicyRule|null); + + /** CreateGatewaySecurityPolicyRuleRequest gatewaySecurityPolicyRuleId */ + gatewaySecurityPolicyRuleId?: (string|null); + } + + /** Represents a CreateGatewaySecurityPolicyRuleRequest. */ + class CreateGatewaySecurityPolicyRuleRequest implements ICreateGatewaySecurityPolicyRuleRequest { + + /** + * Constructs a new CreateGatewaySecurityPolicyRuleRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.networksecurity.v1.ICreateGatewaySecurityPolicyRuleRequest); + + /** CreateGatewaySecurityPolicyRuleRequest parent. */ + public parent: string; + + /** CreateGatewaySecurityPolicyRuleRequest gatewaySecurityPolicyRule. */ + public gatewaySecurityPolicyRule?: (google.cloud.networksecurity.v1.IGatewaySecurityPolicyRule|null); + + /** CreateGatewaySecurityPolicyRuleRequest gatewaySecurityPolicyRuleId. */ + public gatewaySecurityPolicyRuleId: string; + + /** + * Creates a new CreateGatewaySecurityPolicyRuleRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateGatewaySecurityPolicyRuleRequest instance + */ + public static create(properties?: google.cloud.networksecurity.v1.ICreateGatewaySecurityPolicyRuleRequest): google.cloud.networksecurity.v1.CreateGatewaySecurityPolicyRuleRequest; + + /** + * Encodes the specified CreateGatewaySecurityPolicyRuleRequest message. Does not implicitly {@link google.cloud.networksecurity.v1.CreateGatewaySecurityPolicyRuleRequest.verify|verify} messages. + * @param message CreateGatewaySecurityPolicyRuleRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.networksecurity.v1.ICreateGatewaySecurityPolicyRuleRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateGatewaySecurityPolicyRuleRequest message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.CreateGatewaySecurityPolicyRuleRequest.verify|verify} messages. + * @param message CreateGatewaySecurityPolicyRuleRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.networksecurity.v1.ICreateGatewaySecurityPolicyRuleRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateGatewaySecurityPolicyRuleRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateGatewaySecurityPolicyRuleRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.networksecurity.v1.CreateGatewaySecurityPolicyRuleRequest; + + /** + * Decodes a CreateGatewaySecurityPolicyRuleRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateGatewaySecurityPolicyRuleRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.networksecurity.v1.CreateGatewaySecurityPolicyRuleRequest; + + /** + * Verifies a CreateGatewaySecurityPolicyRuleRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateGatewaySecurityPolicyRuleRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateGatewaySecurityPolicyRuleRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.networksecurity.v1.CreateGatewaySecurityPolicyRuleRequest; + + /** + * Creates a plain object from a CreateGatewaySecurityPolicyRuleRequest message. Also converts values to other types if specified. + * @param message CreateGatewaySecurityPolicyRuleRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.networksecurity.v1.CreateGatewaySecurityPolicyRuleRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateGatewaySecurityPolicyRuleRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateGatewaySecurityPolicyRuleRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetGatewaySecurityPolicyRuleRequest. */ + interface IGetGatewaySecurityPolicyRuleRequest { + + /** GetGatewaySecurityPolicyRuleRequest name */ + name?: (string|null); + } + + /** Represents a GetGatewaySecurityPolicyRuleRequest. */ + class GetGatewaySecurityPolicyRuleRequest implements IGetGatewaySecurityPolicyRuleRequest { + + /** + * Constructs a new GetGatewaySecurityPolicyRuleRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.networksecurity.v1.IGetGatewaySecurityPolicyRuleRequest); + + /** GetGatewaySecurityPolicyRuleRequest name. */ + public name: string; + + /** + * Creates a new GetGatewaySecurityPolicyRuleRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetGatewaySecurityPolicyRuleRequest instance + */ + public static create(properties?: google.cloud.networksecurity.v1.IGetGatewaySecurityPolicyRuleRequest): google.cloud.networksecurity.v1.GetGatewaySecurityPolicyRuleRequest; + + /** + * Encodes the specified GetGatewaySecurityPolicyRuleRequest message. Does not implicitly {@link google.cloud.networksecurity.v1.GetGatewaySecurityPolicyRuleRequest.verify|verify} messages. + * @param message GetGatewaySecurityPolicyRuleRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.networksecurity.v1.IGetGatewaySecurityPolicyRuleRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetGatewaySecurityPolicyRuleRequest message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.GetGatewaySecurityPolicyRuleRequest.verify|verify} messages. + * @param message GetGatewaySecurityPolicyRuleRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.networksecurity.v1.IGetGatewaySecurityPolicyRuleRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetGatewaySecurityPolicyRuleRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetGatewaySecurityPolicyRuleRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.networksecurity.v1.GetGatewaySecurityPolicyRuleRequest; + + /** + * Decodes a GetGatewaySecurityPolicyRuleRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetGatewaySecurityPolicyRuleRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.networksecurity.v1.GetGatewaySecurityPolicyRuleRequest; + + /** + * Verifies a GetGatewaySecurityPolicyRuleRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetGatewaySecurityPolicyRuleRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetGatewaySecurityPolicyRuleRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.networksecurity.v1.GetGatewaySecurityPolicyRuleRequest; + + /** + * Creates a plain object from a GetGatewaySecurityPolicyRuleRequest message. Also converts values to other types if specified. + * @param message GetGatewaySecurityPolicyRuleRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.networksecurity.v1.GetGatewaySecurityPolicyRuleRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetGatewaySecurityPolicyRuleRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetGatewaySecurityPolicyRuleRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateGatewaySecurityPolicyRuleRequest. */ + interface IUpdateGatewaySecurityPolicyRuleRequest { + + /** UpdateGatewaySecurityPolicyRuleRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateGatewaySecurityPolicyRuleRequest gatewaySecurityPolicyRule */ + gatewaySecurityPolicyRule?: (google.cloud.networksecurity.v1.IGatewaySecurityPolicyRule|null); + } + + /** Represents an UpdateGatewaySecurityPolicyRuleRequest. */ + class UpdateGatewaySecurityPolicyRuleRequest implements IUpdateGatewaySecurityPolicyRuleRequest { + + /** + * Constructs a new UpdateGatewaySecurityPolicyRuleRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.networksecurity.v1.IUpdateGatewaySecurityPolicyRuleRequest); + + /** UpdateGatewaySecurityPolicyRuleRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateGatewaySecurityPolicyRuleRequest gatewaySecurityPolicyRule. */ + public gatewaySecurityPolicyRule?: (google.cloud.networksecurity.v1.IGatewaySecurityPolicyRule|null); + + /** + * Creates a new UpdateGatewaySecurityPolicyRuleRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateGatewaySecurityPolicyRuleRequest instance + */ + public static create(properties?: google.cloud.networksecurity.v1.IUpdateGatewaySecurityPolicyRuleRequest): google.cloud.networksecurity.v1.UpdateGatewaySecurityPolicyRuleRequest; + + /** + * Encodes the specified UpdateGatewaySecurityPolicyRuleRequest message. Does not implicitly {@link google.cloud.networksecurity.v1.UpdateGatewaySecurityPolicyRuleRequest.verify|verify} messages. + * @param message UpdateGatewaySecurityPolicyRuleRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.networksecurity.v1.IUpdateGatewaySecurityPolicyRuleRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateGatewaySecurityPolicyRuleRequest message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.UpdateGatewaySecurityPolicyRuleRequest.verify|verify} messages. + * @param message UpdateGatewaySecurityPolicyRuleRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.networksecurity.v1.IUpdateGatewaySecurityPolicyRuleRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateGatewaySecurityPolicyRuleRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateGatewaySecurityPolicyRuleRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.networksecurity.v1.UpdateGatewaySecurityPolicyRuleRequest; + + /** + * Decodes an UpdateGatewaySecurityPolicyRuleRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateGatewaySecurityPolicyRuleRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.networksecurity.v1.UpdateGatewaySecurityPolicyRuleRequest; + + /** + * Verifies an UpdateGatewaySecurityPolicyRuleRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UpdateGatewaySecurityPolicyRuleRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateGatewaySecurityPolicyRuleRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.networksecurity.v1.UpdateGatewaySecurityPolicyRuleRequest; + + /** + * Creates a plain object from an UpdateGatewaySecurityPolicyRuleRequest message. Also converts values to other types if specified. + * @param message UpdateGatewaySecurityPolicyRuleRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.networksecurity.v1.UpdateGatewaySecurityPolicyRuleRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateGatewaySecurityPolicyRuleRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateGatewaySecurityPolicyRuleRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListGatewaySecurityPolicyRulesRequest. */ + interface IListGatewaySecurityPolicyRulesRequest { + + /** ListGatewaySecurityPolicyRulesRequest parent */ + parent?: (string|null); + + /** ListGatewaySecurityPolicyRulesRequest pageSize */ + pageSize?: (number|null); + + /** ListGatewaySecurityPolicyRulesRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListGatewaySecurityPolicyRulesRequest. */ + class ListGatewaySecurityPolicyRulesRequest implements IListGatewaySecurityPolicyRulesRequest { + + /** + * Constructs a new ListGatewaySecurityPolicyRulesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.networksecurity.v1.IListGatewaySecurityPolicyRulesRequest); + + /** ListGatewaySecurityPolicyRulesRequest parent. */ + public parent: string; + + /** ListGatewaySecurityPolicyRulesRequest pageSize. */ + public pageSize: number; + + /** ListGatewaySecurityPolicyRulesRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListGatewaySecurityPolicyRulesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListGatewaySecurityPolicyRulesRequest instance + */ + public static create(properties?: google.cloud.networksecurity.v1.IListGatewaySecurityPolicyRulesRequest): google.cloud.networksecurity.v1.ListGatewaySecurityPolicyRulesRequest; + + /** + * Encodes the specified ListGatewaySecurityPolicyRulesRequest message. Does not implicitly {@link google.cloud.networksecurity.v1.ListGatewaySecurityPolicyRulesRequest.verify|verify} messages. + * @param message ListGatewaySecurityPolicyRulesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.networksecurity.v1.IListGatewaySecurityPolicyRulesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListGatewaySecurityPolicyRulesRequest message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.ListGatewaySecurityPolicyRulesRequest.verify|verify} messages. + * @param message ListGatewaySecurityPolicyRulesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.networksecurity.v1.IListGatewaySecurityPolicyRulesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListGatewaySecurityPolicyRulesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListGatewaySecurityPolicyRulesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.networksecurity.v1.ListGatewaySecurityPolicyRulesRequest; + + /** + * Decodes a ListGatewaySecurityPolicyRulesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListGatewaySecurityPolicyRulesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.networksecurity.v1.ListGatewaySecurityPolicyRulesRequest; + + /** + * Verifies a ListGatewaySecurityPolicyRulesRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListGatewaySecurityPolicyRulesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListGatewaySecurityPolicyRulesRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.networksecurity.v1.ListGatewaySecurityPolicyRulesRequest; + + /** + * Creates a plain object from a ListGatewaySecurityPolicyRulesRequest message. Also converts values to other types if specified. + * @param message ListGatewaySecurityPolicyRulesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.networksecurity.v1.ListGatewaySecurityPolicyRulesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListGatewaySecurityPolicyRulesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListGatewaySecurityPolicyRulesRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListGatewaySecurityPolicyRulesResponse. */ + interface IListGatewaySecurityPolicyRulesResponse { + + /** ListGatewaySecurityPolicyRulesResponse gatewaySecurityPolicyRules */ + gatewaySecurityPolicyRules?: (google.cloud.networksecurity.v1.IGatewaySecurityPolicyRule[]|null); + + /** ListGatewaySecurityPolicyRulesResponse nextPageToken */ + nextPageToken?: (string|null); + + /** ListGatewaySecurityPolicyRulesResponse unreachable */ + unreachable?: (string[]|null); + } + + /** Represents a ListGatewaySecurityPolicyRulesResponse. */ + class ListGatewaySecurityPolicyRulesResponse implements IListGatewaySecurityPolicyRulesResponse { + + /** + * Constructs a new ListGatewaySecurityPolicyRulesResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.networksecurity.v1.IListGatewaySecurityPolicyRulesResponse); + + /** ListGatewaySecurityPolicyRulesResponse gatewaySecurityPolicyRules. */ + public gatewaySecurityPolicyRules: google.cloud.networksecurity.v1.IGatewaySecurityPolicyRule[]; + + /** ListGatewaySecurityPolicyRulesResponse nextPageToken. */ + public nextPageToken: string; + + /** ListGatewaySecurityPolicyRulesResponse unreachable. */ + public unreachable: string[]; + + /** + * Creates a new ListGatewaySecurityPolicyRulesResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListGatewaySecurityPolicyRulesResponse instance + */ + public static create(properties?: google.cloud.networksecurity.v1.IListGatewaySecurityPolicyRulesResponse): google.cloud.networksecurity.v1.ListGatewaySecurityPolicyRulesResponse; + + /** + * Encodes the specified ListGatewaySecurityPolicyRulesResponse message. Does not implicitly {@link google.cloud.networksecurity.v1.ListGatewaySecurityPolicyRulesResponse.verify|verify} messages. + * @param message ListGatewaySecurityPolicyRulesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.networksecurity.v1.IListGatewaySecurityPolicyRulesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListGatewaySecurityPolicyRulesResponse message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.ListGatewaySecurityPolicyRulesResponse.verify|verify} messages. + * @param message ListGatewaySecurityPolicyRulesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.networksecurity.v1.IListGatewaySecurityPolicyRulesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListGatewaySecurityPolicyRulesResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListGatewaySecurityPolicyRulesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.networksecurity.v1.ListGatewaySecurityPolicyRulesResponse; + + /** + * Decodes a ListGatewaySecurityPolicyRulesResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListGatewaySecurityPolicyRulesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.networksecurity.v1.ListGatewaySecurityPolicyRulesResponse; + + /** + * Verifies a ListGatewaySecurityPolicyRulesResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListGatewaySecurityPolicyRulesResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListGatewaySecurityPolicyRulesResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.networksecurity.v1.ListGatewaySecurityPolicyRulesResponse; + + /** + * Creates a plain object from a ListGatewaySecurityPolicyRulesResponse message. Also converts values to other types if specified. + * @param message ListGatewaySecurityPolicyRulesResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.networksecurity.v1.ListGatewaySecurityPolicyRulesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListGatewaySecurityPolicyRulesResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListGatewaySecurityPolicyRulesResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteGatewaySecurityPolicyRuleRequest. */ + interface IDeleteGatewaySecurityPolicyRuleRequest { + + /** DeleteGatewaySecurityPolicyRuleRequest name */ + name?: (string|null); + } + + /** Represents a DeleteGatewaySecurityPolicyRuleRequest. */ + class DeleteGatewaySecurityPolicyRuleRequest implements IDeleteGatewaySecurityPolicyRuleRequest { + + /** + * Constructs a new DeleteGatewaySecurityPolicyRuleRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.networksecurity.v1.IDeleteGatewaySecurityPolicyRuleRequest); + + /** DeleteGatewaySecurityPolicyRuleRequest name. */ + public name: string; + + /** + * Creates a new DeleteGatewaySecurityPolicyRuleRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteGatewaySecurityPolicyRuleRequest instance + */ + public static create(properties?: google.cloud.networksecurity.v1.IDeleteGatewaySecurityPolicyRuleRequest): google.cloud.networksecurity.v1.DeleteGatewaySecurityPolicyRuleRequest; + + /** + * Encodes the specified DeleteGatewaySecurityPolicyRuleRequest message. Does not implicitly {@link google.cloud.networksecurity.v1.DeleteGatewaySecurityPolicyRuleRequest.verify|verify} messages. + * @param message DeleteGatewaySecurityPolicyRuleRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.networksecurity.v1.IDeleteGatewaySecurityPolicyRuleRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteGatewaySecurityPolicyRuleRequest message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.DeleteGatewaySecurityPolicyRuleRequest.verify|verify} messages. + * @param message DeleteGatewaySecurityPolicyRuleRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.networksecurity.v1.IDeleteGatewaySecurityPolicyRuleRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteGatewaySecurityPolicyRuleRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteGatewaySecurityPolicyRuleRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.networksecurity.v1.DeleteGatewaySecurityPolicyRuleRequest; + + /** + * Decodes a DeleteGatewaySecurityPolicyRuleRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteGatewaySecurityPolicyRuleRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.networksecurity.v1.DeleteGatewaySecurityPolicyRuleRequest; + + /** + * Verifies a DeleteGatewaySecurityPolicyRuleRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteGatewaySecurityPolicyRuleRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteGatewaySecurityPolicyRuleRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.networksecurity.v1.DeleteGatewaySecurityPolicyRuleRequest; + + /** + * Creates a plain object from a DeleteGatewaySecurityPolicyRuleRequest message. Also converts values to other types if specified. + * @param message DeleteGatewaySecurityPolicyRuleRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.networksecurity.v1.DeleteGatewaySecurityPolicyRuleRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteGatewaySecurityPolicyRuleRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteGatewaySecurityPolicyRuleRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Represents an Intercept */ + class Intercept extends $protobuf.rpc.Service { + + /** + * Constructs a new Intercept service. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + */ + constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); + + /** + * Creates new Intercept service using the specified rpc implementation. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + * @returns RPC service. Useful where requests and/or responses are streamed. + */ + public static create(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean): Intercept; + + /** + * Calls ListInterceptEndpointGroups. + * @param request ListInterceptEndpointGroupsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListInterceptEndpointGroupsResponse + */ + public listInterceptEndpointGroups(request: google.cloud.networksecurity.v1.IListInterceptEndpointGroupsRequest, callback: google.cloud.networksecurity.v1.Intercept.ListInterceptEndpointGroupsCallback): void; + + /** + * Calls ListInterceptEndpointGroups. + * @param request ListInterceptEndpointGroupsRequest message or plain object + * @returns Promise + */ + public listInterceptEndpointGroups(request: google.cloud.networksecurity.v1.IListInterceptEndpointGroupsRequest): Promise; + + /** + * Calls GetInterceptEndpointGroup. + * @param request GetInterceptEndpointGroupRequest message or plain object + * @param callback Node-style callback called with the error, if any, and InterceptEndpointGroup + */ + public getInterceptEndpointGroup(request: google.cloud.networksecurity.v1.IGetInterceptEndpointGroupRequest, callback: google.cloud.networksecurity.v1.Intercept.GetInterceptEndpointGroupCallback): void; + + /** + * Calls GetInterceptEndpointGroup. + * @param request GetInterceptEndpointGroupRequest message or plain object + * @returns Promise + */ + public getInterceptEndpointGroup(request: google.cloud.networksecurity.v1.IGetInterceptEndpointGroupRequest): Promise; + + /** + * Calls CreateInterceptEndpointGroup. + * @param request CreateInterceptEndpointGroupRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public createInterceptEndpointGroup(request: google.cloud.networksecurity.v1.ICreateInterceptEndpointGroupRequest, callback: google.cloud.networksecurity.v1.Intercept.CreateInterceptEndpointGroupCallback): void; + + /** + * Calls CreateInterceptEndpointGroup. + * @param request CreateInterceptEndpointGroupRequest message or plain object + * @returns Promise + */ + public createInterceptEndpointGroup(request: google.cloud.networksecurity.v1.ICreateInterceptEndpointGroupRequest): Promise; + + /** + * Calls UpdateInterceptEndpointGroup. + * @param request UpdateInterceptEndpointGroupRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public updateInterceptEndpointGroup(request: google.cloud.networksecurity.v1.IUpdateInterceptEndpointGroupRequest, callback: google.cloud.networksecurity.v1.Intercept.UpdateInterceptEndpointGroupCallback): void; + + /** + * Calls UpdateInterceptEndpointGroup. + * @param request UpdateInterceptEndpointGroupRequest message or plain object + * @returns Promise + */ + public updateInterceptEndpointGroup(request: google.cloud.networksecurity.v1.IUpdateInterceptEndpointGroupRequest): Promise; + + /** + * Calls DeleteInterceptEndpointGroup. + * @param request DeleteInterceptEndpointGroupRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public deleteInterceptEndpointGroup(request: google.cloud.networksecurity.v1.IDeleteInterceptEndpointGroupRequest, callback: google.cloud.networksecurity.v1.Intercept.DeleteInterceptEndpointGroupCallback): void; + + /** + * Calls DeleteInterceptEndpointGroup. + * @param request DeleteInterceptEndpointGroupRequest message or plain object + * @returns Promise + */ + public deleteInterceptEndpointGroup(request: google.cloud.networksecurity.v1.IDeleteInterceptEndpointGroupRequest): Promise; + + /** + * Calls ListInterceptEndpointGroupAssociations. + * @param request ListInterceptEndpointGroupAssociationsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListInterceptEndpointGroupAssociationsResponse + */ + public listInterceptEndpointGroupAssociations(request: google.cloud.networksecurity.v1.IListInterceptEndpointGroupAssociationsRequest, callback: google.cloud.networksecurity.v1.Intercept.ListInterceptEndpointGroupAssociationsCallback): void; + + /** + * Calls ListInterceptEndpointGroupAssociations. + * @param request ListInterceptEndpointGroupAssociationsRequest message or plain object + * @returns Promise + */ + public listInterceptEndpointGroupAssociations(request: google.cloud.networksecurity.v1.IListInterceptEndpointGroupAssociationsRequest): Promise; + + /** + * Calls GetInterceptEndpointGroupAssociation. + * @param request GetInterceptEndpointGroupAssociationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and InterceptEndpointGroupAssociation + */ + public getInterceptEndpointGroupAssociation(request: google.cloud.networksecurity.v1.IGetInterceptEndpointGroupAssociationRequest, callback: google.cloud.networksecurity.v1.Intercept.GetInterceptEndpointGroupAssociationCallback): void; + + /** + * Calls GetInterceptEndpointGroupAssociation. + * @param request GetInterceptEndpointGroupAssociationRequest message or plain object + * @returns Promise + */ + public getInterceptEndpointGroupAssociation(request: google.cloud.networksecurity.v1.IGetInterceptEndpointGroupAssociationRequest): Promise; + + /** + * Calls CreateInterceptEndpointGroupAssociation. + * @param request CreateInterceptEndpointGroupAssociationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public createInterceptEndpointGroupAssociation(request: google.cloud.networksecurity.v1.ICreateInterceptEndpointGroupAssociationRequest, callback: google.cloud.networksecurity.v1.Intercept.CreateInterceptEndpointGroupAssociationCallback): void; + + /** + * Calls CreateInterceptEndpointGroupAssociation. + * @param request CreateInterceptEndpointGroupAssociationRequest message or plain object + * @returns Promise + */ + public createInterceptEndpointGroupAssociation(request: google.cloud.networksecurity.v1.ICreateInterceptEndpointGroupAssociationRequest): Promise; + + /** + * Calls UpdateInterceptEndpointGroupAssociation. + * @param request UpdateInterceptEndpointGroupAssociationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public updateInterceptEndpointGroupAssociation(request: google.cloud.networksecurity.v1.IUpdateInterceptEndpointGroupAssociationRequest, callback: google.cloud.networksecurity.v1.Intercept.UpdateInterceptEndpointGroupAssociationCallback): void; + + /** + * Calls UpdateInterceptEndpointGroupAssociation. + * @param request UpdateInterceptEndpointGroupAssociationRequest message or plain object + * @returns Promise + */ + public updateInterceptEndpointGroupAssociation(request: google.cloud.networksecurity.v1.IUpdateInterceptEndpointGroupAssociationRequest): Promise; + + /** + * Calls DeleteInterceptEndpointGroupAssociation. + * @param request DeleteInterceptEndpointGroupAssociationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public deleteInterceptEndpointGroupAssociation(request: google.cloud.networksecurity.v1.IDeleteInterceptEndpointGroupAssociationRequest, callback: google.cloud.networksecurity.v1.Intercept.DeleteInterceptEndpointGroupAssociationCallback): void; + + /** + * Calls DeleteInterceptEndpointGroupAssociation. + * @param request DeleteInterceptEndpointGroupAssociationRequest message or plain object + * @returns Promise + */ + public deleteInterceptEndpointGroupAssociation(request: google.cloud.networksecurity.v1.IDeleteInterceptEndpointGroupAssociationRequest): Promise; + + /** + * Calls ListInterceptDeploymentGroups. + * @param request ListInterceptDeploymentGroupsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListInterceptDeploymentGroupsResponse + */ + public listInterceptDeploymentGroups(request: google.cloud.networksecurity.v1.IListInterceptDeploymentGroupsRequest, callback: google.cloud.networksecurity.v1.Intercept.ListInterceptDeploymentGroupsCallback): void; + + /** + * Calls ListInterceptDeploymentGroups. + * @param request ListInterceptDeploymentGroupsRequest message or plain object + * @returns Promise + */ + public listInterceptDeploymentGroups(request: google.cloud.networksecurity.v1.IListInterceptDeploymentGroupsRequest): Promise; + + /** + * Calls GetInterceptDeploymentGroup. + * @param request GetInterceptDeploymentGroupRequest message or plain object + * @param callback Node-style callback called with the error, if any, and InterceptDeploymentGroup + */ + public getInterceptDeploymentGroup(request: google.cloud.networksecurity.v1.IGetInterceptDeploymentGroupRequest, callback: google.cloud.networksecurity.v1.Intercept.GetInterceptDeploymentGroupCallback): void; + + /** + * Calls GetInterceptDeploymentGroup. + * @param request GetInterceptDeploymentGroupRequest message or plain object + * @returns Promise + */ + public getInterceptDeploymentGroup(request: google.cloud.networksecurity.v1.IGetInterceptDeploymentGroupRequest): Promise; + + /** + * Calls CreateInterceptDeploymentGroup. + * @param request CreateInterceptDeploymentGroupRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public createInterceptDeploymentGroup(request: google.cloud.networksecurity.v1.ICreateInterceptDeploymentGroupRequest, callback: google.cloud.networksecurity.v1.Intercept.CreateInterceptDeploymentGroupCallback): void; + + /** + * Calls CreateInterceptDeploymentGroup. + * @param request CreateInterceptDeploymentGroupRequest message or plain object + * @returns Promise + */ + public createInterceptDeploymentGroup(request: google.cloud.networksecurity.v1.ICreateInterceptDeploymentGroupRequest): Promise; + + /** + * Calls UpdateInterceptDeploymentGroup. + * @param request UpdateInterceptDeploymentGroupRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public updateInterceptDeploymentGroup(request: google.cloud.networksecurity.v1.IUpdateInterceptDeploymentGroupRequest, callback: google.cloud.networksecurity.v1.Intercept.UpdateInterceptDeploymentGroupCallback): void; + + /** + * Calls UpdateInterceptDeploymentGroup. + * @param request UpdateInterceptDeploymentGroupRequest message or plain object + * @returns Promise + */ + public updateInterceptDeploymentGroup(request: google.cloud.networksecurity.v1.IUpdateInterceptDeploymentGroupRequest): Promise; + + /** + * Calls DeleteInterceptDeploymentGroup. + * @param request DeleteInterceptDeploymentGroupRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public deleteInterceptDeploymentGroup(request: google.cloud.networksecurity.v1.IDeleteInterceptDeploymentGroupRequest, callback: google.cloud.networksecurity.v1.Intercept.DeleteInterceptDeploymentGroupCallback): void; + + /** + * Calls DeleteInterceptDeploymentGroup. + * @param request DeleteInterceptDeploymentGroupRequest message or plain object + * @returns Promise + */ + public deleteInterceptDeploymentGroup(request: google.cloud.networksecurity.v1.IDeleteInterceptDeploymentGroupRequest): Promise; + + /** + * Calls ListInterceptDeployments. + * @param request ListInterceptDeploymentsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListInterceptDeploymentsResponse + */ + public listInterceptDeployments(request: google.cloud.networksecurity.v1.IListInterceptDeploymentsRequest, callback: google.cloud.networksecurity.v1.Intercept.ListInterceptDeploymentsCallback): void; + + /** + * Calls ListInterceptDeployments. + * @param request ListInterceptDeploymentsRequest message or plain object + * @returns Promise + */ + public listInterceptDeployments(request: google.cloud.networksecurity.v1.IListInterceptDeploymentsRequest): Promise; + + /** + * Calls GetInterceptDeployment. + * @param request GetInterceptDeploymentRequest message or plain object + * @param callback Node-style callback called with the error, if any, and InterceptDeployment + */ + public getInterceptDeployment(request: google.cloud.networksecurity.v1.IGetInterceptDeploymentRequest, callback: google.cloud.networksecurity.v1.Intercept.GetInterceptDeploymentCallback): void; + + /** + * Calls GetInterceptDeployment. + * @param request GetInterceptDeploymentRequest message or plain object + * @returns Promise + */ + public getInterceptDeployment(request: google.cloud.networksecurity.v1.IGetInterceptDeploymentRequest): Promise; + + /** + * Calls CreateInterceptDeployment. + * @param request CreateInterceptDeploymentRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public createInterceptDeployment(request: google.cloud.networksecurity.v1.ICreateInterceptDeploymentRequest, callback: google.cloud.networksecurity.v1.Intercept.CreateInterceptDeploymentCallback): void; + + /** + * Calls CreateInterceptDeployment. + * @param request CreateInterceptDeploymentRequest message or plain object + * @returns Promise + */ + public createInterceptDeployment(request: google.cloud.networksecurity.v1.ICreateInterceptDeploymentRequest): Promise; + + /** + * Calls UpdateInterceptDeployment. + * @param request UpdateInterceptDeploymentRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public updateInterceptDeployment(request: google.cloud.networksecurity.v1.IUpdateInterceptDeploymentRequest, callback: google.cloud.networksecurity.v1.Intercept.UpdateInterceptDeploymentCallback): void; + + /** + * Calls UpdateInterceptDeployment. + * @param request UpdateInterceptDeploymentRequest message or plain object + * @returns Promise + */ + public updateInterceptDeployment(request: google.cloud.networksecurity.v1.IUpdateInterceptDeploymentRequest): Promise; + + /** + * Calls DeleteInterceptDeployment. + * @param request DeleteInterceptDeploymentRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public deleteInterceptDeployment(request: google.cloud.networksecurity.v1.IDeleteInterceptDeploymentRequest, callback: google.cloud.networksecurity.v1.Intercept.DeleteInterceptDeploymentCallback): void; + + /** + * Calls DeleteInterceptDeployment. + * @param request DeleteInterceptDeploymentRequest message or plain object + * @returns Promise + */ + public deleteInterceptDeployment(request: google.cloud.networksecurity.v1.IDeleteInterceptDeploymentRequest): Promise; + } + + namespace Intercept { + + /** + * Callback as used by {@link google.cloud.networksecurity.v1.Intercept|listInterceptEndpointGroups}. + * @param error Error, if any + * @param [response] ListInterceptEndpointGroupsResponse + */ + type ListInterceptEndpointGroupsCallback = (error: (Error|null), response?: google.cloud.networksecurity.v1.ListInterceptEndpointGroupsResponse) => void; + + /** + * Callback as used by {@link google.cloud.networksecurity.v1.Intercept|getInterceptEndpointGroup}. + * @param error Error, if any + * @param [response] InterceptEndpointGroup + */ + type GetInterceptEndpointGroupCallback = (error: (Error|null), response?: google.cloud.networksecurity.v1.InterceptEndpointGroup) => void; + + /** + * Callback as used by {@link google.cloud.networksecurity.v1.Intercept|createInterceptEndpointGroup}. + * @param error Error, if any + * @param [response] Operation + */ + type CreateInterceptEndpointGroupCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.networksecurity.v1.Intercept|updateInterceptEndpointGroup}. + * @param error Error, if any + * @param [response] Operation + */ + type UpdateInterceptEndpointGroupCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.networksecurity.v1.Intercept|deleteInterceptEndpointGroup}. + * @param error Error, if any + * @param [response] Operation + */ + type DeleteInterceptEndpointGroupCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.networksecurity.v1.Intercept|listInterceptEndpointGroupAssociations}. + * @param error Error, if any + * @param [response] ListInterceptEndpointGroupAssociationsResponse + */ + type ListInterceptEndpointGroupAssociationsCallback = (error: (Error|null), response?: google.cloud.networksecurity.v1.ListInterceptEndpointGroupAssociationsResponse) => void; + + /** + * Callback as used by {@link google.cloud.networksecurity.v1.Intercept|getInterceptEndpointGroupAssociation}. + * @param error Error, if any + * @param [response] InterceptEndpointGroupAssociation + */ + type GetInterceptEndpointGroupAssociationCallback = (error: (Error|null), response?: google.cloud.networksecurity.v1.InterceptEndpointGroupAssociation) => void; + + /** + * Callback as used by {@link google.cloud.networksecurity.v1.Intercept|createInterceptEndpointGroupAssociation}. + * @param error Error, if any + * @param [response] Operation + */ + type CreateInterceptEndpointGroupAssociationCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.networksecurity.v1.Intercept|updateInterceptEndpointGroupAssociation}. + * @param error Error, if any + * @param [response] Operation + */ + type UpdateInterceptEndpointGroupAssociationCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.networksecurity.v1.Intercept|deleteInterceptEndpointGroupAssociation}. + * @param error Error, if any + * @param [response] Operation + */ + type DeleteInterceptEndpointGroupAssociationCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.networksecurity.v1.Intercept|listInterceptDeploymentGroups}. + * @param error Error, if any + * @param [response] ListInterceptDeploymentGroupsResponse + */ + type ListInterceptDeploymentGroupsCallback = (error: (Error|null), response?: google.cloud.networksecurity.v1.ListInterceptDeploymentGroupsResponse) => void; + + /** + * Callback as used by {@link google.cloud.networksecurity.v1.Intercept|getInterceptDeploymentGroup}. + * @param error Error, if any + * @param [response] InterceptDeploymentGroup + */ + type GetInterceptDeploymentGroupCallback = (error: (Error|null), response?: google.cloud.networksecurity.v1.InterceptDeploymentGroup) => void; + + /** + * Callback as used by {@link google.cloud.networksecurity.v1.Intercept|createInterceptDeploymentGroup}. + * @param error Error, if any + * @param [response] Operation + */ + type CreateInterceptDeploymentGroupCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.networksecurity.v1.Intercept|updateInterceptDeploymentGroup}. + * @param error Error, if any + * @param [response] Operation + */ + type UpdateInterceptDeploymentGroupCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.networksecurity.v1.Intercept|deleteInterceptDeploymentGroup}. + * @param error Error, if any + * @param [response] Operation + */ + type DeleteInterceptDeploymentGroupCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.networksecurity.v1.Intercept|listInterceptDeployments}. + * @param error Error, if any + * @param [response] ListInterceptDeploymentsResponse + */ + type ListInterceptDeploymentsCallback = (error: (Error|null), response?: google.cloud.networksecurity.v1.ListInterceptDeploymentsResponse) => void; + + /** + * Callback as used by {@link google.cloud.networksecurity.v1.Intercept|getInterceptDeployment}. + * @param error Error, if any + * @param [response] InterceptDeployment + */ + type GetInterceptDeploymentCallback = (error: (Error|null), response?: google.cloud.networksecurity.v1.InterceptDeployment) => void; + + /** + * Callback as used by {@link google.cloud.networksecurity.v1.Intercept|createInterceptDeployment}. + * @param error Error, if any + * @param [response] Operation + */ + type CreateInterceptDeploymentCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.networksecurity.v1.Intercept|updateInterceptDeployment}. + * @param error Error, if any + * @param [response] Operation + */ + type UpdateInterceptDeploymentCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.networksecurity.v1.Intercept|deleteInterceptDeployment}. + * @param error Error, if any + * @param [response] Operation + */ + type DeleteInterceptDeploymentCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + } + + /** Properties of an InterceptEndpointGroup. */ + interface IInterceptEndpointGroup { + + /** InterceptEndpointGroup name */ + name?: (string|null); + + /** InterceptEndpointGroup createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** InterceptEndpointGroup updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** InterceptEndpointGroup labels */ + labels?: ({ [k: string]: string }|null); + + /** InterceptEndpointGroup interceptDeploymentGroup */ + interceptDeploymentGroup?: (string|null); + + /** InterceptEndpointGroup connectedDeploymentGroup */ + connectedDeploymentGroup?: (google.cloud.networksecurity.v1.InterceptEndpointGroup.IConnectedDeploymentGroup|null); + + /** InterceptEndpointGroup state */ + state?: (google.cloud.networksecurity.v1.InterceptEndpointGroup.State|keyof typeof google.cloud.networksecurity.v1.InterceptEndpointGroup.State|null); + + /** InterceptEndpointGroup reconciling */ + reconciling?: (boolean|null); + + /** InterceptEndpointGroup associations */ + associations?: (google.cloud.networksecurity.v1.InterceptEndpointGroup.IAssociationDetails[]|null); + + /** InterceptEndpointGroup description */ + description?: (string|null); + } + + /** Represents an InterceptEndpointGroup. */ + class InterceptEndpointGroup implements IInterceptEndpointGroup { + + /** + * Constructs a new InterceptEndpointGroup. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.networksecurity.v1.IInterceptEndpointGroup); + + /** InterceptEndpointGroup name. */ + public name: string; + + /** InterceptEndpointGroup createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** InterceptEndpointGroup updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** InterceptEndpointGroup labels. */ + public labels: { [k: string]: string }; + + /** InterceptEndpointGroup interceptDeploymentGroup. */ + public interceptDeploymentGroup: string; + + /** InterceptEndpointGroup connectedDeploymentGroup. */ + public connectedDeploymentGroup?: (google.cloud.networksecurity.v1.InterceptEndpointGroup.IConnectedDeploymentGroup|null); + + /** InterceptEndpointGroup state. */ + public state: (google.cloud.networksecurity.v1.InterceptEndpointGroup.State|keyof typeof google.cloud.networksecurity.v1.InterceptEndpointGroup.State); + + /** InterceptEndpointGroup reconciling. */ + public reconciling: boolean; + + /** InterceptEndpointGroup associations. */ + public associations: google.cloud.networksecurity.v1.InterceptEndpointGroup.IAssociationDetails[]; + + /** InterceptEndpointGroup description. */ + public description: string; + + /** + * Creates a new InterceptEndpointGroup instance using the specified properties. + * @param [properties] Properties to set + * @returns InterceptEndpointGroup instance + */ + public static create(properties?: google.cloud.networksecurity.v1.IInterceptEndpointGroup): google.cloud.networksecurity.v1.InterceptEndpointGroup; + + /** + * Encodes the specified InterceptEndpointGroup message. Does not implicitly {@link google.cloud.networksecurity.v1.InterceptEndpointGroup.verify|verify} messages. + * @param message InterceptEndpointGroup message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.networksecurity.v1.IInterceptEndpointGroup, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified InterceptEndpointGroup message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.InterceptEndpointGroup.verify|verify} messages. + * @param message InterceptEndpointGroup message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.networksecurity.v1.IInterceptEndpointGroup, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an InterceptEndpointGroup message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns InterceptEndpointGroup + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.networksecurity.v1.InterceptEndpointGroup; + + /** + * Decodes an InterceptEndpointGroup message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns InterceptEndpointGroup + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.networksecurity.v1.InterceptEndpointGroup; + + /** + * Verifies an InterceptEndpointGroup message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an InterceptEndpointGroup message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns InterceptEndpointGroup + */ + public static fromObject(object: { [k: string]: any }): google.cloud.networksecurity.v1.InterceptEndpointGroup; + + /** + * Creates a plain object from an InterceptEndpointGroup message. Also converts values to other types if specified. + * @param message InterceptEndpointGroup + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.networksecurity.v1.InterceptEndpointGroup, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this InterceptEndpointGroup to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for InterceptEndpointGroup + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace InterceptEndpointGroup { + + /** Properties of a ConnectedDeploymentGroup. */ + interface IConnectedDeploymentGroup { + + /** ConnectedDeploymentGroup name */ + name?: (string|null); + + /** ConnectedDeploymentGroup locations */ + locations?: (google.cloud.networksecurity.v1.IInterceptLocation[]|null); + } + + /** Represents a ConnectedDeploymentGroup. */ + class ConnectedDeploymentGroup implements IConnectedDeploymentGroup { + + /** + * Constructs a new ConnectedDeploymentGroup. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.networksecurity.v1.InterceptEndpointGroup.IConnectedDeploymentGroup); + + /** ConnectedDeploymentGroup name. */ + public name: string; + + /** ConnectedDeploymentGroup locations. */ + public locations: google.cloud.networksecurity.v1.IInterceptLocation[]; + + /** + * Creates a new ConnectedDeploymentGroup instance using the specified properties. + * @param [properties] Properties to set + * @returns ConnectedDeploymentGroup instance + */ + public static create(properties?: google.cloud.networksecurity.v1.InterceptEndpointGroup.IConnectedDeploymentGroup): google.cloud.networksecurity.v1.InterceptEndpointGroup.ConnectedDeploymentGroup; + + /** + * Encodes the specified ConnectedDeploymentGroup message. Does not implicitly {@link google.cloud.networksecurity.v1.InterceptEndpointGroup.ConnectedDeploymentGroup.verify|verify} messages. + * @param message ConnectedDeploymentGroup message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.networksecurity.v1.InterceptEndpointGroup.IConnectedDeploymentGroup, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ConnectedDeploymentGroup message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.InterceptEndpointGroup.ConnectedDeploymentGroup.verify|verify} messages. + * @param message ConnectedDeploymentGroup message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.networksecurity.v1.InterceptEndpointGroup.IConnectedDeploymentGroup, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ConnectedDeploymentGroup message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ConnectedDeploymentGroup + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.networksecurity.v1.InterceptEndpointGroup.ConnectedDeploymentGroup; + + /** + * Decodes a ConnectedDeploymentGroup message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ConnectedDeploymentGroup + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.networksecurity.v1.InterceptEndpointGroup.ConnectedDeploymentGroup; + + /** + * Verifies a ConnectedDeploymentGroup message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ConnectedDeploymentGroup message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ConnectedDeploymentGroup + */ + public static fromObject(object: { [k: string]: any }): google.cloud.networksecurity.v1.InterceptEndpointGroup.ConnectedDeploymentGroup; + + /** + * Creates a plain object from a ConnectedDeploymentGroup message. Also converts values to other types if specified. + * @param message ConnectedDeploymentGroup + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.networksecurity.v1.InterceptEndpointGroup.ConnectedDeploymentGroup, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ConnectedDeploymentGroup to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ConnectedDeploymentGroup + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AssociationDetails. */ + interface IAssociationDetails { + + /** AssociationDetails name */ + name?: (string|null); + + /** AssociationDetails network */ + network?: (string|null); + + /** AssociationDetails state */ + state?: (google.cloud.networksecurity.v1.InterceptEndpointGroupAssociation.State|keyof typeof google.cloud.networksecurity.v1.InterceptEndpointGroupAssociation.State|null); + } + + /** Represents an AssociationDetails. */ + class AssociationDetails implements IAssociationDetails { + + /** + * Constructs a new AssociationDetails. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.networksecurity.v1.InterceptEndpointGroup.IAssociationDetails); + + /** AssociationDetails name. */ + public name: string; + + /** AssociationDetails network. */ + public network: string; + + /** AssociationDetails state. */ + public state: (google.cloud.networksecurity.v1.InterceptEndpointGroupAssociation.State|keyof typeof google.cloud.networksecurity.v1.InterceptEndpointGroupAssociation.State); + + /** + * Creates a new AssociationDetails instance using the specified properties. + * @param [properties] Properties to set + * @returns AssociationDetails instance + */ + public static create(properties?: google.cloud.networksecurity.v1.InterceptEndpointGroup.IAssociationDetails): google.cloud.networksecurity.v1.InterceptEndpointGroup.AssociationDetails; + + /** + * Encodes the specified AssociationDetails message. Does not implicitly {@link google.cloud.networksecurity.v1.InterceptEndpointGroup.AssociationDetails.verify|verify} messages. + * @param message AssociationDetails message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.networksecurity.v1.InterceptEndpointGroup.IAssociationDetails, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AssociationDetails message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.InterceptEndpointGroup.AssociationDetails.verify|verify} messages. + * @param message AssociationDetails message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.networksecurity.v1.InterceptEndpointGroup.IAssociationDetails, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AssociationDetails message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AssociationDetails + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.networksecurity.v1.InterceptEndpointGroup.AssociationDetails; + + /** + * Decodes an AssociationDetails message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AssociationDetails + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.networksecurity.v1.InterceptEndpointGroup.AssociationDetails; + + /** + * Verifies an AssociationDetails message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AssociationDetails message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AssociationDetails + */ + public static fromObject(object: { [k: string]: any }): google.cloud.networksecurity.v1.InterceptEndpointGroup.AssociationDetails; + + /** + * Creates a plain object from an AssociationDetails message. Also converts values to other types if specified. + * @param message AssociationDetails + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.networksecurity.v1.InterceptEndpointGroup.AssociationDetails, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AssociationDetails to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AssociationDetails + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** State enum. */ + enum State { + STATE_UNSPECIFIED = 0, + ACTIVE = 1, + CLOSED = 2, + CREATING = 3, + DELETING = 4, + OUT_OF_SYNC = 5, + DELETE_FAILED = 6 + } + } + + /** Properties of a ListInterceptEndpointGroupsRequest. */ + interface IListInterceptEndpointGroupsRequest { + + /** ListInterceptEndpointGroupsRequest parent */ + parent?: (string|null); + + /** ListInterceptEndpointGroupsRequest pageSize */ + pageSize?: (number|null); + + /** ListInterceptEndpointGroupsRequest pageToken */ + pageToken?: (string|null); + + /** ListInterceptEndpointGroupsRequest filter */ + filter?: (string|null); + + /** ListInterceptEndpointGroupsRequest orderBy */ + orderBy?: (string|null); + } + + /** Represents a ListInterceptEndpointGroupsRequest. */ + class ListInterceptEndpointGroupsRequest implements IListInterceptEndpointGroupsRequest { + + /** + * Constructs a new ListInterceptEndpointGroupsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.networksecurity.v1.IListInterceptEndpointGroupsRequest); + + /** ListInterceptEndpointGroupsRequest parent. */ + public parent: string; + + /** ListInterceptEndpointGroupsRequest pageSize. */ + public pageSize: number; + + /** ListInterceptEndpointGroupsRequest pageToken. */ + public pageToken: string; + + /** ListInterceptEndpointGroupsRequest filter. */ + public filter: string; + + /** ListInterceptEndpointGroupsRequest orderBy. */ + public orderBy: string; + + /** + * Creates a new ListInterceptEndpointGroupsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListInterceptEndpointGroupsRequest instance + */ + public static create(properties?: google.cloud.networksecurity.v1.IListInterceptEndpointGroupsRequest): google.cloud.networksecurity.v1.ListInterceptEndpointGroupsRequest; + + /** + * Encodes the specified ListInterceptEndpointGroupsRequest message. Does not implicitly {@link google.cloud.networksecurity.v1.ListInterceptEndpointGroupsRequest.verify|verify} messages. + * @param message ListInterceptEndpointGroupsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.networksecurity.v1.IListInterceptEndpointGroupsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListInterceptEndpointGroupsRequest message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.ListInterceptEndpointGroupsRequest.verify|verify} messages. + * @param message ListInterceptEndpointGroupsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.networksecurity.v1.IListInterceptEndpointGroupsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListInterceptEndpointGroupsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListInterceptEndpointGroupsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.networksecurity.v1.ListInterceptEndpointGroupsRequest; + + /** + * Decodes a ListInterceptEndpointGroupsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListInterceptEndpointGroupsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.networksecurity.v1.ListInterceptEndpointGroupsRequest; + + /** + * Verifies a ListInterceptEndpointGroupsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListInterceptEndpointGroupsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListInterceptEndpointGroupsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.networksecurity.v1.ListInterceptEndpointGroupsRequest; + + /** + * Creates a plain object from a ListInterceptEndpointGroupsRequest message. Also converts values to other types if specified. + * @param message ListInterceptEndpointGroupsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.networksecurity.v1.ListInterceptEndpointGroupsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListInterceptEndpointGroupsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListInterceptEndpointGroupsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListInterceptEndpointGroupsResponse. */ + interface IListInterceptEndpointGroupsResponse { + + /** ListInterceptEndpointGroupsResponse interceptEndpointGroups */ + interceptEndpointGroups?: (google.cloud.networksecurity.v1.IInterceptEndpointGroup[]|null); + + /** ListInterceptEndpointGroupsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListInterceptEndpointGroupsResponse. */ + class ListInterceptEndpointGroupsResponse implements IListInterceptEndpointGroupsResponse { + + /** + * Constructs a new ListInterceptEndpointGroupsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.networksecurity.v1.IListInterceptEndpointGroupsResponse); + + /** ListInterceptEndpointGroupsResponse interceptEndpointGroups. */ + public interceptEndpointGroups: google.cloud.networksecurity.v1.IInterceptEndpointGroup[]; + + /** ListInterceptEndpointGroupsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListInterceptEndpointGroupsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListInterceptEndpointGroupsResponse instance + */ + public static create(properties?: google.cloud.networksecurity.v1.IListInterceptEndpointGroupsResponse): google.cloud.networksecurity.v1.ListInterceptEndpointGroupsResponse; + + /** + * Encodes the specified ListInterceptEndpointGroupsResponse message. Does not implicitly {@link google.cloud.networksecurity.v1.ListInterceptEndpointGroupsResponse.verify|verify} messages. + * @param message ListInterceptEndpointGroupsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.networksecurity.v1.IListInterceptEndpointGroupsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListInterceptEndpointGroupsResponse message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.ListInterceptEndpointGroupsResponse.verify|verify} messages. + * @param message ListInterceptEndpointGroupsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.networksecurity.v1.IListInterceptEndpointGroupsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListInterceptEndpointGroupsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListInterceptEndpointGroupsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.networksecurity.v1.ListInterceptEndpointGroupsResponse; + + /** + * Decodes a ListInterceptEndpointGroupsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListInterceptEndpointGroupsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.networksecurity.v1.ListInterceptEndpointGroupsResponse; + + /** + * Verifies a ListInterceptEndpointGroupsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListInterceptEndpointGroupsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListInterceptEndpointGroupsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.networksecurity.v1.ListInterceptEndpointGroupsResponse; + + /** + * Creates a plain object from a ListInterceptEndpointGroupsResponse message. Also converts values to other types if specified. + * @param message ListInterceptEndpointGroupsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.networksecurity.v1.ListInterceptEndpointGroupsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListInterceptEndpointGroupsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListInterceptEndpointGroupsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetInterceptEndpointGroupRequest. */ + interface IGetInterceptEndpointGroupRequest { + + /** GetInterceptEndpointGroupRequest name */ + name?: (string|null); + } + + /** Represents a GetInterceptEndpointGroupRequest. */ + class GetInterceptEndpointGroupRequest implements IGetInterceptEndpointGroupRequest { + + /** + * Constructs a new GetInterceptEndpointGroupRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.networksecurity.v1.IGetInterceptEndpointGroupRequest); + + /** GetInterceptEndpointGroupRequest name. */ + public name: string; + + /** + * Creates a new GetInterceptEndpointGroupRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetInterceptEndpointGroupRequest instance + */ + public static create(properties?: google.cloud.networksecurity.v1.IGetInterceptEndpointGroupRequest): google.cloud.networksecurity.v1.GetInterceptEndpointGroupRequest; + + /** + * Encodes the specified GetInterceptEndpointGroupRequest message. Does not implicitly {@link google.cloud.networksecurity.v1.GetInterceptEndpointGroupRequest.verify|verify} messages. + * @param message GetInterceptEndpointGroupRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.networksecurity.v1.IGetInterceptEndpointGroupRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetInterceptEndpointGroupRequest message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.GetInterceptEndpointGroupRequest.verify|verify} messages. + * @param message GetInterceptEndpointGroupRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.networksecurity.v1.IGetInterceptEndpointGroupRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetInterceptEndpointGroupRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetInterceptEndpointGroupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.networksecurity.v1.GetInterceptEndpointGroupRequest; + + /** + * Decodes a GetInterceptEndpointGroupRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetInterceptEndpointGroupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.networksecurity.v1.GetInterceptEndpointGroupRequest; + + /** + * Verifies a GetInterceptEndpointGroupRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetInterceptEndpointGroupRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetInterceptEndpointGroupRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.networksecurity.v1.GetInterceptEndpointGroupRequest; + + /** + * Creates a plain object from a GetInterceptEndpointGroupRequest message. Also converts values to other types if specified. + * @param message GetInterceptEndpointGroupRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.networksecurity.v1.GetInterceptEndpointGroupRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetInterceptEndpointGroupRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetInterceptEndpointGroupRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateInterceptEndpointGroupRequest. */ + interface ICreateInterceptEndpointGroupRequest { + + /** CreateInterceptEndpointGroupRequest parent */ + parent?: (string|null); + + /** CreateInterceptEndpointGroupRequest interceptEndpointGroupId */ + interceptEndpointGroupId?: (string|null); + + /** CreateInterceptEndpointGroupRequest interceptEndpointGroup */ + interceptEndpointGroup?: (google.cloud.networksecurity.v1.IInterceptEndpointGroup|null); + + /** CreateInterceptEndpointGroupRequest requestId */ + requestId?: (string|null); + } + + /** Represents a CreateInterceptEndpointGroupRequest. */ + class CreateInterceptEndpointGroupRequest implements ICreateInterceptEndpointGroupRequest { + + /** + * Constructs a new CreateInterceptEndpointGroupRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.networksecurity.v1.ICreateInterceptEndpointGroupRequest); + + /** CreateInterceptEndpointGroupRequest parent. */ + public parent: string; + + /** CreateInterceptEndpointGroupRequest interceptEndpointGroupId. */ + public interceptEndpointGroupId: string; + + /** CreateInterceptEndpointGroupRequest interceptEndpointGroup. */ + public interceptEndpointGroup?: (google.cloud.networksecurity.v1.IInterceptEndpointGroup|null); + + /** CreateInterceptEndpointGroupRequest requestId. */ + public requestId: string; + + /** + * Creates a new CreateInterceptEndpointGroupRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateInterceptEndpointGroupRequest instance + */ + public static create(properties?: google.cloud.networksecurity.v1.ICreateInterceptEndpointGroupRequest): google.cloud.networksecurity.v1.CreateInterceptEndpointGroupRequest; + + /** + * Encodes the specified CreateInterceptEndpointGroupRequest message. Does not implicitly {@link google.cloud.networksecurity.v1.CreateInterceptEndpointGroupRequest.verify|verify} messages. + * @param message CreateInterceptEndpointGroupRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.networksecurity.v1.ICreateInterceptEndpointGroupRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateInterceptEndpointGroupRequest message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.CreateInterceptEndpointGroupRequest.verify|verify} messages. + * @param message CreateInterceptEndpointGroupRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.networksecurity.v1.ICreateInterceptEndpointGroupRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateInterceptEndpointGroupRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateInterceptEndpointGroupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.networksecurity.v1.CreateInterceptEndpointGroupRequest; + + /** + * Decodes a CreateInterceptEndpointGroupRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateInterceptEndpointGroupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.networksecurity.v1.CreateInterceptEndpointGroupRequest; + + /** + * Verifies a CreateInterceptEndpointGroupRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateInterceptEndpointGroupRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateInterceptEndpointGroupRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.networksecurity.v1.CreateInterceptEndpointGroupRequest; + + /** + * Creates a plain object from a CreateInterceptEndpointGroupRequest message. Also converts values to other types if specified. + * @param message CreateInterceptEndpointGroupRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.networksecurity.v1.CreateInterceptEndpointGroupRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateInterceptEndpointGroupRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateInterceptEndpointGroupRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateInterceptEndpointGroupRequest. */ + interface IUpdateInterceptEndpointGroupRequest { + + /** UpdateInterceptEndpointGroupRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateInterceptEndpointGroupRequest interceptEndpointGroup */ + interceptEndpointGroup?: (google.cloud.networksecurity.v1.IInterceptEndpointGroup|null); + + /** UpdateInterceptEndpointGroupRequest requestId */ + requestId?: (string|null); + } + + /** Represents an UpdateInterceptEndpointGroupRequest. */ + class UpdateInterceptEndpointGroupRequest implements IUpdateInterceptEndpointGroupRequest { + + /** + * Constructs a new UpdateInterceptEndpointGroupRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.networksecurity.v1.IUpdateInterceptEndpointGroupRequest); + + /** UpdateInterceptEndpointGroupRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateInterceptEndpointGroupRequest interceptEndpointGroup. */ + public interceptEndpointGroup?: (google.cloud.networksecurity.v1.IInterceptEndpointGroup|null); + + /** UpdateInterceptEndpointGroupRequest requestId. */ + public requestId: string; + + /** + * Creates a new UpdateInterceptEndpointGroupRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateInterceptEndpointGroupRequest instance + */ + public static create(properties?: google.cloud.networksecurity.v1.IUpdateInterceptEndpointGroupRequest): google.cloud.networksecurity.v1.UpdateInterceptEndpointGroupRequest; + + /** + * Encodes the specified UpdateInterceptEndpointGroupRequest message. Does not implicitly {@link google.cloud.networksecurity.v1.UpdateInterceptEndpointGroupRequest.verify|verify} messages. + * @param message UpdateInterceptEndpointGroupRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.networksecurity.v1.IUpdateInterceptEndpointGroupRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateInterceptEndpointGroupRequest message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.UpdateInterceptEndpointGroupRequest.verify|verify} messages. + * @param message UpdateInterceptEndpointGroupRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.networksecurity.v1.IUpdateInterceptEndpointGroupRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateInterceptEndpointGroupRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateInterceptEndpointGroupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.networksecurity.v1.UpdateInterceptEndpointGroupRequest; + + /** + * Decodes an UpdateInterceptEndpointGroupRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateInterceptEndpointGroupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.networksecurity.v1.UpdateInterceptEndpointGroupRequest; + + /** + * Verifies an UpdateInterceptEndpointGroupRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UpdateInterceptEndpointGroupRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateInterceptEndpointGroupRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.networksecurity.v1.UpdateInterceptEndpointGroupRequest; + + /** + * Creates a plain object from an UpdateInterceptEndpointGroupRequest message. Also converts values to other types if specified. + * @param message UpdateInterceptEndpointGroupRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.networksecurity.v1.UpdateInterceptEndpointGroupRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateInterceptEndpointGroupRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateInterceptEndpointGroupRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteInterceptEndpointGroupRequest. */ + interface IDeleteInterceptEndpointGroupRequest { + + /** DeleteInterceptEndpointGroupRequest name */ + name?: (string|null); + + /** DeleteInterceptEndpointGroupRequest requestId */ + requestId?: (string|null); + } + + /** Represents a DeleteInterceptEndpointGroupRequest. */ + class DeleteInterceptEndpointGroupRequest implements IDeleteInterceptEndpointGroupRequest { + + /** + * Constructs a new DeleteInterceptEndpointGroupRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.networksecurity.v1.IDeleteInterceptEndpointGroupRequest); + + /** DeleteInterceptEndpointGroupRequest name. */ + public name: string; + + /** DeleteInterceptEndpointGroupRequest requestId. */ + public requestId: string; + + /** + * Creates a new DeleteInterceptEndpointGroupRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteInterceptEndpointGroupRequest instance + */ + public static create(properties?: google.cloud.networksecurity.v1.IDeleteInterceptEndpointGroupRequest): google.cloud.networksecurity.v1.DeleteInterceptEndpointGroupRequest; + + /** + * Encodes the specified DeleteInterceptEndpointGroupRequest message. Does not implicitly {@link google.cloud.networksecurity.v1.DeleteInterceptEndpointGroupRequest.verify|verify} messages. + * @param message DeleteInterceptEndpointGroupRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.networksecurity.v1.IDeleteInterceptEndpointGroupRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteInterceptEndpointGroupRequest message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.DeleteInterceptEndpointGroupRequest.verify|verify} messages. + * @param message DeleteInterceptEndpointGroupRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.networksecurity.v1.IDeleteInterceptEndpointGroupRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteInterceptEndpointGroupRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteInterceptEndpointGroupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.networksecurity.v1.DeleteInterceptEndpointGroupRequest; + + /** + * Decodes a DeleteInterceptEndpointGroupRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteInterceptEndpointGroupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.networksecurity.v1.DeleteInterceptEndpointGroupRequest; + + /** + * Verifies a DeleteInterceptEndpointGroupRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteInterceptEndpointGroupRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteInterceptEndpointGroupRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.networksecurity.v1.DeleteInterceptEndpointGroupRequest; + + /** + * Creates a plain object from a DeleteInterceptEndpointGroupRequest message. Also converts values to other types if specified. + * @param message DeleteInterceptEndpointGroupRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.networksecurity.v1.DeleteInterceptEndpointGroupRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteInterceptEndpointGroupRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteInterceptEndpointGroupRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an InterceptEndpointGroupAssociation. */ + interface IInterceptEndpointGroupAssociation { + + /** InterceptEndpointGroupAssociation name */ + name?: (string|null); + + /** InterceptEndpointGroupAssociation createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** InterceptEndpointGroupAssociation updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** InterceptEndpointGroupAssociation labels */ + labels?: ({ [k: string]: string }|null); + + /** InterceptEndpointGroupAssociation interceptEndpointGroup */ + interceptEndpointGroup?: (string|null); + + /** InterceptEndpointGroupAssociation network */ + network?: (string|null); + + /** InterceptEndpointGroupAssociation locationsDetails */ + locationsDetails?: (google.cloud.networksecurity.v1.InterceptEndpointGroupAssociation.ILocationDetails[]|null); + + /** InterceptEndpointGroupAssociation state */ + state?: (google.cloud.networksecurity.v1.InterceptEndpointGroupAssociation.State|keyof typeof google.cloud.networksecurity.v1.InterceptEndpointGroupAssociation.State|null); + + /** InterceptEndpointGroupAssociation reconciling */ + reconciling?: (boolean|null); + + /** InterceptEndpointGroupAssociation locations */ + locations?: (google.cloud.networksecurity.v1.IInterceptLocation[]|null); + + /** InterceptEndpointGroupAssociation networkCookie */ + networkCookie?: (number|null); + } + + /** Represents an InterceptEndpointGroupAssociation. */ + class InterceptEndpointGroupAssociation implements IInterceptEndpointGroupAssociation { + + /** + * Constructs a new InterceptEndpointGroupAssociation. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.networksecurity.v1.IInterceptEndpointGroupAssociation); + + /** InterceptEndpointGroupAssociation name. */ + public name: string; + + /** InterceptEndpointGroupAssociation createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** InterceptEndpointGroupAssociation updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** InterceptEndpointGroupAssociation labels. */ + public labels: { [k: string]: string }; + + /** InterceptEndpointGroupAssociation interceptEndpointGroup. */ + public interceptEndpointGroup: string; + + /** InterceptEndpointGroupAssociation network. */ + public network: string; + + /** InterceptEndpointGroupAssociation locationsDetails. */ + public locationsDetails: google.cloud.networksecurity.v1.InterceptEndpointGroupAssociation.ILocationDetails[]; + + /** InterceptEndpointGroupAssociation state. */ + public state: (google.cloud.networksecurity.v1.InterceptEndpointGroupAssociation.State|keyof typeof google.cloud.networksecurity.v1.InterceptEndpointGroupAssociation.State); + + /** InterceptEndpointGroupAssociation reconciling. */ + public reconciling: boolean; + + /** InterceptEndpointGroupAssociation locations. */ + public locations: google.cloud.networksecurity.v1.IInterceptLocation[]; + + /** InterceptEndpointGroupAssociation networkCookie. */ + public networkCookie: number; + + /** + * Creates a new InterceptEndpointGroupAssociation instance using the specified properties. + * @param [properties] Properties to set + * @returns InterceptEndpointGroupAssociation instance + */ + public static create(properties?: google.cloud.networksecurity.v1.IInterceptEndpointGroupAssociation): google.cloud.networksecurity.v1.InterceptEndpointGroupAssociation; + + /** + * Encodes the specified InterceptEndpointGroupAssociation message. Does not implicitly {@link google.cloud.networksecurity.v1.InterceptEndpointGroupAssociation.verify|verify} messages. + * @param message InterceptEndpointGroupAssociation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.networksecurity.v1.IInterceptEndpointGroupAssociation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified InterceptEndpointGroupAssociation message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.InterceptEndpointGroupAssociation.verify|verify} messages. + * @param message InterceptEndpointGroupAssociation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.networksecurity.v1.IInterceptEndpointGroupAssociation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an InterceptEndpointGroupAssociation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns InterceptEndpointGroupAssociation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.networksecurity.v1.InterceptEndpointGroupAssociation; + + /** + * Decodes an InterceptEndpointGroupAssociation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns InterceptEndpointGroupAssociation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.networksecurity.v1.InterceptEndpointGroupAssociation; + + /** + * Verifies an InterceptEndpointGroupAssociation message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an InterceptEndpointGroupAssociation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns InterceptEndpointGroupAssociation + */ + public static fromObject(object: { [k: string]: any }): google.cloud.networksecurity.v1.InterceptEndpointGroupAssociation; + + /** + * Creates a plain object from an InterceptEndpointGroupAssociation message. Also converts values to other types if specified. + * @param message InterceptEndpointGroupAssociation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.networksecurity.v1.InterceptEndpointGroupAssociation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this InterceptEndpointGroupAssociation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for InterceptEndpointGroupAssociation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace InterceptEndpointGroupAssociation { + + /** Properties of a LocationDetails. */ + interface ILocationDetails { + + /** LocationDetails location */ + location?: (string|null); + + /** LocationDetails state */ + state?: (google.cloud.networksecurity.v1.InterceptEndpointGroupAssociation.LocationDetails.State|keyof typeof google.cloud.networksecurity.v1.InterceptEndpointGroupAssociation.LocationDetails.State|null); + } + + /** Represents a LocationDetails. */ + class LocationDetails implements ILocationDetails { + + /** + * Constructs a new LocationDetails. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.networksecurity.v1.InterceptEndpointGroupAssociation.ILocationDetails); + + /** LocationDetails location. */ + public location: string; + + /** LocationDetails state. */ + public state: (google.cloud.networksecurity.v1.InterceptEndpointGroupAssociation.LocationDetails.State|keyof typeof google.cloud.networksecurity.v1.InterceptEndpointGroupAssociation.LocationDetails.State); + + /** + * Creates a new LocationDetails instance using the specified properties. + * @param [properties] Properties to set + * @returns LocationDetails instance + */ + public static create(properties?: google.cloud.networksecurity.v1.InterceptEndpointGroupAssociation.ILocationDetails): google.cloud.networksecurity.v1.InterceptEndpointGroupAssociation.LocationDetails; + + /** + * Encodes the specified LocationDetails message. Does not implicitly {@link google.cloud.networksecurity.v1.InterceptEndpointGroupAssociation.LocationDetails.verify|verify} messages. + * @param message LocationDetails message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.networksecurity.v1.InterceptEndpointGroupAssociation.ILocationDetails, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified LocationDetails message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.InterceptEndpointGroupAssociation.LocationDetails.verify|verify} messages. + * @param message LocationDetails message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.networksecurity.v1.InterceptEndpointGroupAssociation.ILocationDetails, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a LocationDetails message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns LocationDetails + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.networksecurity.v1.InterceptEndpointGroupAssociation.LocationDetails; + + /** + * Decodes a LocationDetails message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns LocationDetails + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.networksecurity.v1.InterceptEndpointGroupAssociation.LocationDetails; + + /** + * Verifies a LocationDetails message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a LocationDetails message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns LocationDetails + */ + public static fromObject(object: { [k: string]: any }): google.cloud.networksecurity.v1.InterceptEndpointGroupAssociation.LocationDetails; + + /** + * Creates a plain object from a LocationDetails message. Also converts values to other types if specified. + * @param message LocationDetails + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.networksecurity.v1.InterceptEndpointGroupAssociation.LocationDetails, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this LocationDetails to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for LocationDetails + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace LocationDetails { + + /** State enum. */ + enum State { + STATE_UNSPECIFIED = 0, + ACTIVE = 1, + OUT_OF_SYNC = 2 + } + } + + /** State enum. */ + enum State { + STATE_UNSPECIFIED = 0, + ACTIVE = 1, + CREATING = 2, + DELETING = 3, + CLOSED = 4, + OUT_OF_SYNC = 5, + DELETE_FAILED = 6 + } + } + + /** Properties of a ListInterceptEndpointGroupAssociationsRequest. */ + interface IListInterceptEndpointGroupAssociationsRequest { + + /** ListInterceptEndpointGroupAssociationsRequest parent */ + parent?: (string|null); + + /** ListInterceptEndpointGroupAssociationsRequest pageSize */ + pageSize?: (number|null); + + /** ListInterceptEndpointGroupAssociationsRequest pageToken */ + pageToken?: (string|null); + + /** ListInterceptEndpointGroupAssociationsRequest filter */ + filter?: (string|null); + + /** ListInterceptEndpointGroupAssociationsRequest orderBy */ + orderBy?: (string|null); + } + + /** Represents a ListInterceptEndpointGroupAssociationsRequest. */ + class ListInterceptEndpointGroupAssociationsRequest implements IListInterceptEndpointGroupAssociationsRequest { + + /** + * Constructs a new ListInterceptEndpointGroupAssociationsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.networksecurity.v1.IListInterceptEndpointGroupAssociationsRequest); + + /** ListInterceptEndpointGroupAssociationsRequest parent. */ + public parent: string; + + /** ListInterceptEndpointGroupAssociationsRequest pageSize. */ + public pageSize: number; + + /** ListInterceptEndpointGroupAssociationsRequest pageToken. */ + public pageToken: string; + + /** ListInterceptEndpointGroupAssociationsRequest filter. */ + public filter: string; + + /** ListInterceptEndpointGroupAssociationsRequest orderBy. */ + public orderBy: string; + + /** + * Creates a new ListInterceptEndpointGroupAssociationsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListInterceptEndpointGroupAssociationsRequest instance + */ + public static create(properties?: google.cloud.networksecurity.v1.IListInterceptEndpointGroupAssociationsRequest): google.cloud.networksecurity.v1.ListInterceptEndpointGroupAssociationsRequest; + + /** + * Encodes the specified ListInterceptEndpointGroupAssociationsRequest message. Does not implicitly {@link google.cloud.networksecurity.v1.ListInterceptEndpointGroupAssociationsRequest.verify|verify} messages. + * @param message ListInterceptEndpointGroupAssociationsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.networksecurity.v1.IListInterceptEndpointGroupAssociationsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListInterceptEndpointGroupAssociationsRequest message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.ListInterceptEndpointGroupAssociationsRequest.verify|verify} messages. + * @param message ListInterceptEndpointGroupAssociationsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.networksecurity.v1.IListInterceptEndpointGroupAssociationsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListInterceptEndpointGroupAssociationsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListInterceptEndpointGroupAssociationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.networksecurity.v1.ListInterceptEndpointGroupAssociationsRequest; + + /** + * Decodes a ListInterceptEndpointGroupAssociationsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListInterceptEndpointGroupAssociationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.networksecurity.v1.ListInterceptEndpointGroupAssociationsRequest; + + /** + * Verifies a ListInterceptEndpointGroupAssociationsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListInterceptEndpointGroupAssociationsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListInterceptEndpointGroupAssociationsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.networksecurity.v1.ListInterceptEndpointGroupAssociationsRequest; + + /** + * Creates a plain object from a ListInterceptEndpointGroupAssociationsRequest message. Also converts values to other types if specified. + * @param message ListInterceptEndpointGroupAssociationsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.networksecurity.v1.ListInterceptEndpointGroupAssociationsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListInterceptEndpointGroupAssociationsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListInterceptEndpointGroupAssociationsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListInterceptEndpointGroupAssociationsResponse. */ + interface IListInterceptEndpointGroupAssociationsResponse { + + /** ListInterceptEndpointGroupAssociationsResponse interceptEndpointGroupAssociations */ + interceptEndpointGroupAssociations?: (google.cloud.networksecurity.v1.IInterceptEndpointGroupAssociation[]|null); + + /** ListInterceptEndpointGroupAssociationsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListInterceptEndpointGroupAssociationsResponse. */ + class ListInterceptEndpointGroupAssociationsResponse implements IListInterceptEndpointGroupAssociationsResponse { + + /** + * Constructs a new ListInterceptEndpointGroupAssociationsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.networksecurity.v1.IListInterceptEndpointGroupAssociationsResponse); + + /** ListInterceptEndpointGroupAssociationsResponse interceptEndpointGroupAssociations. */ + public interceptEndpointGroupAssociations: google.cloud.networksecurity.v1.IInterceptEndpointGroupAssociation[]; + + /** ListInterceptEndpointGroupAssociationsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListInterceptEndpointGroupAssociationsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListInterceptEndpointGroupAssociationsResponse instance + */ + public static create(properties?: google.cloud.networksecurity.v1.IListInterceptEndpointGroupAssociationsResponse): google.cloud.networksecurity.v1.ListInterceptEndpointGroupAssociationsResponse; + + /** + * Encodes the specified ListInterceptEndpointGroupAssociationsResponse message. Does not implicitly {@link google.cloud.networksecurity.v1.ListInterceptEndpointGroupAssociationsResponse.verify|verify} messages. + * @param message ListInterceptEndpointGroupAssociationsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.networksecurity.v1.IListInterceptEndpointGroupAssociationsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListInterceptEndpointGroupAssociationsResponse message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.ListInterceptEndpointGroupAssociationsResponse.verify|verify} messages. + * @param message ListInterceptEndpointGroupAssociationsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.networksecurity.v1.IListInterceptEndpointGroupAssociationsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListInterceptEndpointGroupAssociationsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListInterceptEndpointGroupAssociationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.networksecurity.v1.ListInterceptEndpointGroupAssociationsResponse; + + /** + * Decodes a ListInterceptEndpointGroupAssociationsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListInterceptEndpointGroupAssociationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.networksecurity.v1.ListInterceptEndpointGroupAssociationsResponse; + + /** + * Verifies a ListInterceptEndpointGroupAssociationsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListInterceptEndpointGroupAssociationsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListInterceptEndpointGroupAssociationsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.networksecurity.v1.ListInterceptEndpointGroupAssociationsResponse; + + /** + * Creates a plain object from a ListInterceptEndpointGroupAssociationsResponse message. Also converts values to other types if specified. + * @param message ListInterceptEndpointGroupAssociationsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.networksecurity.v1.ListInterceptEndpointGroupAssociationsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListInterceptEndpointGroupAssociationsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListInterceptEndpointGroupAssociationsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetInterceptEndpointGroupAssociationRequest. */ + interface IGetInterceptEndpointGroupAssociationRequest { + + /** GetInterceptEndpointGroupAssociationRequest name */ + name?: (string|null); + } + + /** Represents a GetInterceptEndpointGroupAssociationRequest. */ + class GetInterceptEndpointGroupAssociationRequest implements IGetInterceptEndpointGroupAssociationRequest { + + /** + * Constructs a new GetInterceptEndpointGroupAssociationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.networksecurity.v1.IGetInterceptEndpointGroupAssociationRequest); + + /** GetInterceptEndpointGroupAssociationRequest name. */ + public name: string; + + /** + * Creates a new GetInterceptEndpointGroupAssociationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetInterceptEndpointGroupAssociationRequest instance + */ + public static create(properties?: google.cloud.networksecurity.v1.IGetInterceptEndpointGroupAssociationRequest): google.cloud.networksecurity.v1.GetInterceptEndpointGroupAssociationRequest; + + /** + * Encodes the specified GetInterceptEndpointGroupAssociationRequest message. Does not implicitly {@link google.cloud.networksecurity.v1.GetInterceptEndpointGroupAssociationRequest.verify|verify} messages. + * @param message GetInterceptEndpointGroupAssociationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.networksecurity.v1.IGetInterceptEndpointGroupAssociationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetInterceptEndpointGroupAssociationRequest message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.GetInterceptEndpointGroupAssociationRequest.verify|verify} messages. + * @param message GetInterceptEndpointGroupAssociationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.networksecurity.v1.IGetInterceptEndpointGroupAssociationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetInterceptEndpointGroupAssociationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetInterceptEndpointGroupAssociationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.networksecurity.v1.GetInterceptEndpointGroupAssociationRequest; + + /** + * Decodes a GetInterceptEndpointGroupAssociationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetInterceptEndpointGroupAssociationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.networksecurity.v1.GetInterceptEndpointGroupAssociationRequest; + + /** + * Verifies a GetInterceptEndpointGroupAssociationRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetInterceptEndpointGroupAssociationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetInterceptEndpointGroupAssociationRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.networksecurity.v1.GetInterceptEndpointGroupAssociationRequest; + + /** + * Creates a plain object from a GetInterceptEndpointGroupAssociationRequest message. Also converts values to other types if specified. + * @param message GetInterceptEndpointGroupAssociationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.networksecurity.v1.GetInterceptEndpointGroupAssociationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetInterceptEndpointGroupAssociationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetInterceptEndpointGroupAssociationRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateInterceptEndpointGroupAssociationRequest. */ + interface ICreateInterceptEndpointGroupAssociationRequest { + + /** CreateInterceptEndpointGroupAssociationRequest parent */ + parent?: (string|null); + + /** CreateInterceptEndpointGroupAssociationRequest interceptEndpointGroupAssociationId */ + interceptEndpointGroupAssociationId?: (string|null); + + /** CreateInterceptEndpointGroupAssociationRequest interceptEndpointGroupAssociation */ + interceptEndpointGroupAssociation?: (google.cloud.networksecurity.v1.IInterceptEndpointGroupAssociation|null); + + /** CreateInterceptEndpointGroupAssociationRequest requestId */ + requestId?: (string|null); + } + + /** Represents a CreateInterceptEndpointGroupAssociationRequest. */ + class CreateInterceptEndpointGroupAssociationRequest implements ICreateInterceptEndpointGroupAssociationRequest { + + /** + * Constructs a new CreateInterceptEndpointGroupAssociationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.networksecurity.v1.ICreateInterceptEndpointGroupAssociationRequest); + + /** CreateInterceptEndpointGroupAssociationRequest parent. */ + public parent: string; + + /** CreateInterceptEndpointGroupAssociationRequest interceptEndpointGroupAssociationId. */ + public interceptEndpointGroupAssociationId: string; + + /** CreateInterceptEndpointGroupAssociationRequest interceptEndpointGroupAssociation. */ + public interceptEndpointGroupAssociation?: (google.cloud.networksecurity.v1.IInterceptEndpointGroupAssociation|null); + + /** CreateInterceptEndpointGroupAssociationRequest requestId. */ + public requestId: string; + + /** + * Creates a new CreateInterceptEndpointGroupAssociationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateInterceptEndpointGroupAssociationRequest instance + */ + public static create(properties?: google.cloud.networksecurity.v1.ICreateInterceptEndpointGroupAssociationRequest): google.cloud.networksecurity.v1.CreateInterceptEndpointGroupAssociationRequest; + + /** + * Encodes the specified CreateInterceptEndpointGroupAssociationRequest message. Does not implicitly {@link google.cloud.networksecurity.v1.CreateInterceptEndpointGroupAssociationRequest.verify|verify} messages. + * @param message CreateInterceptEndpointGroupAssociationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.networksecurity.v1.ICreateInterceptEndpointGroupAssociationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateInterceptEndpointGroupAssociationRequest message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.CreateInterceptEndpointGroupAssociationRequest.verify|verify} messages. + * @param message CreateInterceptEndpointGroupAssociationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.networksecurity.v1.ICreateInterceptEndpointGroupAssociationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateInterceptEndpointGroupAssociationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateInterceptEndpointGroupAssociationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.networksecurity.v1.CreateInterceptEndpointGroupAssociationRequest; + + /** + * Decodes a CreateInterceptEndpointGroupAssociationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateInterceptEndpointGroupAssociationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.networksecurity.v1.CreateInterceptEndpointGroupAssociationRequest; + + /** + * Verifies a CreateInterceptEndpointGroupAssociationRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateInterceptEndpointGroupAssociationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateInterceptEndpointGroupAssociationRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.networksecurity.v1.CreateInterceptEndpointGroupAssociationRequest; + + /** + * Creates a plain object from a CreateInterceptEndpointGroupAssociationRequest message. Also converts values to other types if specified. + * @param message CreateInterceptEndpointGroupAssociationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.networksecurity.v1.CreateInterceptEndpointGroupAssociationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateInterceptEndpointGroupAssociationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateInterceptEndpointGroupAssociationRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateInterceptEndpointGroupAssociationRequest. */ + interface IUpdateInterceptEndpointGroupAssociationRequest { + + /** UpdateInterceptEndpointGroupAssociationRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateInterceptEndpointGroupAssociationRequest interceptEndpointGroupAssociation */ + interceptEndpointGroupAssociation?: (google.cloud.networksecurity.v1.IInterceptEndpointGroupAssociation|null); + + /** UpdateInterceptEndpointGroupAssociationRequest requestId */ + requestId?: (string|null); + } + + /** Represents an UpdateInterceptEndpointGroupAssociationRequest. */ + class UpdateInterceptEndpointGroupAssociationRequest implements IUpdateInterceptEndpointGroupAssociationRequest { + + /** + * Constructs a new UpdateInterceptEndpointGroupAssociationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.networksecurity.v1.IUpdateInterceptEndpointGroupAssociationRequest); + + /** UpdateInterceptEndpointGroupAssociationRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateInterceptEndpointGroupAssociationRequest interceptEndpointGroupAssociation. */ + public interceptEndpointGroupAssociation?: (google.cloud.networksecurity.v1.IInterceptEndpointGroupAssociation|null); + + /** UpdateInterceptEndpointGroupAssociationRequest requestId. */ + public requestId: string; + + /** + * Creates a new UpdateInterceptEndpointGroupAssociationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateInterceptEndpointGroupAssociationRequest instance + */ + public static create(properties?: google.cloud.networksecurity.v1.IUpdateInterceptEndpointGroupAssociationRequest): google.cloud.networksecurity.v1.UpdateInterceptEndpointGroupAssociationRequest; + + /** + * Encodes the specified UpdateInterceptEndpointGroupAssociationRequest message. Does not implicitly {@link google.cloud.networksecurity.v1.UpdateInterceptEndpointGroupAssociationRequest.verify|verify} messages. + * @param message UpdateInterceptEndpointGroupAssociationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.networksecurity.v1.IUpdateInterceptEndpointGroupAssociationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateInterceptEndpointGroupAssociationRequest message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.UpdateInterceptEndpointGroupAssociationRequest.verify|verify} messages. + * @param message UpdateInterceptEndpointGroupAssociationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.networksecurity.v1.IUpdateInterceptEndpointGroupAssociationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateInterceptEndpointGroupAssociationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateInterceptEndpointGroupAssociationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.networksecurity.v1.UpdateInterceptEndpointGroupAssociationRequest; + + /** + * Decodes an UpdateInterceptEndpointGroupAssociationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateInterceptEndpointGroupAssociationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.networksecurity.v1.UpdateInterceptEndpointGroupAssociationRequest; + + /** + * Verifies an UpdateInterceptEndpointGroupAssociationRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UpdateInterceptEndpointGroupAssociationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateInterceptEndpointGroupAssociationRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.networksecurity.v1.UpdateInterceptEndpointGroupAssociationRequest; + + /** + * Creates a plain object from an UpdateInterceptEndpointGroupAssociationRequest message. Also converts values to other types if specified. + * @param message UpdateInterceptEndpointGroupAssociationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.networksecurity.v1.UpdateInterceptEndpointGroupAssociationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateInterceptEndpointGroupAssociationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateInterceptEndpointGroupAssociationRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteInterceptEndpointGroupAssociationRequest. */ + interface IDeleteInterceptEndpointGroupAssociationRequest { + + /** DeleteInterceptEndpointGroupAssociationRequest name */ + name?: (string|null); + + /** DeleteInterceptEndpointGroupAssociationRequest requestId */ + requestId?: (string|null); + } + + /** Represents a DeleteInterceptEndpointGroupAssociationRequest. */ + class DeleteInterceptEndpointGroupAssociationRequest implements IDeleteInterceptEndpointGroupAssociationRequest { + + /** + * Constructs a new DeleteInterceptEndpointGroupAssociationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.networksecurity.v1.IDeleteInterceptEndpointGroupAssociationRequest); + + /** DeleteInterceptEndpointGroupAssociationRequest name. */ + public name: string; + + /** DeleteInterceptEndpointGroupAssociationRequest requestId. */ + public requestId: string; + + /** + * Creates a new DeleteInterceptEndpointGroupAssociationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteInterceptEndpointGroupAssociationRequest instance + */ + public static create(properties?: google.cloud.networksecurity.v1.IDeleteInterceptEndpointGroupAssociationRequest): google.cloud.networksecurity.v1.DeleteInterceptEndpointGroupAssociationRequest; + + /** + * Encodes the specified DeleteInterceptEndpointGroupAssociationRequest message. Does not implicitly {@link google.cloud.networksecurity.v1.DeleteInterceptEndpointGroupAssociationRequest.verify|verify} messages. + * @param message DeleteInterceptEndpointGroupAssociationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.networksecurity.v1.IDeleteInterceptEndpointGroupAssociationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteInterceptEndpointGroupAssociationRequest message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.DeleteInterceptEndpointGroupAssociationRequest.verify|verify} messages. + * @param message DeleteInterceptEndpointGroupAssociationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.networksecurity.v1.IDeleteInterceptEndpointGroupAssociationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteInterceptEndpointGroupAssociationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteInterceptEndpointGroupAssociationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.networksecurity.v1.DeleteInterceptEndpointGroupAssociationRequest; + + /** + * Decodes a DeleteInterceptEndpointGroupAssociationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteInterceptEndpointGroupAssociationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.networksecurity.v1.DeleteInterceptEndpointGroupAssociationRequest; + + /** + * Verifies a DeleteInterceptEndpointGroupAssociationRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteInterceptEndpointGroupAssociationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteInterceptEndpointGroupAssociationRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.networksecurity.v1.DeleteInterceptEndpointGroupAssociationRequest; + + /** + * Creates a plain object from a DeleteInterceptEndpointGroupAssociationRequest message. Also converts values to other types if specified. + * @param message DeleteInterceptEndpointGroupAssociationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.networksecurity.v1.DeleteInterceptEndpointGroupAssociationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteInterceptEndpointGroupAssociationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteInterceptEndpointGroupAssociationRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an InterceptDeploymentGroup. */ + interface IInterceptDeploymentGroup { + + /** InterceptDeploymentGroup name */ + name?: (string|null); + + /** InterceptDeploymentGroup createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** InterceptDeploymentGroup updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** InterceptDeploymentGroup labels */ + labels?: ({ [k: string]: string }|null); + + /** InterceptDeploymentGroup network */ + network?: (string|null); + + /** InterceptDeploymentGroup connectedEndpointGroups */ + connectedEndpointGroups?: (google.cloud.networksecurity.v1.InterceptDeploymentGroup.IConnectedEndpointGroup[]|null); + + /** InterceptDeploymentGroup nestedDeployments */ + nestedDeployments?: (google.cloud.networksecurity.v1.InterceptDeploymentGroup.IDeployment[]|null); + + /** InterceptDeploymentGroup state */ + state?: (google.cloud.networksecurity.v1.InterceptDeploymentGroup.State|keyof typeof google.cloud.networksecurity.v1.InterceptDeploymentGroup.State|null); + + /** InterceptDeploymentGroup reconciling */ + reconciling?: (boolean|null); + + /** InterceptDeploymentGroup description */ + description?: (string|null); + + /** InterceptDeploymentGroup locations */ + locations?: (google.cloud.networksecurity.v1.IInterceptLocation[]|null); + } + + /** Represents an InterceptDeploymentGroup. */ + class InterceptDeploymentGroup implements IInterceptDeploymentGroup { + + /** + * Constructs a new InterceptDeploymentGroup. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.networksecurity.v1.IInterceptDeploymentGroup); + + /** InterceptDeploymentGroup name. */ + public name: string; + + /** InterceptDeploymentGroup createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** InterceptDeploymentGroup updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** InterceptDeploymentGroup labels. */ + public labels: { [k: string]: string }; + + /** InterceptDeploymentGroup network. */ + public network: string; + + /** InterceptDeploymentGroup connectedEndpointGroups. */ + public connectedEndpointGroups: google.cloud.networksecurity.v1.InterceptDeploymentGroup.IConnectedEndpointGroup[]; + + /** InterceptDeploymentGroup nestedDeployments. */ + public nestedDeployments: google.cloud.networksecurity.v1.InterceptDeploymentGroup.IDeployment[]; + + /** InterceptDeploymentGroup state. */ + public state: (google.cloud.networksecurity.v1.InterceptDeploymentGroup.State|keyof typeof google.cloud.networksecurity.v1.InterceptDeploymentGroup.State); + + /** InterceptDeploymentGroup reconciling. */ + public reconciling: boolean; + + /** InterceptDeploymentGroup description. */ + public description: string; + + /** InterceptDeploymentGroup locations. */ + public locations: google.cloud.networksecurity.v1.IInterceptLocation[]; + + /** + * Creates a new InterceptDeploymentGroup instance using the specified properties. + * @param [properties] Properties to set + * @returns InterceptDeploymentGroup instance + */ + public static create(properties?: google.cloud.networksecurity.v1.IInterceptDeploymentGroup): google.cloud.networksecurity.v1.InterceptDeploymentGroup; + + /** + * Encodes the specified InterceptDeploymentGroup message. Does not implicitly {@link google.cloud.networksecurity.v1.InterceptDeploymentGroup.verify|verify} messages. + * @param message InterceptDeploymentGroup message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.networksecurity.v1.IInterceptDeploymentGroup, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified InterceptDeploymentGroup message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.InterceptDeploymentGroup.verify|verify} messages. + * @param message InterceptDeploymentGroup message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.networksecurity.v1.IInterceptDeploymentGroup, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an InterceptDeploymentGroup message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns InterceptDeploymentGroup + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.networksecurity.v1.InterceptDeploymentGroup; + + /** + * Decodes an InterceptDeploymentGroup message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns InterceptDeploymentGroup + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.networksecurity.v1.InterceptDeploymentGroup; + + /** + * Verifies an InterceptDeploymentGroup message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an InterceptDeploymentGroup message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns InterceptDeploymentGroup + */ + public static fromObject(object: { [k: string]: any }): google.cloud.networksecurity.v1.InterceptDeploymentGroup; + + /** + * Creates a plain object from an InterceptDeploymentGroup message. Also converts values to other types if specified. + * @param message InterceptDeploymentGroup + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.networksecurity.v1.InterceptDeploymentGroup, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this InterceptDeploymentGroup to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for InterceptDeploymentGroup + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace InterceptDeploymentGroup { + + /** Properties of a ConnectedEndpointGroup. */ + interface IConnectedEndpointGroup { + + /** ConnectedEndpointGroup name */ + name?: (string|null); + } + + /** Represents a ConnectedEndpointGroup. */ + class ConnectedEndpointGroup implements IConnectedEndpointGroup { + + /** + * Constructs a new ConnectedEndpointGroup. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.networksecurity.v1.InterceptDeploymentGroup.IConnectedEndpointGroup); + + /** ConnectedEndpointGroup name. */ + public name: string; + + /** + * Creates a new ConnectedEndpointGroup instance using the specified properties. + * @param [properties] Properties to set + * @returns ConnectedEndpointGroup instance + */ + public static create(properties?: google.cloud.networksecurity.v1.InterceptDeploymentGroup.IConnectedEndpointGroup): google.cloud.networksecurity.v1.InterceptDeploymentGroup.ConnectedEndpointGroup; + + /** + * Encodes the specified ConnectedEndpointGroup message. Does not implicitly {@link google.cloud.networksecurity.v1.InterceptDeploymentGroup.ConnectedEndpointGroup.verify|verify} messages. + * @param message ConnectedEndpointGroup message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.networksecurity.v1.InterceptDeploymentGroup.IConnectedEndpointGroup, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ConnectedEndpointGroup message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.InterceptDeploymentGroup.ConnectedEndpointGroup.verify|verify} messages. + * @param message ConnectedEndpointGroup message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.networksecurity.v1.InterceptDeploymentGroup.IConnectedEndpointGroup, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ConnectedEndpointGroup message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ConnectedEndpointGroup + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.networksecurity.v1.InterceptDeploymentGroup.ConnectedEndpointGroup; + + /** + * Decodes a ConnectedEndpointGroup message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ConnectedEndpointGroup + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.networksecurity.v1.InterceptDeploymentGroup.ConnectedEndpointGroup; + + /** + * Verifies a ConnectedEndpointGroup message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ConnectedEndpointGroup message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ConnectedEndpointGroup + */ + public static fromObject(object: { [k: string]: any }): google.cloud.networksecurity.v1.InterceptDeploymentGroup.ConnectedEndpointGroup; + + /** + * Creates a plain object from a ConnectedEndpointGroup message. Also converts values to other types if specified. + * @param message ConnectedEndpointGroup + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.networksecurity.v1.InterceptDeploymentGroup.ConnectedEndpointGroup, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ConnectedEndpointGroup to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ConnectedEndpointGroup + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Deployment. */ + interface IDeployment { + + /** Deployment name */ + name?: (string|null); + + /** Deployment state */ + state?: (google.cloud.networksecurity.v1.InterceptDeployment.State|keyof typeof google.cloud.networksecurity.v1.InterceptDeployment.State|null); + } + + /** Represents a Deployment. */ + class Deployment implements IDeployment { + + /** + * Constructs a new Deployment. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.networksecurity.v1.InterceptDeploymentGroup.IDeployment); + + /** Deployment name. */ + public name: string; + + /** Deployment state. */ + public state: (google.cloud.networksecurity.v1.InterceptDeployment.State|keyof typeof google.cloud.networksecurity.v1.InterceptDeployment.State); + + /** + * Creates a new Deployment instance using the specified properties. + * @param [properties] Properties to set + * @returns Deployment instance + */ + public static create(properties?: google.cloud.networksecurity.v1.InterceptDeploymentGroup.IDeployment): google.cloud.networksecurity.v1.InterceptDeploymentGroup.Deployment; + + /** + * Encodes the specified Deployment message. Does not implicitly {@link google.cloud.networksecurity.v1.InterceptDeploymentGroup.Deployment.verify|verify} messages. + * @param message Deployment message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.networksecurity.v1.InterceptDeploymentGroup.IDeployment, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Deployment message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.InterceptDeploymentGroup.Deployment.verify|verify} messages. + * @param message Deployment message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.networksecurity.v1.InterceptDeploymentGroup.IDeployment, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Deployment message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Deployment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.networksecurity.v1.InterceptDeploymentGroup.Deployment; + + /** + * Decodes a Deployment message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Deployment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.networksecurity.v1.InterceptDeploymentGroup.Deployment; + + /** + * Verifies a Deployment message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Deployment message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Deployment + */ + public static fromObject(object: { [k: string]: any }): google.cloud.networksecurity.v1.InterceptDeploymentGroup.Deployment; + + /** + * Creates a plain object from a Deployment message. Also converts values to other types if specified. + * @param message Deployment + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.networksecurity.v1.InterceptDeploymentGroup.Deployment, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Deployment to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Deployment + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** State enum. */ + enum State { + STATE_UNSPECIFIED = 0, + ACTIVE = 1, + CREATING = 2, + DELETING = 3 + } + } + + /** Properties of a ListInterceptDeploymentGroupsRequest. */ + interface IListInterceptDeploymentGroupsRequest { + + /** ListInterceptDeploymentGroupsRequest parent */ + parent?: (string|null); + + /** ListInterceptDeploymentGroupsRequest pageSize */ + pageSize?: (number|null); + + /** ListInterceptDeploymentGroupsRequest pageToken */ + pageToken?: (string|null); + + /** ListInterceptDeploymentGroupsRequest filter */ + filter?: (string|null); + + /** ListInterceptDeploymentGroupsRequest orderBy */ + orderBy?: (string|null); + } + + /** Represents a ListInterceptDeploymentGroupsRequest. */ + class ListInterceptDeploymentGroupsRequest implements IListInterceptDeploymentGroupsRequest { + + /** + * Constructs a new ListInterceptDeploymentGroupsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.networksecurity.v1.IListInterceptDeploymentGroupsRequest); + + /** ListInterceptDeploymentGroupsRequest parent. */ + public parent: string; + + /** ListInterceptDeploymentGroupsRequest pageSize. */ + public pageSize: number; + + /** ListInterceptDeploymentGroupsRequest pageToken. */ + public pageToken: string; + + /** ListInterceptDeploymentGroupsRequest filter. */ + public filter: string; + + /** ListInterceptDeploymentGroupsRequest orderBy. */ + public orderBy: string; + + /** + * Creates a new ListInterceptDeploymentGroupsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListInterceptDeploymentGroupsRequest instance + */ + public static create(properties?: google.cloud.networksecurity.v1.IListInterceptDeploymentGroupsRequest): google.cloud.networksecurity.v1.ListInterceptDeploymentGroupsRequest; + + /** + * Encodes the specified ListInterceptDeploymentGroupsRequest message. Does not implicitly {@link google.cloud.networksecurity.v1.ListInterceptDeploymentGroupsRequest.verify|verify} messages. + * @param message ListInterceptDeploymentGroupsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.networksecurity.v1.IListInterceptDeploymentGroupsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListInterceptDeploymentGroupsRequest message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.ListInterceptDeploymentGroupsRequest.verify|verify} messages. + * @param message ListInterceptDeploymentGroupsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.networksecurity.v1.IListInterceptDeploymentGroupsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListInterceptDeploymentGroupsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListInterceptDeploymentGroupsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.networksecurity.v1.ListInterceptDeploymentGroupsRequest; + + /** + * Decodes a ListInterceptDeploymentGroupsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListInterceptDeploymentGroupsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.networksecurity.v1.ListInterceptDeploymentGroupsRequest; + + /** + * Verifies a ListInterceptDeploymentGroupsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListInterceptDeploymentGroupsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListInterceptDeploymentGroupsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.networksecurity.v1.ListInterceptDeploymentGroupsRequest; + + /** + * Creates a plain object from a ListInterceptDeploymentGroupsRequest message. Also converts values to other types if specified. + * @param message ListInterceptDeploymentGroupsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.networksecurity.v1.ListInterceptDeploymentGroupsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListInterceptDeploymentGroupsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListInterceptDeploymentGroupsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListInterceptDeploymentGroupsResponse. */ + interface IListInterceptDeploymentGroupsResponse { + + /** ListInterceptDeploymentGroupsResponse interceptDeploymentGroups */ + interceptDeploymentGroups?: (google.cloud.networksecurity.v1.IInterceptDeploymentGroup[]|null); + + /** ListInterceptDeploymentGroupsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListInterceptDeploymentGroupsResponse. */ + class ListInterceptDeploymentGroupsResponse implements IListInterceptDeploymentGroupsResponse { + + /** + * Constructs a new ListInterceptDeploymentGroupsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.networksecurity.v1.IListInterceptDeploymentGroupsResponse); + + /** ListInterceptDeploymentGroupsResponse interceptDeploymentGroups. */ + public interceptDeploymentGroups: google.cloud.networksecurity.v1.IInterceptDeploymentGroup[]; + + /** ListInterceptDeploymentGroupsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListInterceptDeploymentGroupsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListInterceptDeploymentGroupsResponse instance + */ + public static create(properties?: google.cloud.networksecurity.v1.IListInterceptDeploymentGroupsResponse): google.cloud.networksecurity.v1.ListInterceptDeploymentGroupsResponse; + + /** + * Encodes the specified ListInterceptDeploymentGroupsResponse message. Does not implicitly {@link google.cloud.networksecurity.v1.ListInterceptDeploymentGroupsResponse.verify|verify} messages. + * @param message ListInterceptDeploymentGroupsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.networksecurity.v1.IListInterceptDeploymentGroupsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListInterceptDeploymentGroupsResponse message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.ListInterceptDeploymentGroupsResponse.verify|verify} messages. + * @param message ListInterceptDeploymentGroupsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.networksecurity.v1.IListInterceptDeploymentGroupsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListInterceptDeploymentGroupsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListInterceptDeploymentGroupsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.networksecurity.v1.ListInterceptDeploymentGroupsResponse; + + /** + * Decodes a ListInterceptDeploymentGroupsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListInterceptDeploymentGroupsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.networksecurity.v1.ListInterceptDeploymentGroupsResponse; + + /** + * Verifies a ListInterceptDeploymentGroupsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListInterceptDeploymentGroupsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListInterceptDeploymentGroupsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.networksecurity.v1.ListInterceptDeploymentGroupsResponse; + + /** + * Creates a plain object from a ListInterceptDeploymentGroupsResponse message. Also converts values to other types if specified. + * @param message ListInterceptDeploymentGroupsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.networksecurity.v1.ListInterceptDeploymentGroupsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListInterceptDeploymentGroupsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListInterceptDeploymentGroupsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetInterceptDeploymentGroupRequest. */ + interface IGetInterceptDeploymentGroupRequest { + + /** GetInterceptDeploymentGroupRequest name */ + name?: (string|null); + } + + /** Represents a GetInterceptDeploymentGroupRequest. */ + class GetInterceptDeploymentGroupRequest implements IGetInterceptDeploymentGroupRequest { + + /** + * Constructs a new GetInterceptDeploymentGroupRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.networksecurity.v1.IGetInterceptDeploymentGroupRequest); + + /** GetInterceptDeploymentGroupRequest name. */ + public name: string; + + /** + * Creates a new GetInterceptDeploymentGroupRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetInterceptDeploymentGroupRequest instance + */ + public static create(properties?: google.cloud.networksecurity.v1.IGetInterceptDeploymentGroupRequest): google.cloud.networksecurity.v1.GetInterceptDeploymentGroupRequest; + + /** + * Encodes the specified GetInterceptDeploymentGroupRequest message. Does not implicitly {@link google.cloud.networksecurity.v1.GetInterceptDeploymentGroupRequest.verify|verify} messages. + * @param message GetInterceptDeploymentGroupRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.networksecurity.v1.IGetInterceptDeploymentGroupRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetInterceptDeploymentGroupRequest message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.GetInterceptDeploymentGroupRequest.verify|verify} messages. + * @param message GetInterceptDeploymentGroupRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.networksecurity.v1.IGetInterceptDeploymentGroupRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetInterceptDeploymentGroupRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetInterceptDeploymentGroupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.networksecurity.v1.GetInterceptDeploymentGroupRequest; + + /** + * Decodes a GetInterceptDeploymentGroupRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetInterceptDeploymentGroupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.networksecurity.v1.GetInterceptDeploymentGroupRequest; + + /** + * Verifies a GetInterceptDeploymentGroupRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetInterceptDeploymentGroupRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetInterceptDeploymentGroupRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.networksecurity.v1.GetInterceptDeploymentGroupRequest; + + /** + * Creates a plain object from a GetInterceptDeploymentGroupRequest message. Also converts values to other types if specified. + * @param message GetInterceptDeploymentGroupRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.networksecurity.v1.GetInterceptDeploymentGroupRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetInterceptDeploymentGroupRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetInterceptDeploymentGroupRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateInterceptDeploymentGroupRequest. */ + interface ICreateInterceptDeploymentGroupRequest { + + /** CreateInterceptDeploymentGroupRequest parent */ + parent?: (string|null); + + /** CreateInterceptDeploymentGroupRequest interceptDeploymentGroupId */ + interceptDeploymentGroupId?: (string|null); + + /** CreateInterceptDeploymentGroupRequest interceptDeploymentGroup */ + interceptDeploymentGroup?: (google.cloud.networksecurity.v1.IInterceptDeploymentGroup|null); + + /** CreateInterceptDeploymentGroupRequest requestId */ + requestId?: (string|null); + } + + /** Represents a CreateInterceptDeploymentGroupRequest. */ + class CreateInterceptDeploymentGroupRequest implements ICreateInterceptDeploymentGroupRequest { + + /** + * Constructs a new CreateInterceptDeploymentGroupRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.networksecurity.v1.ICreateInterceptDeploymentGroupRequest); + + /** CreateInterceptDeploymentGroupRequest parent. */ + public parent: string; + + /** CreateInterceptDeploymentGroupRequest interceptDeploymentGroupId. */ + public interceptDeploymentGroupId: string; + + /** CreateInterceptDeploymentGroupRequest interceptDeploymentGroup. */ + public interceptDeploymentGroup?: (google.cloud.networksecurity.v1.IInterceptDeploymentGroup|null); + + /** CreateInterceptDeploymentGroupRequest requestId. */ + public requestId: string; + + /** + * Creates a new CreateInterceptDeploymentGroupRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateInterceptDeploymentGroupRequest instance + */ + public static create(properties?: google.cloud.networksecurity.v1.ICreateInterceptDeploymentGroupRequest): google.cloud.networksecurity.v1.CreateInterceptDeploymentGroupRequest; + + /** + * Encodes the specified CreateInterceptDeploymentGroupRequest message. Does not implicitly {@link google.cloud.networksecurity.v1.CreateInterceptDeploymentGroupRequest.verify|verify} messages. + * @param message CreateInterceptDeploymentGroupRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.networksecurity.v1.ICreateInterceptDeploymentGroupRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateInterceptDeploymentGroupRequest message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.CreateInterceptDeploymentGroupRequest.verify|verify} messages. + * @param message CreateInterceptDeploymentGroupRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.networksecurity.v1.ICreateInterceptDeploymentGroupRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateInterceptDeploymentGroupRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateInterceptDeploymentGroupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.networksecurity.v1.CreateInterceptDeploymentGroupRequest; + + /** + * Decodes a CreateInterceptDeploymentGroupRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateInterceptDeploymentGroupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.networksecurity.v1.CreateInterceptDeploymentGroupRequest; + + /** + * Verifies a CreateInterceptDeploymentGroupRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateInterceptDeploymentGroupRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateInterceptDeploymentGroupRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.networksecurity.v1.CreateInterceptDeploymentGroupRequest; + + /** + * Creates a plain object from a CreateInterceptDeploymentGroupRequest message. Also converts values to other types if specified. + * @param message CreateInterceptDeploymentGroupRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.networksecurity.v1.CreateInterceptDeploymentGroupRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateInterceptDeploymentGroupRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateInterceptDeploymentGroupRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateInterceptDeploymentGroupRequest. */ + interface IUpdateInterceptDeploymentGroupRequest { + + /** UpdateInterceptDeploymentGroupRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateInterceptDeploymentGroupRequest interceptDeploymentGroup */ + interceptDeploymentGroup?: (google.cloud.networksecurity.v1.IInterceptDeploymentGroup|null); + + /** UpdateInterceptDeploymentGroupRequest requestId */ + requestId?: (string|null); + } + + /** Represents an UpdateInterceptDeploymentGroupRequest. */ + class UpdateInterceptDeploymentGroupRequest implements IUpdateInterceptDeploymentGroupRequest { + + /** + * Constructs a new UpdateInterceptDeploymentGroupRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.networksecurity.v1.IUpdateInterceptDeploymentGroupRequest); + + /** UpdateInterceptDeploymentGroupRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateInterceptDeploymentGroupRequest interceptDeploymentGroup. */ + public interceptDeploymentGroup?: (google.cloud.networksecurity.v1.IInterceptDeploymentGroup|null); + + /** UpdateInterceptDeploymentGroupRequest requestId. */ + public requestId: string; + + /** + * Creates a new UpdateInterceptDeploymentGroupRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateInterceptDeploymentGroupRequest instance + */ + public static create(properties?: google.cloud.networksecurity.v1.IUpdateInterceptDeploymentGroupRequest): google.cloud.networksecurity.v1.UpdateInterceptDeploymentGroupRequest; + + /** + * Encodes the specified UpdateInterceptDeploymentGroupRequest message. Does not implicitly {@link google.cloud.networksecurity.v1.UpdateInterceptDeploymentGroupRequest.verify|verify} messages. + * @param message UpdateInterceptDeploymentGroupRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.networksecurity.v1.IUpdateInterceptDeploymentGroupRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateInterceptDeploymentGroupRequest message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.UpdateInterceptDeploymentGroupRequest.verify|verify} messages. + * @param message UpdateInterceptDeploymentGroupRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.networksecurity.v1.IUpdateInterceptDeploymentGroupRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateInterceptDeploymentGroupRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateInterceptDeploymentGroupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.networksecurity.v1.UpdateInterceptDeploymentGroupRequest; + + /** + * Decodes an UpdateInterceptDeploymentGroupRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateInterceptDeploymentGroupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.networksecurity.v1.UpdateInterceptDeploymentGroupRequest; + + /** + * Verifies an UpdateInterceptDeploymentGroupRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UpdateInterceptDeploymentGroupRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateInterceptDeploymentGroupRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.networksecurity.v1.UpdateInterceptDeploymentGroupRequest; + + /** + * Creates a plain object from an UpdateInterceptDeploymentGroupRequest message. Also converts values to other types if specified. + * @param message UpdateInterceptDeploymentGroupRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.networksecurity.v1.UpdateInterceptDeploymentGroupRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateInterceptDeploymentGroupRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateInterceptDeploymentGroupRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteInterceptDeploymentGroupRequest. */ + interface IDeleteInterceptDeploymentGroupRequest { + + /** DeleteInterceptDeploymentGroupRequest name */ + name?: (string|null); + + /** DeleteInterceptDeploymentGroupRequest requestId */ + requestId?: (string|null); + } + + /** Represents a DeleteInterceptDeploymentGroupRequest. */ + class DeleteInterceptDeploymentGroupRequest implements IDeleteInterceptDeploymentGroupRequest { + + /** + * Constructs a new DeleteInterceptDeploymentGroupRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.networksecurity.v1.IDeleteInterceptDeploymentGroupRequest); + + /** DeleteInterceptDeploymentGroupRequest name. */ + public name: string; + + /** DeleteInterceptDeploymentGroupRequest requestId. */ + public requestId: string; + + /** + * Creates a new DeleteInterceptDeploymentGroupRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteInterceptDeploymentGroupRequest instance + */ + public static create(properties?: google.cloud.networksecurity.v1.IDeleteInterceptDeploymentGroupRequest): google.cloud.networksecurity.v1.DeleteInterceptDeploymentGroupRequest; + + /** + * Encodes the specified DeleteInterceptDeploymentGroupRequest message. Does not implicitly {@link google.cloud.networksecurity.v1.DeleteInterceptDeploymentGroupRequest.verify|verify} messages. + * @param message DeleteInterceptDeploymentGroupRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.networksecurity.v1.IDeleteInterceptDeploymentGroupRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteInterceptDeploymentGroupRequest message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.DeleteInterceptDeploymentGroupRequest.verify|verify} messages. + * @param message DeleteInterceptDeploymentGroupRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.networksecurity.v1.IDeleteInterceptDeploymentGroupRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteInterceptDeploymentGroupRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteInterceptDeploymentGroupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.networksecurity.v1.DeleteInterceptDeploymentGroupRequest; + + /** + * Decodes a DeleteInterceptDeploymentGroupRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteInterceptDeploymentGroupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.networksecurity.v1.DeleteInterceptDeploymentGroupRequest; + + /** + * Verifies a DeleteInterceptDeploymentGroupRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteInterceptDeploymentGroupRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteInterceptDeploymentGroupRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.networksecurity.v1.DeleteInterceptDeploymentGroupRequest; + + /** + * Creates a plain object from a DeleteInterceptDeploymentGroupRequest message. Also converts values to other types if specified. + * @param message DeleteInterceptDeploymentGroupRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.networksecurity.v1.DeleteInterceptDeploymentGroupRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteInterceptDeploymentGroupRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteInterceptDeploymentGroupRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an InterceptDeployment. */ + interface IInterceptDeployment { + + /** InterceptDeployment name */ + name?: (string|null); + + /** InterceptDeployment createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** InterceptDeployment updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** InterceptDeployment labels */ + labels?: ({ [k: string]: string }|null); + + /** InterceptDeployment forwardingRule */ + forwardingRule?: (string|null); + + /** InterceptDeployment interceptDeploymentGroup */ + interceptDeploymentGroup?: (string|null); + + /** InterceptDeployment state */ + state?: (google.cloud.networksecurity.v1.InterceptDeployment.State|keyof typeof google.cloud.networksecurity.v1.InterceptDeployment.State|null); + + /** InterceptDeployment reconciling */ + reconciling?: (boolean|null); + + /** InterceptDeployment description */ + description?: (string|null); + } + + /** Represents an InterceptDeployment. */ + class InterceptDeployment implements IInterceptDeployment { + + /** + * Constructs a new InterceptDeployment. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.networksecurity.v1.IInterceptDeployment); + + /** InterceptDeployment name. */ + public name: string; + + /** InterceptDeployment createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** InterceptDeployment updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** InterceptDeployment labels. */ + public labels: { [k: string]: string }; + + /** InterceptDeployment forwardingRule. */ + public forwardingRule: string; + + /** InterceptDeployment interceptDeploymentGroup. */ + public interceptDeploymentGroup: string; + + /** InterceptDeployment state. */ + public state: (google.cloud.networksecurity.v1.InterceptDeployment.State|keyof typeof google.cloud.networksecurity.v1.InterceptDeployment.State); + + /** InterceptDeployment reconciling. */ + public reconciling: boolean; + + /** InterceptDeployment description. */ + public description: string; + + /** + * Creates a new InterceptDeployment instance using the specified properties. + * @param [properties] Properties to set + * @returns InterceptDeployment instance + */ + public static create(properties?: google.cloud.networksecurity.v1.IInterceptDeployment): google.cloud.networksecurity.v1.InterceptDeployment; + + /** + * Encodes the specified InterceptDeployment message. Does not implicitly {@link google.cloud.networksecurity.v1.InterceptDeployment.verify|verify} messages. + * @param message InterceptDeployment message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.networksecurity.v1.IInterceptDeployment, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified InterceptDeployment message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.InterceptDeployment.verify|verify} messages. + * @param message InterceptDeployment message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.networksecurity.v1.IInterceptDeployment, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an InterceptDeployment message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns InterceptDeployment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.networksecurity.v1.InterceptDeployment; + + /** + * Decodes an InterceptDeployment message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns InterceptDeployment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.networksecurity.v1.InterceptDeployment; + + /** + * Verifies an InterceptDeployment message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an InterceptDeployment message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns InterceptDeployment + */ + public static fromObject(object: { [k: string]: any }): google.cloud.networksecurity.v1.InterceptDeployment; + + /** + * Creates a plain object from an InterceptDeployment message. Also converts values to other types if specified. + * @param message InterceptDeployment + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.networksecurity.v1.InterceptDeployment, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this InterceptDeployment to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for InterceptDeployment + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace InterceptDeployment { + + /** State enum. */ + enum State { + STATE_UNSPECIFIED = 0, + ACTIVE = 1, + CREATING = 2, + DELETING = 3, + OUT_OF_SYNC = 4, + DELETE_FAILED = 5 + } + } + + /** Properties of a ListInterceptDeploymentsRequest. */ + interface IListInterceptDeploymentsRequest { + + /** ListInterceptDeploymentsRequest parent */ + parent?: (string|null); + + /** ListInterceptDeploymentsRequest pageSize */ + pageSize?: (number|null); + + /** ListInterceptDeploymentsRequest pageToken */ + pageToken?: (string|null); + + /** ListInterceptDeploymentsRequest filter */ + filter?: (string|null); + + /** ListInterceptDeploymentsRequest orderBy */ + orderBy?: (string|null); + } + + /** Represents a ListInterceptDeploymentsRequest. */ + class ListInterceptDeploymentsRequest implements IListInterceptDeploymentsRequest { + + /** + * Constructs a new ListInterceptDeploymentsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.networksecurity.v1.IListInterceptDeploymentsRequest); + + /** ListInterceptDeploymentsRequest parent. */ + public parent: string; + + /** ListInterceptDeploymentsRequest pageSize. */ + public pageSize: number; + + /** ListInterceptDeploymentsRequest pageToken. */ + public pageToken: string; + + /** ListInterceptDeploymentsRequest filter. */ + public filter: string; + + /** ListInterceptDeploymentsRequest orderBy. */ + public orderBy: string; + + /** + * Creates a new ListInterceptDeploymentsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListInterceptDeploymentsRequest instance + */ + public static create(properties?: google.cloud.networksecurity.v1.IListInterceptDeploymentsRequest): google.cloud.networksecurity.v1.ListInterceptDeploymentsRequest; + + /** + * Encodes the specified ListInterceptDeploymentsRequest message. Does not implicitly {@link google.cloud.networksecurity.v1.ListInterceptDeploymentsRequest.verify|verify} messages. + * @param message ListInterceptDeploymentsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.networksecurity.v1.IListInterceptDeploymentsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListInterceptDeploymentsRequest message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.ListInterceptDeploymentsRequest.verify|verify} messages. + * @param message ListInterceptDeploymentsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.networksecurity.v1.IListInterceptDeploymentsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListInterceptDeploymentsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListInterceptDeploymentsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.networksecurity.v1.ListInterceptDeploymentsRequest; + + /** + * Decodes a ListInterceptDeploymentsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListInterceptDeploymentsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.networksecurity.v1.ListInterceptDeploymentsRequest; + + /** + * Verifies a ListInterceptDeploymentsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListInterceptDeploymentsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListInterceptDeploymentsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.networksecurity.v1.ListInterceptDeploymentsRequest; + + /** + * Creates a plain object from a ListInterceptDeploymentsRequest message. Also converts values to other types if specified. + * @param message ListInterceptDeploymentsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.networksecurity.v1.ListInterceptDeploymentsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListInterceptDeploymentsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListInterceptDeploymentsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListInterceptDeploymentsResponse. */ + interface IListInterceptDeploymentsResponse { + + /** ListInterceptDeploymentsResponse interceptDeployments */ + interceptDeployments?: (google.cloud.networksecurity.v1.IInterceptDeployment[]|null); + + /** ListInterceptDeploymentsResponse nextPageToken */ + nextPageToken?: (string|null); + + /** ListInterceptDeploymentsResponse unreachable */ + unreachable?: (string[]|null); + } + + /** Represents a ListInterceptDeploymentsResponse. */ + class ListInterceptDeploymentsResponse implements IListInterceptDeploymentsResponse { + + /** + * Constructs a new ListInterceptDeploymentsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.networksecurity.v1.IListInterceptDeploymentsResponse); + + /** ListInterceptDeploymentsResponse interceptDeployments. */ + public interceptDeployments: google.cloud.networksecurity.v1.IInterceptDeployment[]; + + /** ListInterceptDeploymentsResponse nextPageToken. */ + public nextPageToken: string; + + /** ListInterceptDeploymentsResponse unreachable. */ + public unreachable: string[]; + + /** + * Creates a new ListInterceptDeploymentsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListInterceptDeploymentsResponse instance + */ + public static create(properties?: google.cloud.networksecurity.v1.IListInterceptDeploymentsResponse): google.cloud.networksecurity.v1.ListInterceptDeploymentsResponse; + + /** + * Encodes the specified ListInterceptDeploymentsResponse message. Does not implicitly {@link google.cloud.networksecurity.v1.ListInterceptDeploymentsResponse.verify|verify} messages. + * @param message ListInterceptDeploymentsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.networksecurity.v1.IListInterceptDeploymentsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListInterceptDeploymentsResponse message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.ListInterceptDeploymentsResponse.verify|verify} messages. + * @param message ListInterceptDeploymentsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.networksecurity.v1.IListInterceptDeploymentsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListInterceptDeploymentsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListInterceptDeploymentsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.networksecurity.v1.ListInterceptDeploymentsResponse; + + /** + * Decodes a ListInterceptDeploymentsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListInterceptDeploymentsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.networksecurity.v1.ListInterceptDeploymentsResponse; + + /** + * Verifies a ListInterceptDeploymentsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListInterceptDeploymentsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListInterceptDeploymentsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.networksecurity.v1.ListInterceptDeploymentsResponse; + + /** + * Creates a plain object from a ListInterceptDeploymentsResponse message. Also converts values to other types if specified. + * @param message ListInterceptDeploymentsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.networksecurity.v1.ListInterceptDeploymentsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListInterceptDeploymentsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListInterceptDeploymentsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetInterceptDeploymentRequest. */ + interface IGetInterceptDeploymentRequest { + + /** GetInterceptDeploymentRequest name */ + name?: (string|null); + } + + /** Represents a GetInterceptDeploymentRequest. */ + class GetInterceptDeploymentRequest implements IGetInterceptDeploymentRequest { + + /** + * Constructs a new GetInterceptDeploymentRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.networksecurity.v1.IGetInterceptDeploymentRequest); + + /** GetInterceptDeploymentRequest name. */ + public name: string; + + /** + * Creates a new GetInterceptDeploymentRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetInterceptDeploymentRequest instance + */ + public static create(properties?: google.cloud.networksecurity.v1.IGetInterceptDeploymentRequest): google.cloud.networksecurity.v1.GetInterceptDeploymentRequest; + + /** + * Encodes the specified GetInterceptDeploymentRequest message. Does not implicitly {@link google.cloud.networksecurity.v1.GetInterceptDeploymentRequest.verify|verify} messages. + * @param message GetInterceptDeploymentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.networksecurity.v1.IGetInterceptDeploymentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetInterceptDeploymentRequest message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.GetInterceptDeploymentRequest.verify|verify} messages. + * @param message GetInterceptDeploymentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.networksecurity.v1.IGetInterceptDeploymentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetInterceptDeploymentRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetInterceptDeploymentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.networksecurity.v1.GetInterceptDeploymentRequest; + + /** + * Decodes a GetInterceptDeploymentRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetInterceptDeploymentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.networksecurity.v1.GetInterceptDeploymentRequest; + + /** + * Verifies a GetInterceptDeploymentRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetInterceptDeploymentRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetInterceptDeploymentRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.networksecurity.v1.GetInterceptDeploymentRequest; + + /** + * Creates a plain object from a GetInterceptDeploymentRequest message. Also converts values to other types if specified. + * @param message GetInterceptDeploymentRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.networksecurity.v1.GetInterceptDeploymentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetInterceptDeploymentRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetInterceptDeploymentRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateInterceptDeploymentRequest. */ + interface ICreateInterceptDeploymentRequest { + + /** CreateInterceptDeploymentRequest parent */ + parent?: (string|null); + + /** CreateInterceptDeploymentRequest interceptDeploymentId */ + interceptDeploymentId?: (string|null); + + /** CreateInterceptDeploymentRequest interceptDeployment */ + interceptDeployment?: (google.cloud.networksecurity.v1.IInterceptDeployment|null); + + /** CreateInterceptDeploymentRequest requestId */ + requestId?: (string|null); + } + + /** Represents a CreateInterceptDeploymentRequest. */ + class CreateInterceptDeploymentRequest implements ICreateInterceptDeploymentRequest { + + /** + * Constructs a new CreateInterceptDeploymentRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.networksecurity.v1.ICreateInterceptDeploymentRequest); + + /** CreateInterceptDeploymentRequest parent. */ + public parent: string; + + /** CreateInterceptDeploymentRequest interceptDeploymentId. */ + public interceptDeploymentId: string; + + /** CreateInterceptDeploymentRequest interceptDeployment. */ + public interceptDeployment?: (google.cloud.networksecurity.v1.IInterceptDeployment|null); + + /** CreateInterceptDeploymentRequest requestId. */ + public requestId: string; + + /** + * Creates a new CreateInterceptDeploymentRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateInterceptDeploymentRequest instance + */ + public static create(properties?: google.cloud.networksecurity.v1.ICreateInterceptDeploymentRequest): google.cloud.networksecurity.v1.CreateInterceptDeploymentRequest; + + /** + * Encodes the specified CreateInterceptDeploymentRequest message. Does not implicitly {@link google.cloud.networksecurity.v1.CreateInterceptDeploymentRequest.verify|verify} messages. + * @param message CreateInterceptDeploymentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.networksecurity.v1.ICreateInterceptDeploymentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateInterceptDeploymentRequest message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.CreateInterceptDeploymentRequest.verify|verify} messages. + * @param message CreateInterceptDeploymentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.networksecurity.v1.ICreateInterceptDeploymentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateInterceptDeploymentRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateInterceptDeploymentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.networksecurity.v1.CreateInterceptDeploymentRequest; + + /** + * Decodes a CreateInterceptDeploymentRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateInterceptDeploymentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.networksecurity.v1.CreateInterceptDeploymentRequest; + + /** + * Verifies a CreateInterceptDeploymentRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateInterceptDeploymentRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateInterceptDeploymentRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.networksecurity.v1.CreateInterceptDeploymentRequest; + + /** + * Creates a plain object from a CreateInterceptDeploymentRequest message. Also converts values to other types if specified. + * @param message CreateInterceptDeploymentRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.networksecurity.v1.CreateInterceptDeploymentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateInterceptDeploymentRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateInterceptDeploymentRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateInterceptDeploymentRequest. */ + interface IUpdateInterceptDeploymentRequest { + + /** UpdateInterceptDeploymentRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateInterceptDeploymentRequest interceptDeployment */ + interceptDeployment?: (google.cloud.networksecurity.v1.IInterceptDeployment|null); + + /** UpdateInterceptDeploymentRequest requestId */ + requestId?: (string|null); + } + + /** Represents an UpdateInterceptDeploymentRequest. */ + class UpdateInterceptDeploymentRequest implements IUpdateInterceptDeploymentRequest { + + /** + * Constructs a new UpdateInterceptDeploymentRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.networksecurity.v1.IUpdateInterceptDeploymentRequest); + + /** UpdateInterceptDeploymentRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateInterceptDeploymentRequest interceptDeployment. */ + public interceptDeployment?: (google.cloud.networksecurity.v1.IInterceptDeployment|null); + + /** UpdateInterceptDeploymentRequest requestId. */ + public requestId: string; + + /** + * Creates a new UpdateInterceptDeploymentRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateInterceptDeploymentRequest instance + */ + public static create(properties?: google.cloud.networksecurity.v1.IUpdateInterceptDeploymentRequest): google.cloud.networksecurity.v1.UpdateInterceptDeploymentRequest; + + /** + * Encodes the specified UpdateInterceptDeploymentRequest message. Does not implicitly {@link google.cloud.networksecurity.v1.UpdateInterceptDeploymentRequest.verify|verify} messages. + * @param message UpdateInterceptDeploymentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.networksecurity.v1.IUpdateInterceptDeploymentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateInterceptDeploymentRequest message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.UpdateInterceptDeploymentRequest.verify|verify} messages. + * @param message UpdateInterceptDeploymentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.networksecurity.v1.IUpdateInterceptDeploymentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateInterceptDeploymentRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateInterceptDeploymentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.networksecurity.v1.UpdateInterceptDeploymentRequest; + + /** + * Decodes an UpdateInterceptDeploymentRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateInterceptDeploymentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.networksecurity.v1.UpdateInterceptDeploymentRequest; + + /** + * Verifies an UpdateInterceptDeploymentRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UpdateInterceptDeploymentRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateInterceptDeploymentRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.networksecurity.v1.UpdateInterceptDeploymentRequest; + + /** + * Creates a plain object from an UpdateInterceptDeploymentRequest message. Also converts values to other types if specified. + * @param message UpdateInterceptDeploymentRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.networksecurity.v1.UpdateInterceptDeploymentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateInterceptDeploymentRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateInterceptDeploymentRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteInterceptDeploymentRequest. */ + interface IDeleteInterceptDeploymentRequest { + + /** DeleteInterceptDeploymentRequest name */ + name?: (string|null); + + /** DeleteInterceptDeploymentRequest requestId */ + requestId?: (string|null); + } + + /** Represents a DeleteInterceptDeploymentRequest. */ + class DeleteInterceptDeploymentRequest implements IDeleteInterceptDeploymentRequest { + + /** + * Constructs a new DeleteInterceptDeploymentRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.networksecurity.v1.IDeleteInterceptDeploymentRequest); + + /** DeleteInterceptDeploymentRequest name. */ + public name: string; + + /** DeleteInterceptDeploymentRequest requestId. */ + public requestId: string; + + /** + * Creates a new DeleteInterceptDeploymentRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteInterceptDeploymentRequest instance + */ + public static create(properties?: google.cloud.networksecurity.v1.IDeleteInterceptDeploymentRequest): google.cloud.networksecurity.v1.DeleteInterceptDeploymentRequest; + + /** + * Encodes the specified DeleteInterceptDeploymentRequest message. Does not implicitly {@link google.cloud.networksecurity.v1.DeleteInterceptDeploymentRequest.verify|verify} messages. + * @param message DeleteInterceptDeploymentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.networksecurity.v1.IDeleteInterceptDeploymentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteInterceptDeploymentRequest message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.DeleteInterceptDeploymentRequest.verify|verify} messages. + * @param message DeleteInterceptDeploymentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.networksecurity.v1.IDeleteInterceptDeploymentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteInterceptDeploymentRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteInterceptDeploymentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.networksecurity.v1.DeleteInterceptDeploymentRequest; + + /** + * Decodes a DeleteInterceptDeploymentRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteInterceptDeploymentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.networksecurity.v1.DeleteInterceptDeploymentRequest; + + /** + * Verifies a DeleteInterceptDeploymentRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteInterceptDeploymentRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteInterceptDeploymentRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.networksecurity.v1.DeleteInterceptDeploymentRequest; + + /** + * Creates a plain object from a DeleteInterceptDeploymentRequest message. Also converts values to other types if specified. + * @param message DeleteInterceptDeploymentRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.networksecurity.v1.DeleteInterceptDeploymentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteInterceptDeploymentRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteInterceptDeploymentRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an InterceptLocation. */ + interface IInterceptLocation { + + /** InterceptLocation location */ + location?: (string|null); + + /** InterceptLocation state */ + state?: (google.cloud.networksecurity.v1.InterceptLocation.State|keyof typeof google.cloud.networksecurity.v1.InterceptLocation.State|null); + } + + /** Represents an InterceptLocation. */ + class InterceptLocation implements IInterceptLocation { + + /** + * Constructs a new InterceptLocation. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.networksecurity.v1.IInterceptLocation); + + /** InterceptLocation location. */ + public location: string; + + /** InterceptLocation state. */ + public state: (google.cloud.networksecurity.v1.InterceptLocation.State|keyof typeof google.cloud.networksecurity.v1.InterceptLocation.State); + + /** + * Creates a new InterceptLocation instance using the specified properties. + * @param [properties] Properties to set + * @returns InterceptLocation instance + */ + public static create(properties?: google.cloud.networksecurity.v1.IInterceptLocation): google.cloud.networksecurity.v1.InterceptLocation; + + /** + * Encodes the specified InterceptLocation message. Does not implicitly {@link google.cloud.networksecurity.v1.InterceptLocation.verify|verify} messages. + * @param message InterceptLocation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.networksecurity.v1.IInterceptLocation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified InterceptLocation message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.InterceptLocation.verify|verify} messages. + * @param message InterceptLocation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.networksecurity.v1.IInterceptLocation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an InterceptLocation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns InterceptLocation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.networksecurity.v1.InterceptLocation; + + /** + * Decodes an InterceptLocation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns InterceptLocation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.networksecurity.v1.InterceptLocation; + + /** + * Verifies an InterceptLocation message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an InterceptLocation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns InterceptLocation + */ + public static fromObject(object: { [k: string]: any }): google.cloud.networksecurity.v1.InterceptLocation; + + /** + * Creates a plain object from an InterceptLocation message. Also converts values to other types if specified. + * @param message InterceptLocation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.networksecurity.v1.InterceptLocation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this InterceptLocation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for InterceptLocation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace InterceptLocation { + + /** State enum. */ + enum State { + STATE_UNSPECIFIED = 0, + ACTIVE = 1, + OUT_OF_SYNC = 2 + } + } + + /** Represents a Mirroring */ + class Mirroring extends $protobuf.rpc.Service { + + /** + * Constructs a new Mirroring service. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + */ + constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); + + /** + * Creates new Mirroring service using the specified rpc implementation. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + * @returns RPC service. Useful where requests and/or responses are streamed. + */ + public static create(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean): Mirroring; + + /** + * Calls ListMirroringEndpointGroups. + * @param request ListMirroringEndpointGroupsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListMirroringEndpointGroupsResponse + */ + public listMirroringEndpointGroups(request: google.cloud.networksecurity.v1.IListMirroringEndpointGroupsRequest, callback: google.cloud.networksecurity.v1.Mirroring.ListMirroringEndpointGroupsCallback): void; + + /** + * Calls ListMirroringEndpointGroups. + * @param request ListMirroringEndpointGroupsRequest message or plain object + * @returns Promise + */ + public listMirroringEndpointGroups(request: google.cloud.networksecurity.v1.IListMirroringEndpointGroupsRequest): Promise; + + /** + * Calls GetMirroringEndpointGroup. + * @param request GetMirroringEndpointGroupRequest message or plain object + * @param callback Node-style callback called with the error, if any, and MirroringEndpointGroup + */ + public getMirroringEndpointGroup(request: google.cloud.networksecurity.v1.IGetMirroringEndpointGroupRequest, callback: google.cloud.networksecurity.v1.Mirroring.GetMirroringEndpointGroupCallback): void; + + /** + * Calls GetMirroringEndpointGroup. + * @param request GetMirroringEndpointGroupRequest message or plain object + * @returns Promise + */ + public getMirroringEndpointGroup(request: google.cloud.networksecurity.v1.IGetMirroringEndpointGroupRequest): Promise; + + /** + * Calls CreateMirroringEndpointGroup. + * @param request CreateMirroringEndpointGroupRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public createMirroringEndpointGroup(request: google.cloud.networksecurity.v1.ICreateMirroringEndpointGroupRequest, callback: google.cloud.networksecurity.v1.Mirroring.CreateMirroringEndpointGroupCallback): void; + + /** + * Calls CreateMirroringEndpointGroup. + * @param request CreateMirroringEndpointGroupRequest message or plain object + * @returns Promise + */ + public createMirroringEndpointGroup(request: google.cloud.networksecurity.v1.ICreateMirroringEndpointGroupRequest): Promise; + + /** + * Calls UpdateMirroringEndpointGroup. + * @param request UpdateMirroringEndpointGroupRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public updateMirroringEndpointGroup(request: google.cloud.networksecurity.v1.IUpdateMirroringEndpointGroupRequest, callback: google.cloud.networksecurity.v1.Mirroring.UpdateMirroringEndpointGroupCallback): void; + + /** + * Calls UpdateMirroringEndpointGroup. + * @param request UpdateMirroringEndpointGroupRequest message or plain object + * @returns Promise + */ + public updateMirroringEndpointGroup(request: google.cloud.networksecurity.v1.IUpdateMirroringEndpointGroupRequest): Promise; + + /** + * Calls DeleteMirroringEndpointGroup. + * @param request DeleteMirroringEndpointGroupRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public deleteMirroringEndpointGroup(request: google.cloud.networksecurity.v1.IDeleteMirroringEndpointGroupRequest, callback: google.cloud.networksecurity.v1.Mirroring.DeleteMirroringEndpointGroupCallback): void; + + /** + * Calls DeleteMirroringEndpointGroup. + * @param request DeleteMirroringEndpointGroupRequest message or plain object + * @returns Promise + */ + public deleteMirroringEndpointGroup(request: google.cloud.networksecurity.v1.IDeleteMirroringEndpointGroupRequest): Promise; + + /** + * Calls ListMirroringEndpointGroupAssociations. + * @param request ListMirroringEndpointGroupAssociationsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListMirroringEndpointGroupAssociationsResponse + */ + public listMirroringEndpointGroupAssociations(request: google.cloud.networksecurity.v1.IListMirroringEndpointGroupAssociationsRequest, callback: google.cloud.networksecurity.v1.Mirroring.ListMirroringEndpointGroupAssociationsCallback): void; + + /** + * Calls ListMirroringEndpointGroupAssociations. + * @param request ListMirroringEndpointGroupAssociationsRequest message or plain object + * @returns Promise + */ + public listMirroringEndpointGroupAssociations(request: google.cloud.networksecurity.v1.IListMirroringEndpointGroupAssociationsRequest): Promise; + + /** + * Calls GetMirroringEndpointGroupAssociation. + * @param request GetMirroringEndpointGroupAssociationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and MirroringEndpointGroupAssociation + */ + public getMirroringEndpointGroupAssociation(request: google.cloud.networksecurity.v1.IGetMirroringEndpointGroupAssociationRequest, callback: google.cloud.networksecurity.v1.Mirroring.GetMirroringEndpointGroupAssociationCallback): void; + + /** + * Calls GetMirroringEndpointGroupAssociation. + * @param request GetMirroringEndpointGroupAssociationRequest message or plain object + * @returns Promise + */ + public getMirroringEndpointGroupAssociation(request: google.cloud.networksecurity.v1.IGetMirroringEndpointGroupAssociationRequest): Promise; + + /** + * Calls CreateMirroringEndpointGroupAssociation. + * @param request CreateMirroringEndpointGroupAssociationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public createMirroringEndpointGroupAssociation(request: google.cloud.networksecurity.v1.ICreateMirroringEndpointGroupAssociationRequest, callback: google.cloud.networksecurity.v1.Mirroring.CreateMirroringEndpointGroupAssociationCallback): void; + + /** + * Calls CreateMirroringEndpointGroupAssociation. + * @param request CreateMirroringEndpointGroupAssociationRequest message or plain object + * @returns Promise + */ + public createMirroringEndpointGroupAssociation(request: google.cloud.networksecurity.v1.ICreateMirroringEndpointGroupAssociationRequest): Promise; + + /** + * Calls UpdateMirroringEndpointGroupAssociation. + * @param request UpdateMirroringEndpointGroupAssociationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public updateMirroringEndpointGroupAssociation(request: google.cloud.networksecurity.v1.IUpdateMirroringEndpointGroupAssociationRequest, callback: google.cloud.networksecurity.v1.Mirroring.UpdateMirroringEndpointGroupAssociationCallback): void; + + /** + * Calls UpdateMirroringEndpointGroupAssociation. + * @param request UpdateMirroringEndpointGroupAssociationRequest message or plain object + * @returns Promise + */ + public updateMirroringEndpointGroupAssociation(request: google.cloud.networksecurity.v1.IUpdateMirroringEndpointGroupAssociationRequest): Promise; + + /** + * Calls DeleteMirroringEndpointGroupAssociation. + * @param request DeleteMirroringEndpointGroupAssociationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public deleteMirroringEndpointGroupAssociation(request: google.cloud.networksecurity.v1.IDeleteMirroringEndpointGroupAssociationRequest, callback: google.cloud.networksecurity.v1.Mirroring.DeleteMirroringEndpointGroupAssociationCallback): void; + + /** + * Calls DeleteMirroringEndpointGroupAssociation. + * @param request DeleteMirroringEndpointGroupAssociationRequest message or plain object + * @returns Promise + */ + public deleteMirroringEndpointGroupAssociation(request: google.cloud.networksecurity.v1.IDeleteMirroringEndpointGroupAssociationRequest): Promise; + + /** + * Calls ListMirroringDeploymentGroups. + * @param request ListMirroringDeploymentGroupsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListMirroringDeploymentGroupsResponse + */ + public listMirroringDeploymentGroups(request: google.cloud.networksecurity.v1.IListMirroringDeploymentGroupsRequest, callback: google.cloud.networksecurity.v1.Mirroring.ListMirroringDeploymentGroupsCallback): void; + + /** + * Calls ListMirroringDeploymentGroups. + * @param request ListMirroringDeploymentGroupsRequest message or plain object + * @returns Promise + */ + public listMirroringDeploymentGroups(request: google.cloud.networksecurity.v1.IListMirroringDeploymentGroupsRequest): Promise; + + /** + * Calls GetMirroringDeploymentGroup. + * @param request GetMirroringDeploymentGroupRequest message or plain object + * @param callback Node-style callback called with the error, if any, and MirroringDeploymentGroup + */ + public getMirroringDeploymentGroup(request: google.cloud.networksecurity.v1.IGetMirroringDeploymentGroupRequest, callback: google.cloud.networksecurity.v1.Mirroring.GetMirroringDeploymentGroupCallback): void; + + /** + * Calls GetMirroringDeploymentGroup. + * @param request GetMirroringDeploymentGroupRequest message or plain object + * @returns Promise + */ + public getMirroringDeploymentGroup(request: google.cloud.networksecurity.v1.IGetMirroringDeploymentGroupRequest): Promise; + + /** + * Calls CreateMirroringDeploymentGroup. + * @param request CreateMirroringDeploymentGroupRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public createMirroringDeploymentGroup(request: google.cloud.networksecurity.v1.ICreateMirroringDeploymentGroupRequest, callback: google.cloud.networksecurity.v1.Mirroring.CreateMirroringDeploymentGroupCallback): void; + + /** + * Calls CreateMirroringDeploymentGroup. + * @param request CreateMirroringDeploymentGroupRequest message or plain object + * @returns Promise + */ + public createMirroringDeploymentGroup(request: google.cloud.networksecurity.v1.ICreateMirroringDeploymentGroupRequest): Promise; + + /** + * Calls UpdateMirroringDeploymentGroup. + * @param request UpdateMirroringDeploymentGroupRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public updateMirroringDeploymentGroup(request: google.cloud.networksecurity.v1.IUpdateMirroringDeploymentGroupRequest, callback: google.cloud.networksecurity.v1.Mirroring.UpdateMirroringDeploymentGroupCallback): void; + + /** + * Calls UpdateMirroringDeploymentGroup. + * @param request UpdateMirroringDeploymentGroupRequest message or plain object + * @returns Promise + */ + public updateMirroringDeploymentGroup(request: google.cloud.networksecurity.v1.IUpdateMirroringDeploymentGroupRequest): Promise; + + /** + * Calls DeleteMirroringDeploymentGroup. + * @param request DeleteMirroringDeploymentGroupRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public deleteMirroringDeploymentGroup(request: google.cloud.networksecurity.v1.IDeleteMirroringDeploymentGroupRequest, callback: google.cloud.networksecurity.v1.Mirroring.DeleteMirroringDeploymentGroupCallback): void; + + /** + * Calls DeleteMirroringDeploymentGroup. + * @param request DeleteMirroringDeploymentGroupRequest message or plain object + * @returns Promise + */ + public deleteMirroringDeploymentGroup(request: google.cloud.networksecurity.v1.IDeleteMirroringDeploymentGroupRequest): Promise; + + /** + * Calls ListMirroringDeployments. + * @param request ListMirroringDeploymentsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListMirroringDeploymentsResponse + */ + public listMirroringDeployments(request: google.cloud.networksecurity.v1.IListMirroringDeploymentsRequest, callback: google.cloud.networksecurity.v1.Mirroring.ListMirroringDeploymentsCallback): void; + + /** + * Calls ListMirroringDeployments. + * @param request ListMirroringDeploymentsRequest message or plain object + * @returns Promise + */ + public listMirroringDeployments(request: google.cloud.networksecurity.v1.IListMirroringDeploymentsRequest): Promise; + + /** + * Calls GetMirroringDeployment. + * @param request GetMirroringDeploymentRequest message or plain object + * @param callback Node-style callback called with the error, if any, and MirroringDeployment + */ + public getMirroringDeployment(request: google.cloud.networksecurity.v1.IGetMirroringDeploymentRequest, callback: google.cloud.networksecurity.v1.Mirroring.GetMirroringDeploymentCallback): void; + + /** + * Calls GetMirroringDeployment. + * @param request GetMirroringDeploymentRequest message or plain object + * @returns Promise + */ + public getMirroringDeployment(request: google.cloud.networksecurity.v1.IGetMirroringDeploymentRequest): Promise; + + /** + * Calls CreateMirroringDeployment. + * @param request CreateMirroringDeploymentRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public createMirroringDeployment(request: google.cloud.networksecurity.v1.ICreateMirroringDeploymentRequest, callback: google.cloud.networksecurity.v1.Mirroring.CreateMirroringDeploymentCallback): void; + + /** + * Calls CreateMirroringDeployment. + * @param request CreateMirroringDeploymentRequest message or plain object + * @returns Promise + */ + public createMirroringDeployment(request: google.cloud.networksecurity.v1.ICreateMirroringDeploymentRequest): Promise; + + /** + * Calls UpdateMirroringDeployment. + * @param request UpdateMirroringDeploymentRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public updateMirroringDeployment(request: google.cloud.networksecurity.v1.IUpdateMirroringDeploymentRequest, callback: google.cloud.networksecurity.v1.Mirroring.UpdateMirroringDeploymentCallback): void; + + /** + * Calls UpdateMirroringDeployment. + * @param request UpdateMirroringDeploymentRequest message or plain object + * @returns Promise + */ + public updateMirroringDeployment(request: google.cloud.networksecurity.v1.IUpdateMirroringDeploymentRequest): Promise; + + /** + * Calls DeleteMirroringDeployment. + * @param request DeleteMirroringDeploymentRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public deleteMirroringDeployment(request: google.cloud.networksecurity.v1.IDeleteMirroringDeploymentRequest, callback: google.cloud.networksecurity.v1.Mirroring.DeleteMirroringDeploymentCallback): void; + + /** + * Calls DeleteMirroringDeployment. + * @param request DeleteMirroringDeploymentRequest message or plain object + * @returns Promise + */ + public deleteMirroringDeployment(request: google.cloud.networksecurity.v1.IDeleteMirroringDeploymentRequest): Promise; + } + + namespace Mirroring { + + /** + * Callback as used by {@link google.cloud.networksecurity.v1.Mirroring|listMirroringEndpointGroups}. + * @param error Error, if any + * @param [response] ListMirroringEndpointGroupsResponse + */ + type ListMirroringEndpointGroupsCallback = (error: (Error|null), response?: google.cloud.networksecurity.v1.ListMirroringEndpointGroupsResponse) => void; + + /** + * Callback as used by {@link google.cloud.networksecurity.v1.Mirroring|getMirroringEndpointGroup}. + * @param error Error, if any + * @param [response] MirroringEndpointGroup + */ + type GetMirroringEndpointGroupCallback = (error: (Error|null), response?: google.cloud.networksecurity.v1.MirroringEndpointGroup) => void; + + /** + * Callback as used by {@link google.cloud.networksecurity.v1.Mirroring|createMirroringEndpointGroup}. + * @param error Error, if any + * @param [response] Operation + */ + type CreateMirroringEndpointGroupCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.networksecurity.v1.Mirroring|updateMirroringEndpointGroup}. + * @param error Error, if any + * @param [response] Operation + */ + type UpdateMirroringEndpointGroupCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.networksecurity.v1.Mirroring|deleteMirroringEndpointGroup}. + * @param error Error, if any + * @param [response] Operation + */ + type DeleteMirroringEndpointGroupCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.networksecurity.v1.Mirroring|listMirroringEndpointGroupAssociations}. + * @param error Error, if any + * @param [response] ListMirroringEndpointGroupAssociationsResponse + */ + type ListMirroringEndpointGroupAssociationsCallback = (error: (Error|null), response?: google.cloud.networksecurity.v1.ListMirroringEndpointGroupAssociationsResponse) => void; + + /** + * Callback as used by {@link google.cloud.networksecurity.v1.Mirroring|getMirroringEndpointGroupAssociation}. + * @param error Error, if any + * @param [response] MirroringEndpointGroupAssociation + */ + type GetMirroringEndpointGroupAssociationCallback = (error: (Error|null), response?: google.cloud.networksecurity.v1.MirroringEndpointGroupAssociation) => void; + + /** + * Callback as used by {@link google.cloud.networksecurity.v1.Mirroring|createMirroringEndpointGroupAssociation}. + * @param error Error, if any + * @param [response] Operation + */ + type CreateMirroringEndpointGroupAssociationCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.networksecurity.v1.Mirroring|updateMirroringEndpointGroupAssociation}. + * @param error Error, if any + * @param [response] Operation + */ + type UpdateMirroringEndpointGroupAssociationCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.networksecurity.v1.Mirroring|deleteMirroringEndpointGroupAssociation}. + * @param error Error, if any + * @param [response] Operation + */ + type DeleteMirroringEndpointGroupAssociationCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.networksecurity.v1.Mirroring|listMirroringDeploymentGroups}. + * @param error Error, if any + * @param [response] ListMirroringDeploymentGroupsResponse + */ + type ListMirroringDeploymentGroupsCallback = (error: (Error|null), response?: google.cloud.networksecurity.v1.ListMirroringDeploymentGroupsResponse) => void; + + /** + * Callback as used by {@link google.cloud.networksecurity.v1.Mirroring|getMirroringDeploymentGroup}. + * @param error Error, if any + * @param [response] MirroringDeploymentGroup + */ + type GetMirroringDeploymentGroupCallback = (error: (Error|null), response?: google.cloud.networksecurity.v1.MirroringDeploymentGroup) => void; + + /** + * Callback as used by {@link google.cloud.networksecurity.v1.Mirroring|createMirroringDeploymentGroup}. + * @param error Error, if any + * @param [response] Operation + */ + type CreateMirroringDeploymentGroupCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.networksecurity.v1.Mirroring|updateMirroringDeploymentGroup}. + * @param error Error, if any + * @param [response] Operation + */ + type UpdateMirroringDeploymentGroupCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.networksecurity.v1.Mirroring|deleteMirroringDeploymentGroup}. + * @param error Error, if any + * @param [response] Operation + */ + type DeleteMirroringDeploymentGroupCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.networksecurity.v1.Mirroring|listMirroringDeployments}. + * @param error Error, if any + * @param [response] ListMirroringDeploymentsResponse + */ + type ListMirroringDeploymentsCallback = (error: (Error|null), response?: google.cloud.networksecurity.v1.ListMirroringDeploymentsResponse) => void; + + /** + * Callback as used by {@link google.cloud.networksecurity.v1.Mirroring|getMirroringDeployment}. + * @param error Error, if any + * @param [response] MirroringDeployment + */ + type GetMirroringDeploymentCallback = (error: (Error|null), response?: google.cloud.networksecurity.v1.MirroringDeployment) => void; + + /** + * Callback as used by {@link google.cloud.networksecurity.v1.Mirroring|createMirroringDeployment}. + * @param error Error, if any + * @param [response] Operation + */ + type CreateMirroringDeploymentCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.networksecurity.v1.Mirroring|updateMirroringDeployment}. + * @param error Error, if any + * @param [response] Operation + */ + type UpdateMirroringDeploymentCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.networksecurity.v1.Mirroring|deleteMirroringDeployment}. + * @param error Error, if any + * @param [response] Operation + */ + type DeleteMirroringDeploymentCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + } + + /** Properties of a MirroringEndpointGroup. */ + interface IMirroringEndpointGroup { + + /** MirroringEndpointGroup name */ + name?: (string|null); + + /** MirroringEndpointGroup createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** MirroringEndpointGroup updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** MirroringEndpointGroup labels */ + labels?: ({ [k: string]: string }|null); + + /** MirroringEndpointGroup mirroringDeploymentGroup */ + mirroringDeploymentGroup?: (string|null); + + /** MirroringEndpointGroup connectedDeploymentGroups */ + connectedDeploymentGroups?: (google.cloud.networksecurity.v1.MirroringEndpointGroup.IConnectedDeploymentGroup[]|null); + + /** MirroringEndpointGroup state */ + state?: (google.cloud.networksecurity.v1.MirroringEndpointGroup.State|keyof typeof google.cloud.networksecurity.v1.MirroringEndpointGroup.State|null); + + /** MirroringEndpointGroup reconciling */ + reconciling?: (boolean|null); + + /** MirroringEndpointGroup type */ + type?: (google.cloud.networksecurity.v1.MirroringEndpointGroup.Type|keyof typeof google.cloud.networksecurity.v1.MirroringEndpointGroup.Type|null); + + /** MirroringEndpointGroup associations */ + associations?: (google.cloud.networksecurity.v1.MirroringEndpointGroup.IAssociationDetails[]|null); + + /** MirroringEndpointGroup description */ + description?: (string|null); + } + + /** Represents a MirroringEndpointGroup. */ + class MirroringEndpointGroup implements IMirroringEndpointGroup { + + /** + * Constructs a new MirroringEndpointGroup. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.networksecurity.v1.IMirroringEndpointGroup); + + /** MirroringEndpointGroup name. */ + public name: string; + + /** MirroringEndpointGroup createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** MirroringEndpointGroup updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** MirroringEndpointGroup labels. */ + public labels: { [k: string]: string }; + + /** MirroringEndpointGroup mirroringDeploymentGroup. */ + public mirroringDeploymentGroup: string; + + /** MirroringEndpointGroup connectedDeploymentGroups. */ + public connectedDeploymentGroups: google.cloud.networksecurity.v1.MirroringEndpointGroup.IConnectedDeploymentGroup[]; + + /** MirroringEndpointGroup state. */ + public state: (google.cloud.networksecurity.v1.MirroringEndpointGroup.State|keyof typeof google.cloud.networksecurity.v1.MirroringEndpointGroup.State); + + /** MirroringEndpointGroup reconciling. */ + public reconciling: boolean; + + /** MirroringEndpointGroup type. */ + public type: (google.cloud.networksecurity.v1.MirroringEndpointGroup.Type|keyof typeof google.cloud.networksecurity.v1.MirroringEndpointGroup.Type); + + /** MirroringEndpointGroup associations. */ + public associations: google.cloud.networksecurity.v1.MirroringEndpointGroup.IAssociationDetails[]; + + /** MirroringEndpointGroup description. */ + public description: string; + + /** + * Creates a new MirroringEndpointGroup instance using the specified properties. + * @param [properties] Properties to set + * @returns MirroringEndpointGroup instance + */ + public static create(properties?: google.cloud.networksecurity.v1.IMirroringEndpointGroup): google.cloud.networksecurity.v1.MirroringEndpointGroup; + + /** + * Encodes the specified MirroringEndpointGroup message. Does not implicitly {@link google.cloud.networksecurity.v1.MirroringEndpointGroup.verify|verify} messages. + * @param message MirroringEndpointGroup message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.networksecurity.v1.IMirroringEndpointGroup, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MirroringEndpointGroup message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.MirroringEndpointGroup.verify|verify} messages. + * @param message MirroringEndpointGroup message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.networksecurity.v1.IMirroringEndpointGroup, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MirroringEndpointGroup message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MirroringEndpointGroup + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.networksecurity.v1.MirroringEndpointGroup; + + /** + * Decodes a MirroringEndpointGroup message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MirroringEndpointGroup + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.networksecurity.v1.MirroringEndpointGroup; + + /** + * Verifies a MirroringEndpointGroup message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MirroringEndpointGroup message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MirroringEndpointGroup + */ + public static fromObject(object: { [k: string]: any }): google.cloud.networksecurity.v1.MirroringEndpointGroup; + + /** + * Creates a plain object from a MirroringEndpointGroup message. Also converts values to other types if specified. + * @param message MirroringEndpointGroup + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.networksecurity.v1.MirroringEndpointGroup, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MirroringEndpointGroup to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MirroringEndpointGroup + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace MirroringEndpointGroup { + + /** Properties of a ConnectedDeploymentGroup. */ + interface IConnectedDeploymentGroup { + + /** ConnectedDeploymentGroup name */ + name?: (string|null); + + /** ConnectedDeploymentGroup locations */ + locations?: (google.cloud.networksecurity.v1.IMirroringLocation[]|null); + } + + /** Represents a ConnectedDeploymentGroup. */ + class ConnectedDeploymentGroup implements IConnectedDeploymentGroup { + + /** + * Constructs a new ConnectedDeploymentGroup. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.networksecurity.v1.MirroringEndpointGroup.IConnectedDeploymentGroup); + + /** ConnectedDeploymentGroup name. */ + public name: string; + + /** ConnectedDeploymentGroup locations. */ + public locations: google.cloud.networksecurity.v1.IMirroringLocation[]; + + /** + * Creates a new ConnectedDeploymentGroup instance using the specified properties. + * @param [properties] Properties to set + * @returns ConnectedDeploymentGroup instance + */ + public static create(properties?: google.cloud.networksecurity.v1.MirroringEndpointGroup.IConnectedDeploymentGroup): google.cloud.networksecurity.v1.MirroringEndpointGroup.ConnectedDeploymentGroup; + + /** + * Encodes the specified ConnectedDeploymentGroup message. Does not implicitly {@link google.cloud.networksecurity.v1.MirroringEndpointGroup.ConnectedDeploymentGroup.verify|verify} messages. + * @param message ConnectedDeploymentGroup message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.networksecurity.v1.MirroringEndpointGroup.IConnectedDeploymentGroup, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ConnectedDeploymentGroup message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.MirroringEndpointGroup.ConnectedDeploymentGroup.verify|verify} messages. + * @param message ConnectedDeploymentGroup message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.networksecurity.v1.MirroringEndpointGroup.IConnectedDeploymentGroup, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ConnectedDeploymentGroup message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ConnectedDeploymentGroup + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.networksecurity.v1.MirroringEndpointGroup.ConnectedDeploymentGroup; + + /** + * Decodes a ConnectedDeploymentGroup message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ConnectedDeploymentGroup + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.networksecurity.v1.MirroringEndpointGroup.ConnectedDeploymentGroup; + + /** + * Verifies a ConnectedDeploymentGroup message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ConnectedDeploymentGroup message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ConnectedDeploymentGroup + */ + public static fromObject(object: { [k: string]: any }): google.cloud.networksecurity.v1.MirroringEndpointGroup.ConnectedDeploymentGroup; + + /** + * Creates a plain object from a ConnectedDeploymentGroup message. Also converts values to other types if specified. + * @param message ConnectedDeploymentGroup + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.networksecurity.v1.MirroringEndpointGroup.ConnectedDeploymentGroup, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ConnectedDeploymentGroup to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ConnectedDeploymentGroup + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AssociationDetails. */ + interface IAssociationDetails { + + /** AssociationDetails name */ + name?: (string|null); + + /** AssociationDetails network */ + network?: (string|null); + + /** AssociationDetails state */ + state?: (google.cloud.networksecurity.v1.MirroringEndpointGroupAssociation.State|keyof typeof google.cloud.networksecurity.v1.MirroringEndpointGroupAssociation.State|null); + } + + /** Represents an AssociationDetails. */ + class AssociationDetails implements IAssociationDetails { + + /** + * Constructs a new AssociationDetails. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.networksecurity.v1.MirroringEndpointGroup.IAssociationDetails); + + /** AssociationDetails name. */ + public name: string; + + /** AssociationDetails network. */ + public network: string; + + /** AssociationDetails state. */ + public state: (google.cloud.networksecurity.v1.MirroringEndpointGroupAssociation.State|keyof typeof google.cloud.networksecurity.v1.MirroringEndpointGroupAssociation.State); + + /** + * Creates a new AssociationDetails instance using the specified properties. + * @param [properties] Properties to set + * @returns AssociationDetails instance + */ + public static create(properties?: google.cloud.networksecurity.v1.MirroringEndpointGroup.IAssociationDetails): google.cloud.networksecurity.v1.MirroringEndpointGroup.AssociationDetails; + + /** + * Encodes the specified AssociationDetails message. Does not implicitly {@link google.cloud.networksecurity.v1.MirroringEndpointGroup.AssociationDetails.verify|verify} messages. + * @param message AssociationDetails message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.networksecurity.v1.MirroringEndpointGroup.IAssociationDetails, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AssociationDetails message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.MirroringEndpointGroup.AssociationDetails.verify|verify} messages. + * @param message AssociationDetails message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.networksecurity.v1.MirroringEndpointGroup.IAssociationDetails, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AssociationDetails message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AssociationDetails + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.networksecurity.v1.MirroringEndpointGroup.AssociationDetails; + + /** + * Decodes an AssociationDetails message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AssociationDetails + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.networksecurity.v1.MirroringEndpointGroup.AssociationDetails; + + /** + * Verifies an AssociationDetails message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AssociationDetails message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AssociationDetails + */ + public static fromObject(object: { [k: string]: any }): google.cloud.networksecurity.v1.MirroringEndpointGroup.AssociationDetails; + + /** + * Creates a plain object from an AssociationDetails message. Also converts values to other types if specified. + * @param message AssociationDetails + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.networksecurity.v1.MirroringEndpointGroup.AssociationDetails, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AssociationDetails to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AssociationDetails + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** State enum. */ + enum State { + STATE_UNSPECIFIED = 0, + ACTIVE = 1, + CLOSED = 2, + CREATING = 3, + DELETING = 4, + OUT_OF_SYNC = 5, + DELETE_FAILED = 6 + } + + /** Type enum. */ + enum Type { + TYPE_UNSPECIFIED = 0, + DIRECT = 1 + } + } + + /** Properties of a ListMirroringEndpointGroupsRequest. */ + interface IListMirroringEndpointGroupsRequest { + + /** ListMirroringEndpointGroupsRequest parent */ + parent?: (string|null); + + /** ListMirroringEndpointGroupsRequest pageSize */ + pageSize?: (number|null); + + /** ListMirroringEndpointGroupsRequest pageToken */ + pageToken?: (string|null); + + /** ListMirroringEndpointGroupsRequest filter */ + filter?: (string|null); + + /** ListMirroringEndpointGroupsRequest orderBy */ + orderBy?: (string|null); + } + + /** Represents a ListMirroringEndpointGroupsRequest. */ + class ListMirroringEndpointGroupsRequest implements IListMirroringEndpointGroupsRequest { + + /** + * Constructs a new ListMirroringEndpointGroupsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.networksecurity.v1.IListMirroringEndpointGroupsRequest); + + /** ListMirroringEndpointGroupsRequest parent. */ + public parent: string; + + /** ListMirroringEndpointGroupsRequest pageSize. */ + public pageSize: number; + + /** ListMirroringEndpointGroupsRequest pageToken. */ + public pageToken: string; + + /** ListMirroringEndpointGroupsRequest filter. */ + public filter: string; + + /** ListMirroringEndpointGroupsRequest orderBy. */ + public orderBy: string; + + /** + * Creates a new ListMirroringEndpointGroupsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListMirroringEndpointGroupsRequest instance + */ + public static create(properties?: google.cloud.networksecurity.v1.IListMirroringEndpointGroupsRequest): google.cloud.networksecurity.v1.ListMirroringEndpointGroupsRequest; + + /** + * Encodes the specified ListMirroringEndpointGroupsRequest message. Does not implicitly {@link google.cloud.networksecurity.v1.ListMirroringEndpointGroupsRequest.verify|verify} messages. + * @param message ListMirroringEndpointGroupsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.networksecurity.v1.IListMirroringEndpointGroupsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListMirroringEndpointGroupsRequest message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.ListMirroringEndpointGroupsRequest.verify|verify} messages. + * @param message ListMirroringEndpointGroupsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.networksecurity.v1.IListMirroringEndpointGroupsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListMirroringEndpointGroupsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListMirroringEndpointGroupsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.networksecurity.v1.ListMirroringEndpointGroupsRequest; + + /** + * Decodes a ListMirroringEndpointGroupsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListMirroringEndpointGroupsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.networksecurity.v1.ListMirroringEndpointGroupsRequest; + + /** + * Verifies a ListMirroringEndpointGroupsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListMirroringEndpointGroupsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListMirroringEndpointGroupsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.networksecurity.v1.ListMirroringEndpointGroupsRequest; + + /** + * Creates a plain object from a ListMirroringEndpointGroupsRequest message. Also converts values to other types if specified. + * @param message ListMirroringEndpointGroupsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.networksecurity.v1.ListMirroringEndpointGroupsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListMirroringEndpointGroupsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListMirroringEndpointGroupsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListMirroringEndpointGroupsResponse. */ + interface IListMirroringEndpointGroupsResponse { + + /** ListMirroringEndpointGroupsResponse mirroringEndpointGroups */ + mirroringEndpointGroups?: (google.cloud.networksecurity.v1.IMirroringEndpointGroup[]|null); + + /** ListMirroringEndpointGroupsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListMirroringEndpointGroupsResponse. */ + class ListMirroringEndpointGroupsResponse implements IListMirroringEndpointGroupsResponse { + + /** + * Constructs a new ListMirroringEndpointGroupsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.networksecurity.v1.IListMirroringEndpointGroupsResponse); + + /** ListMirroringEndpointGroupsResponse mirroringEndpointGroups. */ + public mirroringEndpointGroups: google.cloud.networksecurity.v1.IMirroringEndpointGroup[]; + + /** ListMirroringEndpointGroupsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListMirroringEndpointGroupsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListMirroringEndpointGroupsResponse instance + */ + public static create(properties?: google.cloud.networksecurity.v1.IListMirroringEndpointGroupsResponse): google.cloud.networksecurity.v1.ListMirroringEndpointGroupsResponse; + + /** + * Encodes the specified ListMirroringEndpointGroupsResponse message. Does not implicitly {@link google.cloud.networksecurity.v1.ListMirroringEndpointGroupsResponse.verify|verify} messages. + * @param message ListMirroringEndpointGroupsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.networksecurity.v1.IListMirroringEndpointGroupsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListMirroringEndpointGroupsResponse message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.ListMirroringEndpointGroupsResponse.verify|verify} messages. + * @param message ListMirroringEndpointGroupsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.networksecurity.v1.IListMirroringEndpointGroupsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListMirroringEndpointGroupsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListMirroringEndpointGroupsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.networksecurity.v1.ListMirroringEndpointGroupsResponse; + + /** + * Decodes a ListMirroringEndpointGroupsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListMirroringEndpointGroupsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.networksecurity.v1.ListMirroringEndpointGroupsResponse; + + /** + * Verifies a ListMirroringEndpointGroupsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListMirroringEndpointGroupsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListMirroringEndpointGroupsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.networksecurity.v1.ListMirroringEndpointGroupsResponse; + + /** + * Creates a plain object from a ListMirroringEndpointGroupsResponse message. Also converts values to other types if specified. + * @param message ListMirroringEndpointGroupsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.networksecurity.v1.ListMirroringEndpointGroupsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListMirroringEndpointGroupsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListMirroringEndpointGroupsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetMirroringEndpointGroupRequest. */ + interface IGetMirroringEndpointGroupRequest { + + /** GetMirroringEndpointGroupRequest name */ + name?: (string|null); + } + + /** Represents a GetMirroringEndpointGroupRequest. */ + class GetMirroringEndpointGroupRequest implements IGetMirroringEndpointGroupRequest { + + /** + * Constructs a new GetMirroringEndpointGroupRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.networksecurity.v1.IGetMirroringEndpointGroupRequest); + + /** GetMirroringEndpointGroupRequest name. */ + public name: string; + + /** + * Creates a new GetMirroringEndpointGroupRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetMirroringEndpointGroupRequest instance + */ + public static create(properties?: google.cloud.networksecurity.v1.IGetMirroringEndpointGroupRequest): google.cloud.networksecurity.v1.GetMirroringEndpointGroupRequest; + + /** + * Encodes the specified GetMirroringEndpointGroupRequest message. Does not implicitly {@link google.cloud.networksecurity.v1.GetMirroringEndpointGroupRequest.verify|verify} messages. + * @param message GetMirroringEndpointGroupRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.networksecurity.v1.IGetMirroringEndpointGroupRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetMirroringEndpointGroupRequest message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.GetMirroringEndpointGroupRequest.verify|verify} messages. + * @param message GetMirroringEndpointGroupRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.networksecurity.v1.IGetMirroringEndpointGroupRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetMirroringEndpointGroupRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetMirroringEndpointGroupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.networksecurity.v1.GetMirroringEndpointGroupRequest; + + /** + * Decodes a GetMirroringEndpointGroupRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetMirroringEndpointGroupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.networksecurity.v1.GetMirroringEndpointGroupRequest; + + /** + * Verifies a GetMirroringEndpointGroupRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetMirroringEndpointGroupRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetMirroringEndpointGroupRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.networksecurity.v1.GetMirroringEndpointGroupRequest; + + /** + * Creates a plain object from a GetMirroringEndpointGroupRequest message. Also converts values to other types if specified. + * @param message GetMirroringEndpointGroupRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.networksecurity.v1.GetMirroringEndpointGroupRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetMirroringEndpointGroupRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetMirroringEndpointGroupRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateMirroringEndpointGroupRequest. */ + interface ICreateMirroringEndpointGroupRequest { + + /** CreateMirroringEndpointGroupRequest parent */ + parent?: (string|null); + + /** CreateMirroringEndpointGroupRequest mirroringEndpointGroupId */ + mirroringEndpointGroupId?: (string|null); + + /** CreateMirroringEndpointGroupRequest mirroringEndpointGroup */ + mirroringEndpointGroup?: (google.cloud.networksecurity.v1.IMirroringEndpointGroup|null); + + /** CreateMirroringEndpointGroupRequest requestId */ + requestId?: (string|null); + } + + /** Represents a CreateMirroringEndpointGroupRequest. */ + class CreateMirroringEndpointGroupRequest implements ICreateMirroringEndpointGroupRequest { + + /** + * Constructs a new CreateMirroringEndpointGroupRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.networksecurity.v1.ICreateMirroringEndpointGroupRequest); + + /** CreateMirroringEndpointGroupRequest parent. */ + public parent: string; + + /** CreateMirroringEndpointGroupRequest mirroringEndpointGroupId. */ + public mirroringEndpointGroupId: string; + + /** CreateMirroringEndpointGroupRequest mirroringEndpointGroup. */ + public mirroringEndpointGroup?: (google.cloud.networksecurity.v1.IMirroringEndpointGroup|null); + + /** CreateMirroringEndpointGroupRequest requestId. */ + public requestId: string; + + /** + * Creates a new CreateMirroringEndpointGroupRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateMirroringEndpointGroupRequest instance + */ + public static create(properties?: google.cloud.networksecurity.v1.ICreateMirroringEndpointGroupRequest): google.cloud.networksecurity.v1.CreateMirroringEndpointGroupRequest; + + /** + * Encodes the specified CreateMirroringEndpointGroupRequest message. Does not implicitly {@link google.cloud.networksecurity.v1.CreateMirroringEndpointGroupRequest.verify|verify} messages. + * @param message CreateMirroringEndpointGroupRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.networksecurity.v1.ICreateMirroringEndpointGroupRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateMirroringEndpointGroupRequest message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.CreateMirroringEndpointGroupRequest.verify|verify} messages. + * @param message CreateMirroringEndpointGroupRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.networksecurity.v1.ICreateMirroringEndpointGroupRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateMirroringEndpointGroupRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateMirroringEndpointGroupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.networksecurity.v1.CreateMirroringEndpointGroupRequest; + + /** + * Decodes a CreateMirroringEndpointGroupRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateMirroringEndpointGroupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.networksecurity.v1.CreateMirroringEndpointGroupRequest; + + /** + * Verifies a CreateMirroringEndpointGroupRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateMirroringEndpointGroupRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateMirroringEndpointGroupRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.networksecurity.v1.CreateMirroringEndpointGroupRequest; + + /** + * Creates a plain object from a CreateMirroringEndpointGroupRequest message. Also converts values to other types if specified. + * @param message CreateMirroringEndpointGroupRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.networksecurity.v1.CreateMirroringEndpointGroupRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateMirroringEndpointGroupRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateMirroringEndpointGroupRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateMirroringEndpointGroupRequest. */ + interface IUpdateMirroringEndpointGroupRequest { + + /** UpdateMirroringEndpointGroupRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateMirroringEndpointGroupRequest mirroringEndpointGroup */ + mirroringEndpointGroup?: (google.cloud.networksecurity.v1.IMirroringEndpointGroup|null); + + /** UpdateMirroringEndpointGroupRequest requestId */ + requestId?: (string|null); + } + + /** Represents an UpdateMirroringEndpointGroupRequest. */ + class UpdateMirroringEndpointGroupRequest implements IUpdateMirroringEndpointGroupRequest { + + /** + * Constructs a new UpdateMirroringEndpointGroupRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.networksecurity.v1.IUpdateMirroringEndpointGroupRequest); + + /** UpdateMirroringEndpointGroupRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateMirroringEndpointGroupRequest mirroringEndpointGroup. */ + public mirroringEndpointGroup?: (google.cloud.networksecurity.v1.IMirroringEndpointGroup|null); + + /** UpdateMirroringEndpointGroupRequest requestId. */ + public requestId: string; + + /** + * Creates a new UpdateMirroringEndpointGroupRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateMirroringEndpointGroupRequest instance + */ + public static create(properties?: google.cloud.networksecurity.v1.IUpdateMirroringEndpointGroupRequest): google.cloud.networksecurity.v1.UpdateMirroringEndpointGroupRequest; + + /** + * Encodes the specified UpdateMirroringEndpointGroupRequest message. Does not implicitly {@link google.cloud.networksecurity.v1.UpdateMirroringEndpointGroupRequest.verify|verify} messages. + * @param message UpdateMirroringEndpointGroupRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.networksecurity.v1.IUpdateMirroringEndpointGroupRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateMirroringEndpointGroupRequest message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.UpdateMirroringEndpointGroupRequest.verify|verify} messages. + * @param message UpdateMirroringEndpointGroupRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.networksecurity.v1.IUpdateMirroringEndpointGroupRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateMirroringEndpointGroupRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateMirroringEndpointGroupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.networksecurity.v1.UpdateMirroringEndpointGroupRequest; + + /** + * Decodes an UpdateMirroringEndpointGroupRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateMirroringEndpointGroupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.networksecurity.v1.UpdateMirroringEndpointGroupRequest; + + /** + * Verifies an UpdateMirroringEndpointGroupRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UpdateMirroringEndpointGroupRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateMirroringEndpointGroupRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.networksecurity.v1.UpdateMirroringEndpointGroupRequest; + + /** + * Creates a plain object from an UpdateMirroringEndpointGroupRequest message. Also converts values to other types if specified. + * @param message UpdateMirroringEndpointGroupRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.networksecurity.v1.UpdateMirroringEndpointGroupRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateMirroringEndpointGroupRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateMirroringEndpointGroupRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteMirroringEndpointGroupRequest. */ + interface IDeleteMirroringEndpointGroupRequest { + + /** DeleteMirroringEndpointGroupRequest name */ + name?: (string|null); + + /** DeleteMirroringEndpointGroupRequest requestId */ + requestId?: (string|null); + } + + /** Represents a DeleteMirroringEndpointGroupRequest. */ + class DeleteMirroringEndpointGroupRequest implements IDeleteMirroringEndpointGroupRequest { + + /** + * Constructs a new DeleteMirroringEndpointGroupRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.networksecurity.v1.IDeleteMirroringEndpointGroupRequest); + + /** DeleteMirroringEndpointGroupRequest name. */ + public name: string; + + /** DeleteMirroringEndpointGroupRequest requestId. */ + public requestId: string; + + /** + * Creates a new DeleteMirroringEndpointGroupRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteMirroringEndpointGroupRequest instance + */ + public static create(properties?: google.cloud.networksecurity.v1.IDeleteMirroringEndpointGroupRequest): google.cloud.networksecurity.v1.DeleteMirroringEndpointGroupRequest; + + /** + * Encodes the specified DeleteMirroringEndpointGroupRequest message. Does not implicitly {@link google.cloud.networksecurity.v1.DeleteMirroringEndpointGroupRequest.verify|verify} messages. + * @param message DeleteMirroringEndpointGroupRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.networksecurity.v1.IDeleteMirroringEndpointGroupRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteMirroringEndpointGroupRequest message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.DeleteMirroringEndpointGroupRequest.verify|verify} messages. + * @param message DeleteMirroringEndpointGroupRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.networksecurity.v1.IDeleteMirroringEndpointGroupRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteMirroringEndpointGroupRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteMirroringEndpointGroupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.networksecurity.v1.DeleteMirroringEndpointGroupRequest; + + /** + * Decodes a DeleteMirroringEndpointGroupRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteMirroringEndpointGroupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.networksecurity.v1.DeleteMirroringEndpointGroupRequest; + + /** + * Verifies a DeleteMirroringEndpointGroupRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteMirroringEndpointGroupRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteMirroringEndpointGroupRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.networksecurity.v1.DeleteMirroringEndpointGroupRequest; + + /** + * Creates a plain object from a DeleteMirroringEndpointGroupRequest message. Also converts values to other types if specified. + * @param message DeleteMirroringEndpointGroupRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.networksecurity.v1.DeleteMirroringEndpointGroupRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteMirroringEndpointGroupRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteMirroringEndpointGroupRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a MirroringEndpointGroupAssociation. */ + interface IMirroringEndpointGroupAssociation { + + /** MirroringEndpointGroupAssociation name */ + name?: (string|null); + + /** MirroringEndpointGroupAssociation createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** MirroringEndpointGroupAssociation updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** MirroringEndpointGroupAssociation labels */ + labels?: ({ [k: string]: string }|null); + + /** MirroringEndpointGroupAssociation mirroringEndpointGroup */ + mirroringEndpointGroup?: (string|null); + + /** MirroringEndpointGroupAssociation network */ + network?: (string|null); + + /** MirroringEndpointGroupAssociation locationsDetails */ + locationsDetails?: (google.cloud.networksecurity.v1.MirroringEndpointGroupAssociation.ILocationDetails[]|null); + + /** MirroringEndpointGroupAssociation state */ + state?: (google.cloud.networksecurity.v1.MirroringEndpointGroupAssociation.State|keyof typeof google.cloud.networksecurity.v1.MirroringEndpointGroupAssociation.State|null); + + /** MirroringEndpointGroupAssociation reconciling */ + reconciling?: (boolean|null); + + /** MirroringEndpointGroupAssociation locations */ + locations?: (google.cloud.networksecurity.v1.IMirroringLocation[]|null); + } + + /** Represents a MirroringEndpointGroupAssociation. */ + class MirroringEndpointGroupAssociation implements IMirroringEndpointGroupAssociation { + + /** + * Constructs a new MirroringEndpointGroupAssociation. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.networksecurity.v1.IMirroringEndpointGroupAssociation); + + /** MirroringEndpointGroupAssociation name. */ + public name: string; + + /** MirroringEndpointGroupAssociation createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** MirroringEndpointGroupAssociation updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** MirroringEndpointGroupAssociation labels. */ + public labels: { [k: string]: string }; + + /** MirroringEndpointGroupAssociation mirroringEndpointGroup. */ + public mirroringEndpointGroup: string; + + /** MirroringEndpointGroupAssociation network. */ + public network: string; + + /** MirroringEndpointGroupAssociation locationsDetails. */ + public locationsDetails: google.cloud.networksecurity.v1.MirroringEndpointGroupAssociation.ILocationDetails[]; + + /** MirroringEndpointGroupAssociation state. */ + public state: (google.cloud.networksecurity.v1.MirroringEndpointGroupAssociation.State|keyof typeof google.cloud.networksecurity.v1.MirroringEndpointGroupAssociation.State); + + /** MirroringEndpointGroupAssociation reconciling. */ + public reconciling: boolean; + + /** MirroringEndpointGroupAssociation locations. */ + public locations: google.cloud.networksecurity.v1.IMirroringLocation[]; + + /** + * Creates a new MirroringEndpointGroupAssociation instance using the specified properties. + * @param [properties] Properties to set + * @returns MirroringEndpointGroupAssociation instance + */ + public static create(properties?: google.cloud.networksecurity.v1.IMirroringEndpointGroupAssociation): google.cloud.networksecurity.v1.MirroringEndpointGroupAssociation; + + /** + * Encodes the specified MirroringEndpointGroupAssociation message. Does not implicitly {@link google.cloud.networksecurity.v1.MirroringEndpointGroupAssociation.verify|verify} messages. + * @param message MirroringEndpointGroupAssociation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.networksecurity.v1.IMirroringEndpointGroupAssociation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MirroringEndpointGroupAssociation message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.MirroringEndpointGroupAssociation.verify|verify} messages. + * @param message MirroringEndpointGroupAssociation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.networksecurity.v1.IMirroringEndpointGroupAssociation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MirroringEndpointGroupAssociation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MirroringEndpointGroupAssociation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.networksecurity.v1.MirroringEndpointGroupAssociation; + + /** + * Decodes a MirroringEndpointGroupAssociation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MirroringEndpointGroupAssociation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.networksecurity.v1.MirroringEndpointGroupAssociation; + + /** + * Verifies a MirroringEndpointGroupAssociation message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MirroringEndpointGroupAssociation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MirroringEndpointGroupAssociation + */ + public static fromObject(object: { [k: string]: any }): google.cloud.networksecurity.v1.MirroringEndpointGroupAssociation; + + /** + * Creates a plain object from a MirroringEndpointGroupAssociation message. Also converts values to other types if specified. + * @param message MirroringEndpointGroupAssociation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.networksecurity.v1.MirroringEndpointGroupAssociation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MirroringEndpointGroupAssociation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MirroringEndpointGroupAssociation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace MirroringEndpointGroupAssociation { + + /** Properties of a LocationDetails. */ + interface ILocationDetails { + + /** LocationDetails location */ + location?: (string|null); + + /** LocationDetails state */ + state?: (google.cloud.networksecurity.v1.MirroringEndpointGroupAssociation.LocationDetails.State|keyof typeof google.cloud.networksecurity.v1.MirroringEndpointGroupAssociation.LocationDetails.State|null); + } + + /** Represents a LocationDetails. */ + class LocationDetails implements ILocationDetails { + + /** + * Constructs a new LocationDetails. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.networksecurity.v1.MirroringEndpointGroupAssociation.ILocationDetails); + + /** LocationDetails location. */ + public location: string; + + /** LocationDetails state. */ + public state: (google.cloud.networksecurity.v1.MirroringEndpointGroupAssociation.LocationDetails.State|keyof typeof google.cloud.networksecurity.v1.MirroringEndpointGroupAssociation.LocationDetails.State); + + /** + * Creates a new LocationDetails instance using the specified properties. + * @param [properties] Properties to set + * @returns LocationDetails instance + */ + public static create(properties?: google.cloud.networksecurity.v1.MirroringEndpointGroupAssociation.ILocationDetails): google.cloud.networksecurity.v1.MirroringEndpointGroupAssociation.LocationDetails; + + /** + * Encodes the specified LocationDetails message. Does not implicitly {@link google.cloud.networksecurity.v1.MirroringEndpointGroupAssociation.LocationDetails.verify|verify} messages. + * @param message LocationDetails message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.networksecurity.v1.MirroringEndpointGroupAssociation.ILocationDetails, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified LocationDetails message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.MirroringEndpointGroupAssociation.LocationDetails.verify|verify} messages. + * @param message LocationDetails message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.networksecurity.v1.MirroringEndpointGroupAssociation.ILocationDetails, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a LocationDetails message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns LocationDetails + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.networksecurity.v1.MirroringEndpointGroupAssociation.LocationDetails; + + /** + * Decodes a LocationDetails message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns LocationDetails + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.networksecurity.v1.MirroringEndpointGroupAssociation.LocationDetails; + + /** + * Verifies a LocationDetails message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a LocationDetails message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns LocationDetails + */ + public static fromObject(object: { [k: string]: any }): google.cloud.networksecurity.v1.MirroringEndpointGroupAssociation.LocationDetails; + + /** + * Creates a plain object from a LocationDetails message. Also converts values to other types if specified. + * @param message LocationDetails + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.networksecurity.v1.MirroringEndpointGroupAssociation.LocationDetails, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this LocationDetails to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for LocationDetails + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace LocationDetails { + + /** State enum. */ + enum State { + STATE_UNSPECIFIED = 0, + ACTIVE = 1, + OUT_OF_SYNC = 2 + } + } + + /** State enum. */ + enum State { + STATE_UNSPECIFIED = 0, + ACTIVE = 1, + CREATING = 3, + DELETING = 4, + CLOSED = 5, + OUT_OF_SYNC = 6, + DELETE_FAILED = 7 + } + } + + /** Properties of a ListMirroringEndpointGroupAssociationsRequest. */ + interface IListMirroringEndpointGroupAssociationsRequest { + + /** ListMirroringEndpointGroupAssociationsRequest parent */ + parent?: (string|null); + + /** ListMirroringEndpointGroupAssociationsRequest pageSize */ + pageSize?: (number|null); + + /** ListMirroringEndpointGroupAssociationsRequest pageToken */ + pageToken?: (string|null); + + /** ListMirroringEndpointGroupAssociationsRequest filter */ + filter?: (string|null); + + /** ListMirroringEndpointGroupAssociationsRequest orderBy */ + orderBy?: (string|null); + } + + /** Represents a ListMirroringEndpointGroupAssociationsRequest. */ + class ListMirroringEndpointGroupAssociationsRequest implements IListMirroringEndpointGroupAssociationsRequest { + + /** + * Constructs a new ListMirroringEndpointGroupAssociationsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.networksecurity.v1.IListMirroringEndpointGroupAssociationsRequest); + + /** ListMirroringEndpointGroupAssociationsRequest parent. */ + public parent: string; + + /** ListMirroringEndpointGroupAssociationsRequest pageSize. */ + public pageSize: number; + + /** ListMirroringEndpointGroupAssociationsRequest pageToken. */ + public pageToken: string; + + /** ListMirroringEndpointGroupAssociationsRequest filter. */ + public filter: string; + + /** ListMirroringEndpointGroupAssociationsRequest orderBy. */ + public orderBy: string; + + /** + * Creates a new ListMirroringEndpointGroupAssociationsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListMirroringEndpointGroupAssociationsRequest instance + */ + public static create(properties?: google.cloud.networksecurity.v1.IListMirroringEndpointGroupAssociationsRequest): google.cloud.networksecurity.v1.ListMirroringEndpointGroupAssociationsRequest; + + /** + * Encodes the specified ListMirroringEndpointGroupAssociationsRequest message. Does not implicitly {@link google.cloud.networksecurity.v1.ListMirroringEndpointGroupAssociationsRequest.verify|verify} messages. + * @param message ListMirroringEndpointGroupAssociationsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.networksecurity.v1.IListMirroringEndpointGroupAssociationsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListMirroringEndpointGroupAssociationsRequest message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.ListMirroringEndpointGroupAssociationsRequest.verify|verify} messages. + * @param message ListMirroringEndpointGroupAssociationsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.networksecurity.v1.IListMirroringEndpointGroupAssociationsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListMirroringEndpointGroupAssociationsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListMirroringEndpointGroupAssociationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.networksecurity.v1.ListMirroringEndpointGroupAssociationsRequest; + + /** + * Decodes a ListMirroringEndpointGroupAssociationsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListMirroringEndpointGroupAssociationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.networksecurity.v1.ListMirroringEndpointGroupAssociationsRequest; + + /** + * Verifies a ListMirroringEndpointGroupAssociationsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListMirroringEndpointGroupAssociationsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListMirroringEndpointGroupAssociationsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.networksecurity.v1.ListMirroringEndpointGroupAssociationsRequest; + + /** + * Creates a plain object from a ListMirroringEndpointGroupAssociationsRequest message. Also converts values to other types if specified. + * @param message ListMirroringEndpointGroupAssociationsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.networksecurity.v1.ListMirroringEndpointGroupAssociationsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListMirroringEndpointGroupAssociationsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListMirroringEndpointGroupAssociationsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListMirroringEndpointGroupAssociationsResponse. */ + interface IListMirroringEndpointGroupAssociationsResponse { + + /** ListMirroringEndpointGroupAssociationsResponse mirroringEndpointGroupAssociations */ + mirroringEndpointGroupAssociations?: (google.cloud.networksecurity.v1.IMirroringEndpointGroupAssociation[]|null); + + /** ListMirroringEndpointGroupAssociationsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListMirroringEndpointGroupAssociationsResponse. */ + class ListMirroringEndpointGroupAssociationsResponse implements IListMirroringEndpointGroupAssociationsResponse { + + /** + * Constructs a new ListMirroringEndpointGroupAssociationsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.networksecurity.v1.IListMirroringEndpointGroupAssociationsResponse); + + /** ListMirroringEndpointGroupAssociationsResponse mirroringEndpointGroupAssociations. */ + public mirroringEndpointGroupAssociations: google.cloud.networksecurity.v1.IMirroringEndpointGroupAssociation[]; + + /** ListMirroringEndpointGroupAssociationsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListMirroringEndpointGroupAssociationsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListMirroringEndpointGroupAssociationsResponse instance + */ + public static create(properties?: google.cloud.networksecurity.v1.IListMirroringEndpointGroupAssociationsResponse): google.cloud.networksecurity.v1.ListMirroringEndpointGroupAssociationsResponse; + + /** + * Encodes the specified ListMirroringEndpointGroupAssociationsResponse message. Does not implicitly {@link google.cloud.networksecurity.v1.ListMirroringEndpointGroupAssociationsResponse.verify|verify} messages. + * @param message ListMirroringEndpointGroupAssociationsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.networksecurity.v1.IListMirroringEndpointGroupAssociationsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListMirroringEndpointGroupAssociationsResponse message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.ListMirroringEndpointGroupAssociationsResponse.verify|verify} messages. + * @param message ListMirroringEndpointGroupAssociationsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.networksecurity.v1.IListMirroringEndpointGroupAssociationsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListMirroringEndpointGroupAssociationsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListMirroringEndpointGroupAssociationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.networksecurity.v1.ListMirroringEndpointGroupAssociationsResponse; + + /** + * Decodes a ListMirroringEndpointGroupAssociationsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListMirroringEndpointGroupAssociationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.networksecurity.v1.ListMirroringEndpointGroupAssociationsResponse; + + /** + * Verifies a ListMirroringEndpointGroupAssociationsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListMirroringEndpointGroupAssociationsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListMirroringEndpointGroupAssociationsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.networksecurity.v1.ListMirroringEndpointGroupAssociationsResponse; + + /** + * Creates a plain object from a ListMirroringEndpointGroupAssociationsResponse message. Also converts values to other types if specified. + * @param message ListMirroringEndpointGroupAssociationsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.networksecurity.v1.ListMirroringEndpointGroupAssociationsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListMirroringEndpointGroupAssociationsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListMirroringEndpointGroupAssociationsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetMirroringEndpointGroupAssociationRequest. */ + interface IGetMirroringEndpointGroupAssociationRequest { + + /** GetMirroringEndpointGroupAssociationRequest name */ + name?: (string|null); + } + + /** Represents a GetMirroringEndpointGroupAssociationRequest. */ + class GetMirroringEndpointGroupAssociationRequest implements IGetMirroringEndpointGroupAssociationRequest { + + /** + * Constructs a new GetMirroringEndpointGroupAssociationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.networksecurity.v1.IGetMirroringEndpointGroupAssociationRequest); + + /** GetMirroringEndpointGroupAssociationRequest name. */ + public name: string; + + /** + * Creates a new GetMirroringEndpointGroupAssociationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetMirroringEndpointGroupAssociationRequest instance + */ + public static create(properties?: google.cloud.networksecurity.v1.IGetMirroringEndpointGroupAssociationRequest): google.cloud.networksecurity.v1.GetMirroringEndpointGroupAssociationRequest; + + /** + * Encodes the specified GetMirroringEndpointGroupAssociationRequest message. Does not implicitly {@link google.cloud.networksecurity.v1.GetMirroringEndpointGroupAssociationRequest.verify|verify} messages. + * @param message GetMirroringEndpointGroupAssociationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.networksecurity.v1.IGetMirroringEndpointGroupAssociationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetMirroringEndpointGroupAssociationRequest message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.GetMirroringEndpointGroupAssociationRequest.verify|verify} messages. + * @param message GetMirroringEndpointGroupAssociationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.networksecurity.v1.IGetMirroringEndpointGroupAssociationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetMirroringEndpointGroupAssociationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetMirroringEndpointGroupAssociationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.networksecurity.v1.GetMirroringEndpointGroupAssociationRequest; + + /** + * Decodes a GetMirroringEndpointGroupAssociationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetMirroringEndpointGroupAssociationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.networksecurity.v1.GetMirroringEndpointGroupAssociationRequest; + + /** + * Verifies a GetMirroringEndpointGroupAssociationRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetMirroringEndpointGroupAssociationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetMirroringEndpointGroupAssociationRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.networksecurity.v1.GetMirroringEndpointGroupAssociationRequest; + + /** + * Creates a plain object from a GetMirroringEndpointGroupAssociationRequest message. Also converts values to other types if specified. + * @param message GetMirroringEndpointGroupAssociationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.networksecurity.v1.GetMirroringEndpointGroupAssociationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetMirroringEndpointGroupAssociationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetMirroringEndpointGroupAssociationRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateMirroringEndpointGroupAssociationRequest. */ + interface ICreateMirroringEndpointGroupAssociationRequest { + + /** CreateMirroringEndpointGroupAssociationRequest parent */ + parent?: (string|null); + + /** CreateMirroringEndpointGroupAssociationRequest mirroringEndpointGroupAssociationId */ + mirroringEndpointGroupAssociationId?: (string|null); + + /** CreateMirroringEndpointGroupAssociationRequest mirroringEndpointGroupAssociation */ + mirroringEndpointGroupAssociation?: (google.cloud.networksecurity.v1.IMirroringEndpointGroupAssociation|null); + + /** CreateMirroringEndpointGroupAssociationRequest requestId */ + requestId?: (string|null); + } + + /** Represents a CreateMirroringEndpointGroupAssociationRequest. */ + class CreateMirroringEndpointGroupAssociationRequest implements ICreateMirroringEndpointGroupAssociationRequest { + + /** + * Constructs a new CreateMirroringEndpointGroupAssociationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.networksecurity.v1.ICreateMirroringEndpointGroupAssociationRequest); + + /** CreateMirroringEndpointGroupAssociationRequest parent. */ + public parent: string; + + /** CreateMirroringEndpointGroupAssociationRequest mirroringEndpointGroupAssociationId. */ + public mirroringEndpointGroupAssociationId: string; + + /** CreateMirroringEndpointGroupAssociationRequest mirroringEndpointGroupAssociation. */ + public mirroringEndpointGroupAssociation?: (google.cloud.networksecurity.v1.IMirroringEndpointGroupAssociation|null); + + /** CreateMirroringEndpointGroupAssociationRequest requestId. */ + public requestId: string; + + /** + * Creates a new CreateMirroringEndpointGroupAssociationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateMirroringEndpointGroupAssociationRequest instance + */ + public static create(properties?: google.cloud.networksecurity.v1.ICreateMirroringEndpointGroupAssociationRequest): google.cloud.networksecurity.v1.CreateMirroringEndpointGroupAssociationRequest; + + /** + * Encodes the specified CreateMirroringEndpointGroupAssociationRequest message. Does not implicitly {@link google.cloud.networksecurity.v1.CreateMirroringEndpointGroupAssociationRequest.verify|verify} messages. + * @param message CreateMirroringEndpointGroupAssociationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.networksecurity.v1.ICreateMirroringEndpointGroupAssociationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateMirroringEndpointGroupAssociationRequest message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.CreateMirroringEndpointGroupAssociationRequest.verify|verify} messages. + * @param message CreateMirroringEndpointGroupAssociationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.networksecurity.v1.ICreateMirroringEndpointGroupAssociationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateMirroringEndpointGroupAssociationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateMirroringEndpointGroupAssociationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.networksecurity.v1.CreateMirroringEndpointGroupAssociationRequest; + + /** + * Decodes a CreateMirroringEndpointGroupAssociationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateMirroringEndpointGroupAssociationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.networksecurity.v1.CreateMirroringEndpointGroupAssociationRequest; + + /** + * Verifies a CreateMirroringEndpointGroupAssociationRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateMirroringEndpointGroupAssociationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateMirroringEndpointGroupAssociationRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.networksecurity.v1.CreateMirroringEndpointGroupAssociationRequest; + + /** + * Creates a plain object from a CreateMirroringEndpointGroupAssociationRequest message. Also converts values to other types if specified. + * @param message CreateMirroringEndpointGroupAssociationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.networksecurity.v1.CreateMirroringEndpointGroupAssociationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateMirroringEndpointGroupAssociationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateMirroringEndpointGroupAssociationRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateMirroringEndpointGroupAssociationRequest. */ + interface IUpdateMirroringEndpointGroupAssociationRequest { + + /** UpdateMirroringEndpointGroupAssociationRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateMirroringEndpointGroupAssociationRequest mirroringEndpointGroupAssociation */ + mirroringEndpointGroupAssociation?: (google.cloud.networksecurity.v1.IMirroringEndpointGroupAssociation|null); + + /** UpdateMirroringEndpointGroupAssociationRequest requestId */ + requestId?: (string|null); + } + + /** Represents an UpdateMirroringEndpointGroupAssociationRequest. */ + class UpdateMirroringEndpointGroupAssociationRequest implements IUpdateMirroringEndpointGroupAssociationRequest { + + /** + * Constructs a new UpdateMirroringEndpointGroupAssociationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.networksecurity.v1.IUpdateMirroringEndpointGroupAssociationRequest); + + /** UpdateMirroringEndpointGroupAssociationRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateMirroringEndpointGroupAssociationRequest mirroringEndpointGroupAssociation. */ + public mirroringEndpointGroupAssociation?: (google.cloud.networksecurity.v1.IMirroringEndpointGroupAssociation|null); + + /** UpdateMirroringEndpointGroupAssociationRequest requestId. */ + public requestId: string; + + /** + * Creates a new UpdateMirroringEndpointGroupAssociationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateMirroringEndpointGroupAssociationRequest instance + */ + public static create(properties?: google.cloud.networksecurity.v1.IUpdateMirroringEndpointGroupAssociationRequest): google.cloud.networksecurity.v1.UpdateMirroringEndpointGroupAssociationRequest; + + /** + * Encodes the specified UpdateMirroringEndpointGroupAssociationRequest message. Does not implicitly {@link google.cloud.networksecurity.v1.UpdateMirroringEndpointGroupAssociationRequest.verify|verify} messages. + * @param message UpdateMirroringEndpointGroupAssociationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.networksecurity.v1.IUpdateMirroringEndpointGroupAssociationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateMirroringEndpointGroupAssociationRequest message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.UpdateMirroringEndpointGroupAssociationRequest.verify|verify} messages. + * @param message UpdateMirroringEndpointGroupAssociationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.networksecurity.v1.IUpdateMirroringEndpointGroupAssociationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateMirroringEndpointGroupAssociationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateMirroringEndpointGroupAssociationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.networksecurity.v1.UpdateMirroringEndpointGroupAssociationRequest; + + /** + * Decodes an UpdateMirroringEndpointGroupAssociationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateMirroringEndpointGroupAssociationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.networksecurity.v1.UpdateMirroringEndpointGroupAssociationRequest; + + /** + * Verifies an UpdateMirroringEndpointGroupAssociationRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UpdateMirroringEndpointGroupAssociationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateMirroringEndpointGroupAssociationRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.networksecurity.v1.UpdateMirroringEndpointGroupAssociationRequest; + + /** + * Creates a plain object from an UpdateMirroringEndpointGroupAssociationRequest message. Also converts values to other types if specified. + * @param message UpdateMirroringEndpointGroupAssociationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.networksecurity.v1.UpdateMirroringEndpointGroupAssociationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateMirroringEndpointGroupAssociationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateMirroringEndpointGroupAssociationRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteMirroringEndpointGroupAssociationRequest. */ + interface IDeleteMirroringEndpointGroupAssociationRequest { + + /** DeleteMirroringEndpointGroupAssociationRequest name */ + name?: (string|null); + + /** DeleteMirroringEndpointGroupAssociationRequest requestId */ + requestId?: (string|null); + } + + /** Represents a DeleteMirroringEndpointGroupAssociationRequest. */ + class DeleteMirroringEndpointGroupAssociationRequest implements IDeleteMirroringEndpointGroupAssociationRequest { + + /** + * Constructs a new DeleteMirroringEndpointGroupAssociationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.networksecurity.v1.IDeleteMirroringEndpointGroupAssociationRequest); + + /** DeleteMirroringEndpointGroupAssociationRequest name. */ + public name: string; + + /** DeleteMirroringEndpointGroupAssociationRequest requestId. */ + public requestId: string; + + /** + * Creates a new DeleteMirroringEndpointGroupAssociationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteMirroringEndpointGroupAssociationRequest instance + */ + public static create(properties?: google.cloud.networksecurity.v1.IDeleteMirroringEndpointGroupAssociationRequest): google.cloud.networksecurity.v1.DeleteMirroringEndpointGroupAssociationRequest; + + /** + * Encodes the specified DeleteMirroringEndpointGroupAssociationRequest message. Does not implicitly {@link google.cloud.networksecurity.v1.DeleteMirroringEndpointGroupAssociationRequest.verify|verify} messages. + * @param message DeleteMirroringEndpointGroupAssociationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.networksecurity.v1.IDeleteMirroringEndpointGroupAssociationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteMirroringEndpointGroupAssociationRequest message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.DeleteMirroringEndpointGroupAssociationRequest.verify|verify} messages. + * @param message DeleteMirroringEndpointGroupAssociationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.networksecurity.v1.IDeleteMirroringEndpointGroupAssociationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteMirroringEndpointGroupAssociationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteMirroringEndpointGroupAssociationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.networksecurity.v1.DeleteMirroringEndpointGroupAssociationRequest; + + /** + * Decodes a DeleteMirroringEndpointGroupAssociationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteMirroringEndpointGroupAssociationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.networksecurity.v1.DeleteMirroringEndpointGroupAssociationRequest; + + /** + * Verifies a DeleteMirroringEndpointGroupAssociationRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteMirroringEndpointGroupAssociationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteMirroringEndpointGroupAssociationRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.networksecurity.v1.DeleteMirroringEndpointGroupAssociationRequest; + + /** + * Creates a plain object from a DeleteMirroringEndpointGroupAssociationRequest message. Also converts values to other types if specified. + * @param message DeleteMirroringEndpointGroupAssociationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.networksecurity.v1.DeleteMirroringEndpointGroupAssociationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteMirroringEndpointGroupAssociationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteMirroringEndpointGroupAssociationRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a MirroringDeploymentGroup. */ + interface IMirroringDeploymentGroup { + + /** MirroringDeploymentGroup name */ + name?: (string|null); + + /** MirroringDeploymentGroup createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** MirroringDeploymentGroup updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** MirroringDeploymentGroup labels */ + labels?: ({ [k: string]: string }|null); + + /** MirroringDeploymentGroup network */ + network?: (string|null); + + /** MirroringDeploymentGroup connectedEndpointGroups */ + connectedEndpointGroups?: (google.cloud.networksecurity.v1.MirroringDeploymentGroup.IConnectedEndpointGroup[]|null); + + /** MirroringDeploymentGroup nestedDeployments */ + nestedDeployments?: (google.cloud.networksecurity.v1.MirroringDeploymentGroup.IDeployment[]|null); + + /** MirroringDeploymentGroup state */ + state?: (google.cloud.networksecurity.v1.MirroringDeploymentGroup.State|keyof typeof google.cloud.networksecurity.v1.MirroringDeploymentGroup.State|null); + + /** MirroringDeploymentGroup reconciling */ + reconciling?: (boolean|null); + + /** MirroringDeploymentGroup description */ + description?: (string|null); + + /** MirroringDeploymentGroup locations */ + locations?: (google.cloud.networksecurity.v1.IMirroringLocation[]|null); + } + + /** Represents a MirroringDeploymentGroup. */ + class MirroringDeploymentGroup implements IMirroringDeploymentGroup { + + /** + * Constructs a new MirroringDeploymentGroup. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.networksecurity.v1.IMirroringDeploymentGroup); + + /** MirroringDeploymentGroup name. */ + public name: string; + + /** MirroringDeploymentGroup createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** MirroringDeploymentGroup updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** MirroringDeploymentGroup labels. */ + public labels: { [k: string]: string }; + + /** MirroringDeploymentGroup network. */ + public network: string; + + /** MirroringDeploymentGroup connectedEndpointGroups. */ + public connectedEndpointGroups: google.cloud.networksecurity.v1.MirroringDeploymentGroup.IConnectedEndpointGroup[]; + + /** MirroringDeploymentGroup nestedDeployments. */ + public nestedDeployments: google.cloud.networksecurity.v1.MirroringDeploymentGroup.IDeployment[]; + + /** MirroringDeploymentGroup state. */ + public state: (google.cloud.networksecurity.v1.MirroringDeploymentGroup.State|keyof typeof google.cloud.networksecurity.v1.MirroringDeploymentGroup.State); + + /** MirroringDeploymentGroup reconciling. */ + public reconciling: boolean; + + /** MirroringDeploymentGroup description. */ + public description: string; + + /** MirroringDeploymentGroup locations. */ + public locations: google.cloud.networksecurity.v1.IMirroringLocation[]; + + /** + * Creates a new MirroringDeploymentGroup instance using the specified properties. + * @param [properties] Properties to set + * @returns MirroringDeploymentGroup instance + */ + public static create(properties?: google.cloud.networksecurity.v1.IMirroringDeploymentGroup): google.cloud.networksecurity.v1.MirroringDeploymentGroup; + + /** + * Encodes the specified MirroringDeploymentGroup message. Does not implicitly {@link google.cloud.networksecurity.v1.MirroringDeploymentGroup.verify|verify} messages. + * @param message MirroringDeploymentGroup message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.networksecurity.v1.IMirroringDeploymentGroup, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MirroringDeploymentGroup message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.MirroringDeploymentGroup.verify|verify} messages. + * @param message MirroringDeploymentGroup message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.networksecurity.v1.IMirroringDeploymentGroup, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MirroringDeploymentGroup message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MirroringDeploymentGroup + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.networksecurity.v1.MirroringDeploymentGroup; + + /** + * Decodes a MirroringDeploymentGroup message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MirroringDeploymentGroup + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.networksecurity.v1.MirroringDeploymentGroup; + + /** + * Verifies a MirroringDeploymentGroup message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MirroringDeploymentGroup message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MirroringDeploymentGroup + */ + public static fromObject(object: { [k: string]: any }): google.cloud.networksecurity.v1.MirroringDeploymentGroup; + + /** + * Creates a plain object from a MirroringDeploymentGroup message. Also converts values to other types if specified. + * @param message MirroringDeploymentGroup + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.networksecurity.v1.MirroringDeploymentGroup, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MirroringDeploymentGroup to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MirroringDeploymentGroup + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace MirroringDeploymentGroup { + + /** Properties of a ConnectedEndpointGroup. */ + interface IConnectedEndpointGroup { + + /** ConnectedEndpointGroup name */ + name?: (string|null); + } + + /** Represents a ConnectedEndpointGroup. */ + class ConnectedEndpointGroup implements IConnectedEndpointGroup { + + /** + * Constructs a new ConnectedEndpointGroup. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.networksecurity.v1.MirroringDeploymentGroup.IConnectedEndpointGroup); + + /** ConnectedEndpointGroup name. */ + public name: string; + + /** + * Creates a new ConnectedEndpointGroup instance using the specified properties. + * @param [properties] Properties to set + * @returns ConnectedEndpointGroup instance + */ + public static create(properties?: google.cloud.networksecurity.v1.MirroringDeploymentGroup.IConnectedEndpointGroup): google.cloud.networksecurity.v1.MirroringDeploymentGroup.ConnectedEndpointGroup; + + /** + * Encodes the specified ConnectedEndpointGroup message. Does not implicitly {@link google.cloud.networksecurity.v1.MirroringDeploymentGroup.ConnectedEndpointGroup.verify|verify} messages. + * @param message ConnectedEndpointGroup message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.networksecurity.v1.MirroringDeploymentGroup.IConnectedEndpointGroup, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ConnectedEndpointGroup message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.MirroringDeploymentGroup.ConnectedEndpointGroup.verify|verify} messages. + * @param message ConnectedEndpointGroup message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.networksecurity.v1.MirroringDeploymentGroup.IConnectedEndpointGroup, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ConnectedEndpointGroup message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ConnectedEndpointGroup + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.networksecurity.v1.MirroringDeploymentGroup.ConnectedEndpointGroup; + + /** + * Decodes a ConnectedEndpointGroup message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ConnectedEndpointGroup + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.networksecurity.v1.MirroringDeploymentGroup.ConnectedEndpointGroup; + + /** + * Verifies a ConnectedEndpointGroup message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ConnectedEndpointGroup message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ConnectedEndpointGroup + */ + public static fromObject(object: { [k: string]: any }): google.cloud.networksecurity.v1.MirroringDeploymentGroup.ConnectedEndpointGroup; + + /** + * Creates a plain object from a ConnectedEndpointGroup message. Also converts values to other types if specified. + * @param message ConnectedEndpointGroup + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.networksecurity.v1.MirroringDeploymentGroup.ConnectedEndpointGroup, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ConnectedEndpointGroup to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ConnectedEndpointGroup + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Deployment. */ + interface IDeployment { + + /** Deployment name */ + name?: (string|null); + + /** Deployment state */ + state?: (google.cloud.networksecurity.v1.MirroringDeployment.State|keyof typeof google.cloud.networksecurity.v1.MirroringDeployment.State|null); + } + + /** Represents a Deployment. */ + class Deployment implements IDeployment { + + /** + * Constructs a new Deployment. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.networksecurity.v1.MirroringDeploymentGroup.IDeployment); + + /** Deployment name. */ + public name: string; + + /** Deployment state. */ + public state: (google.cloud.networksecurity.v1.MirroringDeployment.State|keyof typeof google.cloud.networksecurity.v1.MirroringDeployment.State); + + /** + * Creates a new Deployment instance using the specified properties. + * @param [properties] Properties to set + * @returns Deployment instance + */ + public static create(properties?: google.cloud.networksecurity.v1.MirroringDeploymentGroup.IDeployment): google.cloud.networksecurity.v1.MirroringDeploymentGroup.Deployment; + + /** + * Encodes the specified Deployment message. Does not implicitly {@link google.cloud.networksecurity.v1.MirroringDeploymentGroup.Deployment.verify|verify} messages. + * @param message Deployment message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.networksecurity.v1.MirroringDeploymentGroup.IDeployment, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Deployment message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.MirroringDeploymentGroup.Deployment.verify|verify} messages. + * @param message Deployment message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.networksecurity.v1.MirroringDeploymentGroup.IDeployment, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Deployment message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Deployment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.networksecurity.v1.MirroringDeploymentGroup.Deployment; + + /** + * Decodes a Deployment message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Deployment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.networksecurity.v1.MirroringDeploymentGroup.Deployment; + + /** + * Verifies a Deployment message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Deployment message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Deployment + */ + public static fromObject(object: { [k: string]: any }): google.cloud.networksecurity.v1.MirroringDeploymentGroup.Deployment; + + /** + * Creates a plain object from a Deployment message. Also converts values to other types if specified. + * @param message Deployment + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.networksecurity.v1.MirroringDeploymentGroup.Deployment, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Deployment to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Deployment + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** State enum. */ + enum State { + STATE_UNSPECIFIED = 0, + ACTIVE = 1, + CREATING = 2, + DELETING = 3, + CLOSED = 4 + } + } + + /** Properties of a ListMirroringDeploymentGroupsRequest. */ + interface IListMirroringDeploymentGroupsRequest { + + /** ListMirroringDeploymentGroupsRequest parent */ + parent?: (string|null); + + /** ListMirroringDeploymentGroupsRequest pageSize */ + pageSize?: (number|null); + + /** ListMirroringDeploymentGroupsRequest pageToken */ + pageToken?: (string|null); + + /** ListMirroringDeploymentGroupsRequest filter */ + filter?: (string|null); + + /** ListMirroringDeploymentGroupsRequest orderBy */ + orderBy?: (string|null); + } + + /** Represents a ListMirroringDeploymentGroupsRequest. */ + class ListMirroringDeploymentGroupsRequest implements IListMirroringDeploymentGroupsRequest { + + /** + * Constructs a new ListMirroringDeploymentGroupsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.networksecurity.v1.IListMirroringDeploymentGroupsRequest); + + /** ListMirroringDeploymentGroupsRequest parent. */ + public parent: string; + + /** ListMirroringDeploymentGroupsRequest pageSize. */ + public pageSize: number; + + /** ListMirroringDeploymentGroupsRequest pageToken. */ + public pageToken: string; + + /** ListMirroringDeploymentGroupsRequest filter. */ + public filter: string; + + /** ListMirroringDeploymentGroupsRequest orderBy. */ + public orderBy: string; + + /** + * Creates a new ListMirroringDeploymentGroupsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListMirroringDeploymentGroupsRequest instance + */ + public static create(properties?: google.cloud.networksecurity.v1.IListMirroringDeploymentGroupsRequest): google.cloud.networksecurity.v1.ListMirroringDeploymentGroupsRequest; + + /** + * Encodes the specified ListMirroringDeploymentGroupsRequest message. Does not implicitly {@link google.cloud.networksecurity.v1.ListMirroringDeploymentGroupsRequest.verify|verify} messages. + * @param message ListMirroringDeploymentGroupsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.networksecurity.v1.IListMirroringDeploymentGroupsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListMirroringDeploymentGroupsRequest message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.ListMirroringDeploymentGroupsRequest.verify|verify} messages. + * @param message ListMirroringDeploymentGroupsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.networksecurity.v1.IListMirroringDeploymentGroupsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListMirroringDeploymentGroupsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListMirroringDeploymentGroupsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.networksecurity.v1.ListMirroringDeploymentGroupsRequest; + + /** + * Decodes a ListMirroringDeploymentGroupsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListMirroringDeploymentGroupsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.networksecurity.v1.ListMirroringDeploymentGroupsRequest; + + /** + * Verifies a ListMirroringDeploymentGroupsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListMirroringDeploymentGroupsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListMirroringDeploymentGroupsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.networksecurity.v1.ListMirroringDeploymentGroupsRequest; + + /** + * Creates a plain object from a ListMirroringDeploymentGroupsRequest message. Also converts values to other types if specified. + * @param message ListMirroringDeploymentGroupsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.networksecurity.v1.ListMirroringDeploymentGroupsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListMirroringDeploymentGroupsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListMirroringDeploymentGroupsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListMirroringDeploymentGroupsResponse. */ + interface IListMirroringDeploymentGroupsResponse { + + /** ListMirroringDeploymentGroupsResponse mirroringDeploymentGroups */ + mirroringDeploymentGroups?: (google.cloud.networksecurity.v1.IMirroringDeploymentGroup[]|null); + + /** ListMirroringDeploymentGroupsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListMirroringDeploymentGroupsResponse. */ + class ListMirroringDeploymentGroupsResponse implements IListMirroringDeploymentGroupsResponse { + + /** + * Constructs a new ListMirroringDeploymentGroupsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.networksecurity.v1.IListMirroringDeploymentGroupsResponse); + + /** ListMirroringDeploymentGroupsResponse mirroringDeploymentGroups. */ + public mirroringDeploymentGroups: google.cloud.networksecurity.v1.IMirroringDeploymentGroup[]; + + /** ListMirroringDeploymentGroupsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListMirroringDeploymentGroupsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListMirroringDeploymentGroupsResponse instance + */ + public static create(properties?: google.cloud.networksecurity.v1.IListMirroringDeploymentGroupsResponse): google.cloud.networksecurity.v1.ListMirroringDeploymentGroupsResponse; + + /** + * Encodes the specified ListMirroringDeploymentGroupsResponse message. Does not implicitly {@link google.cloud.networksecurity.v1.ListMirroringDeploymentGroupsResponse.verify|verify} messages. + * @param message ListMirroringDeploymentGroupsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.networksecurity.v1.IListMirroringDeploymentGroupsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListMirroringDeploymentGroupsResponse message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.ListMirroringDeploymentGroupsResponse.verify|verify} messages. + * @param message ListMirroringDeploymentGroupsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.networksecurity.v1.IListMirroringDeploymentGroupsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListMirroringDeploymentGroupsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListMirroringDeploymentGroupsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.networksecurity.v1.ListMirroringDeploymentGroupsResponse; + + /** + * Decodes a ListMirroringDeploymentGroupsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListMirroringDeploymentGroupsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.networksecurity.v1.ListMirroringDeploymentGroupsResponse; + + /** + * Verifies a ListMirroringDeploymentGroupsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListMirroringDeploymentGroupsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListMirroringDeploymentGroupsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.networksecurity.v1.ListMirroringDeploymentGroupsResponse; + + /** + * Creates a plain object from a ListMirroringDeploymentGroupsResponse message. Also converts values to other types if specified. + * @param message ListMirroringDeploymentGroupsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.networksecurity.v1.ListMirroringDeploymentGroupsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListMirroringDeploymentGroupsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListMirroringDeploymentGroupsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetMirroringDeploymentGroupRequest. */ + interface IGetMirroringDeploymentGroupRequest { + + /** GetMirroringDeploymentGroupRequest name */ + name?: (string|null); + } + + /** Represents a GetMirroringDeploymentGroupRequest. */ + class GetMirroringDeploymentGroupRequest implements IGetMirroringDeploymentGroupRequest { + + /** + * Constructs a new GetMirroringDeploymentGroupRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.networksecurity.v1.IGetMirroringDeploymentGroupRequest); + + /** GetMirroringDeploymentGroupRequest name. */ + public name: string; + + /** + * Creates a new GetMirroringDeploymentGroupRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetMirroringDeploymentGroupRequest instance + */ + public static create(properties?: google.cloud.networksecurity.v1.IGetMirroringDeploymentGroupRequest): google.cloud.networksecurity.v1.GetMirroringDeploymentGroupRequest; + + /** + * Encodes the specified GetMirroringDeploymentGroupRequest message. Does not implicitly {@link google.cloud.networksecurity.v1.GetMirroringDeploymentGroupRequest.verify|verify} messages. + * @param message GetMirroringDeploymentGroupRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.networksecurity.v1.IGetMirroringDeploymentGroupRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetMirroringDeploymentGroupRequest message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.GetMirroringDeploymentGroupRequest.verify|verify} messages. + * @param message GetMirroringDeploymentGroupRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.networksecurity.v1.IGetMirroringDeploymentGroupRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetMirroringDeploymentGroupRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetMirroringDeploymentGroupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.networksecurity.v1.GetMirroringDeploymentGroupRequest; + + /** + * Decodes a GetMirroringDeploymentGroupRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetMirroringDeploymentGroupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.networksecurity.v1.GetMirroringDeploymentGroupRequest; + + /** + * Verifies a GetMirroringDeploymentGroupRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetMirroringDeploymentGroupRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetMirroringDeploymentGroupRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.networksecurity.v1.GetMirroringDeploymentGroupRequest; + + /** + * Creates a plain object from a GetMirroringDeploymentGroupRequest message. Also converts values to other types if specified. + * @param message GetMirroringDeploymentGroupRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.networksecurity.v1.GetMirroringDeploymentGroupRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetMirroringDeploymentGroupRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetMirroringDeploymentGroupRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateMirroringDeploymentGroupRequest. */ + interface ICreateMirroringDeploymentGroupRequest { + + /** CreateMirroringDeploymentGroupRequest parent */ + parent?: (string|null); + + /** CreateMirroringDeploymentGroupRequest mirroringDeploymentGroupId */ + mirroringDeploymentGroupId?: (string|null); + + /** CreateMirroringDeploymentGroupRequest mirroringDeploymentGroup */ + mirroringDeploymentGroup?: (google.cloud.networksecurity.v1.IMirroringDeploymentGroup|null); + + /** CreateMirroringDeploymentGroupRequest requestId */ + requestId?: (string|null); + } + + /** Represents a CreateMirroringDeploymentGroupRequest. */ + class CreateMirroringDeploymentGroupRequest implements ICreateMirroringDeploymentGroupRequest { + + /** + * Constructs a new CreateMirroringDeploymentGroupRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.networksecurity.v1.ICreateMirroringDeploymentGroupRequest); + + /** CreateMirroringDeploymentGroupRequest parent. */ + public parent: string; + + /** CreateMirroringDeploymentGroupRequest mirroringDeploymentGroupId. */ + public mirroringDeploymentGroupId: string; + + /** CreateMirroringDeploymentGroupRequest mirroringDeploymentGroup. */ + public mirroringDeploymentGroup?: (google.cloud.networksecurity.v1.IMirroringDeploymentGroup|null); + + /** CreateMirroringDeploymentGroupRequest requestId. */ + public requestId: string; + + /** + * Creates a new CreateMirroringDeploymentGroupRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateMirroringDeploymentGroupRequest instance + */ + public static create(properties?: google.cloud.networksecurity.v1.ICreateMirroringDeploymentGroupRequest): google.cloud.networksecurity.v1.CreateMirroringDeploymentGroupRequest; + + /** + * Encodes the specified CreateMirroringDeploymentGroupRequest message. Does not implicitly {@link google.cloud.networksecurity.v1.CreateMirroringDeploymentGroupRequest.verify|verify} messages. + * @param message CreateMirroringDeploymentGroupRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.networksecurity.v1.ICreateMirroringDeploymentGroupRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateMirroringDeploymentGroupRequest message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.CreateMirroringDeploymentGroupRequest.verify|verify} messages. + * @param message CreateMirroringDeploymentGroupRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.networksecurity.v1.ICreateMirroringDeploymentGroupRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateMirroringDeploymentGroupRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateMirroringDeploymentGroupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.networksecurity.v1.CreateMirroringDeploymentGroupRequest; + + /** + * Decodes a CreateMirroringDeploymentGroupRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateMirroringDeploymentGroupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.networksecurity.v1.CreateMirroringDeploymentGroupRequest; + + /** + * Verifies a CreateMirroringDeploymentGroupRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateMirroringDeploymentGroupRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateMirroringDeploymentGroupRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.networksecurity.v1.CreateMirroringDeploymentGroupRequest; + + /** + * Creates a plain object from a CreateMirroringDeploymentGroupRequest message. Also converts values to other types if specified. + * @param message CreateMirroringDeploymentGroupRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.networksecurity.v1.CreateMirroringDeploymentGroupRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateMirroringDeploymentGroupRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateMirroringDeploymentGroupRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateMirroringDeploymentGroupRequest. */ + interface IUpdateMirroringDeploymentGroupRequest { + + /** UpdateMirroringDeploymentGroupRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateMirroringDeploymentGroupRequest mirroringDeploymentGroup */ + mirroringDeploymentGroup?: (google.cloud.networksecurity.v1.IMirroringDeploymentGroup|null); + + /** UpdateMirroringDeploymentGroupRequest requestId */ + requestId?: (string|null); + } + + /** Represents an UpdateMirroringDeploymentGroupRequest. */ + class UpdateMirroringDeploymentGroupRequest implements IUpdateMirroringDeploymentGroupRequest { + + /** + * Constructs a new UpdateMirroringDeploymentGroupRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.networksecurity.v1.IUpdateMirroringDeploymentGroupRequest); + + /** UpdateMirroringDeploymentGroupRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateMirroringDeploymentGroupRequest mirroringDeploymentGroup. */ + public mirroringDeploymentGroup?: (google.cloud.networksecurity.v1.IMirroringDeploymentGroup|null); + + /** UpdateMirroringDeploymentGroupRequest requestId. */ + public requestId: string; + + /** + * Creates a new UpdateMirroringDeploymentGroupRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateMirroringDeploymentGroupRequest instance + */ + public static create(properties?: google.cloud.networksecurity.v1.IUpdateMirroringDeploymentGroupRequest): google.cloud.networksecurity.v1.UpdateMirroringDeploymentGroupRequest; + + /** + * Encodes the specified UpdateMirroringDeploymentGroupRequest message. Does not implicitly {@link google.cloud.networksecurity.v1.UpdateMirroringDeploymentGroupRequest.verify|verify} messages. + * @param message UpdateMirroringDeploymentGroupRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.networksecurity.v1.IUpdateMirroringDeploymentGroupRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateMirroringDeploymentGroupRequest message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.UpdateMirroringDeploymentGroupRequest.verify|verify} messages. + * @param message UpdateMirroringDeploymentGroupRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.networksecurity.v1.IUpdateMirroringDeploymentGroupRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateMirroringDeploymentGroupRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateMirroringDeploymentGroupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.networksecurity.v1.UpdateMirroringDeploymentGroupRequest; + + /** + * Decodes an UpdateMirroringDeploymentGroupRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateMirroringDeploymentGroupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.networksecurity.v1.UpdateMirroringDeploymentGroupRequest; + + /** + * Verifies an UpdateMirroringDeploymentGroupRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UpdateMirroringDeploymentGroupRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateMirroringDeploymentGroupRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.networksecurity.v1.UpdateMirroringDeploymentGroupRequest; + + /** + * Creates a plain object from an UpdateMirroringDeploymentGroupRequest message. Also converts values to other types if specified. + * @param message UpdateMirroringDeploymentGroupRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.networksecurity.v1.UpdateMirroringDeploymentGroupRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateMirroringDeploymentGroupRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateMirroringDeploymentGroupRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteMirroringDeploymentGroupRequest. */ + interface IDeleteMirroringDeploymentGroupRequest { + + /** DeleteMirroringDeploymentGroupRequest name */ + name?: (string|null); + + /** DeleteMirroringDeploymentGroupRequest requestId */ + requestId?: (string|null); + } + + /** Represents a DeleteMirroringDeploymentGroupRequest. */ + class DeleteMirroringDeploymentGroupRequest implements IDeleteMirroringDeploymentGroupRequest { + + /** + * Constructs a new DeleteMirroringDeploymentGroupRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.networksecurity.v1.IDeleteMirroringDeploymentGroupRequest); + + /** DeleteMirroringDeploymentGroupRequest name. */ + public name: string; + + /** DeleteMirroringDeploymentGroupRequest requestId. */ + public requestId: string; + + /** + * Creates a new DeleteMirroringDeploymentGroupRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteMirroringDeploymentGroupRequest instance + */ + public static create(properties?: google.cloud.networksecurity.v1.IDeleteMirroringDeploymentGroupRequest): google.cloud.networksecurity.v1.DeleteMirroringDeploymentGroupRequest; + + /** + * Encodes the specified DeleteMirroringDeploymentGroupRequest message. Does not implicitly {@link google.cloud.networksecurity.v1.DeleteMirroringDeploymentGroupRequest.verify|verify} messages. + * @param message DeleteMirroringDeploymentGroupRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.networksecurity.v1.IDeleteMirroringDeploymentGroupRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteMirroringDeploymentGroupRequest message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.DeleteMirroringDeploymentGroupRequest.verify|verify} messages. + * @param message DeleteMirroringDeploymentGroupRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.networksecurity.v1.IDeleteMirroringDeploymentGroupRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteMirroringDeploymentGroupRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteMirroringDeploymentGroupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.networksecurity.v1.DeleteMirroringDeploymentGroupRequest; + + /** + * Decodes a DeleteMirroringDeploymentGroupRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteMirroringDeploymentGroupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.networksecurity.v1.DeleteMirroringDeploymentGroupRequest; + + /** + * Verifies a DeleteMirroringDeploymentGroupRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteMirroringDeploymentGroupRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteMirroringDeploymentGroupRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.networksecurity.v1.DeleteMirroringDeploymentGroupRequest; + + /** + * Creates a plain object from a DeleteMirroringDeploymentGroupRequest message. Also converts values to other types if specified. + * @param message DeleteMirroringDeploymentGroupRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.networksecurity.v1.DeleteMirroringDeploymentGroupRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteMirroringDeploymentGroupRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteMirroringDeploymentGroupRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a MirroringDeployment. */ + interface IMirroringDeployment { + + /** MirroringDeployment name */ + name?: (string|null); + + /** MirroringDeployment createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** MirroringDeployment updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** MirroringDeployment labels */ + labels?: ({ [k: string]: string }|null); + + /** MirroringDeployment forwardingRule */ + forwardingRule?: (string|null); + + /** MirroringDeployment mirroringDeploymentGroup */ + mirroringDeploymentGroup?: (string|null); + + /** MirroringDeployment state */ + state?: (google.cloud.networksecurity.v1.MirroringDeployment.State|keyof typeof google.cloud.networksecurity.v1.MirroringDeployment.State|null); + + /** MirroringDeployment reconciling */ + reconciling?: (boolean|null); + + /** MirroringDeployment description */ + description?: (string|null); + } + + /** Represents a MirroringDeployment. */ + class MirroringDeployment implements IMirroringDeployment { + + /** + * Constructs a new MirroringDeployment. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.networksecurity.v1.IMirroringDeployment); + + /** MirroringDeployment name. */ + public name: string; + + /** MirroringDeployment createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** MirroringDeployment updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** MirroringDeployment labels. */ + public labels: { [k: string]: string }; + + /** MirroringDeployment forwardingRule. */ + public forwardingRule: string; + + /** MirroringDeployment mirroringDeploymentGroup. */ + public mirroringDeploymentGroup: string; + + /** MirroringDeployment state. */ + public state: (google.cloud.networksecurity.v1.MirroringDeployment.State|keyof typeof google.cloud.networksecurity.v1.MirroringDeployment.State); + + /** MirroringDeployment reconciling. */ + public reconciling: boolean; + + /** MirroringDeployment description. */ + public description: string; + + /** + * Creates a new MirroringDeployment instance using the specified properties. + * @param [properties] Properties to set + * @returns MirroringDeployment instance + */ + public static create(properties?: google.cloud.networksecurity.v1.IMirroringDeployment): google.cloud.networksecurity.v1.MirroringDeployment; + + /** + * Encodes the specified MirroringDeployment message. Does not implicitly {@link google.cloud.networksecurity.v1.MirroringDeployment.verify|verify} messages. + * @param message MirroringDeployment message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.networksecurity.v1.IMirroringDeployment, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MirroringDeployment message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.MirroringDeployment.verify|verify} messages. + * @param message MirroringDeployment message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.networksecurity.v1.IMirroringDeployment, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MirroringDeployment message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MirroringDeployment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.networksecurity.v1.MirroringDeployment; + + /** + * Decodes a MirroringDeployment message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MirroringDeployment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.networksecurity.v1.MirroringDeployment; + + /** + * Verifies a MirroringDeployment message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MirroringDeployment message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MirroringDeployment + */ + public static fromObject(object: { [k: string]: any }): google.cloud.networksecurity.v1.MirroringDeployment; + + /** + * Creates a plain object from a MirroringDeployment message. Also converts values to other types if specified. + * @param message MirroringDeployment + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.networksecurity.v1.MirroringDeployment, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MirroringDeployment to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MirroringDeployment + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace MirroringDeployment { + + /** State enum. */ + enum State { + STATE_UNSPECIFIED = 0, + ACTIVE = 1, + CREATING = 2, + DELETING = 3, + OUT_OF_SYNC = 4, + DELETE_FAILED = 5 + } + } + + /** Properties of a ListMirroringDeploymentsRequest. */ + interface IListMirroringDeploymentsRequest { + + /** ListMirroringDeploymentsRequest parent */ + parent?: (string|null); + + /** ListMirroringDeploymentsRequest pageSize */ + pageSize?: (number|null); + + /** ListMirroringDeploymentsRequest pageToken */ + pageToken?: (string|null); + + /** ListMirroringDeploymentsRequest filter */ + filter?: (string|null); + + /** ListMirroringDeploymentsRequest orderBy */ + orderBy?: (string|null); + } + + /** Represents a ListMirroringDeploymentsRequest. */ + class ListMirroringDeploymentsRequest implements IListMirroringDeploymentsRequest { + + /** + * Constructs a new ListMirroringDeploymentsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.networksecurity.v1.IListMirroringDeploymentsRequest); + + /** ListMirroringDeploymentsRequest parent. */ + public parent: string; + + /** ListMirroringDeploymentsRequest pageSize. */ + public pageSize: number; + + /** ListMirroringDeploymentsRequest pageToken. */ + public pageToken: string; + + /** ListMirroringDeploymentsRequest filter. */ + public filter: string; + + /** ListMirroringDeploymentsRequest orderBy. */ + public orderBy: string; + + /** + * Creates a new ListMirroringDeploymentsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListMirroringDeploymentsRequest instance + */ + public static create(properties?: google.cloud.networksecurity.v1.IListMirroringDeploymentsRequest): google.cloud.networksecurity.v1.ListMirroringDeploymentsRequest; + + /** + * Encodes the specified ListMirroringDeploymentsRequest message. Does not implicitly {@link google.cloud.networksecurity.v1.ListMirroringDeploymentsRequest.verify|verify} messages. + * @param message ListMirroringDeploymentsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.networksecurity.v1.IListMirroringDeploymentsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListMirroringDeploymentsRequest message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.ListMirroringDeploymentsRequest.verify|verify} messages. + * @param message ListMirroringDeploymentsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.networksecurity.v1.IListMirroringDeploymentsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListMirroringDeploymentsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListMirroringDeploymentsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.networksecurity.v1.ListMirroringDeploymentsRequest; + + /** + * Decodes a ListMirroringDeploymentsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListMirroringDeploymentsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.networksecurity.v1.ListMirroringDeploymentsRequest; + + /** + * Verifies a ListMirroringDeploymentsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListMirroringDeploymentsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListMirroringDeploymentsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.networksecurity.v1.ListMirroringDeploymentsRequest; + + /** + * Creates a plain object from a ListMirroringDeploymentsRequest message. Also converts values to other types if specified. + * @param message ListMirroringDeploymentsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.networksecurity.v1.ListMirroringDeploymentsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListMirroringDeploymentsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListMirroringDeploymentsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListMirroringDeploymentsResponse. */ + interface IListMirroringDeploymentsResponse { + + /** ListMirroringDeploymentsResponse mirroringDeployments */ + mirroringDeployments?: (google.cloud.networksecurity.v1.IMirroringDeployment[]|null); + + /** ListMirroringDeploymentsResponse nextPageToken */ + nextPageToken?: (string|null); + + /** ListMirroringDeploymentsResponse unreachable */ + unreachable?: (string[]|null); + } + + /** Represents a ListMirroringDeploymentsResponse. */ + class ListMirroringDeploymentsResponse implements IListMirroringDeploymentsResponse { + + /** + * Constructs a new ListMirroringDeploymentsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.networksecurity.v1.IListMirroringDeploymentsResponse); + + /** ListMirroringDeploymentsResponse mirroringDeployments. */ + public mirroringDeployments: google.cloud.networksecurity.v1.IMirroringDeployment[]; + + /** ListMirroringDeploymentsResponse nextPageToken. */ + public nextPageToken: string; + + /** ListMirroringDeploymentsResponse unreachable. */ + public unreachable: string[]; + + /** + * Creates a new ListMirroringDeploymentsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListMirroringDeploymentsResponse instance + */ + public static create(properties?: google.cloud.networksecurity.v1.IListMirroringDeploymentsResponse): google.cloud.networksecurity.v1.ListMirroringDeploymentsResponse; + + /** + * Encodes the specified ListMirroringDeploymentsResponse message. Does not implicitly {@link google.cloud.networksecurity.v1.ListMirroringDeploymentsResponse.verify|verify} messages. + * @param message ListMirroringDeploymentsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.networksecurity.v1.IListMirroringDeploymentsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListMirroringDeploymentsResponse message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.ListMirroringDeploymentsResponse.verify|verify} messages. + * @param message ListMirroringDeploymentsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.networksecurity.v1.IListMirroringDeploymentsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListMirroringDeploymentsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListMirroringDeploymentsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.networksecurity.v1.ListMirroringDeploymentsResponse; + + /** + * Decodes a ListMirroringDeploymentsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListMirroringDeploymentsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.networksecurity.v1.ListMirroringDeploymentsResponse; + + /** + * Verifies a ListMirroringDeploymentsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListMirroringDeploymentsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListMirroringDeploymentsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.networksecurity.v1.ListMirroringDeploymentsResponse; + + /** + * Creates a plain object from a ListMirroringDeploymentsResponse message. Also converts values to other types if specified. + * @param message ListMirroringDeploymentsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.networksecurity.v1.ListMirroringDeploymentsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListMirroringDeploymentsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListMirroringDeploymentsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetMirroringDeploymentRequest. */ + interface IGetMirroringDeploymentRequest { + + /** GetMirroringDeploymentRequest name */ + name?: (string|null); + } + + /** Represents a GetMirroringDeploymentRequest. */ + class GetMirroringDeploymentRequest implements IGetMirroringDeploymentRequest { + + /** + * Constructs a new GetMirroringDeploymentRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.networksecurity.v1.IGetMirroringDeploymentRequest); + + /** GetMirroringDeploymentRequest name. */ + public name: string; + + /** + * Creates a new GetMirroringDeploymentRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetMirroringDeploymentRequest instance + */ + public static create(properties?: google.cloud.networksecurity.v1.IGetMirroringDeploymentRequest): google.cloud.networksecurity.v1.GetMirroringDeploymentRequest; + + /** + * Encodes the specified GetMirroringDeploymentRequest message. Does not implicitly {@link google.cloud.networksecurity.v1.GetMirroringDeploymentRequest.verify|verify} messages. + * @param message GetMirroringDeploymentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.networksecurity.v1.IGetMirroringDeploymentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetMirroringDeploymentRequest message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.GetMirroringDeploymentRequest.verify|verify} messages. + * @param message GetMirroringDeploymentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.networksecurity.v1.IGetMirroringDeploymentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetMirroringDeploymentRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetMirroringDeploymentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.networksecurity.v1.GetMirroringDeploymentRequest; + + /** + * Decodes a GetMirroringDeploymentRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetMirroringDeploymentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.networksecurity.v1.GetMirroringDeploymentRequest; + + /** + * Verifies a GetMirroringDeploymentRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetMirroringDeploymentRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetMirroringDeploymentRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.networksecurity.v1.GetMirroringDeploymentRequest; + + /** + * Creates a plain object from a GetMirroringDeploymentRequest message. Also converts values to other types if specified. + * @param message GetMirroringDeploymentRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.networksecurity.v1.GetMirroringDeploymentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetMirroringDeploymentRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetMirroringDeploymentRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateMirroringDeploymentRequest. */ + interface ICreateMirroringDeploymentRequest { + + /** CreateMirroringDeploymentRequest parent */ + parent?: (string|null); + + /** CreateMirroringDeploymentRequest mirroringDeploymentId */ + mirroringDeploymentId?: (string|null); + + /** CreateMirroringDeploymentRequest mirroringDeployment */ + mirroringDeployment?: (google.cloud.networksecurity.v1.IMirroringDeployment|null); + + /** CreateMirroringDeploymentRequest requestId */ + requestId?: (string|null); + } + + /** Represents a CreateMirroringDeploymentRequest. */ + class CreateMirroringDeploymentRequest implements ICreateMirroringDeploymentRequest { + + /** + * Constructs a new CreateMirroringDeploymentRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.networksecurity.v1.ICreateMirroringDeploymentRequest); + + /** CreateMirroringDeploymentRequest parent. */ + public parent: string; + + /** CreateMirroringDeploymentRequest mirroringDeploymentId. */ + public mirroringDeploymentId: string; + + /** CreateMirroringDeploymentRequest mirroringDeployment. */ + public mirroringDeployment?: (google.cloud.networksecurity.v1.IMirroringDeployment|null); + + /** CreateMirroringDeploymentRequest requestId. */ + public requestId: string; + + /** + * Creates a new CreateMirroringDeploymentRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateMirroringDeploymentRequest instance + */ + public static create(properties?: google.cloud.networksecurity.v1.ICreateMirroringDeploymentRequest): google.cloud.networksecurity.v1.CreateMirroringDeploymentRequest; + + /** + * Encodes the specified CreateMirroringDeploymentRequest message. Does not implicitly {@link google.cloud.networksecurity.v1.CreateMirroringDeploymentRequest.verify|verify} messages. + * @param message CreateMirroringDeploymentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.networksecurity.v1.ICreateMirroringDeploymentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateMirroringDeploymentRequest message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.CreateMirroringDeploymentRequest.verify|verify} messages. + * @param message CreateMirroringDeploymentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.networksecurity.v1.ICreateMirroringDeploymentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateMirroringDeploymentRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateMirroringDeploymentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.networksecurity.v1.CreateMirroringDeploymentRequest; + + /** + * Decodes a CreateMirroringDeploymentRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateMirroringDeploymentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.networksecurity.v1.CreateMirroringDeploymentRequest; + + /** + * Verifies a CreateMirroringDeploymentRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateMirroringDeploymentRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateMirroringDeploymentRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.networksecurity.v1.CreateMirroringDeploymentRequest; + + /** + * Creates a plain object from a CreateMirroringDeploymentRequest message. Also converts values to other types if specified. + * @param message CreateMirroringDeploymentRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.networksecurity.v1.CreateMirroringDeploymentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateMirroringDeploymentRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateMirroringDeploymentRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateMirroringDeploymentRequest. */ + interface IUpdateMirroringDeploymentRequest { + + /** UpdateMirroringDeploymentRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateMirroringDeploymentRequest mirroringDeployment */ + mirroringDeployment?: (google.cloud.networksecurity.v1.IMirroringDeployment|null); + + /** UpdateMirroringDeploymentRequest requestId */ + requestId?: (string|null); + } + + /** Represents an UpdateMirroringDeploymentRequest. */ + class UpdateMirroringDeploymentRequest implements IUpdateMirroringDeploymentRequest { + + /** + * Constructs a new UpdateMirroringDeploymentRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.networksecurity.v1.IUpdateMirroringDeploymentRequest); + + /** UpdateMirroringDeploymentRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateMirroringDeploymentRequest mirroringDeployment. */ + public mirroringDeployment?: (google.cloud.networksecurity.v1.IMirroringDeployment|null); + + /** UpdateMirroringDeploymentRequest requestId. */ + public requestId: string; + + /** + * Creates a new UpdateMirroringDeploymentRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateMirroringDeploymentRequest instance + */ + public static create(properties?: google.cloud.networksecurity.v1.IUpdateMirroringDeploymentRequest): google.cloud.networksecurity.v1.UpdateMirroringDeploymentRequest; + + /** + * Encodes the specified UpdateMirroringDeploymentRequest message. Does not implicitly {@link google.cloud.networksecurity.v1.UpdateMirroringDeploymentRequest.verify|verify} messages. + * @param message UpdateMirroringDeploymentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.networksecurity.v1.IUpdateMirroringDeploymentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateMirroringDeploymentRequest message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.UpdateMirroringDeploymentRequest.verify|verify} messages. + * @param message UpdateMirroringDeploymentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.networksecurity.v1.IUpdateMirroringDeploymentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateMirroringDeploymentRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateMirroringDeploymentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.networksecurity.v1.UpdateMirroringDeploymentRequest; + + /** + * Decodes an UpdateMirroringDeploymentRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateMirroringDeploymentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.networksecurity.v1.UpdateMirroringDeploymentRequest; + + /** + * Verifies an UpdateMirroringDeploymentRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UpdateMirroringDeploymentRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateMirroringDeploymentRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.networksecurity.v1.UpdateMirroringDeploymentRequest; + + /** + * Creates a plain object from an UpdateMirroringDeploymentRequest message. Also converts values to other types if specified. + * @param message UpdateMirroringDeploymentRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.networksecurity.v1.UpdateMirroringDeploymentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateMirroringDeploymentRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateMirroringDeploymentRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteMirroringDeploymentRequest. */ + interface IDeleteMirroringDeploymentRequest { + + /** DeleteMirroringDeploymentRequest name */ + name?: (string|null); + + /** DeleteMirroringDeploymentRequest requestId */ + requestId?: (string|null); + } + + /** Represents a DeleteMirroringDeploymentRequest. */ + class DeleteMirroringDeploymentRequest implements IDeleteMirroringDeploymentRequest { + + /** + * Constructs a new DeleteMirroringDeploymentRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.networksecurity.v1.IDeleteMirroringDeploymentRequest); + + /** DeleteMirroringDeploymentRequest name. */ + public name: string; + + /** DeleteMirroringDeploymentRequest requestId. */ + public requestId: string; + + /** + * Creates a new DeleteMirroringDeploymentRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteMirroringDeploymentRequest instance + */ + public static create(properties?: google.cloud.networksecurity.v1.IDeleteMirroringDeploymentRequest): google.cloud.networksecurity.v1.DeleteMirroringDeploymentRequest; + + /** + * Encodes the specified DeleteMirroringDeploymentRequest message. Does not implicitly {@link google.cloud.networksecurity.v1.DeleteMirroringDeploymentRequest.verify|verify} messages. + * @param message DeleteMirroringDeploymentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.networksecurity.v1.IDeleteMirroringDeploymentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteMirroringDeploymentRequest message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.DeleteMirroringDeploymentRequest.verify|verify} messages. + * @param message DeleteMirroringDeploymentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.networksecurity.v1.IDeleteMirroringDeploymentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteMirroringDeploymentRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteMirroringDeploymentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.networksecurity.v1.DeleteMirroringDeploymentRequest; + + /** + * Decodes a DeleteMirroringDeploymentRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteMirroringDeploymentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.networksecurity.v1.DeleteMirroringDeploymentRequest; + + /** + * Verifies a DeleteMirroringDeploymentRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteMirroringDeploymentRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteMirroringDeploymentRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.networksecurity.v1.DeleteMirroringDeploymentRequest; + + /** + * Creates a plain object from a DeleteMirroringDeploymentRequest message. Also converts values to other types if specified. + * @param message DeleteMirroringDeploymentRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.networksecurity.v1.DeleteMirroringDeploymentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteMirroringDeploymentRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteMirroringDeploymentRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a MirroringLocation. */ + interface IMirroringLocation { + + /** MirroringLocation location */ + location?: (string|null); + + /** MirroringLocation state */ + state?: (google.cloud.networksecurity.v1.MirroringLocation.State|keyof typeof google.cloud.networksecurity.v1.MirroringLocation.State|null); + } + + /** Represents a MirroringLocation. */ + class MirroringLocation implements IMirroringLocation { + + /** + * Constructs a new MirroringLocation. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.networksecurity.v1.IMirroringLocation); + + /** MirroringLocation location. */ + public location: string; + + /** MirroringLocation state. */ + public state: (google.cloud.networksecurity.v1.MirroringLocation.State|keyof typeof google.cloud.networksecurity.v1.MirroringLocation.State); + + /** + * Creates a new MirroringLocation instance using the specified properties. + * @param [properties] Properties to set + * @returns MirroringLocation instance + */ + public static create(properties?: google.cloud.networksecurity.v1.IMirroringLocation): google.cloud.networksecurity.v1.MirroringLocation; + + /** + * Encodes the specified MirroringLocation message. Does not implicitly {@link google.cloud.networksecurity.v1.MirroringLocation.verify|verify} messages. + * @param message MirroringLocation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.networksecurity.v1.IMirroringLocation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MirroringLocation message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.MirroringLocation.verify|verify} messages. + * @param message MirroringLocation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.networksecurity.v1.IMirroringLocation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MirroringLocation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MirroringLocation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.networksecurity.v1.MirroringLocation; + + /** + * Decodes a MirroringLocation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MirroringLocation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.networksecurity.v1.MirroringLocation; + + /** + * Verifies a MirroringLocation message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MirroringLocation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MirroringLocation + */ + public static fromObject(object: { [k: string]: any }): google.cloud.networksecurity.v1.MirroringLocation; + + /** + * Creates a plain object from a MirroringLocation message. Also converts values to other types if specified. + * @param message MirroringLocation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.networksecurity.v1.MirroringLocation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MirroringLocation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MirroringLocation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace MirroringLocation { + + /** State enum. */ + enum State { + STATE_UNSPECIFIED = 0, + ACTIVE = 1, + OUT_OF_SYNC = 2 + } + } + + /** Represents a NetworkSecurity */ + class NetworkSecurity extends $protobuf.rpc.Service { + + /** + * Constructs a new NetworkSecurity service. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + */ + constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); + + /** + * Creates new NetworkSecurity service using the specified rpc implementation. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + * @returns RPC service. Useful where requests and/or responses are streamed. + */ + public static create(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean): NetworkSecurity; + + /** + * Calls ListAuthorizationPolicies. + * @param request ListAuthorizationPoliciesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListAuthorizationPoliciesResponse + */ + public listAuthorizationPolicies(request: google.cloud.networksecurity.v1.IListAuthorizationPoliciesRequest, callback: google.cloud.networksecurity.v1.NetworkSecurity.ListAuthorizationPoliciesCallback): void; + + /** + * Calls ListAuthorizationPolicies. + * @param request ListAuthorizationPoliciesRequest message or plain object + * @returns Promise + */ + public listAuthorizationPolicies(request: google.cloud.networksecurity.v1.IListAuthorizationPoliciesRequest): Promise; + + /** + * Calls GetAuthorizationPolicy. + * @param request GetAuthorizationPolicyRequest message or plain object + * @param callback Node-style callback called with the error, if any, and AuthorizationPolicy + */ + public getAuthorizationPolicy(request: google.cloud.networksecurity.v1.IGetAuthorizationPolicyRequest, callback: google.cloud.networksecurity.v1.NetworkSecurity.GetAuthorizationPolicyCallback): void; + + /** + * Calls GetAuthorizationPolicy. + * @param request GetAuthorizationPolicyRequest message or plain object + * @returns Promise + */ + public getAuthorizationPolicy(request: google.cloud.networksecurity.v1.IGetAuthorizationPolicyRequest): Promise; + + /** + * Calls CreateAuthorizationPolicy. + * @param request CreateAuthorizationPolicyRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public createAuthorizationPolicy(request: google.cloud.networksecurity.v1.ICreateAuthorizationPolicyRequest, callback: google.cloud.networksecurity.v1.NetworkSecurity.CreateAuthorizationPolicyCallback): void; + + /** + * Calls CreateAuthorizationPolicy. + * @param request CreateAuthorizationPolicyRequest message or plain object + * @returns Promise + */ + public createAuthorizationPolicy(request: google.cloud.networksecurity.v1.ICreateAuthorizationPolicyRequest): Promise; + + /** + * Calls UpdateAuthorizationPolicy. + * @param request UpdateAuthorizationPolicyRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public updateAuthorizationPolicy(request: google.cloud.networksecurity.v1.IUpdateAuthorizationPolicyRequest, callback: google.cloud.networksecurity.v1.NetworkSecurity.UpdateAuthorizationPolicyCallback): void; + + /** + * Calls UpdateAuthorizationPolicy. + * @param request UpdateAuthorizationPolicyRequest message or plain object + * @returns Promise + */ + public updateAuthorizationPolicy(request: google.cloud.networksecurity.v1.IUpdateAuthorizationPolicyRequest): Promise; + + /** + * Calls DeleteAuthorizationPolicy. + * @param request DeleteAuthorizationPolicyRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public deleteAuthorizationPolicy(request: google.cloud.networksecurity.v1.IDeleteAuthorizationPolicyRequest, callback: google.cloud.networksecurity.v1.NetworkSecurity.DeleteAuthorizationPolicyCallback): void; + + /** + * Calls DeleteAuthorizationPolicy. + * @param request DeleteAuthorizationPolicyRequest message or plain object + * @returns Promise + */ + public deleteAuthorizationPolicy(request: google.cloud.networksecurity.v1.IDeleteAuthorizationPolicyRequest): Promise; + + /** + * Calls ListBackendAuthenticationConfigs. + * @param request ListBackendAuthenticationConfigsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListBackendAuthenticationConfigsResponse + */ + public listBackendAuthenticationConfigs(request: google.cloud.networksecurity.v1.IListBackendAuthenticationConfigsRequest, callback: google.cloud.networksecurity.v1.NetworkSecurity.ListBackendAuthenticationConfigsCallback): void; + + /** + * Calls ListBackendAuthenticationConfigs. + * @param request ListBackendAuthenticationConfigsRequest message or plain object + * @returns Promise + */ + public listBackendAuthenticationConfigs(request: google.cloud.networksecurity.v1.IListBackendAuthenticationConfigsRequest): Promise; + + /** + * Calls GetBackendAuthenticationConfig. + * @param request GetBackendAuthenticationConfigRequest message or plain object + * @param callback Node-style callback called with the error, if any, and BackendAuthenticationConfig + */ + public getBackendAuthenticationConfig(request: google.cloud.networksecurity.v1.IGetBackendAuthenticationConfigRequest, callback: google.cloud.networksecurity.v1.NetworkSecurity.GetBackendAuthenticationConfigCallback): void; + + /** + * Calls GetBackendAuthenticationConfig. + * @param request GetBackendAuthenticationConfigRequest message or plain object + * @returns Promise + */ + public getBackendAuthenticationConfig(request: google.cloud.networksecurity.v1.IGetBackendAuthenticationConfigRequest): Promise; + + /** + * Calls CreateBackendAuthenticationConfig. + * @param request CreateBackendAuthenticationConfigRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public createBackendAuthenticationConfig(request: google.cloud.networksecurity.v1.ICreateBackendAuthenticationConfigRequest, callback: google.cloud.networksecurity.v1.NetworkSecurity.CreateBackendAuthenticationConfigCallback): void; + + /** + * Calls CreateBackendAuthenticationConfig. + * @param request CreateBackendAuthenticationConfigRequest message or plain object + * @returns Promise + */ + public createBackendAuthenticationConfig(request: google.cloud.networksecurity.v1.ICreateBackendAuthenticationConfigRequest): Promise; + + /** + * Calls UpdateBackendAuthenticationConfig. + * @param request UpdateBackendAuthenticationConfigRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public updateBackendAuthenticationConfig(request: google.cloud.networksecurity.v1.IUpdateBackendAuthenticationConfigRequest, callback: google.cloud.networksecurity.v1.NetworkSecurity.UpdateBackendAuthenticationConfigCallback): void; + + /** + * Calls UpdateBackendAuthenticationConfig. + * @param request UpdateBackendAuthenticationConfigRequest message or plain object + * @returns Promise + */ + public updateBackendAuthenticationConfig(request: google.cloud.networksecurity.v1.IUpdateBackendAuthenticationConfigRequest): Promise; + + /** + * Calls DeleteBackendAuthenticationConfig. + * @param request DeleteBackendAuthenticationConfigRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public deleteBackendAuthenticationConfig(request: google.cloud.networksecurity.v1.IDeleteBackendAuthenticationConfigRequest, callback: google.cloud.networksecurity.v1.NetworkSecurity.DeleteBackendAuthenticationConfigCallback): void; + + /** + * Calls DeleteBackendAuthenticationConfig. + * @param request DeleteBackendAuthenticationConfigRequest message or plain object + * @returns Promise + */ + public deleteBackendAuthenticationConfig(request: google.cloud.networksecurity.v1.IDeleteBackendAuthenticationConfigRequest): Promise; + + /** + * Calls ListServerTlsPolicies. + * @param request ListServerTlsPoliciesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListServerTlsPoliciesResponse + */ + public listServerTlsPolicies(request: google.cloud.networksecurity.v1.IListServerTlsPoliciesRequest, callback: google.cloud.networksecurity.v1.NetworkSecurity.ListServerTlsPoliciesCallback): void; + + /** + * Calls ListServerTlsPolicies. + * @param request ListServerTlsPoliciesRequest message or plain object + * @returns Promise + */ + public listServerTlsPolicies(request: google.cloud.networksecurity.v1.IListServerTlsPoliciesRequest): Promise; + + /** + * Calls GetServerTlsPolicy. + * @param request GetServerTlsPolicyRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ServerTlsPolicy + */ + public getServerTlsPolicy(request: google.cloud.networksecurity.v1.IGetServerTlsPolicyRequest, callback: google.cloud.networksecurity.v1.NetworkSecurity.GetServerTlsPolicyCallback): void; + + /** + * Calls GetServerTlsPolicy. + * @param request GetServerTlsPolicyRequest message or plain object + * @returns Promise + */ + public getServerTlsPolicy(request: google.cloud.networksecurity.v1.IGetServerTlsPolicyRequest): Promise; + + /** + * Calls CreateServerTlsPolicy. + * @param request CreateServerTlsPolicyRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public createServerTlsPolicy(request: google.cloud.networksecurity.v1.ICreateServerTlsPolicyRequest, callback: google.cloud.networksecurity.v1.NetworkSecurity.CreateServerTlsPolicyCallback): void; + + /** + * Calls CreateServerTlsPolicy. + * @param request CreateServerTlsPolicyRequest message or plain object + * @returns Promise + */ + public createServerTlsPolicy(request: google.cloud.networksecurity.v1.ICreateServerTlsPolicyRequest): Promise; + + /** + * Calls UpdateServerTlsPolicy. + * @param request UpdateServerTlsPolicyRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public updateServerTlsPolicy(request: google.cloud.networksecurity.v1.IUpdateServerTlsPolicyRequest, callback: google.cloud.networksecurity.v1.NetworkSecurity.UpdateServerTlsPolicyCallback): void; + + /** + * Calls UpdateServerTlsPolicy. + * @param request UpdateServerTlsPolicyRequest message or plain object + * @returns Promise + */ + public updateServerTlsPolicy(request: google.cloud.networksecurity.v1.IUpdateServerTlsPolicyRequest): Promise; + + /** + * Calls DeleteServerTlsPolicy. + * @param request DeleteServerTlsPolicyRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public deleteServerTlsPolicy(request: google.cloud.networksecurity.v1.IDeleteServerTlsPolicyRequest, callback: google.cloud.networksecurity.v1.NetworkSecurity.DeleteServerTlsPolicyCallback): void; + + /** + * Calls DeleteServerTlsPolicy. + * @param request DeleteServerTlsPolicyRequest message or plain object + * @returns Promise + */ + public deleteServerTlsPolicy(request: google.cloud.networksecurity.v1.IDeleteServerTlsPolicyRequest): Promise; + + /** + * Calls ListClientTlsPolicies. + * @param request ListClientTlsPoliciesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListClientTlsPoliciesResponse + */ + public listClientTlsPolicies(request: google.cloud.networksecurity.v1.IListClientTlsPoliciesRequest, callback: google.cloud.networksecurity.v1.NetworkSecurity.ListClientTlsPoliciesCallback): void; + + /** + * Calls ListClientTlsPolicies. + * @param request ListClientTlsPoliciesRequest message or plain object + * @returns Promise + */ + public listClientTlsPolicies(request: google.cloud.networksecurity.v1.IListClientTlsPoliciesRequest): Promise; + + /** + * Calls GetClientTlsPolicy. + * @param request GetClientTlsPolicyRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ClientTlsPolicy + */ + public getClientTlsPolicy(request: google.cloud.networksecurity.v1.IGetClientTlsPolicyRequest, callback: google.cloud.networksecurity.v1.NetworkSecurity.GetClientTlsPolicyCallback): void; + + /** + * Calls GetClientTlsPolicy. + * @param request GetClientTlsPolicyRequest message or plain object + * @returns Promise + */ + public getClientTlsPolicy(request: google.cloud.networksecurity.v1.IGetClientTlsPolicyRequest): Promise; + + /** + * Calls CreateClientTlsPolicy. + * @param request CreateClientTlsPolicyRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public createClientTlsPolicy(request: google.cloud.networksecurity.v1.ICreateClientTlsPolicyRequest, callback: google.cloud.networksecurity.v1.NetworkSecurity.CreateClientTlsPolicyCallback): void; + + /** + * Calls CreateClientTlsPolicy. + * @param request CreateClientTlsPolicyRequest message or plain object + * @returns Promise + */ + public createClientTlsPolicy(request: google.cloud.networksecurity.v1.ICreateClientTlsPolicyRequest): Promise; + + /** + * Calls UpdateClientTlsPolicy. + * @param request UpdateClientTlsPolicyRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public updateClientTlsPolicy(request: google.cloud.networksecurity.v1.IUpdateClientTlsPolicyRequest, callback: google.cloud.networksecurity.v1.NetworkSecurity.UpdateClientTlsPolicyCallback): void; + + /** + * Calls UpdateClientTlsPolicy. + * @param request UpdateClientTlsPolicyRequest message or plain object + * @returns Promise + */ + public updateClientTlsPolicy(request: google.cloud.networksecurity.v1.IUpdateClientTlsPolicyRequest): Promise; + + /** + * Calls DeleteClientTlsPolicy. + * @param request DeleteClientTlsPolicyRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public deleteClientTlsPolicy(request: google.cloud.networksecurity.v1.IDeleteClientTlsPolicyRequest, callback: google.cloud.networksecurity.v1.NetworkSecurity.DeleteClientTlsPolicyCallback): void; + + /** + * Calls DeleteClientTlsPolicy. + * @param request DeleteClientTlsPolicyRequest message or plain object + * @returns Promise + */ + public deleteClientTlsPolicy(request: google.cloud.networksecurity.v1.IDeleteClientTlsPolicyRequest): Promise; + + /** + * Calls ListGatewaySecurityPolicies. + * @param request ListGatewaySecurityPoliciesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListGatewaySecurityPoliciesResponse + */ + public listGatewaySecurityPolicies(request: google.cloud.networksecurity.v1.IListGatewaySecurityPoliciesRequest, callback: google.cloud.networksecurity.v1.NetworkSecurity.ListGatewaySecurityPoliciesCallback): void; + + /** + * Calls ListGatewaySecurityPolicies. + * @param request ListGatewaySecurityPoliciesRequest message or plain object + * @returns Promise + */ + public listGatewaySecurityPolicies(request: google.cloud.networksecurity.v1.IListGatewaySecurityPoliciesRequest): Promise; + + /** + * Calls GetGatewaySecurityPolicy. + * @param request GetGatewaySecurityPolicyRequest message or plain object + * @param callback Node-style callback called with the error, if any, and GatewaySecurityPolicy + */ + public getGatewaySecurityPolicy(request: google.cloud.networksecurity.v1.IGetGatewaySecurityPolicyRequest, callback: google.cloud.networksecurity.v1.NetworkSecurity.GetGatewaySecurityPolicyCallback): void; + + /** + * Calls GetGatewaySecurityPolicy. + * @param request GetGatewaySecurityPolicyRequest message or plain object + * @returns Promise + */ + public getGatewaySecurityPolicy(request: google.cloud.networksecurity.v1.IGetGatewaySecurityPolicyRequest): Promise; + + /** + * Calls CreateGatewaySecurityPolicy. + * @param request CreateGatewaySecurityPolicyRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public createGatewaySecurityPolicy(request: google.cloud.networksecurity.v1.ICreateGatewaySecurityPolicyRequest, callback: google.cloud.networksecurity.v1.NetworkSecurity.CreateGatewaySecurityPolicyCallback): void; + + /** + * Calls CreateGatewaySecurityPolicy. + * @param request CreateGatewaySecurityPolicyRequest message or plain object + * @returns Promise + */ + public createGatewaySecurityPolicy(request: google.cloud.networksecurity.v1.ICreateGatewaySecurityPolicyRequest): Promise; + + /** + * Calls UpdateGatewaySecurityPolicy. + * @param request UpdateGatewaySecurityPolicyRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public updateGatewaySecurityPolicy(request: google.cloud.networksecurity.v1.IUpdateGatewaySecurityPolicyRequest, callback: google.cloud.networksecurity.v1.NetworkSecurity.UpdateGatewaySecurityPolicyCallback): void; + + /** + * Calls UpdateGatewaySecurityPolicy. + * @param request UpdateGatewaySecurityPolicyRequest message or plain object + * @returns Promise + */ + public updateGatewaySecurityPolicy(request: google.cloud.networksecurity.v1.IUpdateGatewaySecurityPolicyRequest): Promise; + + /** + * Calls DeleteGatewaySecurityPolicy. + * @param request DeleteGatewaySecurityPolicyRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public deleteGatewaySecurityPolicy(request: google.cloud.networksecurity.v1.IDeleteGatewaySecurityPolicyRequest, callback: google.cloud.networksecurity.v1.NetworkSecurity.DeleteGatewaySecurityPolicyCallback): void; + + /** + * Calls DeleteGatewaySecurityPolicy. + * @param request DeleteGatewaySecurityPolicyRequest message or plain object + * @returns Promise + */ + public deleteGatewaySecurityPolicy(request: google.cloud.networksecurity.v1.IDeleteGatewaySecurityPolicyRequest): Promise; + + /** + * Calls ListGatewaySecurityPolicyRules. + * @param request ListGatewaySecurityPolicyRulesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListGatewaySecurityPolicyRulesResponse + */ + public listGatewaySecurityPolicyRules(request: google.cloud.networksecurity.v1.IListGatewaySecurityPolicyRulesRequest, callback: google.cloud.networksecurity.v1.NetworkSecurity.ListGatewaySecurityPolicyRulesCallback): void; + + /** + * Calls ListGatewaySecurityPolicyRules. + * @param request ListGatewaySecurityPolicyRulesRequest message or plain object + * @returns Promise + */ + public listGatewaySecurityPolicyRules(request: google.cloud.networksecurity.v1.IListGatewaySecurityPolicyRulesRequest): Promise; + + /** + * Calls GetGatewaySecurityPolicyRule. + * @param request GetGatewaySecurityPolicyRuleRequest message or plain object + * @param callback Node-style callback called with the error, if any, and GatewaySecurityPolicyRule + */ + public getGatewaySecurityPolicyRule(request: google.cloud.networksecurity.v1.IGetGatewaySecurityPolicyRuleRequest, callback: google.cloud.networksecurity.v1.NetworkSecurity.GetGatewaySecurityPolicyRuleCallback): void; + + /** + * Calls GetGatewaySecurityPolicyRule. + * @param request GetGatewaySecurityPolicyRuleRequest message or plain object + * @returns Promise + */ + public getGatewaySecurityPolicyRule(request: google.cloud.networksecurity.v1.IGetGatewaySecurityPolicyRuleRequest): Promise; + + /** + * Calls CreateGatewaySecurityPolicyRule. + * @param request CreateGatewaySecurityPolicyRuleRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public createGatewaySecurityPolicyRule(request: google.cloud.networksecurity.v1.ICreateGatewaySecurityPolicyRuleRequest, callback: google.cloud.networksecurity.v1.NetworkSecurity.CreateGatewaySecurityPolicyRuleCallback): void; + + /** + * Calls CreateGatewaySecurityPolicyRule. + * @param request CreateGatewaySecurityPolicyRuleRequest message or plain object + * @returns Promise + */ + public createGatewaySecurityPolicyRule(request: google.cloud.networksecurity.v1.ICreateGatewaySecurityPolicyRuleRequest): Promise; + + /** + * Calls UpdateGatewaySecurityPolicyRule. + * @param request UpdateGatewaySecurityPolicyRuleRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public updateGatewaySecurityPolicyRule(request: google.cloud.networksecurity.v1.IUpdateGatewaySecurityPolicyRuleRequest, callback: google.cloud.networksecurity.v1.NetworkSecurity.UpdateGatewaySecurityPolicyRuleCallback): void; + + /** + * Calls UpdateGatewaySecurityPolicyRule. + * @param request UpdateGatewaySecurityPolicyRuleRequest message or plain object + * @returns Promise + */ + public updateGatewaySecurityPolicyRule(request: google.cloud.networksecurity.v1.IUpdateGatewaySecurityPolicyRuleRequest): Promise; + + /** + * Calls DeleteGatewaySecurityPolicyRule. + * @param request DeleteGatewaySecurityPolicyRuleRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public deleteGatewaySecurityPolicyRule(request: google.cloud.networksecurity.v1.IDeleteGatewaySecurityPolicyRuleRequest, callback: google.cloud.networksecurity.v1.NetworkSecurity.DeleteGatewaySecurityPolicyRuleCallback): void; + + /** + * Calls DeleteGatewaySecurityPolicyRule. + * @param request DeleteGatewaySecurityPolicyRuleRequest message or plain object + * @returns Promise + */ + public deleteGatewaySecurityPolicyRule(request: google.cloud.networksecurity.v1.IDeleteGatewaySecurityPolicyRuleRequest): Promise; + + /** + * Calls ListUrlLists. + * @param request ListUrlListsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListUrlListsResponse + */ + public listUrlLists(request: google.cloud.networksecurity.v1.IListUrlListsRequest, callback: google.cloud.networksecurity.v1.NetworkSecurity.ListUrlListsCallback): void; + + /** + * Calls ListUrlLists. + * @param request ListUrlListsRequest message or plain object + * @returns Promise + */ + public listUrlLists(request: google.cloud.networksecurity.v1.IListUrlListsRequest): Promise; + + /** + * Calls GetUrlList. + * @param request GetUrlListRequest message or plain object + * @param callback Node-style callback called with the error, if any, and UrlList + */ + public getUrlList(request: google.cloud.networksecurity.v1.IGetUrlListRequest, callback: google.cloud.networksecurity.v1.NetworkSecurity.GetUrlListCallback): void; + + /** + * Calls GetUrlList. + * @param request GetUrlListRequest message or plain object + * @returns Promise + */ + public getUrlList(request: google.cloud.networksecurity.v1.IGetUrlListRequest): Promise; + + /** + * Calls CreateUrlList. + * @param request CreateUrlListRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public createUrlList(request: google.cloud.networksecurity.v1.ICreateUrlListRequest, callback: google.cloud.networksecurity.v1.NetworkSecurity.CreateUrlListCallback): void; + + /** + * Calls CreateUrlList. + * @param request CreateUrlListRequest message or plain object + * @returns Promise + */ + public createUrlList(request: google.cloud.networksecurity.v1.ICreateUrlListRequest): Promise; + + /** + * Calls UpdateUrlList. + * @param request UpdateUrlListRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public updateUrlList(request: google.cloud.networksecurity.v1.IUpdateUrlListRequest, callback: google.cloud.networksecurity.v1.NetworkSecurity.UpdateUrlListCallback): void; + + /** + * Calls UpdateUrlList. + * @param request UpdateUrlListRequest message or plain object + * @returns Promise + */ + public updateUrlList(request: google.cloud.networksecurity.v1.IUpdateUrlListRequest): Promise; + + /** + * Calls DeleteUrlList. + * @param request DeleteUrlListRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public deleteUrlList(request: google.cloud.networksecurity.v1.IDeleteUrlListRequest, callback: google.cloud.networksecurity.v1.NetworkSecurity.DeleteUrlListCallback): void; + + /** + * Calls DeleteUrlList. + * @param request DeleteUrlListRequest message or plain object + * @returns Promise + */ + public deleteUrlList(request: google.cloud.networksecurity.v1.IDeleteUrlListRequest): Promise; + + /** + * Calls ListTlsInspectionPolicies. + * @param request ListTlsInspectionPoliciesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListTlsInspectionPoliciesResponse + */ + public listTlsInspectionPolicies(request: google.cloud.networksecurity.v1.IListTlsInspectionPoliciesRequest, callback: google.cloud.networksecurity.v1.NetworkSecurity.ListTlsInspectionPoliciesCallback): void; + + /** + * Calls ListTlsInspectionPolicies. + * @param request ListTlsInspectionPoliciesRequest message or plain object + * @returns Promise + */ + public listTlsInspectionPolicies(request: google.cloud.networksecurity.v1.IListTlsInspectionPoliciesRequest): Promise; + + /** + * Calls GetTlsInspectionPolicy. + * @param request GetTlsInspectionPolicyRequest message or plain object + * @param callback Node-style callback called with the error, if any, and TlsInspectionPolicy + */ + public getTlsInspectionPolicy(request: google.cloud.networksecurity.v1.IGetTlsInspectionPolicyRequest, callback: google.cloud.networksecurity.v1.NetworkSecurity.GetTlsInspectionPolicyCallback): void; + + /** + * Calls GetTlsInspectionPolicy. + * @param request GetTlsInspectionPolicyRequest message or plain object + * @returns Promise + */ + public getTlsInspectionPolicy(request: google.cloud.networksecurity.v1.IGetTlsInspectionPolicyRequest): Promise; + + /** + * Calls CreateTlsInspectionPolicy. + * @param request CreateTlsInspectionPolicyRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public createTlsInspectionPolicy(request: google.cloud.networksecurity.v1.ICreateTlsInspectionPolicyRequest, callback: google.cloud.networksecurity.v1.NetworkSecurity.CreateTlsInspectionPolicyCallback): void; + + /** + * Calls CreateTlsInspectionPolicy. + * @param request CreateTlsInspectionPolicyRequest message or plain object + * @returns Promise + */ + public createTlsInspectionPolicy(request: google.cloud.networksecurity.v1.ICreateTlsInspectionPolicyRequest): Promise; + + /** + * Calls UpdateTlsInspectionPolicy. + * @param request UpdateTlsInspectionPolicyRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public updateTlsInspectionPolicy(request: google.cloud.networksecurity.v1.IUpdateTlsInspectionPolicyRequest, callback: google.cloud.networksecurity.v1.NetworkSecurity.UpdateTlsInspectionPolicyCallback): void; + + /** + * Calls UpdateTlsInspectionPolicy. + * @param request UpdateTlsInspectionPolicyRequest message or plain object + * @returns Promise + */ + public updateTlsInspectionPolicy(request: google.cloud.networksecurity.v1.IUpdateTlsInspectionPolicyRequest): Promise; + + /** + * Calls DeleteTlsInspectionPolicy. + * @param request DeleteTlsInspectionPolicyRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public deleteTlsInspectionPolicy(request: google.cloud.networksecurity.v1.IDeleteTlsInspectionPolicyRequest, callback: google.cloud.networksecurity.v1.NetworkSecurity.DeleteTlsInspectionPolicyCallback): void; + + /** + * Calls DeleteTlsInspectionPolicy. + * @param request DeleteTlsInspectionPolicyRequest message or plain object + * @returns Promise + */ + public deleteTlsInspectionPolicy(request: google.cloud.networksecurity.v1.IDeleteTlsInspectionPolicyRequest): Promise; + + /** + * Calls ListAuthzPolicies. + * @param request ListAuthzPoliciesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListAuthzPoliciesResponse + */ + public listAuthzPolicies(request: google.cloud.networksecurity.v1.IListAuthzPoliciesRequest, callback: google.cloud.networksecurity.v1.NetworkSecurity.ListAuthzPoliciesCallback): void; + + /** + * Calls ListAuthzPolicies. + * @param request ListAuthzPoliciesRequest message or plain object + * @returns Promise + */ + public listAuthzPolicies(request: google.cloud.networksecurity.v1.IListAuthzPoliciesRequest): Promise; + + /** + * Calls GetAuthzPolicy. + * @param request GetAuthzPolicyRequest message or plain object + * @param callback Node-style callback called with the error, if any, and AuthzPolicy + */ + public getAuthzPolicy(request: google.cloud.networksecurity.v1.IGetAuthzPolicyRequest, callback: google.cloud.networksecurity.v1.NetworkSecurity.GetAuthzPolicyCallback): void; + + /** + * Calls GetAuthzPolicy. + * @param request GetAuthzPolicyRequest message or plain object + * @returns Promise + */ + public getAuthzPolicy(request: google.cloud.networksecurity.v1.IGetAuthzPolicyRequest): Promise; + + /** + * Calls CreateAuthzPolicy. + * @param request CreateAuthzPolicyRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public createAuthzPolicy(request: google.cloud.networksecurity.v1.ICreateAuthzPolicyRequest, callback: google.cloud.networksecurity.v1.NetworkSecurity.CreateAuthzPolicyCallback): void; + + /** + * Calls CreateAuthzPolicy. + * @param request CreateAuthzPolicyRequest message or plain object + * @returns Promise + */ + public createAuthzPolicy(request: google.cloud.networksecurity.v1.ICreateAuthzPolicyRequest): Promise; + + /** + * Calls UpdateAuthzPolicy. + * @param request UpdateAuthzPolicyRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public updateAuthzPolicy(request: google.cloud.networksecurity.v1.IUpdateAuthzPolicyRequest, callback: google.cloud.networksecurity.v1.NetworkSecurity.UpdateAuthzPolicyCallback): void; + + /** + * Calls UpdateAuthzPolicy. + * @param request UpdateAuthzPolicyRequest message or plain object + * @returns Promise + */ + public updateAuthzPolicy(request: google.cloud.networksecurity.v1.IUpdateAuthzPolicyRequest): Promise; + + /** + * Calls DeleteAuthzPolicy. + * @param request DeleteAuthzPolicyRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public deleteAuthzPolicy(request: google.cloud.networksecurity.v1.IDeleteAuthzPolicyRequest, callback: google.cloud.networksecurity.v1.NetworkSecurity.DeleteAuthzPolicyCallback): void; + + /** + * Calls DeleteAuthzPolicy. + * @param request DeleteAuthzPolicyRequest message or plain object + * @returns Promise + */ + public deleteAuthzPolicy(request: google.cloud.networksecurity.v1.IDeleteAuthzPolicyRequest): Promise; + } + + namespace NetworkSecurity { + + /** + * Callback as used by {@link google.cloud.networksecurity.v1.NetworkSecurity|listAuthorizationPolicies}. + * @param error Error, if any + * @param [response] ListAuthorizationPoliciesResponse + */ + type ListAuthorizationPoliciesCallback = (error: (Error|null), response?: google.cloud.networksecurity.v1.ListAuthorizationPoliciesResponse) => void; + + /** + * Callback as used by {@link google.cloud.networksecurity.v1.NetworkSecurity|getAuthorizationPolicy}. + * @param error Error, if any + * @param [response] AuthorizationPolicy + */ + type GetAuthorizationPolicyCallback = (error: (Error|null), response?: google.cloud.networksecurity.v1.AuthorizationPolicy) => void; + + /** + * Callback as used by {@link google.cloud.networksecurity.v1.NetworkSecurity|createAuthorizationPolicy}. + * @param error Error, if any + * @param [response] Operation + */ + type CreateAuthorizationPolicyCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.networksecurity.v1.NetworkSecurity|updateAuthorizationPolicy}. + * @param error Error, if any + * @param [response] Operation + */ + type UpdateAuthorizationPolicyCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.networksecurity.v1.NetworkSecurity|deleteAuthorizationPolicy}. + * @param error Error, if any + * @param [response] Operation + */ + type DeleteAuthorizationPolicyCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.networksecurity.v1.NetworkSecurity|listBackendAuthenticationConfigs}. + * @param error Error, if any + * @param [response] ListBackendAuthenticationConfigsResponse + */ + type ListBackendAuthenticationConfigsCallback = (error: (Error|null), response?: google.cloud.networksecurity.v1.ListBackendAuthenticationConfigsResponse) => void; + + /** + * Callback as used by {@link google.cloud.networksecurity.v1.NetworkSecurity|getBackendAuthenticationConfig}. + * @param error Error, if any + * @param [response] BackendAuthenticationConfig + */ + type GetBackendAuthenticationConfigCallback = (error: (Error|null), response?: google.cloud.networksecurity.v1.BackendAuthenticationConfig) => void; + + /** + * Callback as used by {@link google.cloud.networksecurity.v1.NetworkSecurity|createBackendAuthenticationConfig}. + * @param error Error, if any + * @param [response] Operation + */ + type CreateBackendAuthenticationConfigCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.networksecurity.v1.NetworkSecurity|updateBackendAuthenticationConfig}. + * @param error Error, if any + * @param [response] Operation + */ + type UpdateBackendAuthenticationConfigCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.networksecurity.v1.NetworkSecurity|deleteBackendAuthenticationConfig}. + * @param error Error, if any + * @param [response] Operation + */ + type DeleteBackendAuthenticationConfigCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.networksecurity.v1.NetworkSecurity|listServerTlsPolicies}. + * @param error Error, if any + * @param [response] ListServerTlsPoliciesResponse + */ + type ListServerTlsPoliciesCallback = (error: (Error|null), response?: google.cloud.networksecurity.v1.ListServerTlsPoliciesResponse) => void; + + /** + * Callback as used by {@link google.cloud.networksecurity.v1.NetworkSecurity|getServerTlsPolicy}. + * @param error Error, if any + * @param [response] ServerTlsPolicy + */ + type GetServerTlsPolicyCallback = (error: (Error|null), response?: google.cloud.networksecurity.v1.ServerTlsPolicy) => void; + + /** + * Callback as used by {@link google.cloud.networksecurity.v1.NetworkSecurity|createServerTlsPolicy}. + * @param error Error, if any + * @param [response] Operation + */ + type CreateServerTlsPolicyCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.networksecurity.v1.NetworkSecurity|updateServerTlsPolicy}. + * @param error Error, if any + * @param [response] Operation + */ + type UpdateServerTlsPolicyCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.networksecurity.v1.NetworkSecurity|deleteServerTlsPolicy}. + * @param error Error, if any + * @param [response] Operation + */ + type DeleteServerTlsPolicyCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.networksecurity.v1.NetworkSecurity|listClientTlsPolicies}. + * @param error Error, if any + * @param [response] ListClientTlsPoliciesResponse + */ + type ListClientTlsPoliciesCallback = (error: (Error|null), response?: google.cloud.networksecurity.v1.ListClientTlsPoliciesResponse) => void; + + /** + * Callback as used by {@link google.cloud.networksecurity.v1.NetworkSecurity|getClientTlsPolicy}. + * @param error Error, if any + * @param [response] ClientTlsPolicy + */ + type GetClientTlsPolicyCallback = (error: (Error|null), response?: google.cloud.networksecurity.v1.ClientTlsPolicy) => void; + + /** + * Callback as used by {@link google.cloud.networksecurity.v1.NetworkSecurity|createClientTlsPolicy}. + * @param error Error, if any + * @param [response] Operation + */ + type CreateClientTlsPolicyCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.networksecurity.v1.NetworkSecurity|updateClientTlsPolicy}. + * @param error Error, if any + * @param [response] Operation + */ + type UpdateClientTlsPolicyCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.networksecurity.v1.NetworkSecurity|deleteClientTlsPolicy}. + * @param error Error, if any + * @param [response] Operation + */ + type DeleteClientTlsPolicyCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.networksecurity.v1.NetworkSecurity|listGatewaySecurityPolicies}. + * @param error Error, if any + * @param [response] ListGatewaySecurityPoliciesResponse + */ + type ListGatewaySecurityPoliciesCallback = (error: (Error|null), response?: google.cloud.networksecurity.v1.ListGatewaySecurityPoliciesResponse) => void; + + /** + * Callback as used by {@link google.cloud.networksecurity.v1.NetworkSecurity|getGatewaySecurityPolicy}. + * @param error Error, if any + * @param [response] GatewaySecurityPolicy + */ + type GetGatewaySecurityPolicyCallback = (error: (Error|null), response?: google.cloud.networksecurity.v1.GatewaySecurityPolicy) => void; + + /** + * Callback as used by {@link google.cloud.networksecurity.v1.NetworkSecurity|createGatewaySecurityPolicy}. + * @param error Error, if any + * @param [response] Operation + */ + type CreateGatewaySecurityPolicyCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.networksecurity.v1.NetworkSecurity|updateGatewaySecurityPolicy}. + * @param error Error, if any + * @param [response] Operation + */ + type UpdateGatewaySecurityPolicyCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.networksecurity.v1.NetworkSecurity|deleteGatewaySecurityPolicy}. + * @param error Error, if any + * @param [response] Operation + */ + type DeleteGatewaySecurityPolicyCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.networksecurity.v1.NetworkSecurity|listGatewaySecurityPolicyRules}. + * @param error Error, if any + * @param [response] ListGatewaySecurityPolicyRulesResponse + */ + type ListGatewaySecurityPolicyRulesCallback = (error: (Error|null), response?: google.cloud.networksecurity.v1.ListGatewaySecurityPolicyRulesResponse) => void; + + /** + * Callback as used by {@link google.cloud.networksecurity.v1.NetworkSecurity|getGatewaySecurityPolicyRule}. + * @param error Error, if any + * @param [response] GatewaySecurityPolicyRule + */ + type GetGatewaySecurityPolicyRuleCallback = (error: (Error|null), response?: google.cloud.networksecurity.v1.GatewaySecurityPolicyRule) => void; + + /** + * Callback as used by {@link google.cloud.networksecurity.v1.NetworkSecurity|createGatewaySecurityPolicyRule}. + * @param error Error, if any + * @param [response] Operation + */ + type CreateGatewaySecurityPolicyRuleCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.networksecurity.v1.NetworkSecurity|updateGatewaySecurityPolicyRule}. + * @param error Error, if any + * @param [response] Operation + */ + type UpdateGatewaySecurityPolicyRuleCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.networksecurity.v1.NetworkSecurity|deleteGatewaySecurityPolicyRule}. + * @param error Error, if any + * @param [response] Operation + */ + type DeleteGatewaySecurityPolicyRuleCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.networksecurity.v1.NetworkSecurity|listUrlLists}. + * @param error Error, if any + * @param [response] ListUrlListsResponse + */ + type ListUrlListsCallback = (error: (Error|null), response?: google.cloud.networksecurity.v1.ListUrlListsResponse) => void; + + /** + * Callback as used by {@link google.cloud.networksecurity.v1.NetworkSecurity|getUrlList}. + * @param error Error, if any + * @param [response] UrlList + */ + type GetUrlListCallback = (error: (Error|null), response?: google.cloud.networksecurity.v1.UrlList) => void; + + /** + * Callback as used by {@link google.cloud.networksecurity.v1.NetworkSecurity|createUrlList}. + * @param error Error, if any + * @param [response] Operation + */ + type CreateUrlListCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.networksecurity.v1.NetworkSecurity|updateUrlList}. + * @param error Error, if any + * @param [response] Operation + */ + type UpdateUrlListCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.networksecurity.v1.NetworkSecurity|deleteUrlList}. + * @param error Error, if any + * @param [response] Operation + */ + type DeleteUrlListCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.networksecurity.v1.NetworkSecurity|listTlsInspectionPolicies}. + * @param error Error, if any + * @param [response] ListTlsInspectionPoliciesResponse + */ + type ListTlsInspectionPoliciesCallback = (error: (Error|null), response?: google.cloud.networksecurity.v1.ListTlsInspectionPoliciesResponse) => void; + + /** + * Callback as used by {@link google.cloud.networksecurity.v1.NetworkSecurity|getTlsInspectionPolicy}. + * @param error Error, if any + * @param [response] TlsInspectionPolicy + */ + type GetTlsInspectionPolicyCallback = (error: (Error|null), response?: google.cloud.networksecurity.v1.TlsInspectionPolicy) => void; + + /** + * Callback as used by {@link google.cloud.networksecurity.v1.NetworkSecurity|createTlsInspectionPolicy}. + * @param error Error, if any + * @param [response] Operation + */ + type CreateTlsInspectionPolicyCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.networksecurity.v1.NetworkSecurity|updateTlsInspectionPolicy}. + * @param error Error, if any + * @param [response] Operation + */ + type UpdateTlsInspectionPolicyCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.networksecurity.v1.NetworkSecurity|deleteTlsInspectionPolicy}. + * @param error Error, if any + * @param [response] Operation + */ + type DeleteTlsInspectionPolicyCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.networksecurity.v1.NetworkSecurity|listAuthzPolicies}. + * @param error Error, if any + * @param [response] ListAuthzPoliciesResponse + */ + type ListAuthzPoliciesCallback = (error: (Error|null), response?: google.cloud.networksecurity.v1.ListAuthzPoliciesResponse) => void; + + /** + * Callback as used by {@link google.cloud.networksecurity.v1.NetworkSecurity|getAuthzPolicy}. + * @param error Error, if any + * @param [response] AuthzPolicy + */ + type GetAuthzPolicyCallback = (error: (Error|null), response?: google.cloud.networksecurity.v1.AuthzPolicy) => void; + + /** + * Callback as used by {@link google.cloud.networksecurity.v1.NetworkSecurity|createAuthzPolicy}. + * @param error Error, if any + * @param [response] Operation + */ + type CreateAuthzPolicyCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.networksecurity.v1.NetworkSecurity|updateAuthzPolicy}. + * @param error Error, if any + * @param [response] Operation + */ + type UpdateAuthzPolicyCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.networksecurity.v1.NetworkSecurity|deleteAuthzPolicy}. + * @param error Error, if any + * @param [response] Operation + */ + type DeleteAuthzPolicyCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + } + + /** Properties of a ServerTlsPolicy. */ + interface IServerTlsPolicy { + + /** ServerTlsPolicy name */ + name?: (string|null); + + /** ServerTlsPolicy description */ + description?: (string|null); + + /** ServerTlsPolicy createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** ServerTlsPolicy updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** ServerTlsPolicy labels */ + labels?: ({ [k: string]: string }|null); + + /** ServerTlsPolicy allowOpen */ + allowOpen?: (boolean|null); + + /** ServerTlsPolicy serverCertificate */ + serverCertificate?: (google.cloud.networksecurity.v1.ICertificateProvider|null); + + /** ServerTlsPolicy mtlsPolicy */ + mtlsPolicy?: (google.cloud.networksecurity.v1.ServerTlsPolicy.IMTLSPolicy|null); + } + + /** Represents a ServerTlsPolicy. */ + class ServerTlsPolicy implements IServerTlsPolicy { + + /** + * Constructs a new ServerTlsPolicy. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.networksecurity.v1.IServerTlsPolicy); + + /** ServerTlsPolicy name. */ + public name: string; + + /** ServerTlsPolicy description. */ + public description: string; + + /** ServerTlsPolicy createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** ServerTlsPolicy updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** ServerTlsPolicy labels. */ + public labels: { [k: string]: string }; + + /** ServerTlsPolicy allowOpen. */ + public allowOpen: boolean; + + /** ServerTlsPolicy serverCertificate. */ + public serverCertificate?: (google.cloud.networksecurity.v1.ICertificateProvider|null); + + /** ServerTlsPolicy mtlsPolicy. */ + public mtlsPolicy?: (google.cloud.networksecurity.v1.ServerTlsPolicy.IMTLSPolicy|null); + + /** + * Creates a new ServerTlsPolicy instance using the specified properties. + * @param [properties] Properties to set + * @returns ServerTlsPolicy instance + */ + public static create(properties?: google.cloud.networksecurity.v1.IServerTlsPolicy): google.cloud.networksecurity.v1.ServerTlsPolicy; + + /** + * Encodes the specified ServerTlsPolicy message. Does not implicitly {@link google.cloud.networksecurity.v1.ServerTlsPolicy.verify|verify} messages. + * @param message ServerTlsPolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.networksecurity.v1.IServerTlsPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ServerTlsPolicy message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.ServerTlsPolicy.verify|verify} messages. + * @param message ServerTlsPolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.networksecurity.v1.IServerTlsPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ServerTlsPolicy message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ServerTlsPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.networksecurity.v1.ServerTlsPolicy; + + /** + * Decodes a ServerTlsPolicy message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ServerTlsPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.networksecurity.v1.ServerTlsPolicy; + + /** + * Verifies a ServerTlsPolicy message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ServerTlsPolicy message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ServerTlsPolicy + */ + public static fromObject(object: { [k: string]: any }): google.cloud.networksecurity.v1.ServerTlsPolicy; + + /** + * Creates a plain object from a ServerTlsPolicy message. Also converts values to other types if specified. + * @param message ServerTlsPolicy + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.networksecurity.v1.ServerTlsPolicy, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ServerTlsPolicy to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ServerTlsPolicy + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ServerTlsPolicy { + + /** Properties of a MTLSPolicy. */ + interface IMTLSPolicy { + + /** MTLSPolicy clientValidationMode */ + clientValidationMode?: (google.cloud.networksecurity.v1.ServerTlsPolicy.MTLSPolicy.ClientValidationMode|keyof typeof google.cloud.networksecurity.v1.ServerTlsPolicy.MTLSPolicy.ClientValidationMode|null); + + /** MTLSPolicy clientValidationCa */ + clientValidationCa?: (google.cloud.networksecurity.v1.IValidationCA[]|null); + + /** MTLSPolicy clientValidationTrustConfig */ + clientValidationTrustConfig?: (string|null); + } + + /** Represents a MTLSPolicy. */ + class MTLSPolicy implements IMTLSPolicy { + + /** + * Constructs a new MTLSPolicy. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.networksecurity.v1.ServerTlsPolicy.IMTLSPolicy); + + /** MTLSPolicy clientValidationMode. */ + public clientValidationMode: (google.cloud.networksecurity.v1.ServerTlsPolicy.MTLSPolicy.ClientValidationMode|keyof typeof google.cloud.networksecurity.v1.ServerTlsPolicy.MTLSPolicy.ClientValidationMode); + + /** MTLSPolicy clientValidationCa. */ + public clientValidationCa: google.cloud.networksecurity.v1.IValidationCA[]; + + /** MTLSPolicy clientValidationTrustConfig. */ + public clientValidationTrustConfig: string; + + /** + * Creates a new MTLSPolicy instance using the specified properties. + * @param [properties] Properties to set + * @returns MTLSPolicy instance + */ + public static create(properties?: google.cloud.networksecurity.v1.ServerTlsPolicy.IMTLSPolicy): google.cloud.networksecurity.v1.ServerTlsPolicy.MTLSPolicy; + + /** + * Encodes the specified MTLSPolicy message. Does not implicitly {@link google.cloud.networksecurity.v1.ServerTlsPolicy.MTLSPolicy.verify|verify} messages. + * @param message MTLSPolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.networksecurity.v1.ServerTlsPolicy.IMTLSPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MTLSPolicy message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.ServerTlsPolicy.MTLSPolicy.verify|verify} messages. + * @param message MTLSPolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.networksecurity.v1.ServerTlsPolicy.IMTLSPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MTLSPolicy message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MTLSPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.networksecurity.v1.ServerTlsPolicy.MTLSPolicy; + + /** + * Decodes a MTLSPolicy message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MTLSPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.networksecurity.v1.ServerTlsPolicy.MTLSPolicy; + + /** + * Verifies a MTLSPolicy message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MTLSPolicy message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MTLSPolicy + */ + public static fromObject(object: { [k: string]: any }): google.cloud.networksecurity.v1.ServerTlsPolicy.MTLSPolicy; + + /** + * Creates a plain object from a MTLSPolicy message. Also converts values to other types if specified. + * @param message MTLSPolicy + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.networksecurity.v1.ServerTlsPolicy.MTLSPolicy, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MTLSPolicy to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MTLSPolicy + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace MTLSPolicy { + + /** ClientValidationMode enum. */ + enum ClientValidationMode { + CLIENT_VALIDATION_MODE_UNSPECIFIED = 0, + ALLOW_INVALID_OR_MISSING_CLIENT_CERT = 1, + REJECT_INVALID = 2 + } + } + } + + /** Properties of a ListServerTlsPoliciesRequest. */ + interface IListServerTlsPoliciesRequest { + + /** ListServerTlsPoliciesRequest parent */ + parent?: (string|null); + + /** ListServerTlsPoliciesRequest pageSize */ + pageSize?: (number|null); + + /** ListServerTlsPoliciesRequest pageToken */ + pageToken?: (string|null); + + /** ListServerTlsPoliciesRequest returnPartialSuccess */ + returnPartialSuccess?: (boolean|null); + } + + /** Represents a ListServerTlsPoliciesRequest. */ + class ListServerTlsPoliciesRequest implements IListServerTlsPoliciesRequest { + + /** + * Constructs a new ListServerTlsPoliciesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.networksecurity.v1.IListServerTlsPoliciesRequest); + + /** ListServerTlsPoliciesRequest parent. */ + public parent: string; + + /** ListServerTlsPoliciesRequest pageSize. */ + public pageSize: number; + + /** ListServerTlsPoliciesRequest pageToken. */ + public pageToken: string; + + /** ListServerTlsPoliciesRequest returnPartialSuccess. */ + public returnPartialSuccess: boolean; + + /** + * Creates a new ListServerTlsPoliciesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListServerTlsPoliciesRequest instance + */ + public static create(properties?: google.cloud.networksecurity.v1.IListServerTlsPoliciesRequest): google.cloud.networksecurity.v1.ListServerTlsPoliciesRequest; + + /** + * Encodes the specified ListServerTlsPoliciesRequest message. Does not implicitly {@link google.cloud.networksecurity.v1.ListServerTlsPoliciesRequest.verify|verify} messages. + * @param message ListServerTlsPoliciesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.networksecurity.v1.IListServerTlsPoliciesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListServerTlsPoliciesRequest message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.ListServerTlsPoliciesRequest.verify|verify} messages. + * @param message ListServerTlsPoliciesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.networksecurity.v1.IListServerTlsPoliciesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListServerTlsPoliciesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListServerTlsPoliciesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.networksecurity.v1.ListServerTlsPoliciesRequest; + + /** + * Decodes a ListServerTlsPoliciesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListServerTlsPoliciesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.networksecurity.v1.ListServerTlsPoliciesRequest; + + /** + * Verifies a ListServerTlsPoliciesRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListServerTlsPoliciesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListServerTlsPoliciesRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.networksecurity.v1.ListServerTlsPoliciesRequest; + + /** + * Creates a plain object from a ListServerTlsPoliciesRequest message. Also converts values to other types if specified. + * @param message ListServerTlsPoliciesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.networksecurity.v1.ListServerTlsPoliciesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListServerTlsPoliciesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListServerTlsPoliciesRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListServerTlsPoliciesResponse. */ + interface IListServerTlsPoliciesResponse { + + /** ListServerTlsPoliciesResponse serverTlsPolicies */ + serverTlsPolicies?: (google.cloud.networksecurity.v1.IServerTlsPolicy[]|null); + + /** ListServerTlsPoliciesResponse nextPageToken */ + nextPageToken?: (string|null); + + /** ListServerTlsPoliciesResponse unreachable */ + unreachable?: (string[]|null); + } + + /** Represents a ListServerTlsPoliciesResponse. */ + class ListServerTlsPoliciesResponse implements IListServerTlsPoliciesResponse { + + /** + * Constructs a new ListServerTlsPoliciesResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.networksecurity.v1.IListServerTlsPoliciesResponse); + + /** ListServerTlsPoliciesResponse serverTlsPolicies. */ + public serverTlsPolicies: google.cloud.networksecurity.v1.IServerTlsPolicy[]; + + /** ListServerTlsPoliciesResponse nextPageToken. */ + public nextPageToken: string; + + /** ListServerTlsPoliciesResponse unreachable. */ + public unreachable: string[]; + + /** + * Creates a new ListServerTlsPoliciesResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListServerTlsPoliciesResponse instance + */ + public static create(properties?: google.cloud.networksecurity.v1.IListServerTlsPoliciesResponse): google.cloud.networksecurity.v1.ListServerTlsPoliciesResponse; + + /** + * Encodes the specified ListServerTlsPoliciesResponse message. Does not implicitly {@link google.cloud.networksecurity.v1.ListServerTlsPoliciesResponse.verify|verify} messages. + * @param message ListServerTlsPoliciesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.networksecurity.v1.IListServerTlsPoliciesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListServerTlsPoliciesResponse message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.ListServerTlsPoliciesResponse.verify|verify} messages. + * @param message ListServerTlsPoliciesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.networksecurity.v1.IListServerTlsPoliciesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListServerTlsPoliciesResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListServerTlsPoliciesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.networksecurity.v1.ListServerTlsPoliciesResponse; + + /** + * Decodes a ListServerTlsPoliciesResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListServerTlsPoliciesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.networksecurity.v1.ListServerTlsPoliciesResponse; + + /** + * Verifies a ListServerTlsPoliciesResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListServerTlsPoliciesResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListServerTlsPoliciesResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.networksecurity.v1.ListServerTlsPoliciesResponse; + + /** + * Creates a plain object from a ListServerTlsPoliciesResponse message. Also converts values to other types if specified. + * @param message ListServerTlsPoliciesResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.networksecurity.v1.ListServerTlsPoliciesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListServerTlsPoliciesResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListServerTlsPoliciesResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetServerTlsPolicyRequest. */ + interface IGetServerTlsPolicyRequest { + + /** GetServerTlsPolicyRequest name */ + name?: (string|null); + } + + /** Represents a GetServerTlsPolicyRequest. */ + class GetServerTlsPolicyRequest implements IGetServerTlsPolicyRequest { + + /** + * Constructs a new GetServerTlsPolicyRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.networksecurity.v1.IGetServerTlsPolicyRequest); + + /** GetServerTlsPolicyRequest name. */ + public name: string; + + /** + * Creates a new GetServerTlsPolicyRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetServerTlsPolicyRequest instance + */ + public static create(properties?: google.cloud.networksecurity.v1.IGetServerTlsPolicyRequest): google.cloud.networksecurity.v1.GetServerTlsPolicyRequest; + + /** + * Encodes the specified GetServerTlsPolicyRequest message. Does not implicitly {@link google.cloud.networksecurity.v1.GetServerTlsPolicyRequest.verify|verify} messages. + * @param message GetServerTlsPolicyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.networksecurity.v1.IGetServerTlsPolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetServerTlsPolicyRequest message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.GetServerTlsPolicyRequest.verify|verify} messages. + * @param message GetServerTlsPolicyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.networksecurity.v1.IGetServerTlsPolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetServerTlsPolicyRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetServerTlsPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.networksecurity.v1.GetServerTlsPolicyRequest; + + /** + * Decodes a GetServerTlsPolicyRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetServerTlsPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.networksecurity.v1.GetServerTlsPolicyRequest; + + /** + * Verifies a GetServerTlsPolicyRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetServerTlsPolicyRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetServerTlsPolicyRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.networksecurity.v1.GetServerTlsPolicyRequest; + + /** + * Creates a plain object from a GetServerTlsPolicyRequest message. Also converts values to other types if specified. + * @param message GetServerTlsPolicyRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.networksecurity.v1.GetServerTlsPolicyRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetServerTlsPolicyRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetServerTlsPolicyRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateServerTlsPolicyRequest. */ + interface ICreateServerTlsPolicyRequest { + + /** CreateServerTlsPolicyRequest parent */ + parent?: (string|null); + + /** CreateServerTlsPolicyRequest serverTlsPolicyId */ + serverTlsPolicyId?: (string|null); + + /** CreateServerTlsPolicyRequest serverTlsPolicy */ + serverTlsPolicy?: (google.cloud.networksecurity.v1.IServerTlsPolicy|null); + } + + /** Represents a CreateServerTlsPolicyRequest. */ + class CreateServerTlsPolicyRequest implements ICreateServerTlsPolicyRequest { + + /** + * Constructs a new CreateServerTlsPolicyRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.networksecurity.v1.ICreateServerTlsPolicyRequest); + + /** CreateServerTlsPolicyRequest parent. */ + public parent: string; + + /** CreateServerTlsPolicyRequest serverTlsPolicyId. */ + public serverTlsPolicyId: string; + + /** CreateServerTlsPolicyRequest serverTlsPolicy. */ + public serverTlsPolicy?: (google.cloud.networksecurity.v1.IServerTlsPolicy|null); + + /** + * Creates a new CreateServerTlsPolicyRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateServerTlsPolicyRequest instance + */ + public static create(properties?: google.cloud.networksecurity.v1.ICreateServerTlsPolicyRequest): google.cloud.networksecurity.v1.CreateServerTlsPolicyRequest; + + /** + * Encodes the specified CreateServerTlsPolicyRequest message. Does not implicitly {@link google.cloud.networksecurity.v1.CreateServerTlsPolicyRequest.verify|verify} messages. + * @param message CreateServerTlsPolicyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.networksecurity.v1.ICreateServerTlsPolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateServerTlsPolicyRequest message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.CreateServerTlsPolicyRequest.verify|verify} messages. + * @param message CreateServerTlsPolicyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.networksecurity.v1.ICreateServerTlsPolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateServerTlsPolicyRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateServerTlsPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.networksecurity.v1.CreateServerTlsPolicyRequest; + + /** + * Decodes a CreateServerTlsPolicyRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateServerTlsPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.networksecurity.v1.CreateServerTlsPolicyRequest; + + /** + * Verifies a CreateServerTlsPolicyRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateServerTlsPolicyRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateServerTlsPolicyRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.networksecurity.v1.CreateServerTlsPolicyRequest; + + /** + * Creates a plain object from a CreateServerTlsPolicyRequest message. Also converts values to other types if specified. + * @param message CreateServerTlsPolicyRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.networksecurity.v1.CreateServerTlsPolicyRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateServerTlsPolicyRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateServerTlsPolicyRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateServerTlsPolicyRequest. */ + interface IUpdateServerTlsPolicyRequest { + + /** UpdateServerTlsPolicyRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateServerTlsPolicyRequest serverTlsPolicy */ + serverTlsPolicy?: (google.cloud.networksecurity.v1.IServerTlsPolicy|null); + } + + /** Represents an UpdateServerTlsPolicyRequest. */ + class UpdateServerTlsPolicyRequest implements IUpdateServerTlsPolicyRequest { + + /** + * Constructs a new UpdateServerTlsPolicyRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.networksecurity.v1.IUpdateServerTlsPolicyRequest); + + /** UpdateServerTlsPolicyRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateServerTlsPolicyRequest serverTlsPolicy. */ + public serverTlsPolicy?: (google.cloud.networksecurity.v1.IServerTlsPolicy|null); + + /** + * Creates a new UpdateServerTlsPolicyRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateServerTlsPolicyRequest instance + */ + public static create(properties?: google.cloud.networksecurity.v1.IUpdateServerTlsPolicyRequest): google.cloud.networksecurity.v1.UpdateServerTlsPolicyRequest; + + /** + * Encodes the specified UpdateServerTlsPolicyRequest message. Does not implicitly {@link google.cloud.networksecurity.v1.UpdateServerTlsPolicyRequest.verify|verify} messages. + * @param message UpdateServerTlsPolicyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.networksecurity.v1.IUpdateServerTlsPolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateServerTlsPolicyRequest message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.UpdateServerTlsPolicyRequest.verify|verify} messages. + * @param message UpdateServerTlsPolicyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.networksecurity.v1.IUpdateServerTlsPolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateServerTlsPolicyRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateServerTlsPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.networksecurity.v1.UpdateServerTlsPolicyRequest; + + /** + * Decodes an UpdateServerTlsPolicyRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateServerTlsPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.networksecurity.v1.UpdateServerTlsPolicyRequest; + + /** + * Verifies an UpdateServerTlsPolicyRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UpdateServerTlsPolicyRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateServerTlsPolicyRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.networksecurity.v1.UpdateServerTlsPolicyRequest; + + /** + * Creates a plain object from an UpdateServerTlsPolicyRequest message. Also converts values to other types if specified. + * @param message UpdateServerTlsPolicyRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.networksecurity.v1.UpdateServerTlsPolicyRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateServerTlsPolicyRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateServerTlsPolicyRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteServerTlsPolicyRequest. */ + interface IDeleteServerTlsPolicyRequest { + + /** DeleteServerTlsPolicyRequest name */ + name?: (string|null); + } + + /** Represents a DeleteServerTlsPolicyRequest. */ + class DeleteServerTlsPolicyRequest implements IDeleteServerTlsPolicyRequest { + + /** + * Constructs a new DeleteServerTlsPolicyRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.networksecurity.v1.IDeleteServerTlsPolicyRequest); + + /** DeleteServerTlsPolicyRequest name. */ + public name: string; + + /** + * Creates a new DeleteServerTlsPolicyRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteServerTlsPolicyRequest instance + */ + public static create(properties?: google.cloud.networksecurity.v1.IDeleteServerTlsPolicyRequest): google.cloud.networksecurity.v1.DeleteServerTlsPolicyRequest; + + /** + * Encodes the specified DeleteServerTlsPolicyRequest message. Does not implicitly {@link google.cloud.networksecurity.v1.DeleteServerTlsPolicyRequest.verify|verify} messages. + * @param message DeleteServerTlsPolicyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.networksecurity.v1.IDeleteServerTlsPolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteServerTlsPolicyRequest message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.DeleteServerTlsPolicyRequest.verify|verify} messages. + * @param message DeleteServerTlsPolicyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.networksecurity.v1.IDeleteServerTlsPolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteServerTlsPolicyRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteServerTlsPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.networksecurity.v1.DeleteServerTlsPolicyRequest; + + /** + * Decodes a DeleteServerTlsPolicyRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteServerTlsPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.networksecurity.v1.DeleteServerTlsPolicyRequest; + + /** + * Verifies a DeleteServerTlsPolicyRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteServerTlsPolicyRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteServerTlsPolicyRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.networksecurity.v1.DeleteServerTlsPolicyRequest; + + /** + * Creates a plain object from a DeleteServerTlsPolicyRequest message. Also converts values to other types if specified. + * @param message DeleteServerTlsPolicyRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.networksecurity.v1.DeleteServerTlsPolicyRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteServerTlsPolicyRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteServerTlsPolicyRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TlsInspectionPolicy. */ + interface ITlsInspectionPolicy { + + /** TlsInspectionPolicy name */ + name?: (string|null); + + /** TlsInspectionPolicy description */ + description?: (string|null); + + /** TlsInspectionPolicy createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** TlsInspectionPolicy updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** TlsInspectionPolicy caPool */ + caPool?: (string|null); + + /** TlsInspectionPolicy trustConfig */ + trustConfig?: (string|null); + + /** TlsInspectionPolicy excludePublicCaSet */ + excludePublicCaSet?: (boolean|null); + + /** TlsInspectionPolicy minTlsVersion */ + minTlsVersion?: (google.cloud.networksecurity.v1.TlsInspectionPolicy.TlsVersion|keyof typeof google.cloud.networksecurity.v1.TlsInspectionPolicy.TlsVersion|null); + + /** TlsInspectionPolicy tlsFeatureProfile */ + tlsFeatureProfile?: (google.cloud.networksecurity.v1.TlsInspectionPolicy.Profile|keyof typeof google.cloud.networksecurity.v1.TlsInspectionPolicy.Profile|null); + + /** TlsInspectionPolicy customTlsFeatures */ + customTlsFeatures?: (string[]|null); + } + + /** Represents a TlsInspectionPolicy. */ + class TlsInspectionPolicy implements ITlsInspectionPolicy { + + /** + * Constructs a new TlsInspectionPolicy. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.networksecurity.v1.ITlsInspectionPolicy); + + /** TlsInspectionPolicy name. */ + public name: string; + + /** TlsInspectionPolicy description. */ + public description: string; + + /** TlsInspectionPolicy createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** TlsInspectionPolicy updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** TlsInspectionPolicy caPool. */ + public caPool: string; + + /** TlsInspectionPolicy trustConfig. */ + public trustConfig: string; + + /** TlsInspectionPolicy excludePublicCaSet. */ + public excludePublicCaSet?: (boolean|null); + + /** TlsInspectionPolicy minTlsVersion. */ + public minTlsVersion: (google.cloud.networksecurity.v1.TlsInspectionPolicy.TlsVersion|keyof typeof google.cloud.networksecurity.v1.TlsInspectionPolicy.TlsVersion); + + /** TlsInspectionPolicy tlsFeatureProfile. */ + public tlsFeatureProfile: (google.cloud.networksecurity.v1.TlsInspectionPolicy.Profile|keyof typeof google.cloud.networksecurity.v1.TlsInspectionPolicy.Profile); + + /** TlsInspectionPolicy customTlsFeatures. */ + public customTlsFeatures: string[]; + + /** + * Creates a new TlsInspectionPolicy instance using the specified properties. + * @param [properties] Properties to set + * @returns TlsInspectionPolicy instance + */ + public static create(properties?: google.cloud.networksecurity.v1.ITlsInspectionPolicy): google.cloud.networksecurity.v1.TlsInspectionPolicy; + + /** + * Encodes the specified TlsInspectionPolicy message. Does not implicitly {@link google.cloud.networksecurity.v1.TlsInspectionPolicy.verify|verify} messages. + * @param message TlsInspectionPolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.networksecurity.v1.ITlsInspectionPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TlsInspectionPolicy message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.TlsInspectionPolicy.verify|verify} messages. + * @param message TlsInspectionPolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.networksecurity.v1.ITlsInspectionPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TlsInspectionPolicy message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TlsInspectionPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.networksecurity.v1.TlsInspectionPolicy; + + /** + * Decodes a TlsInspectionPolicy message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TlsInspectionPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.networksecurity.v1.TlsInspectionPolicy; + + /** + * Verifies a TlsInspectionPolicy message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TlsInspectionPolicy message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TlsInspectionPolicy + */ + public static fromObject(object: { [k: string]: any }): google.cloud.networksecurity.v1.TlsInspectionPolicy; + + /** + * Creates a plain object from a TlsInspectionPolicy message. Also converts values to other types if specified. + * @param message TlsInspectionPolicy + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.networksecurity.v1.TlsInspectionPolicy, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TlsInspectionPolicy to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TlsInspectionPolicy + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace TlsInspectionPolicy { + + /** TlsVersion enum. */ + enum TlsVersion { + TLS_VERSION_UNSPECIFIED = 0, + TLS_1_0 = 1, + TLS_1_1 = 2, + TLS_1_2 = 3, + TLS_1_3 = 4 + } + + /** Profile enum. */ + enum Profile { + PROFILE_UNSPECIFIED = 0, + PROFILE_COMPATIBLE = 1, + PROFILE_MODERN = 2, + PROFILE_RESTRICTED = 3, + PROFILE_CUSTOM = 4 + } + } + + /** Properties of a CreateTlsInspectionPolicyRequest. */ + interface ICreateTlsInspectionPolicyRequest { + + /** CreateTlsInspectionPolicyRequest parent */ + parent?: (string|null); + + /** CreateTlsInspectionPolicyRequest tlsInspectionPolicyId */ + tlsInspectionPolicyId?: (string|null); + + /** CreateTlsInspectionPolicyRequest tlsInspectionPolicy */ + tlsInspectionPolicy?: (google.cloud.networksecurity.v1.ITlsInspectionPolicy|null); + } + + /** Represents a CreateTlsInspectionPolicyRequest. */ + class CreateTlsInspectionPolicyRequest implements ICreateTlsInspectionPolicyRequest { + + /** + * Constructs a new CreateTlsInspectionPolicyRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.networksecurity.v1.ICreateTlsInspectionPolicyRequest); + + /** CreateTlsInspectionPolicyRequest parent. */ + public parent: string; + + /** CreateTlsInspectionPolicyRequest tlsInspectionPolicyId. */ + public tlsInspectionPolicyId: string; + + /** CreateTlsInspectionPolicyRequest tlsInspectionPolicy. */ + public tlsInspectionPolicy?: (google.cloud.networksecurity.v1.ITlsInspectionPolicy|null); + + /** + * Creates a new CreateTlsInspectionPolicyRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateTlsInspectionPolicyRequest instance + */ + public static create(properties?: google.cloud.networksecurity.v1.ICreateTlsInspectionPolicyRequest): google.cloud.networksecurity.v1.CreateTlsInspectionPolicyRequest; + + /** + * Encodes the specified CreateTlsInspectionPolicyRequest message. Does not implicitly {@link google.cloud.networksecurity.v1.CreateTlsInspectionPolicyRequest.verify|verify} messages. + * @param message CreateTlsInspectionPolicyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.networksecurity.v1.ICreateTlsInspectionPolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateTlsInspectionPolicyRequest message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.CreateTlsInspectionPolicyRequest.verify|verify} messages. + * @param message CreateTlsInspectionPolicyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.networksecurity.v1.ICreateTlsInspectionPolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateTlsInspectionPolicyRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateTlsInspectionPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.networksecurity.v1.CreateTlsInspectionPolicyRequest; + + /** + * Decodes a CreateTlsInspectionPolicyRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateTlsInspectionPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.networksecurity.v1.CreateTlsInspectionPolicyRequest; + + /** + * Verifies a CreateTlsInspectionPolicyRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateTlsInspectionPolicyRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateTlsInspectionPolicyRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.networksecurity.v1.CreateTlsInspectionPolicyRequest; + + /** + * Creates a plain object from a CreateTlsInspectionPolicyRequest message. Also converts values to other types if specified. + * @param message CreateTlsInspectionPolicyRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.networksecurity.v1.CreateTlsInspectionPolicyRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateTlsInspectionPolicyRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateTlsInspectionPolicyRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListTlsInspectionPoliciesRequest. */ + interface IListTlsInspectionPoliciesRequest { + + /** ListTlsInspectionPoliciesRequest parent */ + parent?: (string|null); + + /** ListTlsInspectionPoliciesRequest pageSize */ + pageSize?: (number|null); + + /** ListTlsInspectionPoliciesRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListTlsInspectionPoliciesRequest. */ + class ListTlsInspectionPoliciesRequest implements IListTlsInspectionPoliciesRequest { + + /** + * Constructs a new ListTlsInspectionPoliciesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.networksecurity.v1.IListTlsInspectionPoliciesRequest); + + /** ListTlsInspectionPoliciesRequest parent. */ + public parent: string; + + /** ListTlsInspectionPoliciesRequest pageSize. */ + public pageSize: number; + + /** ListTlsInspectionPoliciesRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListTlsInspectionPoliciesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListTlsInspectionPoliciesRequest instance + */ + public static create(properties?: google.cloud.networksecurity.v1.IListTlsInspectionPoliciesRequest): google.cloud.networksecurity.v1.ListTlsInspectionPoliciesRequest; + + /** + * Encodes the specified ListTlsInspectionPoliciesRequest message. Does not implicitly {@link google.cloud.networksecurity.v1.ListTlsInspectionPoliciesRequest.verify|verify} messages. + * @param message ListTlsInspectionPoliciesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.networksecurity.v1.IListTlsInspectionPoliciesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListTlsInspectionPoliciesRequest message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.ListTlsInspectionPoliciesRequest.verify|verify} messages. + * @param message ListTlsInspectionPoliciesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.networksecurity.v1.IListTlsInspectionPoliciesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListTlsInspectionPoliciesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListTlsInspectionPoliciesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.networksecurity.v1.ListTlsInspectionPoliciesRequest; + + /** + * Decodes a ListTlsInspectionPoliciesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListTlsInspectionPoliciesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.networksecurity.v1.ListTlsInspectionPoliciesRequest; + + /** + * Verifies a ListTlsInspectionPoliciesRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListTlsInspectionPoliciesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListTlsInspectionPoliciesRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.networksecurity.v1.ListTlsInspectionPoliciesRequest; + + /** + * Creates a plain object from a ListTlsInspectionPoliciesRequest message. Also converts values to other types if specified. + * @param message ListTlsInspectionPoliciesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.networksecurity.v1.ListTlsInspectionPoliciesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListTlsInspectionPoliciesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListTlsInspectionPoliciesRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListTlsInspectionPoliciesResponse. */ + interface IListTlsInspectionPoliciesResponse { + + /** ListTlsInspectionPoliciesResponse tlsInspectionPolicies */ + tlsInspectionPolicies?: (google.cloud.networksecurity.v1.ITlsInspectionPolicy[]|null); + + /** ListTlsInspectionPoliciesResponse nextPageToken */ + nextPageToken?: (string|null); + + /** ListTlsInspectionPoliciesResponse unreachable */ + unreachable?: (string[]|null); + } + + /** Represents a ListTlsInspectionPoliciesResponse. */ + class ListTlsInspectionPoliciesResponse implements IListTlsInspectionPoliciesResponse { + + /** + * Constructs a new ListTlsInspectionPoliciesResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.networksecurity.v1.IListTlsInspectionPoliciesResponse); + + /** ListTlsInspectionPoliciesResponse tlsInspectionPolicies. */ + public tlsInspectionPolicies: google.cloud.networksecurity.v1.ITlsInspectionPolicy[]; + + /** ListTlsInspectionPoliciesResponse nextPageToken. */ + public nextPageToken: string; + + /** ListTlsInspectionPoliciesResponse unreachable. */ + public unreachable: string[]; + + /** + * Creates a new ListTlsInspectionPoliciesResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListTlsInspectionPoliciesResponse instance + */ + public static create(properties?: google.cloud.networksecurity.v1.IListTlsInspectionPoliciesResponse): google.cloud.networksecurity.v1.ListTlsInspectionPoliciesResponse; + + /** + * Encodes the specified ListTlsInspectionPoliciesResponse message. Does not implicitly {@link google.cloud.networksecurity.v1.ListTlsInspectionPoliciesResponse.verify|verify} messages. + * @param message ListTlsInspectionPoliciesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.networksecurity.v1.IListTlsInspectionPoliciesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListTlsInspectionPoliciesResponse message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.ListTlsInspectionPoliciesResponse.verify|verify} messages. + * @param message ListTlsInspectionPoliciesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.networksecurity.v1.IListTlsInspectionPoliciesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListTlsInspectionPoliciesResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListTlsInspectionPoliciesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.networksecurity.v1.ListTlsInspectionPoliciesResponse; + + /** + * Decodes a ListTlsInspectionPoliciesResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListTlsInspectionPoliciesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.networksecurity.v1.ListTlsInspectionPoliciesResponse; + + /** + * Verifies a ListTlsInspectionPoliciesResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListTlsInspectionPoliciesResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListTlsInspectionPoliciesResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.networksecurity.v1.ListTlsInspectionPoliciesResponse; + + /** + * Creates a plain object from a ListTlsInspectionPoliciesResponse message. Also converts values to other types if specified. + * @param message ListTlsInspectionPoliciesResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.networksecurity.v1.ListTlsInspectionPoliciesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListTlsInspectionPoliciesResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListTlsInspectionPoliciesResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetTlsInspectionPolicyRequest. */ + interface IGetTlsInspectionPolicyRequest { + + /** GetTlsInspectionPolicyRequest name */ + name?: (string|null); + } + + /** Represents a GetTlsInspectionPolicyRequest. */ + class GetTlsInspectionPolicyRequest implements IGetTlsInspectionPolicyRequest { + + /** + * Constructs a new GetTlsInspectionPolicyRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.networksecurity.v1.IGetTlsInspectionPolicyRequest); + + /** GetTlsInspectionPolicyRequest name. */ + public name: string; + + /** + * Creates a new GetTlsInspectionPolicyRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetTlsInspectionPolicyRequest instance + */ + public static create(properties?: google.cloud.networksecurity.v1.IGetTlsInspectionPolicyRequest): google.cloud.networksecurity.v1.GetTlsInspectionPolicyRequest; + + /** + * Encodes the specified GetTlsInspectionPolicyRequest message. Does not implicitly {@link google.cloud.networksecurity.v1.GetTlsInspectionPolicyRequest.verify|verify} messages. + * @param message GetTlsInspectionPolicyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.networksecurity.v1.IGetTlsInspectionPolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetTlsInspectionPolicyRequest message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.GetTlsInspectionPolicyRequest.verify|verify} messages. + * @param message GetTlsInspectionPolicyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.networksecurity.v1.IGetTlsInspectionPolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetTlsInspectionPolicyRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetTlsInspectionPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.networksecurity.v1.GetTlsInspectionPolicyRequest; + + /** + * Decodes a GetTlsInspectionPolicyRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetTlsInspectionPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.networksecurity.v1.GetTlsInspectionPolicyRequest; + + /** + * Verifies a GetTlsInspectionPolicyRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetTlsInspectionPolicyRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetTlsInspectionPolicyRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.networksecurity.v1.GetTlsInspectionPolicyRequest; + + /** + * Creates a plain object from a GetTlsInspectionPolicyRequest message. Also converts values to other types if specified. + * @param message GetTlsInspectionPolicyRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.networksecurity.v1.GetTlsInspectionPolicyRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetTlsInspectionPolicyRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetTlsInspectionPolicyRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteTlsInspectionPolicyRequest. */ + interface IDeleteTlsInspectionPolicyRequest { + + /** DeleteTlsInspectionPolicyRequest name */ + name?: (string|null); + + /** DeleteTlsInspectionPolicyRequest force */ + force?: (boolean|null); + } + + /** Represents a DeleteTlsInspectionPolicyRequest. */ + class DeleteTlsInspectionPolicyRequest implements IDeleteTlsInspectionPolicyRequest { + + /** + * Constructs a new DeleteTlsInspectionPolicyRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.networksecurity.v1.IDeleteTlsInspectionPolicyRequest); + + /** DeleteTlsInspectionPolicyRequest name. */ + public name: string; + + /** DeleteTlsInspectionPolicyRequest force. */ + public force: boolean; + + /** + * Creates a new DeleteTlsInspectionPolicyRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteTlsInspectionPolicyRequest instance + */ + public static create(properties?: google.cloud.networksecurity.v1.IDeleteTlsInspectionPolicyRequest): google.cloud.networksecurity.v1.DeleteTlsInspectionPolicyRequest; + + /** + * Encodes the specified DeleteTlsInspectionPolicyRequest message. Does not implicitly {@link google.cloud.networksecurity.v1.DeleteTlsInspectionPolicyRequest.verify|verify} messages. + * @param message DeleteTlsInspectionPolicyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.networksecurity.v1.IDeleteTlsInspectionPolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteTlsInspectionPolicyRequest message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.DeleteTlsInspectionPolicyRequest.verify|verify} messages. + * @param message DeleteTlsInspectionPolicyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.networksecurity.v1.IDeleteTlsInspectionPolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteTlsInspectionPolicyRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteTlsInspectionPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.networksecurity.v1.DeleteTlsInspectionPolicyRequest; + + /** + * Decodes a DeleteTlsInspectionPolicyRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteTlsInspectionPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.networksecurity.v1.DeleteTlsInspectionPolicyRequest; + + /** + * Verifies a DeleteTlsInspectionPolicyRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteTlsInspectionPolicyRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteTlsInspectionPolicyRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.networksecurity.v1.DeleteTlsInspectionPolicyRequest; + + /** + * Creates a plain object from a DeleteTlsInspectionPolicyRequest message. Also converts values to other types if specified. + * @param message DeleteTlsInspectionPolicyRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.networksecurity.v1.DeleteTlsInspectionPolicyRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteTlsInspectionPolicyRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteTlsInspectionPolicyRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateTlsInspectionPolicyRequest. */ + interface IUpdateTlsInspectionPolicyRequest { + + /** UpdateTlsInspectionPolicyRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateTlsInspectionPolicyRequest tlsInspectionPolicy */ + tlsInspectionPolicy?: (google.cloud.networksecurity.v1.ITlsInspectionPolicy|null); + } + + /** Represents an UpdateTlsInspectionPolicyRequest. */ + class UpdateTlsInspectionPolicyRequest implements IUpdateTlsInspectionPolicyRequest { + + /** + * Constructs a new UpdateTlsInspectionPolicyRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.networksecurity.v1.IUpdateTlsInspectionPolicyRequest); + + /** UpdateTlsInspectionPolicyRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateTlsInspectionPolicyRequest tlsInspectionPolicy. */ + public tlsInspectionPolicy?: (google.cloud.networksecurity.v1.ITlsInspectionPolicy|null); + + /** + * Creates a new UpdateTlsInspectionPolicyRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateTlsInspectionPolicyRequest instance + */ + public static create(properties?: google.cloud.networksecurity.v1.IUpdateTlsInspectionPolicyRequest): google.cloud.networksecurity.v1.UpdateTlsInspectionPolicyRequest; + + /** + * Encodes the specified UpdateTlsInspectionPolicyRequest message. Does not implicitly {@link google.cloud.networksecurity.v1.UpdateTlsInspectionPolicyRequest.verify|verify} messages. + * @param message UpdateTlsInspectionPolicyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.networksecurity.v1.IUpdateTlsInspectionPolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateTlsInspectionPolicyRequest message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.UpdateTlsInspectionPolicyRequest.verify|verify} messages. + * @param message UpdateTlsInspectionPolicyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.networksecurity.v1.IUpdateTlsInspectionPolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateTlsInspectionPolicyRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateTlsInspectionPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.networksecurity.v1.UpdateTlsInspectionPolicyRequest; + + /** + * Decodes an UpdateTlsInspectionPolicyRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateTlsInspectionPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.networksecurity.v1.UpdateTlsInspectionPolicyRequest; + + /** + * Verifies an UpdateTlsInspectionPolicyRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UpdateTlsInspectionPolicyRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateTlsInspectionPolicyRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.networksecurity.v1.UpdateTlsInspectionPolicyRequest; + + /** + * Creates a plain object from an UpdateTlsInspectionPolicyRequest message. Also converts values to other types if specified. + * @param message UpdateTlsInspectionPolicyRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.networksecurity.v1.UpdateTlsInspectionPolicyRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateTlsInspectionPolicyRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateTlsInspectionPolicyRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UrlList. */ + interface IUrlList { + + /** UrlList name */ + name?: (string|null); + + /** UrlList createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** UrlList updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** UrlList description */ + description?: (string|null); + + /** UrlList values */ + values?: (string[]|null); + } + + /** Represents an UrlList. */ + class UrlList implements IUrlList { + + /** + * Constructs a new UrlList. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.networksecurity.v1.IUrlList); + + /** UrlList name. */ + public name: string; + + /** UrlList createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** UrlList updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** UrlList description. */ + public description: string; + + /** UrlList values. */ + public values: string[]; + + /** + * Creates a new UrlList instance using the specified properties. + * @param [properties] Properties to set + * @returns UrlList instance + */ + public static create(properties?: google.cloud.networksecurity.v1.IUrlList): google.cloud.networksecurity.v1.UrlList; + + /** + * Encodes the specified UrlList message. Does not implicitly {@link google.cloud.networksecurity.v1.UrlList.verify|verify} messages. + * @param message UrlList message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.networksecurity.v1.IUrlList, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UrlList message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.UrlList.verify|verify} messages. + * @param message UrlList message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.networksecurity.v1.IUrlList, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UrlList message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UrlList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.networksecurity.v1.UrlList; + + /** + * Decodes an UrlList message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UrlList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.networksecurity.v1.UrlList; + + /** + * Verifies an UrlList message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UrlList message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UrlList + */ + public static fromObject(object: { [k: string]: any }): google.cloud.networksecurity.v1.UrlList; + + /** + * Creates a plain object from an UrlList message. Also converts values to other types if specified. + * @param message UrlList + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.networksecurity.v1.UrlList, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UrlList to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UrlList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListUrlListsRequest. */ + interface IListUrlListsRequest { + + /** ListUrlListsRequest parent */ + parent?: (string|null); + + /** ListUrlListsRequest pageSize */ + pageSize?: (number|null); + + /** ListUrlListsRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListUrlListsRequest. */ + class ListUrlListsRequest implements IListUrlListsRequest { + + /** + * Constructs a new ListUrlListsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.networksecurity.v1.IListUrlListsRequest); + + /** ListUrlListsRequest parent. */ + public parent: string; + + /** ListUrlListsRequest pageSize. */ + public pageSize: number; + + /** ListUrlListsRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListUrlListsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListUrlListsRequest instance + */ + public static create(properties?: google.cloud.networksecurity.v1.IListUrlListsRequest): google.cloud.networksecurity.v1.ListUrlListsRequest; + + /** + * Encodes the specified ListUrlListsRequest message. Does not implicitly {@link google.cloud.networksecurity.v1.ListUrlListsRequest.verify|verify} messages. + * @param message ListUrlListsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.networksecurity.v1.IListUrlListsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListUrlListsRequest message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.ListUrlListsRequest.verify|verify} messages. + * @param message ListUrlListsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.networksecurity.v1.IListUrlListsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListUrlListsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListUrlListsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.networksecurity.v1.ListUrlListsRequest; + + /** + * Decodes a ListUrlListsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListUrlListsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.networksecurity.v1.ListUrlListsRequest; + + /** + * Verifies a ListUrlListsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListUrlListsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListUrlListsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.networksecurity.v1.ListUrlListsRequest; + + /** + * Creates a plain object from a ListUrlListsRequest message. Also converts values to other types if specified. + * @param message ListUrlListsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.networksecurity.v1.ListUrlListsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListUrlListsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListUrlListsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListUrlListsResponse. */ + interface IListUrlListsResponse { + + /** ListUrlListsResponse urlLists */ + urlLists?: (google.cloud.networksecurity.v1.IUrlList[]|null); + + /** ListUrlListsResponse nextPageToken */ + nextPageToken?: (string|null); + + /** ListUrlListsResponse unreachable */ + unreachable?: (string[]|null); + } + + /** Represents a ListUrlListsResponse. */ + class ListUrlListsResponse implements IListUrlListsResponse { + + /** + * Constructs a new ListUrlListsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.networksecurity.v1.IListUrlListsResponse); + + /** ListUrlListsResponse urlLists. */ + public urlLists: google.cloud.networksecurity.v1.IUrlList[]; + + /** ListUrlListsResponse nextPageToken. */ + public nextPageToken: string; + + /** ListUrlListsResponse unreachable. */ + public unreachable: string[]; + + /** + * Creates a new ListUrlListsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListUrlListsResponse instance + */ + public static create(properties?: google.cloud.networksecurity.v1.IListUrlListsResponse): google.cloud.networksecurity.v1.ListUrlListsResponse; + + /** + * Encodes the specified ListUrlListsResponse message. Does not implicitly {@link google.cloud.networksecurity.v1.ListUrlListsResponse.verify|verify} messages. + * @param message ListUrlListsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.networksecurity.v1.IListUrlListsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListUrlListsResponse message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.ListUrlListsResponse.verify|verify} messages. + * @param message ListUrlListsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.networksecurity.v1.IListUrlListsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListUrlListsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListUrlListsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.networksecurity.v1.ListUrlListsResponse; + + /** + * Decodes a ListUrlListsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListUrlListsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.networksecurity.v1.ListUrlListsResponse; + + /** + * Verifies a ListUrlListsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListUrlListsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListUrlListsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.networksecurity.v1.ListUrlListsResponse; + + /** + * Creates a plain object from a ListUrlListsResponse message. Also converts values to other types if specified. + * @param message ListUrlListsResponse + * @param [options] Conversion options + * @returns Plain object */ - public static fromObject(object: { [k: string]: any }): google.cloud.networksecurity.v1.ListClientTlsPoliciesResponse; + public static toObject(message: google.cloud.networksecurity.v1.ListUrlListsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Creates a plain object from a ListClientTlsPoliciesResponse message. Also converts values to other types if specified. - * @param message ListClientTlsPoliciesResponse + * Converts this ListUrlListsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListUrlListsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetUrlListRequest. */ + interface IGetUrlListRequest { + + /** GetUrlListRequest name */ + name?: (string|null); + } + + /** Represents a GetUrlListRequest. */ + class GetUrlListRequest implements IGetUrlListRequest { + + /** + * Constructs a new GetUrlListRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.networksecurity.v1.IGetUrlListRequest); + + /** GetUrlListRequest name. */ + public name: string; + + /** + * Creates a new GetUrlListRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetUrlListRequest instance + */ + public static create(properties?: google.cloud.networksecurity.v1.IGetUrlListRequest): google.cloud.networksecurity.v1.GetUrlListRequest; + + /** + * Encodes the specified GetUrlListRequest message. Does not implicitly {@link google.cloud.networksecurity.v1.GetUrlListRequest.verify|verify} messages. + * @param message GetUrlListRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.networksecurity.v1.IGetUrlListRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetUrlListRequest message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.GetUrlListRequest.verify|verify} messages. + * @param message GetUrlListRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.networksecurity.v1.IGetUrlListRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetUrlListRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetUrlListRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.networksecurity.v1.GetUrlListRequest; + + /** + * Decodes a GetUrlListRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetUrlListRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.networksecurity.v1.GetUrlListRequest; + + /** + * Verifies a GetUrlListRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetUrlListRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetUrlListRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.networksecurity.v1.GetUrlListRequest; + + /** + * Creates a plain object from a GetUrlListRequest message. Also converts values to other types if specified. + * @param message GetUrlListRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.networksecurity.v1.GetUrlListRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetUrlListRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetUrlListRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateUrlListRequest. */ + interface ICreateUrlListRequest { + + /** CreateUrlListRequest parent */ + parent?: (string|null); + + /** CreateUrlListRequest urlListId */ + urlListId?: (string|null); + + /** CreateUrlListRequest urlList */ + urlList?: (google.cloud.networksecurity.v1.IUrlList|null); + } + + /** Represents a CreateUrlListRequest. */ + class CreateUrlListRequest implements ICreateUrlListRequest { + + /** + * Constructs a new CreateUrlListRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.networksecurity.v1.ICreateUrlListRequest); + + /** CreateUrlListRequest parent. */ + public parent: string; + + /** CreateUrlListRequest urlListId. */ + public urlListId: string; + + /** CreateUrlListRequest urlList. */ + public urlList?: (google.cloud.networksecurity.v1.IUrlList|null); + + /** + * Creates a new CreateUrlListRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateUrlListRequest instance + */ + public static create(properties?: google.cloud.networksecurity.v1.ICreateUrlListRequest): google.cloud.networksecurity.v1.CreateUrlListRequest; + + /** + * Encodes the specified CreateUrlListRequest message. Does not implicitly {@link google.cloud.networksecurity.v1.CreateUrlListRequest.verify|verify} messages. + * @param message CreateUrlListRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.networksecurity.v1.ICreateUrlListRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateUrlListRequest message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.CreateUrlListRequest.verify|verify} messages. + * @param message CreateUrlListRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.networksecurity.v1.ICreateUrlListRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateUrlListRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateUrlListRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.networksecurity.v1.CreateUrlListRequest; + + /** + * Decodes a CreateUrlListRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateUrlListRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.networksecurity.v1.CreateUrlListRequest; + + /** + * Verifies a CreateUrlListRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateUrlListRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateUrlListRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.networksecurity.v1.CreateUrlListRequest; + + /** + * Creates a plain object from a CreateUrlListRequest message. Also converts values to other types if specified. + * @param message CreateUrlListRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.networksecurity.v1.CreateUrlListRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateUrlListRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateUrlListRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateUrlListRequest. */ + interface IUpdateUrlListRequest { + + /** UpdateUrlListRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateUrlListRequest urlList */ + urlList?: (google.cloud.networksecurity.v1.IUrlList|null); + } + + /** Represents an UpdateUrlListRequest. */ + class UpdateUrlListRequest implements IUpdateUrlListRequest { + + /** + * Constructs a new UpdateUrlListRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.networksecurity.v1.IUpdateUrlListRequest); + + /** UpdateUrlListRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateUrlListRequest urlList. */ + public urlList?: (google.cloud.networksecurity.v1.IUrlList|null); + + /** + * Creates a new UpdateUrlListRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateUrlListRequest instance + */ + public static create(properties?: google.cloud.networksecurity.v1.IUpdateUrlListRequest): google.cloud.networksecurity.v1.UpdateUrlListRequest; + + /** + * Encodes the specified UpdateUrlListRequest message. Does not implicitly {@link google.cloud.networksecurity.v1.UpdateUrlListRequest.verify|verify} messages. + * @param message UpdateUrlListRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.networksecurity.v1.IUpdateUrlListRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateUrlListRequest message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.UpdateUrlListRequest.verify|verify} messages. + * @param message UpdateUrlListRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.networksecurity.v1.IUpdateUrlListRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateUrlListRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateUrlListRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.networksecurity.v1.UpdateUrlListRequest; + + /** + * Decodes an UpdateUrlListRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateUrlListRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.networksecurity.v1.UpdateUrlListRequest; + + /** + * Verifies an UpdateUrlListRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UpdateUrlListRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateUrlListRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.networksecurity.v1.UpdateUrlListRequest; + + /** + * Creates a plain object from an UpdateUrlListRequest message. Also converts values to other types if specified. + * @param message UpdateUrlListRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.networksecurity.v1.UpdateUrlListRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateUrlListRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateUrlListRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteUrlListRequest. */ + interface IDeleteUrlListRequest { + + /** DeleteUrlListRequest name */ + name?: (string|null); + } + + /** Represents a DeleteUrlListRequest. */ + class DeleteUrlListRequest implements IDeleteUrlListRequest { + + /** + * Constructs a new DeleteUrlListRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.networksecurity.v1.IDeleteUrlListRequest); + + /** DeleteUrlListRequest name. */ + public name: string; + + /** + * Creates a new DeleteUrlListRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteUrlListRequest instance + */ + public static create(properties?: google.cloud.networksecurity.v1.IDeleteUrlListRequest): google.cloud.networksecurity.v1.DeleteUrlListRequest; + + /** + * Encodes the specified DeleteUrlListRequest message. Does not implicitly {@link google.cloud.networksecurity.v1.DeleteUrlListRequest.verify|verify} messages. + * @param message DeleteUrlListRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.networksecurity.v1.IDeleteUrlListRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteUrlListRequest message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.DeleteUrlListRequest.verify|verify} messages. + * @param message DeleteUrlListRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.networksecurity.v1.IDeleteUrlListRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteUrlListRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteUrlListRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.networksecurity.v1.DeleteUrlListRequest; + + /** + * Decodes a DeleteUrlListRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteUrlListRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.networksecurity.v1.DeleteUrlListRequest; + + /** + * Verifies a DeleteUrlListRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteUrlListRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteUrlListRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.networksecurity.v1.DeleteUrlListRequest; + + /** + * Creates a plain object from a DeleteUrlListRequest message. Also converts values to other types if specified. + * @param message DeleteUrlListRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.networksecurity.v1.DeleteUrlListRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteUrlListRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteUrlListRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SecurityProfileGroup. */ + interface ISecurityProfileGroup { + + /** SecurityProfileGroup name */ + name?: (string|null); + + /** SecurityProfileGroup description */ + description?: (string|null); + + /** SecurityProfileGroup createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** SecurityProfileGroup updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** SecurityProfileGroup etag */ + etag?: (string|null); + + /** SecurityProfileGroup dataPathId */ + dataPathId?: (number|Long|string|null); + + /** SecurityProfileGroup labels */ + labels?: ({ [k: string]: string }|null); + + /** SecurityProfileGroup threatPreventionProfile */ + threatPreventionProfile?: (string|null); + + /** SecurityProfileGroup customMirroringProfile */ + customMirroringProfile?: (string|null); + + /** SecurityProfileGroup customInterceptProfile */ + customInterceptProfile?: (string|null); + + /** SecurityProfileGroup urlFilteringProfile */ + urlFilteringProfile?: (string|null); + } + + /** Represents a SecurityProfileGroup. */ + class SecurityProfileGroup implements ISecurityProfileGroup { + + /** + * Constructs a new SecurityProfileGroup. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.networksecurity.v1.ISecurityProfileGroup); + + /** SecurityProfileGroup name. */ + public name: string; + + /** SecurityProfileGroup description. */ + public description: string; + + /** SecurityProfileGroup createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** SecurityProfileGroup updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** SecurityProfileGroup etag. */ + public etag: string; + + /** SecurityProfileGroup dataPathId. */ + public dataPathId: (number|Long|string); + + /** SecurityProfileGroup labels. */ + public labels: { [k: string]: string }; + + /** SecurityProfileGroup threatPreventionProfile. */ + public threatPreventionProfile: string; + + /** SecurityProfileGroup customMirroringProfile. */ + public customMirroringProfile: string; + + /** SecurityProfileGroup customInterceptProfile. */ + public customInterceptProfile: string; + + /** SecurityProfileGroup urlFilteringProfile. */ + public urlFilteringProfile: string; + + /** + * Creates a new SecurityProfileGroup instance using the specified properties. + * @param [properties] Properties to set + * @returns SecurityProfileGroup instance + */ + public static create(properties?: google.cloud.networksecurity.v1.ISecurityProfileGroup): google.cloud.networksecurity.v1.SecurityProfileGroup; + + /** + * Encodes the specified SecurityProfileGroup message. Does not implicitly {@link google.cloud.networksecurity.v1.SecurityProfileGroup.verify|verify} messages. + * @param message SecurityProfileGroup message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.networksecurity.v1.ISecurityProfileGroup, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SecurityProfileGroup message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.SecurityProfileGroup.verify|verify} messages. + * @param message SecurityProfileGroup message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.networksecurity.v1.ISecurityProfileGroup, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SecurityProfileGroup message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SecurityProfileGroup + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.networksecurity.v1.SecurityProfileGroup; + + /** + * Decodes a SecurityProfileGroup message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SecurityProfileGroup + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.networksecurity.v1.SecurityProfileGroup; + + /** + * Verifies a SecurityProfileGroup message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SecurityProfileGroup message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SecurityProfileGroup + */ + public static fromObject(object: { [k: string]: any }): google.cloud.networksecurity.v1.SecurityProfileGroup; + + /** + * Creates a plain object from a SecurityProfileGroup message. Also converts values to other types if specified. + * @param message SecurityProfileGroup * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.networksecurity.v1.ListClientTlsPoliciesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.networksecurity.v1.SecurityProfileGroup, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ListClientTlsPoliciesResponse to JSON. + * Converts this SecurityProfileGroup to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for ListClientTlsPoliciesResponse + * Gets the default type url for SecurityProfileGroup * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a GetClientTlsPolicyRequest. */ - interface IGetClientTlsPolicyRequest { + /** Properties of a SecurityProfile. */ + interface ISecurityProfile { - /** GetClientTlsPolicyRequest name */ + /** SecurityProfile threatPreventionProfile */ + threatPreventionProfile?: (google.cloud.networksecurity.v1.IThreatPreventionProfile|null); + + /** SecurityProfile customMirroringProfile */ + customMirroringProfile?: (google.cloud.networksecurity.v1.ICustomMirroringProfile|null); + + /** SecurityProfile customInterceptProfile */ + customInterceptProfile?: (google.cloud.networksecurity.v1.ICustomInterceptProfile|null); + + /** SecurityProfile urlFilteringProfile */ + urlFilteringProfile?: (google.cloud.networksecurity.v1.IUrlFilteringProfile|null); + + /** SecurityProfile name */ name?: (string|null); + + /** SecurityProfile description */ + description?: (string|null); + + /** SecurityProfile createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** SecurityProfile updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** SecurityProfile etag */ + etag?: (string|null); + + /** SecurityProfile labels */ + labels?: ({ [k: string]: string }|null); + + /** SecurityProfile type */ + type?: (google.cloud.networksecurity.v1.SecurityProfile.ProfileType|keyof typeof google.cloud.networksecurity.v1.SecurityProfile.ProfileType|null); } - /** Represents a GetClientTlsPolicyRequest. */ - class GetClientTlsPolicyRequest implements IGetClientTlsPolicyRequest { + /** Represents a SecurityProfile. */ + class SecurityProfile implements ISecurityProfile { /** - * Constructs a new GetClientTlsPolicyRequest. + * Constructs a new SecurityProfile. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.networksecurity.v1.IGetClientTlsPolicyRequest); + constructor(properties?: google.cloud.networksecurity.v1.ISecurityProfile); - /** GetClientTlsPolicyRequest name. */ + /** SecurityProfile threatPreventionProfile. */ + public threatPreventionProfile?: (google.cloud.networksecurity.v1.IThreatPreventionProfile|null); + + /** SecurityProfile customMirroringProfile. */ + public customMirroringProfile?: (google.cloud.networksecurity.v1.ICustomMirroringProfile|null); + + /** SecurityProfile customInterceptProfile. */ + public customInterceptProfile?: (google.cloud.networksecurity.v1.ICustomInterceptProfile|null); + + /** SecurityProfile urlFilteringProfile. */ + public urlFilteringProfile?: (google.cloud.networksecurity.v1.IUrlFilteringProfile|null); + + /** SecurityProfile name. */ public name: string; + /** SecurityProfile description. */ + public description: string; + + /** SecurityProfile createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** SecurityProfile updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** SecurityProfile etag. */ + public etag: string; + + /** SecurityProfile labels. */ + public labels: { [k: string]: string }; + + /** SecurityProfile type. */ + public type: (google.cloud.networksecurity.v1.SecurityProfile.ProfileType|keyof typeof google.cloud.networksecurity.v1.SecurityProfile.ProfileType); + + /** SecurityProfile profile. */ + public profile?: ("threatPreventionProfile"|"customMirroringProfile"|"customInterceptProfile"|"urlFilteringProfile"); + /** - * Creates a new GetClientTlsPolicyRequest instance using the specified properties. + * Creates a new SecurityProfile instance using the specified properties. * @param [properties] Properties to set - * @returns GetClientTlsPolicyRequest instance + * @returns SecurityProfile instance */ - public static create(properties?: google.cloud.networksecurity.v1.IGetClientTlsPolicyRequest): google.cloud.networksecurity.v1.GetClientTlsPolicyRequest; + public static create(properties?: google.cloud.networksecurity.v1.ISecurityProfile): google.cloud.networksecurity.v1.SecurityProfile; /** - * Encodes the specified GetClientTlsPolicyRequest message. Does not implicitly {@link google.cloud.networksecurity.v1.GetClientTlsPolicyRequest.verify|verify} messages. - * @param message GetClientTlsPolicyRequest message or plain object to encode + * Encodes the specified SecurityProfile message. Does not implicitly {@link google.cloud.networksecurity.v1.SecurityProfile.verify|verify} messages. + * @param message SecurityProfile message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.networksecurity.v1.IGetClientTlsPolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.networksecurity.v1.ISecurityProfile, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified GetClientTlsPolicyRequest message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.GetClientTlsPolicyRequest.verify|verify} messages. - * @param message GetClientTlsPolicyRequest message or plain object to encode + * Encodes the specified SecurityProfile message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.SecurityProfile.verify|verify} messages. + * @param message SecurityProfile message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.networksecurity.v1.IGetClientTlsPolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.networksecurity.v1.ISecurityProfile, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a GetClientTlsPolicyRequest message from the specified reader or buffer. + * Decodes a SecurityProfile message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns GetClientTlsPolicyRequest + * @returns SecurityProfile * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.networksecurity.v1.GetClientTlsPolicyRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.networksecurity.v1.SecurityProfile; /** - * Decodes a GetClientTlsPolicyRequest message from the specified reader or buffer, length delimited. + * Decodes a SecurityProfile message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns GetClientTlsPolicyRequest + * @returns SecurityProfile * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.networksecurity.v1.GetClientTlsPolicyRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.networksecurity.v1.SecurityProfile; /** - * Verifies a GetClientTlsPolicyRequest message. + * Verifies a SecurityProfile message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a GetClientTlsPolicyRequest message from a plain object. Also converts values to their respective internal types. + * Creates a SecurityProfile message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns GetClientTlsPolicyRequest + * @returns SecurityProfile */ - public static fromObject(object: { [k: string]: any }): google.cloud.networksecurity.v1.GetClientTlsPolicyRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.networksecurity.v1.SecurityProfile; /** - * Creates a plain object from a GetClientTlsPolicyRequest message. Also converts values to other types if specified. - * @param message GetClientTlsPolicyRequest + * Creates a plain object from a SecurityProfile message. Also converts values to other types if specified. + * @param message SecurityProfile * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.networksecurity.v1.GetClientTlsPolicyRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.networksecurity.v1.SecurityProfile, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this GetClientTlsPolicyRequest to JSON. + * Converts this SecurityProfile to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for GetClientTlsPolicyRequest + * Gets the default type url for SecurityProfile * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a CreateClientTlsPolicyRequest. */ - interface ICreateClientTlsPolicyRequest { + namespace SecurityProfile { - /** CreateClientTlsPolicyRequest parent */ - parent?: (string|null); + /** ProfileType enum. */ + enum ProfileType { + PROFILE_TYPE_UNSPECIFIED = 0, + THREAT_PREVENTION = 1, + CUSTOM_MIRRORING = 2, + CUSTOM_INTERCEPT = 3, + URL_FILTERING = 5 + } + } - /** CreateClientTlsPolicyRequest clientTlsPolicyId */ - clientTlsPolicyId?: (string|null); + /** Properties of a CustomInterceptProfile. */ + interface ICustomInterceptProfile { - /** CreateClientTlsPolicyRequest clientTlsPolicy */ - clientTlsPolicy?: (google.cloud.networksecurity.v1.IClientTlsPolicy|null); + /** CustomInterceptProfile interceptEndpointGroup */ + interceptEndpointGroup?: (string|null); } - /** Represents a CreateClientTlsPolicyRequest. */ - class CreateClientTlsPolicyRequest implements ICreateClientTlsPolicyRequest { + /** Represents a CustomInterceptProfile. */ + class CustomInterceptProfile implements ICustomInterceptProfile { /** - * Constructs a new CreateClientTlsPolicyRequest. + * Constructs a new CustomInterceptProfile. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.networksecurity.v1.ICreateClientTlsPolicyRequest); - - /** CreateClientTlsPolicyRequest parent. */ - public parent: string; + constructor(properties?: google.cloud.networksecurity.v1.ICustomInterceptProfile); - /** CreateClientTlsPolicyRequest clientTlsPolicyId. */ - public clientTlsPolicyId: string; - - /** CreateClientTlsPolicyRequest clientTlsPolicy. */ - public clientTlsPolicy?: (google.cloud.networksecurity.v1.IClientTlsPolicy|null); + /** CustomInterceptProfile interceptEndpointGroup. */ + public interceptEndpointGroup: string; /** - * Creates a new CreateClientTlsPolicyRequest instance using the specified properties. + * Creates a new CustomInterceptProfile instance using the specified properties. * @param [properties] Properties to set - * @returns CreateClientTlsPolicyRequest instance + * @returns CustomInterceptProfile instance */ - public static create(properties?: google.cloud.networksecurity.v1.ICreateClientTlsPolicyRequest): google.cloud.networksecurity.v1.CreateClientTlsPolicyRequest; + public static create(properties?: google.cloud.networksecurity.v1.ICustomInterceptProfile): google.cloud.networksecurity.v1.CustomInterceptProfile; /** - * Encodes the specified CreateClientTlsPolicyRequest message. Does not implicitly {@link google.cloud.networksecurity.v1.CreateClientTlsPolicyRequest.verify|verify} messages. - * @param message CreateClientTlsPolicyRequest message or plain object to encode + * Encodes the specified CustomInterceptProfile message. Does not implicitly {@link google.cloud.networksecurity.v1.CustomInterceptProfile.verify|verify} messages. + * @param message CustomInterceptProfile message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.networksecurity.v1.ICreateClientTlsPolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.networksecurity.v1.ICustomInterceptProfile, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified CreateClientTlsPolicyRequest message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.CreateClientTlsPolicyRequest.verify|verify} messages. - * @param message CreateClientTlsPolicyRequest message or plain object to encode + * Encodes the specified CustomInterceptProfile message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.CustomInterceptProfile.verify|verify} messages. + * @param message CustomInterceptProfile message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.networksecurity.v1.ICreateClientTlsPolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.networksecurity.v1.ICustomInterceptProfile, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a CreateClientTlsPolicyRequest message from the specified reader or buffer. + * Decodes a CustomInterceptProfile message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns CreateClientTlsPolicyRequest + * @returns CustomInterceptProfile * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.networksecurity.v1.CreateClientTlsPolicyRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.networksecurity.v1.CustomInterceptProfile; /** - * Decodes a CreateClientTlsPolicyRequest message from the specified reader or buffer, length delimited. + * Decodes a CustomInterceptProfile message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns CreateClientTlsPolicyRequest + * @returns CustomInterceptProfile * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.networksecurity.v1.CreateClientTlsPolicyRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.networksecurity.v1.CustomInterceptProfile; /** - * Verifies a CreateClientTlsPolicyRequest message. + * Verifies a CustomInterceptProfile message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a CreateClientTlsPolicyRequest message from a plain object. Also converts values to their respective internal types. + * Creates a CustomInterceptProfile message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns CreateClientTlsPolicyRequest + * @returns CustomInterceptProfile */ - public static fromObject(object: { [k: string]: any }): google.cloud.networksecurity.v1.CreateClientTlsPolicyRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.networksecurity.v1.CustomInterceptProfile; /** - * Creates a plain object from a CreateClientTlsPolicyRequest message. Also converts values to other types if specified. - * @param message CreateClientTlsPolicyRequest + * Creates a plain object from a CustomInterceptProfile message. Also converts values to other types if specified. + * @param message CustomInterceptProfile * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.networksecurity.v1.CreateClientTlsPolicyRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.networksecurity.v1.CustomInterceptProfile, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this CreateClientTlsPolicyRequest to JSON. + * Converts this CustomInterceptProfile to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for CreateClientTlsPolicyRequest + * Gets the default type url for CustomInterceptProfile * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of an UpdateClientTlsPolicyRequest. */ - interface IUpdateClientTlsPolicyRequest { - - /** UpdateClientTlsPolicyRequest updateMask */ - updateMask?: (google.protobuf.IFieldMask|null); + /** Properties of a CustomMirroringProfile. */ + interface ICustomMirroringProfile { - /** UpdateClientTlsPolicyRequest clientTlsPolicy */ - clientTlsPolicy?: (google.cloud.networksecurity.v1.IClientTlsPolicy|null); + /** CustomMirroringProfile mirroringEndpointGroup */ + mirroringEndpointGroup?: (string|null); } - /** Represents an UpdateClientTlsPolicyRequest. */ - class UpdateClientTlsPolicyRequest implements IUpdateClientTlsPolicyRequest { + /** Represents a CustomMirroringProfile. */ + class CustomMirroringProfile implements ICustomMirroringProfile { /** - * Constructs a new UpdateClientTlsPolicyRequest. + * Constructs a new CustomMirroringProfile. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.networksecurity.v1.IUpdateClientTlsPolicyRequest); + constructor(properties?: google.cloud.networksecurity.v1.ICustomMirroringProfile); - /** UpdateClientTlsPolicyRequest updateMask. */ - public updateMask?: (google.protobuf.IFieldMask|null); - - /** UpdateClientTlsPolicyRequest clientTlsPolicy. */ - public clientTlsPolicy?: (google.cloud.networksecurity.v1.IClientTlsPolicy|null); + /** CustomMirroringProfile mirroringEndpointGroup. */ + public mirroringEndpointGroup: string; /** - * Creates a new UpdateClientTlsPolicyRequest instance using the specified properties. + * Creates a new CustomMirroringProfile instance using the specified properties. * @param [properties] Properties to set - * @returns UpdateClientTlsPolicyRequest instance + * @returns CustomMirroringProfile instance */ - public static create(properties?: google.cloud.networksecurity.v1.IUpdateClientTlsPolicyRequest): google.cloud.networksecurity.v1.UpdateClientTlsPolicyRequest; + public static create(properties?: google.cloud.networksecurity.v1.ICustomMirroringProfile): google.cloud.networksecurity.v1.CustomMirroringProfile; /** - * Encodes the specified UpdateClientTlsPolicyRequest message. Does not implicitly {@link google.cloud.networksecurity.v1.UpdateClientTlsPolicyRequest.verify|verify} messages. - * @param message UpdateClientTlsPolicyRequest message or plain object to encode + * Encodes the specified CustomMirroringProfile message. Does not implicitly {@link google.cloud.networksecurity.v1.CustomMirroringProfile.verify|verify} messages. + * @param message CustomMirroringProfile message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.networksecurity.v1.IUpdateClientTlsPolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.networksecurity.v1.ICustomMirroringProfile, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified UpdateClientTlsPolicyRequest message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.UpdateClientTlsPolicyRequest.verify|verify} messages. - * @param message UpdateClientTlsPolicyRequest message or plain object to encode + * Encodes the specified CustomMirroringProfile message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.CustomMirroringProfile.verify|verify} messages. + * @param message CustomMirroringProfile message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.networksecurity.v1.IUpdateClientTlsPolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.networksecurity.v1.ICustomMirroringProfile, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an UpdateClientTlsPolicyRequest message from the specified reader or buffer. + * Decodes a CustomMirroringProfile message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns UpdateClientTlsPolicyRequest + * @returns CustomMirroringProfile * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.networksecurity.v1.UpdateClientTlsPolicyRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.networksecurity.v1.CustomMirroringProfile; /** - * Decodes an UpdateClientTlsPolicyRequest message from the specified reader or buffer, length delimited. + * Decodes a CustomMirroringProfile message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns UpdateClientTlsPolicyRequest + * @returns CustomMirroringProfile * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.networksecurity.v1.UpdateClientTlsPolicyRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.networksecurity.v1.CustomMirroringProfile; /** - * Verifies an UpdateClientTlsPolicyRequest message. + * Verifies a CustomMirroringProfile message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates an UpdateClientTlsPolicyRequest message from a plain object. Also converts values to their respective internal types. + * Creates a CustomMirroringProfile message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns UpdateClientTlsPolicyRequest + * @returns CustomMirroringProfile */ - public static fromObject(object: { [k: string]: any }): google.cloud.networksecurity.v1.UpdateClientTlsPolicyRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.networksecurity.v1.CustomMirroringProfile; /** - * Creates a plain object from an UpdateClientTlsPolicyRequest message. Also converts values to other types if specified. - * @param message UpdateClientTlsPolicyRequest + * Creates a plain object from a CustomMirroringProfile message. Also converts values to other types if specified. + * @param message CustomMirroringProfile * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.networksecurity.v1.UpdateClientTlsPolicyRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.networksecurity.v1.CustomMirroringProfile, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this UpdateClientTlsPolicyRequest to JSON. + * Converts this CustomMirroringProfile to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for UpdateClientTlsPolicyRequest + * Gets the default type url for CustomMirroringProfile * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a DeleteClientTlsPolicyRequest. */ - interface IDeleteClientTlsPolicyRequest { + /** Severity enum. */ + enum Severity { + SEVERITY_UNSPECIFIED = 0, + INFORMATIONAL = 1, + LOW = 2, + MEDIUM = 3, + HIGH = 4, + CRITICAL = 5 + } - /** DeleteClientTlsPolicyRequest name */ - name?: (string|null); + /** ThreatType enum. */ + enum ThreatType { + THREAT_TYPE_UNSPECIFIED = 0, + UNKNOWN = 1, + VULNERABILITY = 2, + ANTIVIRUS = 3, + SPYWARE = 4, + DNS = 5 } - /** Represents a DeleteClientTlsPolicyRequest. */ - class DeleteClientTlsPolicyRequest implements IDeleteClientTlsPolicyRequest { + /** ThreatAction enum. */ + enum ThreatAction { + THREAT_ACTION_UNSPECIFIED = 0, + DEFAULT_ACTION = 4, + ALLOW = 1, + ALERT = 2, + DENY = 3 + } + + /** Protocol enum. */ + enum Protocol { + PROTOCOL_UNSPECIFIED = 0, + SMTP = 1, + SMB = 2, + POP3 = 3, + IMAP = 4, + HTTP2 = 5, + HTTP = 6, + FTP = 7 + } + + /** Properties of a ThreatPreventionProfile. */ + interface IThreatPreventionProfile { + + /** ThreatPreventionProfile severityOverrides */ + severityOverrides?: (google.cloud.networksecurity.v1.ISeverityOverride[]|null); + + /** ThreatPreventionProfile threatOverrides */ + threatOverrides?: (google.cloud.networksecurity.v1.IThreatOverride[]|null); + + /** ThreatPreventionProfile antivirusOverrides */ + antivirusOverrides?: (google.cloud.networksecurity.v1.IAntivirusOverride[]|null); + } + + /** Represents a ThreatPreventionProfile. */ + class ThreatPreventionProfile implements IThreatPreventionProfile { /** - * Constructs a new DeleteClientTlsPolicyRequest. + * Constructs a new ThreatPreventionProfile. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.networksecurity.v1.IDeleteClientTlsPolicyRequest); + constructor(properties?: google.cloud.networksecurity.v1.IThreatPreventionProfile); - /** DeleteClientTlsPolicyRequest name. */ - public name: string; + /** ThreatPreventionProfile severityOverrides. */ + public severityOverrides: google.cloud.networksecurity.v1.ISeverityOverride[]; + + /** ThreatPreventionProfile threatOverrides. */ + public threatOverrides: google.cloud.networksecurity.v1.IThreatOverride[]; + + /** ThreatPreventionProfile antivirusOverrides. */ + public antivirusOverrides: google.cloud.networksecurity.v1.IAntivirusOverride[]; /** - * Creates a new DeleteClientTlsPolicyRequest instance using the specified properties. + * Creates a new ThreatPreventionProfile instance using the specified properties. * @param [properties] Properties to set - * @returns DeleteClientTlsPolicyRequest instance + * @returns ThreatPreventionProfile instance */ - public static create(properties?: google.cloud.networksecurity.v1.IDeleteClientTlsPolicyRequest): google.cloud.networksecurity.v1.DeleteClientTlsPolicyRequest; + public static create(properties?: google.cloud.networksecurity.v1.IThreatPreventionProfile): google.cloud.networksecurity.v1.ThreatPreventionProfile; /** - * Encodes the specified DeleteClientTlsPolicyRequest message. Does not implicitly {@link google.cloud.networksecurity.v1.DeleteClientTlsPolicyRequest.verify|verify} messages. - * @param message DeleteClientTlsPolicyRequest message or plain object to encode + * Encodes the specified ThreatPreventionProfile message. Does not implicitly {@link google.cloud.networksecurity.v1.ThreatPreventionProfile.verify|verify} messages. + * @param message ThreatPreventionProfile message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.networksecurity.v1.IDeleteClientTlsPolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.networksecurity.v1.IThreatPreventionProfile, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified DeleteClientTlsPolicyRequest message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.DeleteClientTlsPolicyRequest.verify|verify} messages. - * @param message DeleteClientTlsPolicyRequest message or plain object to encode + * Encodes the specified ThreatPreventionProfile message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.ThreatPreventionProfile.verify|verify} messages. + * @param message ThreatPreventionProfile message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.networksecurity.v1.IDeleteClientTlsPolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.networksecurity.v1.IThreatPreventionProfile, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a DeleteClientTlsPolicyRequest message from the specified reader or buffer. + * Decodes a ThreatPreventionProfile message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns DeleteClientTlsPolicyRequest + * @returns ThreatPreventionProfile * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.networksecurity.v1.DeleteClientTlsPolicyRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.networksecurity.v1.ThreatPreventionProfile; /** - * Decodes a DeleteClientTlsPolicyRequest message from the specified reader or buffer, length delimited. + * Decodes a ThreatPreventionProfile message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns DeleteClientTlsPolicyRequest + * @returns ThreatPreventionProfile * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.networksecurity.v1.DeleteClientTlsPolicyRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.networksecurity.v1.ThreatPreventionProfile; /** - * Verifies a DeleteClientTlsPolicyRequest message. + * Verifies a ThreatPreventionProfile message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a DeleteClientTlsPolicyRequest message from a plain object. Also converts values to their respective internal types. + * Creates a ThreatPreventionProfile message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns DeleteClientTlsPolicyRequest + * @returns ThreatPreventionProfile */ - public static fromObject(object: { [k: string]: any }): google.cloud.networksecurity.v1.DeleteClientTlsPolicyRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.networksecurity.v1.ThreatPreventionProfile; /** - * Creates a plain object from a DeleteClientTlsPolicyRequest message. Also converts values to other types if specified. - * @param message DeleteClientTlsPolicyRequest + * Creates a plain object from a ThreatPreventionProfile message. Also converts values to other types if specified. + * @param message ThreatPreventionProfile * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.networksecurity.v1.DeleteClientTlsPolicyRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.networksecurity.v1.ThreatPreventionProfile, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this DeleteClientTlsPolicyRequest to JSON. + * Converts this ThreatPreventionProfile to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for DeleteClientTlsPolicyRequest + * Gets the default type url for ThreatPreventionProfile * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a GrpcEndpoint. */ - interface IGrpcEndpoint { + /** Properties of a SeverityOverride. */ + interface ISeverityOverride { - /** GrpcEndpoint targetUri */ - targetUri?: (string|null); + /** SeverityOverride severity */ + severity?: (google.cloud.networksecurity.v1.Severity|keyof typeof google.cloud.networksecurity.v1.Severity|null); + + /** SeverityOverride action */ + action?: (google.cloud.networksecurity.v1.ThreatAction|keyof typeof google.cloud.networksecurity.v1.ThreatAction|null); } - /** Represents a GrpcEndpoint. */ - class GrpcEndpoint implements IGrpcEndpoint { + /** Represents a SeverityOverride. */ + class SeverityOverride implements ISeverityOverride { /** - * Constructs a new GrpcEndpoint. + * Constructs a new SeverityOverride. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.networksecurity.v1.IGrpcEndpoint); + constructor(properties?: google.cloud.networksecurity.v1.ISeverityOverride); - /** GrpcEndpoint targetUri. */ - public targetUri: string; + /** SeverityOverride severity. */ + public severity: (google.cloud.networksecurity.v1.Severity|keyof typeof google.cloud.networksecurity.v1.Severity); + + /** SeverityOverride action. */ + public action: (google.cloud.networksecurity.v1.ThreatAction|keyof typeof google.cloud.networksecurity.v1.ThreatAction); /** - * Creates a new GrpcEndpoint instance using the specified properties. + * Creates a new SeverityOverride instance using the specified properties. * @param [properties] Properties to set - * @returns GrpcEndpoint instance + * @returns SeverityOverride instance */ - public static create(properties?: google.cloud.networksecurity.v1.IGrpcEndpoint): google.cloud.networksecurity.v1.GrpcEndpoint; + public static create(properties?: google.cloud.networksecurity.v1.ISeverityOverride): google.cloud.networksecurity.v1.SeverityOverride; /** - * Encodes the specified GrpcEndpoint message. Does not implicitly {@link google.cloud.networksecurity.v1.GrpcEndpoint.verify|verify} messages. - * @param message GrpcEndpoint message or plain object to encode + * Encodes the specified SeverityOverride message. Does not implicitly {@link google.cloud.networksecurity.v1.SeverityOverride.verify|verify} messages. + * @param message SeverityOverride message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.networksecurity.v1.IGrpcEndpoint, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.networksecurity.v1.ISeverityOverride, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified GrpcEndpoint message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.GrpcEndpoint.verify|verify} messages. - * @param message GrpcEndpoint message or plain object to encode + * Encodes the specified SeverityOverride message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.SeverityOverride.verify|verify} messages. + * @param message SeverityOverride message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.networksecurity.v1.IGrpcEndpoint, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.networksecurity.v1.ISeverityOverride, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a GrpcEndpoint message from the specified reader or buffer. + * Decodes a SeverityOverride message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns GrpcEndpoint + * @returns SeverityOverride * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.networksecurity.v1.GrpcEndpoint; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.networksecurity.v1.SeverityOverride; /** - * Decodes a GrpcEndpoint message from the specified reader or buffer, length delimited. + * Decodes a SeverityOverride message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns GrpcEndpoint + * @returns SeverityOverride * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.networksecurity.v1.GrpcEndpoint; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.networksecurity.v1.SeverityOverride; /** - * Verifies a GrpcEndpoint message. + * Verifies a SeverityOverride message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a GrpcEndpoint message from a plain object. Also converts values to their respective internal types. + * Creates a SeverityOverride message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns GrpcEndpoint + * @returns SeverityOverride */ - public static fromObject(object: { [k: string]: any }): google.cloud.networksecurity.v1.GrpcEndpoint; + public static fromObject(object: { [k: string]: any }): google.cloud.networksecurity.v1.SeverityOverride; /** - * Creates a plain object from a GrpcEndpoint message. Also converts values to other types if specified. - * @param message GrpcEndpoint + * Creates a plain object from a SeverityOverride message. Also converts values to other types if specified. + * @param message SeverityOverride * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.networksecurity.v1.GrpcEndpoint, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.networksecurity.v1.SeverityOverride, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this GrpcEndpoint to JSON. + * Converts this SeverityOverride to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for GrpcEndpoint + * Gets the default type url for SeverityOverride * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a ValidationCA. */ - interface IValidationCA { + /** Properties of a ThreatOverride. */ + interface IThreatOverride { - /** ValidationCA grpcEndpoint */ - grpcEndpoint?: (google.cloud.networksecurity.v1.IGrpcEndpoint|null); + /** ThreatOverride threatId */ + threatId?: (string|null); - /** ValidationCA certificateProviderInstance */ - certificateProviderInstance?: (google.cloud.networksecurity.v1.ICertificateProviderInstance|null); + /** ThreatOverride type */ + type?: (google.cloud.networksecurity.v1.ThreatType|keyof typeof google.cloud.networksecurity.v1.ThreatType|null); + + /** ThreatOverride action */ + action?: (google.cloud.networksecurity.v1.ThreatAction|keyof typeof google.cloud.networksecurity.v1.ThreatAction|null); } - /** Represents a ValidationCA. */ - class ValidationCA implements IValidationCA { + /** Represents a ThreatOverride. */ + class ThreatOverride implements IThreatOverride { /** - * Constructs a new ValidationCA. + * Constructs a new ThreatOverride. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.networksecurity.v1.IValidationCA); + constructor(properties?: google.cloud.networksecurity.v1.IThreatOverride); - /** ValidationCA grpcEndpoint. */ - public grpcEndpoint?: (google.cloud.networksecurity.v1.IGrpcEndpoint|null); + /** ThreatOverride threatId. */ + public threatId: string; - /** ValidationCA certificateProviderInstance. */ - public certificateProviderInstance?: (google.cloud.networksecurity.v1.ICertificateProviderInstance|null); + /** ThreatOverride type. */ + public type: (google.cloud.networksecurity.v1.ThreatType|keyof typeof google.cloud.networksecurity.v1.ThreatType); - /** ValidationCA type. */ - public type?: ("grpcEndpoint"|"certificateProviderInstance"); + /** ThreatOverride action. */ + public action: (google.cloud.networksecurity.v1.ThreatAction|keyof typeof google.cloud.networksecurity.v1.ThreatAction); /** - * Creates a new ValidationCA instance using the specified properties. + * Creates a new ThreatOverride instance using the specified properties. * @param [properties] Properties to set - * @returns ValidationCA instance + * @returns ThreatOverride instance */ - public static create(properties?: google.cloud.networksecurity.v1.IValidationCA): google.cloud.networksecurity.v1.ValidationCA; + public static create(properties?: google.cloud.networksecurity.v1.IThreatOverride): google.cloud.networksecurity.v1.ThreatOverride; /** - * Encodes the specified ValidationCA message. Does not implicitly {@link google.cloud.networksecurity.v1.ValidationCA.verify|verify} messages. - * @param message ValidationCA message or plain object to encode + * Encodes the specified ThreatOverride message. Does not implicitly {@link google.cloud.networksecurity.v1.ThreatOverride.verify|verify} messages. + * @param message ThreatOverride message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.networksecurity.v1.IValidationCA, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.networksecurity.v1.IThreatOverride, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified ValidationCA message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.ValidationCA.verify|verify} messages. - * @param message ValidationCA message or plain object to encode + * Encodes the specified ThreatOverride message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.ThreatOverride.verify|verify} messages. + * @param message ThreatOverride message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.networksecurity.v1.IValidationCA, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.networksecurity.v1.IThreatOverride, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a ValidationCA message from the specified reader or buffer. + * Decodes a ThreatOverride message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns ValidationCA + * @returns ThreatOverride * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.networksecurity.v1.ValidationCA; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.networksecurity.v1.ThreatOverride; /** - * Decodes a ValidationCA message from the specified reader or buffer, length delimited. + * Decodes a ThreatOverride message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ValidationCA + * @returns ThreatOverride * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.networksecurity.v1.ValidationCA; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.networksecurity.v1.ThreatOverride; /** - * Verifies a ValidationCA message. + * Verifies a ThreatOverride message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a ValidationCA message from a plain object. Also converts values to their respective internal types. + * Creates a ThreatOverride message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ValidationCA + * @returns ThreatOverride */ - public static fromObject(object: { [k: string]: any }): google.cloud.networksecurity.v1.ValidationCA; + public static fromObject(object: { [k: string]: any }): google.cloud.networksecurity.v1.ThreatOverride; /** - * Creates a plain object from a ValidationCA message. Also converts values to other types if specified. - * @param message ValidationCA + * Creates a plain object from a ThreatOverride message. Also converts values to other types if specified. + * @param message ThreatOverride * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.networksecurity.v1.ValidationCA, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.networksecurity.v1.ThreatOverride, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ValidationCA to JSON. + * Converts this ThreatOverride to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for ValidationCA + * Gets the default type url for ThreatOverride * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a CertificateProviderInstance. */ - interface ICertificateProviderInstance { + /** Properties of an AntivirusOverride. */ + interface IAntivirusOverride { - /** CertificateProviderInstance pluginInstance */ - pluginInstance?: (string|null); + /** AntivirusOverride protocol */ + protocol?: (google.cloud.networksecurity.v1.Protocol|keyof typeof google.cloud.networksecurity.v1.Protocol|null); + + /** AntivirusOverride action */ + action?: (google.cloud.networksecurity.v1.ThreatAction|keyof typeof google.cloud.networksecurity.v1.ThreatAction|null); } - /** Represents a CertificateProviderInstance. */ - class CertificateProviderInstance implements ICertificateProviderInstance { + /** Represents an AntivirusOverride. */ + class AntivirusOverride implements IAntivirusOverride { /** - * Constructs a new CertificateProviderInstance. + * Constructs a new AntivirusOverride. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.networksecurity.v1.ICertificateProviderInstance); + constructor(properties?: google.cloud.networksecurity.v1.IAntivirusOverride); - /** CertificateProviderInstance pluginInstance. */ - public pluginInstance: string; + /** AntivirusOverride protocol. */ + public protocol: (google.cloud.networksecurity.v1.Protocol|keyof typeof google.cloud.networksecurity.v1.Protocol); + + /** AntivirusOverride action. */ + public action: (google.cloud.networksecurity.v1.ThreatAction|keyof typeof google.cloud.networksecurity.v1.ThreatAction); /** - * Creates a new CertificateProviderInstance instance using the specified properties. + * Creates a new AntivirusOverride instance using the specified properties. * @param [properties] Properties to set - * @returns CertificateProviderInstance instance + * @returns AntivirusOverride instance */ - public static create(properties?: google.cloud.networksecurity.v1.ICertificateProviderInstance): google.cloud.networksecurity.v1.CertificateProviderInstance; + public static create(properties?: google.cloud.networksecurity.v1.IAntivirusOverride): google.cloud.networksecurity.v1.AntivirusOverride; /** - * Encodes the specified CertificateProviderInstance message. Does not implicitly {@link google.cloud.networksecurity.v1.CertificateProviderInstance.verify|verify} messages. - * @param message CertificateProviderInstance message or plain object to encode + * Encodes the specified AntivirusOverride message. Does not implicitly {@link google.cloud.networksecurity.v1.AntivirusOverride.verify|verify} messages. + * @param message AntivirusOverride message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.networksecurity.v1.ICertificateProviderInstance, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.networksecurity.v1.IAntivirusOverride, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified CertificateProviderInstance message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.CertificateProviderInstance.verify|verify} messages. - * @param message CertificateProviderInstance message or plain object to encode + * Encodes the specified AntivirusOverride message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.AntivirusOverride.verify|verify} messages. + * @param message AntivirusOverride message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.networksecurity.v1.ICertificateProviderInstance, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.networksecurity.v1.IAntivirusOverride, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a CertificateProviderInstance message from the specified reader or buffer. + * Decodes an AntivirusOverride message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns CertificateProviderInstance + * @returns AntivirusOverride * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.networksecurity.v1.CertificateProviderInstance; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.networksecurity.v1.AntivirusOverride; /** - * Decodes a CertificateProviderInstance message from the specified reader or buffer, length delimited. + * Decodes an AntivirusOverride message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns CertificateProviderInstance + * @returns AntivirusOverride * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.networksecurity.v1.CertificateProviderInstance; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.networksecurity.v1.AntivirusOverride; /** - * Verifies a CertificateProviderInstance message. + * Verifies an AntivirusOverride message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a CertificateProviderInstance message from a plain object. Also converts values to their respective internal types. + * Creates an AntivirusOverride message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns CertificateProviderInstance + * @returns AntivirusOverride */ - public static fromObject(object: { [k: string]: any }): google.cloud.networksecurity.v1.CertificateProviderInstance; + public static fromObject(object: { [k: string]: any }): google.cloud.networksecurity.v1.AntivirusOverride; /** - * Creates a plain object from a CertificateProviderInstance message. Also converts values to other types if specified. - * @param message CertificateProviderInstance + * Creates a plain object from an AntivirusOverride message. Also converts values to other types if specified. + * @param message AntivirusOverride * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.networksecurity.v1.CertificateProviderInstance, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.networksecurity.v1.AntivirusOverride, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this CertificateProviderInstance to JSON. + * Converts this AntivirusOverride to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for CertificateProviderInstance + * Gets the default type url for AntivirusOverride * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a CertificateProvider. */ - interface ICertificateProvider { - - /** CertificateProvider grpcEndpoint */ - grpcEndpoint?: (google.cloud.networksecurity.v1.IGrpcEndpoint|null); + /** Properties of an UrlFilteringProfile. */ + interface IUrlFilteringProfile { - /** CertificateProvider certificateProviderInstance */ - certificateProviderInstance?: (google.cloud.networksecurity.v1.ICertificateProviderInstance|null); + /** UrlFilteringProfile urlFilters */ + urlFilters?: (google.cloud.networksecurity.v1.IUrlFilter[]|null); } - /** Represents a CertificateProvider. */ - class CertificateProvider implements ICertificateProvider { + /** Represents an UrlFilteringProfile. */ + class UrlFilteringProfile implements IUrlFilteringProfile { /** - * Constructs a new CertificateProvider. + * Constructs a new UrlFilteringProfile. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.networksecurity.v1.ICertificateProvider); - - /** CertificateProvider grpcEndpoint. */ - public grpcEndpoint?: (google.cloud.networksecurity.v1.IGrpcEndpoint|null); + constructor(properties?: google.cloud.networksecurity.v1.IUrlFilteringProfile); - /** CertificateProvider certificateProviderInstance. */ - public certificateProviderInstance?: (google.cloud.networksecurity.v1.ICertificateProviderInstance|null); - - /** CertificateProvider type. */ - public type?: ("grpcEndpoint"|"certificateProviderInstance"); + /** UrlFilteringProfile urlFilters. */ + public urlFilters: google.cloud.networksecurity.v1.IUrlFilter[]; /** - * Creates a new CertificateProvider instance using the specified properties. + * Creates a new UrlFilteringProfile instance using the specified properties. * @param [properties] Properties to set - * @returns CertificateProvider instance + * @returns UrlFilteringProfile instance */ - public static create(properties?: google.cloud.networksecurity.v1.ICertificateProvider): google.cloud.networksecurity.v1.CertificateProvider; + public static create(properties?: google.cloud.networksecurity.v1.IUrlFilteringProfile): google.cloud.networksecurity.v1.UrlFilteringProfile; /** - * Encodes the specified CertificateProvider message. Does not implicitly {@link google.cloud.networksecurity.v1.CertificateProvider.verify|verify} messages. - * @param message CertificateProvider message or plain object to encode + * Encodes the specified UrlFilteringProfile message. Does not implicitly {@link google.cloud.networksecurity.v1.UrlFilteringProfile.verify|verify} messages. + * @param message UrlFilteringProfile message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.networksecurity.v1.ICertificateProvider, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.networksecurity.v1.IUrlFilteringProfile, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified CertificateProvider message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.CertificateProvider.verify|verify} messages. - * @param message CertificateProvider message or plain object to encode + * Encodes the specified UrlFilteringProfile message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.UrlFilteringProfile.verify|verify} messages. + * @param message UrlFilteringProfile message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.networksecurity.v1.ICertificateProvider, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.networksecurity.v1.IUrlFilteringProfile, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a CertificateProvider message from the specified reader or buffer. + * Decodes an UrlFilteringProfile message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns CertificateProvider + * @returns UrlFilteringProfile * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.networksecurity.v1.CertificateProvider; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.networksecurity.v1.UrlFilteringProfile; /** - * Decodes a CertificateProvider message from the specified reader or buffer, length delimited. + * Decodes an UrlFilteringProfile message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns CertificateProvider + * @returns UrlFilteringProfile * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.networksecurity.v1.CertificateProvider; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.networksecurity.v1.UrlFilteringProfile; /** - * Verifies a CertificateProvider message. + * Verifies an UrlFilteringProfile message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a CertificateProvider message from a plain object. Also converts values to their respective internal types. + * Creates an UrlFilteringProfile message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns CertificateProvider + * @returns UrlFilteringProfile */ - public static fromObject(object: { [k: string]: any }): google.cloud.networksecurity.v1.CertificateProvider; + public static fromObject(object: { [k: string]: any }): google.cloud.networksecurity.v1.UrlFilteringProfile; /** - * Creates a plain object from a CertificateProvider message. Also converts values to other types if specified. - * @param message CertificateProvider + * Creates a plain object from an UrlFilteringProfile message. Also converts values to other types if specified. + * @param message UrlFilteringProfile * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.networksecurity.v1.CertificateProvider, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.networksecurity.v1.UrlFilteringProfile, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this CertificateProvider to JSON. + * Converts this UrlFilteringProfile to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for CertificateProvider + * Gets the default type url for UrlFilteringProfile * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of an OperationMetadata. */ - interface IOperationMetadata { - - /** OperationMetadata createTime */ - createTime?: (google.protobuf.ITimestamp|null); - - /** OperationMetadata endTime */ - endTime?: (google.protobuf.ITimestamp|null); - - /** OperationMetadata target */ - target?: (string|null); - - /** OperationMetadata verb */ - verb?: (string|null); + /** Properties of an UrlFilter. */ + interface IUrlFilter { - /** OperationMetadata statusMessage */ - statusMessage?: (string|null); + /** UrlFilter filteringAction */ + filteringAction?: (google.cloud.networksecurity.v1.UrlFilter.UrlFilteringAction|keyof typeof google.cloud.networksecurity.v1.UrlFilter.UrlFilteringAction|null); - /** OperationMetadata requestedCancellation */ - requestedCancellation?: (boolean|null); + /** UrlFilter urls */ + urls?: (string[]|null); - /** OperationMetadata apiVersion */ - apiVersion?: (string|null); + /** UrlFilter priority */ + priority?: (number|null); } - /** Represents an OperationMetadata. */ - class OperationMetadata implements IOperationMetadata { + /** Represents an UrlFilter. */ + class UrlFilter implements IUrlFilter { /** - * Constructs a new OperationMetadata. + * Constructs a new UrlFilter. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.networksecurity.v1.IOperationMetadata); - - /** OperationMetadata createTime. */ - public createTime?: (google.protobuf.ITimestamp|null); - - /** OperationMetadata endTime. */ - public endTime?: (google.protobuf.ITimestamp|null); - - /** OperationMetadata target. */ - public target: string; + constructor(properties?: google.cloud.networksecurity.v1.IUrlFilter); - /** OperationMetadata verb. */ - public verb: string; - - /** OperationMetadata statusMessage. */ - public statusMessage: string; + /** UrlFilter filteringAction. */ + public filteringAction: (google.cloud.networksecurity.v1.UrlFilter.UrlFilteringAction|keyof typeof google.cloud.networksecurity.v1.UrlFilter.UrlFilteringAction); - /** OperationMetadata requestedCancellation. */ - public requestedCancellation: boolean; + /** UrlFilter urls. */ + public urls: string[]; - /** OperationMetadata apiVersion. */ - public apiVersion: string; + /** UrlFilter priority. */ + public priority?: (number|null); /** - * Creates a new OperationMetadata instance using the specified properties. + * Creates a new UrlFilter instance using the specified properties. * @param [properties] Properties to set - * @returns OperationMetadata instance + * @returns UrlFilter instance */ - public static create(properties?: google.cloud.networksecurity.v1.IOperationMetadata): google.cloud.networksecurity.v1.OperationMetadata; + public static create(properties?: google.cloud.networksecurity.v1.IUrlFilter): google.cloud.networksecurity.v1.UrlFilter; /** - * Encodes the specified OperationMetadata message. Does not implicitly {@link google.cloud.networksecurity.v1.OperationMetadata.verify|verify} messages. - * @param message OperationMetadata message or plain object to encode + * Encodes the specified UrlFilter message. Does not implicitly {@link google.cloud.networksecurity.v1.UrlFilter.verify|verify} messages. + * @param message UrlFilter message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.networksecurity.v1.IOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.networksecurity.v1.IUrlFilter, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified OperationMetadata message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.OperationMetadata.verify|verify} messages. - * @param message OperationMetadata message or plain object to encode + * Encodes the specified UrlFilter message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.UrlFilter.verify|verify} messages. + * @param message UrlFilter message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.networksecurity.v1.IOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.networksecurity.v1.IUrlFilter, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an OperationMetadata message from the specified reader or buffer. + * Decodes an UrlFilter message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns OperationMetadata + * @returns UrlFilter * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.networksecurity.v1.OperationMetadata; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.networksecurity.v1.UrlFilter; /** - * Decodes an OperationMetadata message from the specified reader or buffer, length delimited. + * Decodes an UrlFilter message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns OperationMetadata + * @returns UrlFilter * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.networksecurity.v1.OperationMetadata; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.networksecurity.v1.UrlFilter; /** - * Verifies an OperationMetadata message. + * Verifies an UrlFilter message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates an OperationMetadata message from a plain object. Also converts values to their respective internal types. + * Creates an UrlFilter message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns OperationMetadata + * @returns UrlFilter */ - public static fromObject(object: { [k: string]: any }): google.cloud.networksecurity.v1.OperationMetadata; + public static fromObject(object: { [k: string]: any }): google.cloud.networksecurity.v1.UrlFilter; /** - * Creates a plain object from an OperationMetadata message. Also converts values to other types if specified. - * @param message OperationMetadata + * Creates a plain object from an UrlFilter message. Also converts values to other types if specified. + * @param message UrlFilter * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.networksecurity.v1.OperationMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.networksecurity.v1.UrlFilter, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this OperationMetadata to JSON. + * Converts this UrlFilter to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for OperationMetadata + * Gets the default type url for UrlFilter * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Represents a NetworkSecurity */ - class NetworkSecurity extends $protobuf.rpc.Service { + namespace UrlFilter { + + /** UrlFilteringAction enum. */ + enum UrlFilteringAction { + URL_FILTERING_ACTION_UNSPECIFIED = 0, + ALLOW = 1, + DENY = 2 + } + } + + /** Represents an OrganizationSecurityProfileGroupService */ + class OrganizationSecurityProfileGroupService extends $protobuf.rpc.Service { /** - * Constructs a new NetworkSecurity service. + * Constructs a new OrganizationSecurityProfileGroupService service. * @param rpcImpl RPC implementation * @param [requestDelimited=false] Whether requests are length-delimited * @param [responseDelimited=false] Whether responses are length-delimited @@ -4421,1184 +25759,1470 @@ export namespace google { constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); /** - * Creates new NetworkSecurity service using the specified rpc implementation. + * Creates new OrganizationSecurityProfileGroupService service using the specified rpc implementation. * @param rpcImpl RPC implementation * @param [requestDelimited=false] Whether requests are length-delimited * @param [responseDelimited=false] Whether responses are length-delimited * @returns RPC service. Useful where requests and/or responses are streamed. */ - public static create(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean): NetworkSecurity; + public static create(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean): OrganizationSecurityProfileGroupService; /** - * Calls ListAuthorizationPolicies. - * @param request ListAuthorizationPoliciesRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ListAuthorizationPoliciesResponse + * Calls ListSecurityProfileGroups. + * @param request ListSecurityProfileGroupsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListSecurityProfileGroupsResponse */ - public listAuthorizationPolicies(request: google.cloud.networksecurity.v1.IListAuthorizationPoliciesRequest, callback: google.cloud.networksecurity.v1.NetworkSecurity.ListAuthorizationPoliciesCallback): void; + public listSecurityProfileGroups(request: google.cloud.networksecurity.v1.IListSecurityProfileGroupsRequest, callback: google.cloud.networksecurity.v1.OrganizationSecurityProfileGroupService.ListSecurityProfileGroupsCallback): void; /** - * Calls ListAuthorizationPolicies. - * @param request ListAuthorizationPoliciesRequest message or plain object + * Calls ListSecurityProfileGroups. + * @param request ListSecurityProfileGroupsRequest message or plain object * @returns Promise */ - public listAuthorizationPolicies(request: google.cloud.networksecurity.v1.IListAuthorizationPoliciesRequest): Promise; + public listSecurityProfileGroups(request: google.cloud.networksecurity.v1.IListSecurityProfileGroupsRequest): Promise; /** - * Calls GetAuthorizationPolicy. - * @param request GetAuthorizationPolicyRequest message or plain object - * @param callback Node-style callback called with the error, if any, and AuthorizationPolicy + * Calls GetSecurityProfileGroup. + * @param request GetSecurityProfileGroupRequest message or plain object + * @param callback Node-style callback called with the error, if any, and SecurityProfileGroup */ - public getAuthorizationPolicy(request: google.cloud.networksecurity.v1.IGetAuthorizationPolicyRequest, callback: google.cloud.networksecurity.v1.NetworkSecurity.GetAuthorizationPolicyCallback): void; + public getSecurityProfileGroup(request: google.cloud.networksecurity.v1.IGetSecurityProfileGroupRequest, callback: google.cloud.networksecurity.v1.OrganizationSecurityProfileGroupService.GetSecurityProfileGroupCallback): void; /** - * Calls GetAuthorizationPolicy. - * @param request GetAuthorizationPolicyRequest message or plain object + * Calls GetSecurityProfileGroup. + * @param request GetSecurityProfileGroupRequest message or plain object * @returns Promise */ - public getAuthorizationPolicy(request: google.cloud.networksecurity.v1.IGetAuthorizationPolicyRequest): Promise; + public getSecurityProfileGroup(request: google.cloud.networksecurity.v1.IGetSecurityProfileGroupRequest): Promise; /** - * Calls CreateAuthorizationPolicy. - * @param request CreateAuthorizationPolicyRequest message or plain object + * Calls CreateSecurityProfileGroup. + * @param request CreateSecurityProfileGroupRequest message or plain object * @param callback Node-style callback called with the error, if any, and Operation */ - public createAuthorizationPolicy(request: google.cloud.networksecurity.v1.ICreateAuthorizationPolicyRequest, callback: google.cloud.networksecurity.v1.NetworkSecurity.CreateAuthorizationPolicyCallback): void; + public createSecurityProfileGroup(request: google.cloud.networksecurity.v1.ICreateSecurityProfileGroupRequest, callback: google.cloud.networksecurity.v1.OrganizationSecurityProfileGroupService.CreateSecurityProfileGroupCallback): void; /** - * Calls CreateAuthorizationPolicy. - * @param request CreateAuthorizationPolicyRequest message or plain object + * Calls CreateSecurityProfileGroup. + * @param request CreateSecurityProfileGroupRequest message or plain object * @returns Promise */ - public createAuthorizationPolicy(request: google.cloud.networksecurity.v1.ICreateAuthorizationPolicyRequest): Promise; + public createSecurityProfileGroup(request: google.cloud.networksecurity.v1.ICreateSecurityProfileGroupRequest): Promise; /** - * Calls UpdateAuthorizationPolicy. - * @param request UpdateAuthorizationPolicyRequest message or plain object + * Calls UpdateSecurityProfileGroup. + * @param request UpdateSecurityProfileGroupRequest message or plain object * @param callback Node-style callback called with the error, if any, and Operation */ - public updateAuthorizationPolicy(request: google.cloud.networksecurity.v1.IUpdateAuthorizationPolicyRequest, callback: google.cloud.networksecurity.v1.NetworkSecurity.UpdateAuthorizationPolicyCallback): void; + public updateSecurityProfileGroup(request: google.cloud.networksecurity.v1.IUpdateSecurityProfileGroupRequest, callback: google.cloud.networksecurity.v1.OrganizationSecurityProfileGroupService.UpdateSecurityProfileGroupCallback): void; /** - * Calls UpdateAuthorizationPolicy. - * @param request UpdateAuthorizationPolicyRequest message or plain object + * Calls UpdateSecurityProfileGroup. + * @param request UpdateSecurityProfileGroupRequest message or plain object * @returns Promise */ - public updateAuthorizationPolicy(request: google.cloud.networksecurity.v1.IUpdateAuthorizationPolicyRequest): Promise; + public updateSecurityProfileGroup(request: google.cloud.networksecurity.v1.IUpdateSecurityProfileGroupRequest): Promise; /** - * Calls DeleteAuthorizationPolicy. - * @param request DeleteAuthorizationPolicyRequest message or plain object + * Calls DeleteSecurityProfileGroup. + * @param request DeleteSecurityProfileGroupRequest message or plain object * @param callback Node-style callback called with the error, if any, and Operation */ - public deleteAuthorizationPolicy(request: google.cloud.networksecurity.v1.IDeleteAuthorizationPolicyRequest, callback: google.cloud.networksecurity.v1.NetworkSecurity.DeleteAuthorizationPolicyCallback): void; + public deleteSecurityProfileGroup(request: google.cloud.networksecurity.v1.IDeleteSecurityProfileGroupRequest, callback: google.cloud.networksecurity.v1.OrganizationSecurityProfileGroupService.DeleteSecurityProfileGroupCallback): void; /** - * Calls DeleteAuthorizationPolicy. - * @param request DeleteAuthorizationPolicyRequest message or plain object + * Calls DeleteSecurityProfileGroup. + * @param request DeleteSecurityProfileGroupRequest message or plain object * @returns Promise */ - public deleteAuthorizationPolicy(request: google.cloud.networksecurity.v1.IDeleteAuthorizationPolicyRequest): Promise; + public deleteSecurityProfileGroup(request: google.cloud.networksecurity.v1.IDeleteSecurityProfileGroupRequest): Promise; /** - * Calls ListServerTlsPolicies. - * @param request ListServerTlsPoliciesRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ListServerTlsPoliciesResponse + * Calls ListSecurityProfiles. + * @param request ListSecurityProfilesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListSecurityProfilesResponse */ - public listServerTlsPolicies(request: google.cloud.networksecurity.v1.IListServerTlsPoliciesRequest, callback: google.cloud.networksecurity.v1.NetworkSecurity.ListServerTlsPoliciesCallback): void; + public listSecurityProfiles(request: google.cloud.networksecurity.v1.IListSecurityProfilesRequest, callback: google.cloud.networksecurity.v1.OrganizationSecurityProfileGroupService.ListSecurityProfilesCallback): void; /** - * Calls ListServerTlsPolicies. - * @param request ListServerTlsPoliciesRequest message or plain object + * Calls ListSecurityProfiles. + * @param request ListSecurityProfilesRequest message or plain object * @returns Promise */ - public listServerTlsPolicies(request: google.cloud.networksecurity.v1.IListServerTlsPoliciesRequest): Promise; + public listSecurityProfiles(request: google.cloud.networksecurity.v1.IListSecurityProfilesRequest): Promise; + + /** + * Calls GetSecurityProfile. + * @param request GetSecurityProfileRequest message or plain object + * @param callback Node-style callback called with the error, if any, and SecurityProfile + */ + public getSecurityProfile(request: google.cloud.networksecurity.v1.IGetSecurityProfileRequest, callback: google.cloud.networksecurity.v1.OrganizationSecurityProfileGroupService.GetSecurityProfileCallback): void; + + /** + * Calls GetSecurityProfile. + * @param request GetSecurityProfileRequest message or plain object + * @returns Promise + */ + public getSecurityProfile(request: google.cloud.networksecurity.v1.IGetSecurityProfileRequest): Promise; + + /** + * Calls CreateSecurityProfile. + * @param request CreateSecurityProfileRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public createSecurityProfile(request: google.cloud.networksecurity.v1.ICreateSecurityProfileRequest, callback: google.cloud.networksecurity.v1.OrganizationSecurityProfileGroupService.CreateSecurityProfileCallback): void; + + /** + * Calls CreateSecurityProfile. + * @param request CreateSecurityProfileRequest message or plain object + * @returns Promise + */ + public createSecurityProfile(request: google.cloud.networksecurity.v1.ICreateSecurityProfileRequest): Promise; + + /** + * Calls UpdateSecurityProfile. + * @param request UpdateSecurityProfileRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public updateSecurityProfile(request: google.cloud.networksecurity.v1.IUpdateSecurityProfileRequest, callback: google.cloud.networksecurity.v1.OrganizationSecurityProfileGroupService.UpdateSecurityProfileCallback): void; + + /** + * Calls UpdateSecurityProfile. + * @param request UpdateSecurityProfileRequest message or plain object + * @returns Promise + */ + public updateSecurityProfile(request: google.cloud.networksecurity.v1.IUpdateSecurityProfileRequest): Promise; + + /** + * Calls DeleteSecurityProfile. + * @param request DeleteSecurityProfileRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public deleteSecurityProfile(request: google.cloud.networksecurity.v1.IDeleteSecurityProfileRequest, callback: google.cloud.networksecurity.v1.OrganizationSecurityProfileGroupService.DeleteSecurityProfileCallback): void; + + /** + * Calls DeleteSecurityProfile. + * @param request DeleteSecurityProfileRequest message or plain object + * @returns Promise + */ + public deleteSecurityProfile(request: google.cloud.networksecurity.v1.IDeleteSecurityProfileRequest): Promise; + } + + namespace OrganizationSecurityProfileGroupService { + + /** + * Callback as used by {@link google.cloud.networksecurity.v1.OrganizationSecurityProfileGroupService|listSecurityProfileGroups}. + * @param error Error, if any + * @param [response] ListSecurityProfileGroupsResponse + */ + type ListSecurityProfileGroupsCallback = (error: (Error|null), response?: google.cloud.networksecurity.v1.ListSecurityProfileGroupsResponse) => void; + + /** + * Callback as used by {@link google.cloud.networksecurity.v1.OrganizationSecurityProfileGroupService|getSecurityProfileGroup}. + * @param error Error, if any + * @param [response] SecurityProfileGroup + */ + type GetSecurityProfileGroupCallback = (error: (Error|null), response?: google.cloud.networksecurity.v1.SecurityProfileGroup) => void; + + /** + * Callback as used by {@link google.cloud.networksecurity.v1.OrganizationSecurityProfileGroupService|createSecurityProfileGroup}. + * @param error Error, if any + * @param [response] Operation + */ + type CreateSecurityProfileGroupCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.networksecurity.v1.OrganizationSecurityProfileGroupService|updateSecurityProfileGroup}. + * @param error Error, if any + * @param [response] Operation + */ + type UpdateSecurityProfileGroupCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.networksecurity.v1.OrganizationSecurityProfileGroupService|deleteSecurityProfileGroup}. + * @param error Error, if any + * @param [response] Operation + */ + type DeleteSecurityProfileGroupCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.networksecurity.v1.OrganizationSecurityProfileGroupService|listSecurityProfiles}. + * @param error Error, if any + * @param [response] ListSecurityProfilesResponse + */ + type ListSecurityProfilesCallback = (error: (Error|null), response?: google.cloud.networksecurity.v1.ListSecurityProfilesResponse) => void; + + /** + * Callback as used by {@link google.cloud.networksecurity.v1.OrganizationSecurityProfileGroupService|getSecurityProfile}. + * @param error Error, if any + * @param [response] SecurityProfile + */ + type GetSecurityProfileCallback = (error: (Error|null), response?: google.cloud.networksecurity.v1.SecurityProfile) => void; + + /** + * Callback as used by {@link google.cloud.networksecurity.v1.OrganizationSecurityProfileGroupService|createSecurityProfile}. + * @param error Error, if any + * @param [response] Operation + */ + type CreateSecurityProfileCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.networksecurity.v1.OrganizationSecurityProfileGroupService|updateSecurityProfile}. + * @param error Error, if any + * @param [response] Operation + */ + type UpdateSecurityProfileCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.networksecurity.v1.OrganizationSecurityProfileGroupService|deleteSecurityProfile}. + * @param error Error, if any + * @param [response] Operation + */ + type DeleteSecurityProfileCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + } + + /** Properties of a ListSecurityProfileGroupsRequest. */ + interface IListSecurityProfileGroupsRequest { + + /** ListSecurityProfileGroupsRequest parent */ + parent?: (string|null); + + /** ListSecurityProfileGroupsRequest pageSize */ + pageSize?: (number|null); + + /** ListSecurityProfileGroupsRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListSecurityProfileGroupsRequest. */ + class ListSecurityProfileGroupsRequest implements IListSecurityProfileGroupsRequest { + + /** + * Constructs a new ListSecurityProfileGroupsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.networksecurity.v1.IListSecurityProfileGroupsRequest); + + /** ListSecurityProfileGroupsRequest parent. */ + public parent: string; + + /** ListSecurityProfileGroupsRequest pageSize. */ + public pageSize: number; + + /** ListSecurityProfileGroupsRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListSecurityProfileGroupsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListSecurityProfileGroupsRequest instance + */ + public static create(properties?: google.cloud.networksecurity.v1.IListSecurityProfileGroupsRequest): google.cloud.networksecurity.v1.ListSecurityProfileGroupsRequest; + + /** + * Encodes the specified ListSecurityProfileGroupsRequest message. Does not implicitly {@link google.cloud.networksecurity.v1.ListSecurityProfileGroupsRequest.verify|verify} messages. + * @param message ListSecurityProfileGroupsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.networksecurity.v1.IListSecurityProfileGroupsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListSecurityProfileGroupsRequest message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.ListSecurityProfileGroupsRequest.verify|verify} messages. + * @param message ListSecurityProfileGroupsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.networksecurity.v1.IListSecurityProfileGroupsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListSecurityProfileGroupsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListSecurityProfileGroupsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.networksecurity.v1.ListSecurityProfileGroupsRequest; + + /** + * Decodes a ListSecurityProfileGroupsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListSecurityProfileGroupsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.networksecurity.v1.ListSecurityProfileGroupsRequest; + + /** + * Verifies a ListSecurityProfileGroupsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListSecurityProfileGroupsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListSecurityProfileGroupsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.networksecurity.v1.ListSecurityProfileGroupsRequest; + + /** + * Creates a plain object from a ListSecurityProfileGroupsRequest message. Also converts values to other types if specified. + * @param message ListSecurityProfileGroupsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.networksecurity.v1.ListSecurityProfileGroupsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListSecurityProfileGroupsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListSecurityProfileGroupsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListSecurityProfileGroupsResponse. */ + interface IListSecurityProfileGroupsResponse { + + /** ListSecurityProfileGroupsResponse securityProfileGroups */ + securityProfileGroups?: (google.cloud.networksecurity.v1.ISecurityProfileGroup[]|null); + + /** ListSecurityProfileGroupsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListSecurityProfileGroupsResponse. */ + class ListSecurityProfileGroupsResponse implements IListSecurityProfileGroupsResponse { + + /** + * Constructs a new ListSecurityProfileGroupsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.networksecurity.v1.IListSecurityProfileGroupsResponse); + + /** ListSecurityProfileGroupsResponse securityProfileGroups. */ + public securityProfileGroups: google.cloud.networksecurity.v1.ISecurityProfileGroup[]; + + /** ListSecurityProfileGroupsResponse nextPageToken. */ + public nextPageToken: string; /** - * Calls GetServerTlsPolicy. - * @param request GetServerTlsPolicyRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ServerTlsPolicy + * Creates a new ListSecurityProfileGroupsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListSecurityProfileGroupsResponse instance */ - public getServerTlsPolicy(request: google.cloud.networksecurity.v1.IGetServerTlsPolicyRequest, callback: google.cloud.networksecurity.v1.NetworkSecurity.GetServerTlsPolicyCallback): void; + public static create(properties?: google.cloud.networksecurity.v1.IListSecurityProfileGroupsResponse): google.cloud.networksecurity.v1.ListSecurityProfileGroupsResponse; /** - * Calls GetServerTlsPolicy. - * @param request GetServerTlsPolicyRequest message or plain object - * @returns Promise + * Encodes the specified ListSecurityProfileGroupsResponse message. Does not implicitly {@link google.cloud.networksecurity.v1.ListSecurityProfileGroupsResponse.verify|verify} messages. + * @param message ListSecurityProfileGroupsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer */ - public getServerTlsPolicy(request: google.cloud.networksecurity.v1.IGetServerTlsPolicyRequest): Promise; + public static encode(message: google.cloud.networksecurity.v1.IListSecurityProfileGroupsResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Calls CreateServerTlsPolicy. - * @param request CreateServerTlsPolicyRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation + * Encodes the specified ListSecurityProfileGroupsResponse message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.ListSecurityProfileGroupsResponse.verify|verify} messages. + * @param message ListSecurityProfileGroupsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer */ - public createServerTlsPolicy(request: google.cloud.networksecurity.v1.ICreateServerTlsPolicyRequest, callback: google.cloud.networksecurity.v1.NetworkSecurity.CreateServerTlsPolicyCallback): void; + public static encodeDelimited(message: google.cloud.networksecurity.v1.IListSecurityProfileGroupsResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Calls CreateServerTlsPolicy. - * @param request CreateServerTlsPolicyRequest message or plain object - * @returns Promise + * Decodes a ListSecurityProfileGroupsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListSecurityProfileGroupsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public createServerTlsPolicy(request: google.cloud.networksecurity.v1.ICreateServerTlsPolicyRequest): Promise; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.networksecurity.v1.ListSecurityProfileGroupsResponse; /** - * Calls UpdateServerTlsPolicy. - * @param request UpdateServerTlsPolicyRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation + * Decodes a ListSecurityProfileGroupsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListSecurityProfileGroupsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public updateServerTlsPolicy(request: google.cloud.networksecurity.v1.IUpdateServerTlsPolicyRequest, callback: google.cloud.networksecurity.v1.NetworkSecurity.UpdateServerTlsPolicyCallback): void; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.networksecurity.v1.ListSecurityProfileGroupsResponse; /** - * Calls UpdateServerTlsPolicy. - * @param request UpdateServerTlsPolicyRequest message or plain object - * @returns Promise + * Verifies a ListSecurityProfileGroupsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not */ - public updateServerTlsPolicy(request: google.cloud.networksecurity.v1.IUpdateServerTlsPolicyRequest): Promise; + public static verify(message: { [k: string]: any }): (string|null); /** - * Calls DeleteServerTlsPolicy. - * @param request DeleteServerTlsPolicyRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation + * Creates a ListSecurityProfileGroupsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListSecurityProfileGroupsResponse */ - public deleteServerTlsPolicy(request: google.cloud.networksecurity.v1.IDeleteServerTlsPolicyRequest, callback: google.cloud.networksecurity.v1.NetworkSecurity.DeleteServerTlsPolicyCallback): void; + public static fromObject(object: { [k: string]: any }): google.cloud.networksecurity.v1.ListSecurityProfileGroupsResponse; /** - * Calls DeleteServerTlsPolicy. - * @param request DeleteServerTlsPolicyRequest message or plain object - * @returns Promise + * Creates a plain object from a ListSecurityProfileGroupsResponse message. Also converts values to other types if specified. + * @param message ListSecurityProfileGroupsResponse + * @param [options] Conversion options + * @returns Plain object */ - public deleteServerTlsPolicy(request: google.cloud.networksecurity.v1.IDeleteServerTlsPolicyRequest): Promise; + public static toObject(message: google.cloud.networksecurity.v1.ListSecurityProfileGroupsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Calls ListClientTlsPolicies. - * @param request ListClientTlsPoliciesRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ListClientTlsPoliciesResponse + * Converts this ListSecurityProfileGroupsResponse to JSON. + * @returns JSON object */ - public listClientTlsPolicies(request: google.cloud.networksecurity.v1.IListClientTlsPoliciesRequest, callback: google.cloud.networksecurity.v1.NetworkSecurity.ListClientTlsPoliciesCallback): void; + public toJSON(): { [k: string]: any }; /** - * Calls ListClientTlsPolicies. - * @param request ListClientTlsPoliciesRequest message or plain object - * @returns Promise + * Gets the default type url for ListSecurityProfileGroupsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url */ - public listClientTlsPolicies(request: google.cloud.networksecurity.v1.IListClientTlsPoliciesRequest): Promise; + public static getTypeUrl(typeUrlPrefix?: string): string; + } - /** - * Calls GetClientTlsPolicy. - * @param request GetClientTlsPolicyRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ClientTlsPolicy - */ - public getClientTlsPolicy(request: google.cloud.networksecurity.v1.IGetClientTlsPolicyRequest, callback: google.cloud.networksecurity.v1.NetworkSecurity.GetClientTlsPolicyCallback): void; + /** Properties of a GetSecurityProfileGroupRequest. */ + interface IGetSecurityProfileGroupRequest { + + /** GetSecurityProfileGroupRequest name */ + name?: (string|null); + } + + /** Represents a GetSecurityProfileGroupRequest. */ + class GetSecurityProfileGroupRequest implements IGetSecurityProfileGroupRequest { /** - * Calls GetClientTlsPolicy. - * @param request GetClientTlsPolicyRequest message or plain object - * @returns Promise + * Constructs a new GetSecurityProfileGroupRequest. + * @param [properties] Properties to set */ - public getClientTlsPolicy(request: google.cloud.networksecurity.v1.IGetClientTlsPolicyRequest): Promise; + constructor(properties?: google.cloud.networksecurity.v1.IGetSecurityProfileGroupRequest); + + /** GetSecurityProfileGroupRequest name. */ + public name: string; /** - * Calls CreateClientTlsPolicy. - * @param request CreateClientTlsPolicyRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation + * Creates a new GetSecurityProfileGroupRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetSecurityProfileGroupRequest instance */ - public createClientTlsPolicy(request: google.cloud.networksecurity.v1.ICreateClientTlsPolicyRequest, callback: google.cloud.networksecurity.v1.NetworkSecurity.CreateClientTlsPolicyCallback): void; + public static create(properties?: google.cloud.networksecurity.v1.IGetSecurityProfileGroupRequest): google.cloud.networksecurity.v1.GetSecurityProfileGroupRequest; /** - * Calls CreateClientTlsPolicy. - * @param request CreateClientTlsPolicyRequest message or plain object - * @returns Promise + * Encodes the specified GetSecurityProfileGroupRequest message. Does not implicitly {@link google.cloud.networksecurity.v1.GetSecurityProfileGroupRequest.verify|verify} messages. + * @param message GetSecurityProfileGroupRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer */ - public createClientTlsPolicy(request: google.cloud.networksecurity.v1.ICreateClientTlsPolicyRequest): Promise; + public static encode(message: google.cloud.networksecurity.v1.IGetSecurityProfileGroupRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Calls UpdateClientTlsPolicy. - * @param request UpdateClientTlsPolicyRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation + * Encodes the specified GetSecurityProfileGroupRequest message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.GetSecurityProfileGroupRequest.verify|verify} messages. + * @param message GetSecurityProfileGroupRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer */ - public updateClientTlsPolicy(request: google.cloud.networksecurity.v1.IUpdateClientTlsPolicyRequest, callback: google.cloud.networksecurity.v1.NetworkSecurity.UpdateClientTlsPolicyCallback): void; + public static encodeDelimited(message: google.cloud.networksecurity.v1.IGetSecurityProfileGroupRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Calls UpdateClientTlsPolicy. - * @param request UpdateClientTlsPolicyRequest message or plain object - * @returns Promise + * Decodes a GetSecurityProfileGroupRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetSecurityProfileGroupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public updateClientTlsPolicy(request: google.cloud.networksecurity.v1.IUpdateClientTlsPolicyRequest): Promise; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.networksecurity.v1.GetSecurityProfileGroupRequest; /** - * Calls DeleteClientTlsPolicy. - * @param request DeleteClientTlsPolicyRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation + * Decodes a GetSecurityProfileGroupRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetSecurityProfileGroupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public deleteClientTlsPolicy(request: google.cloud.networksecurity.v1.IDeleteClientTlsPolicyRequest, callback: google.cloud.networksecurity.v1.NetworkSecurity.DeleteClientTlsPolicyCallback): void; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.networksecurity.v1.GetSecurityProfileGroupRequest; /** - * Calls DeleteClientTlsPolicy. - * @param request DeleteClientTlsPolicyRequest message or plain object - * @returns Promise + * Verifies a GetSecurityProfileGroupRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not */ - public deleteClientTlsPolicy(request: google.cloud.networksecurity.v1.IDeleteClientTlsPolicyRequest): Promise; - } - - namespace NetworkSecurity { + public static verify(message: { [k: string]: any }): (string|null); /** - * Callback as used by {@link google.cloud.networksecurity.v1.NetworkSecurity|listAuthorizationPolicies}. - * @param error Error, if any - * @param [response] ListAuthorizationPoliciesResponse + * Creates a GetSecurityProfileGroupRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetSecurityProfileGroupRequest */ - type ListAuthorizationPoliciesCallback = (error: (Error|null), response?: google.cloud.networksecurity.v1.ListAuthorizationPoliciesResponse) => void; + public static fromObject(object: { [k: string]: any }): google.cloud.networksecurity.v1.GetSecurityProfileGroupRequest; /** - * Callback as used by {@link google.cloud.networksecurity.v1.NetworkSecurity|getAuthorizationPolicy}. - * @param error Error, if any - * @param [response] AuthorizationPolicy + * Creates a plain object from a GetSecurityProfileGroupRequest message. Also converts values to other types if specified. + * @param message GetSecurityProfileGroupRequest + * @param [options] Conversion options + * @returns Plain object */ - type GetAuthorizationPolicyCallback = (error: (Error|null), response?: google.cloud.networksecurity.v1.AuthorizationPolicy) => void; + public static toObject(message: google.cloud.networksecurity.v1.GetSecurityProfileGroupRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Callback as used by {@link google.cloud.networksecurity.v1.NetworkSecurity|createAuthorizationPolicy}. - * @param error Error, if any - * @param [response] Operation + * Converts this GetSecurityProfileGroupRequest to JSON. + * @returns JSON object */ - type CreateAuthorizationPolicyCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + public toJSON(): { [k: string]: any }; /** - * Callback as used by {@link google.cloud.networksecurity.v1.NetworkSecurity|updateAuthorizationPolicy}. - * @param error Error, if any - * @param [response] Operation + * Gets the default type url for GetSecurityProfileGroupRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url */ - type UpdateAuthorizationPolicyCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateSecurityProfileGroupRequest. */ + interface ICreateSecurityProfileGroupRequest { + + /** CreateSecurityProfileGroupRequest parent */ + parent?: (string|null); + + /** CreateSecurityProfileGroupRequest securityProfileGroupId */ + securityProfileGroupId?: (string|null); + + /** CreateSecurityProfileGroupRequest securityProfileGroup */ + securityProfileGroup?: (google.cloud.networksecurity.v1.ISecurityProfileGroup|null); + } + + /** Represents a CreateSecurityProfileGroupRequest. */ + class CreateSecurityProfileGroupRequest implements ICreateSecurityProfileGroupRequest { /** - * Callback as used by {@link google.cloud.networksecurity.v1.NetworkSecurity|deleteAuthorizationPolicy}. - * @param error Error, if any - * @param [response] Operation + * Constructs a new CreateSecurityProfileGroupRequest. + * @param [properties] Properties to set */ - type DeleteAuthorizationPolicyCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + constructor(properties?: google.cloud.networksecurity.v1.ICreateSecurityProfileGroupRequest); + + /** CreateSecurityProfileGroupRequest parent. */ + public parent: string; + + /** CreateSecurityProfileGroupRequest securityProfileGroupId. */ + public securityProfileGroupId: string; + + /** CreateSecurityProfileGroupRequest securityProfileGroup. */ + public securityProfileGroup?: (google.cloud.networksecurity.v1.ISecurityProfileGroup|null); /** - * Callback as used by {@link google.cloud.networksecurity.v1.NetworkSecurity|listServerTlsPolicies}. - * @param error Error, if any - * @param [response] ListServerTlsPoliciesResponse + * Creates a new CreateSecurityProfileGroupRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateSecurityProfileGroupRequest instance */ - type ListServerTlsPoliciesCallback = (error: (Error|null), response?: google.cloud.networksecurity.v1.ListServerTlsPoliciesResponse) => void; + public static create(properties?: google.cloud.networksecurity.v1.ICreateSecurityProfileGroupRequest): google.cloud.networksecurity.v1.CreateSecurityProfileGroupRequest; /** - * Callback as used by {@link google.cloud.networksecurity.v1.NetworkSecurity|getServerTlsPolicy}. - * @param error Error, if any - * @param [response] ServerTlsPolicy + * Encodes the specified CreateSecurityProfileGroupRequest message. Does not implicitly {@link google.cloud.networksecurity.v1.CreateSecurityProfileGroupRequest.verify|verify} messages. + * @param message CreateSecurityProfileGroupRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer */ - type GetServerTlsPolicyCallback = (error: (Error|null), response?: google.cloud.networksecurity.v1.ServerTlsPolicy) => void; + public static encode(message: google.cloud.networksecurity.v1.ICreateSecurityProfileGroupRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Callback as used by {@link google.cloud.networksecurity.v1.NetworkSecurity|createServerTlsPolicy}. - * @param error Error, if any - * @param [response] Operation + * Encodes the specified CreateSecurityProfileGroupRequest message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.CreateSecurityProfileGroupRequest.verify|verify} messages. + * @param message CreateSecurityProfileGroupRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer */ - type CreateServerTlsPolicyCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + public static encodeDelimited(message: google.cloud.networksecurity.v1.ICreateSecurityProfileGroupRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Callback as used by {@link google.cloud.networksecurity.v1.NetworkSecurity|updateServerTlsPolicy}. - * @param error Error, if any - * @param [response] Operation + * Decodes a CreateSecurityProfileGroupRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateSecurityProfileGroupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - type UpdateServerTlsPolicyCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.networksecurity.v1.CreateSecurityProfileGroupRequest; /** - * Callback as used by {@link google.cloud.networksecurity.v1.NetworkSecurity|deleteServerTlsPolicy}. - * @param error Error, if any - * @param [response] Operation + * Decodes a CreateSecurityProfileGroupRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateSecurityProfileGroupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - type DeleteServerTlsPolicyCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.networksecurity.v1.CreateSecurityProfileGroupRequest; /** - * Callback as used by {@link google.cloud.networksecurity.v1.NetworkSecurity|listClientTlsPolicies}. - * @param error Error, if any - * @param [response] ListClientTlsPoliciesResponse + * Verifies a CreateSecurityProfileGroupRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not */ - type ListClientTlsPoliciesCallback = (error: (Error|null), response?: google.cloud.networksecurity.v1.ListClientTlsPoliciesResponse) => void; + public static verify(message: { [k: string]: any }): (string|null); /** - * Callback as used by {@link google.cloud.networksecurity.v1.NetworkSecurity|getClientTlsPolicy}. - * @param error Error, if any - * @param [response] ClientTlsPolicy + * Creates a CreateSecurityProfileGroupRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateSecurityProfileGroupRequest */ - type GetClientTlsPolicyCallback = (error: (Error|null), response?: google.cloud.networksecurity.v1.ClientTlsPolicy) => void; + public static fromObject(object: { [k: string]: any }): google.cloud.networksecurity.v1.CreateSecurityProfileGroupRequest; /** - * Callback as used by {@link google.cloud.networksecurity.v1.NetworkSecurity|createClientTlsPolicy}. - * @param error Error, if any - * @param [response] Operation + * Creates a plain object from a CreateSecurityProfileGroupRequest message. Also converts values to other types if specified. + * @param message CreateSecurityProfileGroupRequest + * @param [options] Conversion options + * @returns Plain object */ - type CreateClientTlsPolicyCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + public static toObject(message: google.cloud.networksecurity.v1.CreateSecurityProfileGroupRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Callback as used by {@link google.cloud.networksecurity.v1.NetworkSecurity|updateClientTlsPolicy}. - * @param error Error, if any - * @param [response] Operation + * Converts this CreateSecurityProfileGroupRequest to JSON. + * @returns JSON object */ - type UpdateClientTlsPolicyCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + public toJSON(): { [k: string]: any }; /** - * Callback as used by {@link google.cloud.networksecurity.v1.NetworkSecurity|deleteClientTlsPolicy}. - * @param error Error, if any - * @param [response] Operation + * Gets the default type url for CreateSecurityProfileGroupRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url */ - type DeleteClientTlsPolicyCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a ServerTlsPolicy. */ - interface IServerTlsPolicy { - - /** ServerTlsPolicy name */ - name?: (string|null); - - /** ServerTlsPolicy description */ - description?: (string|null); - - /** ServerTlsPolicy createTime */ - createTime?: (google.protobuf.ITimestamp|null); - - /** ServerTlsPolicy updateTime */ - updateTime?: (google.protobuf.ITimestamp|null); - - /** ServerTlsPolicy labels */ - labels?: ({ [k: string]: string }|null); - - /** ServerTlsPolicy allowOpen */ - allowOpen?: (boolean|null); + /** Properties of an UpdateSecurityProfileGroupRequest. */ + interface IUpdateSecurityProfileGroupRequest { - /** ServerTlsPolicy serverCertificate */ - serverCertificate?: (google.cloud.networksecurity.v1.ICertificateProvider|null); + /** UpdateSecurityProfileGroupRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); - /** ServerTlsPolicy mtlsPolicy */ - mtlsPolicy?: (google.cloud.networksecurity.v1.ServerTlsPolicy.IMTLSPolicy|null); + /** UpdateSecurityProfileGroupRequest securityProfileGroup */ + securityProfileGroup?: (google.cloud.networksecurity.v1.ISecurityProfileGroup|null); } - /** Represents a ServerTlsPolicy. */ - class ServerTlsPolicy implements IServerTlsPolicy { + /** Represents an UpdateSecurityProfileGroupRequest. */ + class UpdateSecurityProfileGroupRequest implements IUpdateSecurityProfileGroupRequest { /** - * Constructs a new ServerTlsPolicy. + * Constructs a new UpdateSecurityProfileGroupRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.networksecurity.v1.IServerTlsPolicy); - - /** ServerTlsPolicy name. */ - public name: string; - - /** ServerTlsPolicy description. */ - public description: string; - - /** ServerTlsPolicy createTime. */ - public createTime?: (google.protobuf.ITimestamp|null); - - /** ServerTlsPolicy updateTime. */ - public updateTime?: (google.protobuf.ITimestamp|null); - - /** ServerTlsPolicy labels. */ - public labels: { [k: string]: string }; - - /** ServerTlsPolicy allowOpen. */ - public allowOpen: boolean; + constructor(properties?: google.cloud.networksecurity.v1.IUpdateSecurityProfileGroupRequest); - /** ServerTlsPolicy serverCertificate. */ - public serverCertificate?: (google.cloud.networksecurity.v1.ICertificateProvider|null); + /** UpdateSecurityProfileGroupRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); - /** ServerTlsPolicy mtlsPolicy. */ - public mtlsPolicy?: (google.cloud.networksecurity.v1.ServerTlsPolicy.IMTLSPolicy|null); + /** UpdateSecurityProfileGroupRequest securityProfileGroup. */ + public securityProfileGroup?: (google.cloud.networksecurity.v1.ISecurityProfileGroup|null); /** - * Creates a new ServerTlsPolicy instance using the specified properties. + * Creates a new UpdateSecurityProfileGroupRequest instance using the specified properties. * @param [properties] Properties to set - * @returns ServerTlsPolicy instance + * @returns UpdateSecurityProfileGroupRequest instance */ - public static create(properties?: google.cloud.networksecurity.v1.IServerTlsPolicy): google.cloud.networksecurity.v1.ServerTlsPolicy; + public static create(properties?: google.cloud.networksecurity.v1.IUpdateSecurityProfileGroupRequest): google.cloud.networksecurity.v1.UpdateSecurityProfileGroupRequest; /** - * Encodes the specified ServerTlsPolicy message. Does not implicitly {@link google.cloud.networksecurity.v1.ServerTlsPolicy.verify|verify} messages. - * @param message ServerTlsPolicy message or plain object to encode + * Encodes the specified UpdateSecurityProfileGroupRequest message. Does not implicitly {@link google.cloud.networksecurity.v1.UpdateSecurityProfileGroupRequest.verify|verify} messages. + * @param message UpdateSecurityProfileGroupRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.networksecurity.v1.IServerTlsPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.networksecurity.v1.IUpdateSecurityProfileGroupRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified ServerTlsPolicy message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.ServerTlsPolicy.verify|verify} messages. - * @param message ServerTlsPolicy message or plain object to encode + * Encodes the specified UpdateSecurityProfileGroupRequest message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.UpdateSecurityProfileGroupRequest.verify|verify} messages. + * @param message UpdateSecurityProfileGroupRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.networksecurity.v1.IServerTlsPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.networksecurity.v1.IUpdateSecurityProfileGroupRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a ServerTlsPolicy message from the specified reader or buffer. + * Decodes an UpdateSecurityProfileGroupRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns ServerTlsPolicy + * @returns UpdateSecurityProfileGroupRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.networksecurity.v1.ServerTlsPolicy; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.networksecurity.v1.UpdateSecurityProfileGroupRequest; /** - * Decodes a ServerTlsPolicy message from the specified reader or buffer, length delimited. + * Decodes an UpdateSecurityProfileGroupRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ServerTlsPolicy + * @returns UpdateSecurityProfileGroupRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.networksecurity.v1.ServerTlsPolicy; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.networksecurity.v1.UpdateSecurityProfileGroupRequest; /** - * Verifies a ServerTlsPolicy message. + * Verifies an UpdateSecurityProfileGroupRequest message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a ServerTlsPolicy message from a plain object. Also converts values to their respective internal types. + * Creates an UpdateSecurityProfileGroupRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ServerTlsPolicy + * @returns UpdateSecurityProfileGroupRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.networksecurity.v1.ServerTlsPolicy; + public static fromObject(object: { [k: string]: any }): google.cloud.networksecurity.v1.UpdateSecurityProfileGroupRequest; /** - * Creates a plain object from a ServerTlsPolicy message. Also converts values to other types if specified. - * @param message ServerTlsPolicy + * Creates a plain object from an UpdateSecurityProfileGroupRequest message. Also converts values to other types if specified. + * @param message UpdateSecurityProfileGroupRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.networksecurity.v1.ServerTlsPolicy, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.networksecurity.v1.UpdateSecurityProfileGroupRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ServerTlsPolicy to JSON. + * Converts this UpdateSecurityProfileGroupRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for ServerTlsPolicy + * Gets the default type url for UpdateSecurityProfileGroupRequest * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - namespace ServerTlsPolicy { + /** Properties of a DeleteSecurityProfileGroupRequest. */ + interface IDeleteSecurityProfileGroupRequest { - /** Properties of a MTLSPolicy. */ - interface IMTLSPolicy { + /** DeleteSecurityProfileGroupRequest name */ + name?: (string|null); - /** MTLSPolicy clientValidationCa */ - clientValidationCa?: (google.cloud.networksecurity.v1.IValidationCA[]|null); - } + /** DeleteSecurityProfileGroupRequest etag */ + etag?: (string|null); + } - /** Represents a MTLSPolicy. */ - class MTLSPolicy implements IMTLSPolicy { + /** Represents a DeleteSecurityProfileGroupRequest. */ + class DeleteSecurityProfileGroupRequest implements IDeleteSecurityProfileGroupRequest { - /** - * Constructs a new MTLSPolicy. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.networksecurity.v1.ServerTlsPolicy.IMTLSPolicy); + /** + * Constructs a new DeleteSecurityProfileGroupRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.networksecurity.v1.IDeleteSecurityProfileGroupRequest); - /** MTLSPolicy clientValidationCa. */ - public clientValidationCa: google.cloud.networksecurity.v1.IValidationCA[]; + /** DeleteSecurityProfileGroupRequest name. */ + public name: string; - /** - * Creates a new MTLSPolicy instance using the specified properties. - * @param [properties] Properties to set - * @returns MTLSPolicy instance - */ - public static create(properties?: google.cloud.networksecurity.v1.ServerTlsPolicy.IMTLSPolicy): google.cloud.networksecurity.v1.ServerTlsPolicy.MTLSPolicy; + /** DeleteSecurityProfileGroupRequest etag. */ + public etag: string; - /** - * Encodes the specified MTLSPolicy message. Does not implicitly {@link google.cloud.networksecurity.v1.ServerTlsPolicy.MTLSPolicy.verify|verify} messages. - * @param message MTLSPolicy message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.networksecurity.v1.ServerTlsPolicy.IMTLSPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Creates a new DeleteSecurityProfileGroupRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteSecurityProfileGroupRequest instance + */ + public static create(properties?: google.cloud.networksecurity.v1.IDeleteSecurityProfileGroupRequest): google.cloud.networksecurity.v1.DeleteSecurityProfileGroupRequest; - /** - * Encodes the specified MTLSPolicy message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.ServerTlsPolicy.MTLSPolicy.verify|verify} messages. - * @param message MTLSPolicy message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.networksecurity.v1.ServerTlsPolicy.IMTLSPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Encodes the specified DeleteSecurityProfileGroupRequest message. Does not implicitly {@link google.cloud.networksecurity.v1.DeleteSecurityProfileGroupRequest.verify|verify} messages. + * @param message DeleteSecurityProfileGroupRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.networksecurity.v1.IDeleteSecurityProfileGroupRequest, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Decodes a MTLSPolicy message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns MTLSPolicy - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.networksecurity.v1.ServerTlsPolicy.MTLSPolicy; + /** + * Encodes the specified DeleteSecurityProfileGroupRequest message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.DeleteSecurityProfileGroupRequest.verify|verify} messages. + * @param message DeleteSecurityProfileGroupRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.networksecurity.v1.IDeleteSecurityProfileGroupRequest, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Decodes a MTLSPolicy message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns MTLSPolicy - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.networksecurity.v1.ServerTlsPolicy.MTLSPolicy; + /** + * Decodes a DeleteSecurityProfileGroupRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteSecurityProfileGroupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.networksecurity.v1.DeleteSecurityProfileGroupRequest; - /** - * Verifies a MTLSPolicy message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** + * Decodes a DeleteSecurityProfileGroupRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteSecurityProfileGroupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.networksecurity.v1.DeleteSecurityProfileGroupRequest; - /** - * Creates a MTLSPolicy message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns MTLSPolicy - */ - public static fromObject(object: { [k: string]: any }): google.cloud.networksecurity.v1.ServerTlsPolicy.MTLSPolicy; + /** + * Verifies a DeleteSecurityProfileGroupRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteSecurityProfileGroupRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteSecurityProfileGroupRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.networksecurity.v1.DeleteSecurityProfileGroupRequest; - /** - * Creates a plain object from a MTLSPolicy message. Also converts values to other types if specified. - * @param message MTLSPolicy - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.networksecurity.v1.ServerTlsPolicy.MTLSPolicy, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** + * Creates a plain object from a DeleteSecurityProfileGroupRequest message. Also converts values to other types if specified. + * @param message DeleteSecurityProfileGroupRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.networksecurity.v1.DeleteSecurityProfileGroupRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** - * Converts this MTLSPolicy to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; + /** + * Converts this DeleteSecurityProfileGroupRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; - /** - * Gets the default type url for MTLSPolicy - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } + /** + * Gets the default type url for DeleteSecurityProfileGroupRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a ListServerTlsPoliciesRequest. */ - interface IListServerTlsPoliciesRequest { + /** Properties of a ListSecurityProfilesRequest. */ + interface IListSecurityProfilesRequest { - /** ListServerTlsPoliciesRequest parent */ + /** ListSecurityProfilesRequest parent */ parent?: (string|null); - /** ListServerTlsPoliciesRequest pageSize */ + /** ListSecurityProfilesRequest pageSize */ pageSize?: (number|null); - /** ListServerTlsPoliciesRequest pageToken */ + /** ListSecurityProfilesRequest pageToken */ pageToken?: (string|null); } - /** Represents a ListServerTlsPoliciesRequest. */ - class ListServerTlsPoliciesRequest implements IListServerTlsPoliciesRequest { + /** Represents a ListSecurityProfilesRequest. */ + class ListSecurityProfilesRequest implements IListSecurityProfilesRequest { /** - * Constructs a new ListServerTlsPoliciesRequest. + * Constructs a new ListSecurityProfilesRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.networksecurity.v1.IListServerTlsPoliciesRequest); + constructor(properties?: google.cloud.networksecurity.v1.IListSecurityProfilesRequest); - /** ListServerTlsPoliciesRequest parent. */ + /** ListSecurityProfilesRequest parent. */ public parent: string; - /** ListServerTlsPoliciesRequest pageSize. */ + /** ListSecurityProfilesRequest pageSize. */ public pageSize: number; - /** ListServerTlsPoliciesRequest pageToken. */ + /** ListSecurityProfilesRequest pageToken. */ public pageToken: string; /** - * Creates a new ListServerTlsPoliciesRequest instance using the specified properties. + * Creates a new ListSecurityProfilesRequest instance using the specified properties. * @param [properties] Properties to set - * @returns ListServerTlsPoliciesRequest instance + * @returns ListSecurityProfilesRequest instance */ - public static create(properties?: google.cloud.networksecurity.v1.IListServerTlsPoliciesRequest): google.cloud.networksecurity.v1.ListServerTlsPoliciesRequest; + public static create(properties?: google.cloud.networksecurity.v1.IListSecurityProfilesRequest): google.cloud.networksecurity.v1.ListSecurityProfilesRequest; /** - * Encodes the specified ListServerTlsPoliciesRequest message. Does not implicitly {@link google.cloud.networksecurity.v1.ListServerTlsPoliciesRequest.verify|verify} messages. - * @param message ListServerTlsPoliciesRequest message or plain object to encode + * Encodes the specified ListSecurityProfilesRequest message. Does not implicitly {@link google.cloud.networksecurity.v1.ListSecurityProfilesRequest.verify|verify} messages. + * @param message ListSecurityProfilesRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.networksecurity.v1.IListServerTlsPoliciesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.networksecurity.v1.IListSecurityProfilesRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified ListServerTlsPoliciesRequest message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.ListServerTlsPoliciesRequest.verify|verify} messages. - * @param message ListServerTlsPoliciesRequest message or plain object to encode + * Encodes the specified ListSecurityProfilesRequest message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.ListSecurityProfilesRequest.verify|verify} messages. + * @param message ListSecurityProfilesRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.networksecurity.v1.IListServerTlsPoliciesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.networksecurity.v1.IListSecurityProfilesRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a ListServerTlsPoliciesRequest message from the specified reader or buffer. + * Decodes a ListSecurityProfilesRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns ListServerTlsPoliciesRequest + * @returns ListSecurityProfilesRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.networksecurity.v1.ListServerTlsPoliciesRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.networksecurity.v1.ListSecurityProfilesRequest; /** - * Decodes a ListServerTlsPoliciesRequest message from the specified reader or buffer, length delimited. + * Decodes a ListSecurityProfilesRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ListServerTlsPoliciesRequest + * @returns ListSecurityProfilesRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.networksecurity.v1.ListServerTlsPoliciesRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.networksecurity.v1.ListSecurityProfilesRequest; /** - * Verifies a ListServerTlsPoliciesRequest message. + * Verifies a ListSecurityProfilesRequest message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a ListServerTlsPoliciesRequest message from a plain object. Also converts values to their respective internal types. + * Creates a ListSecurityProfilesRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ListServerTlsPoliciesRequest + * @returns ListSecurityProfilesRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.networksecurity.v1.ListServerTlsPoliciesRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.networksecurity.v1.ListSecurityProfilesRequest; /** - * Creates a plain object from a ListServerTlsPoliciesRequest message. Also converts values to other types if specified. - * @param message ListServerTlsPoliciesRequest + * Creates a plain object from a ListSecurityProfilesRequest message. Also converts values to other types if specified. + * @param message ListSecurityProfilesRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.networksecurity.v1.ListServerTlsPoliciesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.networksecurity.v1.ListSecurityProfilesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ListServerTlsPoliciesRequest to JSON. + * Converts this ListSecurityProfilesRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for ListServerTlsPoliciesRequest + * Gets the default type url for ListSecurityProfilesRequest * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a ListServerTlsPoliciesResponse. */ - interface IListServerTlsPoliciesResponse { + /** Properties of a ListSecurityProfilesResponse. */ + interface IListSecurityProfilesResponse { - /** ListServerTlsPoliciesResponse serverTlsPolicies */ - serverTlsPolicies?: (google.cloud.networksecurity.v1.IServerTlsPolicy[]|null); + /** ListSecurityProfilesResponse securityProfiles */ + securityProfiles?: (google.cloud.networksecurity.v1.ISecurityProfile[]|null); - /** ListServerTlsPoliciesResponse nextPageToken */ + /** ListSecurityProfilesResponse nextPageToken */ nextPageToken?: (string|null); } - /** Represents a ListServerTlsPoliciesResponse. */ - class ListServerTlsPoliciesResponse implements IListServerTlsPoliciesResponse { + /** Represents a ListSecurityProfilesResponse. */ + class ListSecurityProfilesResponse implements IListSecurityProfilesResponse { /** - * Constructs a new ListServerTlsPoliciesResponse. + * Constructs a new ListSecurityProfilesResponse. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.networksecurity.v1.IListServerTlsPoliciesResponse); + constructor(properties?: google.cloud.networksecurity.v1.IListSecurityProfilesResponse); - /** ListServerTlsPoliciesResponse serverTlsPolicies. */ - public serverTlsPolicies: google.cloud.networksecurity.v1.IServerTlsPolicy[]; + /** ListSecurityProfilesResponse securityProfiles. */ + public securityProfiles: google.cloud.networksecurity.v1.ISecurityProfile[]; - /** ListServerTlsPoliciesResponse nextPageToken. */ + /** ListSecurityProfilesResponse nextPageToken. */ public nextPageToken: string; /** - * Creates a new ListServerTlsPoliciesResponse instance using the specified properties. + * Creates a new ListSecurityProfilesResponse instance using the specified properties. * @param [properties] Properties to set - * @returns ListServerTlsPoliciesResponse instance + * @returns ListSecurityProfilesResponse instance */ - public static create(properties?: google.cloud.networksecurity.v1.IListServerTlsPoliciesResponse): google.cloud.networksecurity.v1.ListServerTlsPoliciesResponse; + public static create(properties?: google.cloud.networksecurity.v1.IListSecurityProfilesResponse): google.cloud.networksecurity.v1.ListSecurityProfilesResponse; /** - * Encodes the specified ListServerTlsPoliciesResponse message. Does not implicitly {@link google.cloud.networksecurity.v1.ListServerTlsPoliciesResponse.verify|verify} messages. - * @param message ListServerTlsPoliciesResponse message or plain object to encode + * Encodes the specified ListSecurityProfilesResponse message. Does not implicitly {@link google.cloud.networksecurity.v1.ListSecurityProfilesResponse.verify|verify} messages. + * @param message ListSecurityProfilesResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.networksecurity.v1.IListServerTlsPoliciesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.networksecurity.v1.IListSecurityProfilesResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified ListServerTlsPoliciesResponse message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.ListServerTlsPoliciesResponse.verify|verify} messages. - * @param message ListServerTlsPoliciesResponse message or plain object to encode + * Encodes the specified ListSecurityProfilesResponse message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.ListSecurityProfilesResponse.verify|verify} messages. + * @param message ListSecurityProfilesResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.networksecurity.v1.IListServerTlsPoliciesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.networksecurity.v1.IListSecurityProfilesResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a ListServerTlsPoliciesResponse message from the specified reader or buffer. + * Decodes a ListSecurityProfilesResponse message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns ListServerTlsPoliciesResponse + * @returns ListSecurityProfilesResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.networksecurity.v1.ListServerTlsPoliciesResponse; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.networksecurity.v1.ListSecurityProfilesResponse; /** - * Decodes a ListServerTlsPoliciesResponse message from the specified reader or buffer, length delimited. + * Decodes a ListSecurityProfilesResponse message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ListServerTlsPoliciesResponse + * @returns ListSecurityProfilesResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.networksecurity.v1.ListServerTlsPoliciesResponse; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.networksecurity.v1.ListSecurityProfilesResponse; /** - * Verifies a ListServerTlsPoliciesResponse message. + * Verifies a ListSecurityProfilesResponse message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a ListServerTlsPoliciesResponse message from a plain object. Also converts values to their respective internal types. + * Creates a ListSecurityProfilesResponse message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ListServerTlsPoliciesResponse + * @returns ListSecurityProfilesResponse */ - public static fromObject(object: { [k: string]: any }): google.cloud.networksecurity.v1.ListServerTlsPoliciesResponse; + public static fromObject(object: { [k: string]: any }): google.cloud.networksecurity.v1.ListSecurityProfilesResponse; /** - * Creates a plain object from a ListServerTlsPoliciesResponse message. Also converts values to other types if specified. - * @param message ListServerTlsPoliciesResponse + * Creates a plain object from a ListSecurityProfilesResponse message. Also converts values to other types if specified. + * @param message ListSecurityProfilesResponse * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.networksecurity.v1.ListServerTlsPoliciesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.networksecurity.v1.ListSecurityProfilesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ListServerTlsPoliciesResponse to JSON. + * Converts this ListSecurityProfilesResponse to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for ListServerTlsPoliciesResponse + * Gets the default type url for ListSecurityProfilesResponse * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a GetServerTlsPolicyRequest. */ - interface IGetServerTlsPolicyRequest { + /** Properties of a GetSecurityProfileRequest. */ + interface IGetSecurityProfileRequest { - /** GetServerTlsPolicyRequest name */ + /** GetSecurityProfileRequest name */ name?: (string|null); } - /** Represents a GetServerTlsPolicyRequest. */ - class GetServerTlsPolicyRequest implements IGetServerTlsPolicyRequest { + /** Represents a GetSecurityProfileRequest. */ + class GetSecurityProfileRequest implements IGetSecurityProfileRequest { /** - * Constructs a new GetServerTlsPolicyRequest. + * Constructs a new GetSecurityProfileRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.networksecurity.v1.IGetServerTlsPolicyRequest); + constructor(properties?: google.cloud.networksecurity.v1.IGetSecurityProfileRequest); - /** GetServerTlsPolicyRequest name. */ + /** GetSecurityProfileRequest name. */ public name: string; /** - * Creates a new GetServerTlsPolicyRequest instance using the specified properties. + * Creates a new GetSecurityProfileRequest instance using the specified properties. * @param [properties] Properties to set - * @returns GetServerTlsPolicyRequest instance + * @returns GetSecurityProfileRequest instance */ - public static create(properties?: google.cloud.networksecurity.v1.IGetServerTlsPolicyRequest): google.cloud.networksecurity.v1.GetServerTlsPolicyRequest; + public static create(properties?: google.cloud.networksecurity.v1.IGetSecurityProfileRequest): google.cloud.networksecurity.v1.GetSecurityProfileRequest; /** - * Encodes the specified GetServerTlsPolicyRequest message. Does not implicitly {@link google.cloud.networksecurity.v1.GetServerTlsPolicyRequest.verify|verify} messages. - * @param message GetServerTlsPolicyRequest message or plain object to encode + * Encodes the specified GetSecurityProfileRequest message. Does not implicitly {@link google.cloud.networksecurity.v1.GetSecurityProfileRequest.verify|verify} messages. + * @param message GetSecurityProfileRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.networksecurity.v1.IGetServerTlsPolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.networksecurity.v1.IGetSecurityProfileRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified GetServerTlsPolicyRequest message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.GetServerTlsPolicyRequest.verify|verify} messages. - * @param message GetServerTlsPolicyRequest message or plain object to encode + * Encodes the specified GetSecurityProfileRequest message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.GetSecurityProfileRequest.verify|verify} messages. + * @param message GetSecurityProfileRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.networksecurity.v1.IGetServerTlsPolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.networksecurity.v1.IGetSecurityProfileRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a GetServerTlsPolicyRequest message from the specified reader or buffer. + * Decodes a GetSecurityProfileRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns GetServerTlsPolicyRequest + * @returns GetSecurityProfileRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.networksecurity.v1.GetServerTlsPolicyRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.networksecurity.v1.GetSecurityProfileRequest; /** - * Decodes a GetServerTlsPolicyRequest message from the specified reader or buffer, length delimited. + * Decodes a GetSecurityProfileRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns GetServerTlsPolicyRequest + * @returns GetSecurityProfileRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.networksecurity.v1.GetServerTlsPolicyRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.networksecurity.v1.GetSecurityProfileRequest; /** - * Verifies a GetServerTlsPolicyRequest message. + * Verifies a GetSecurityProfileRequest message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a GetServerTlsPolicyRequest message from a plain object. Also converts values to their respective internal types. + * Creates a GetSecurityProfileRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns GetServerTlsPolicyRequest + * @returns GetSecurityProfileRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.networksecurity.v1.GetServerTlsPolicyRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.networksecurity.v1.GetSecurityProfileRequest; /** - * Creates a plain object from a GetServerTlsPolicyRequest message. Also converts values to other types if specified. - * @param message GetServerTlsPolicyRequest + * Creates a plain object from a GetSecurityProfileRequest message. Also converts values to other types if specified. + * @param message GetSecurityProfileRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.networksecurity.v1.GetServerTlsPolicyRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.networksecurity.v1.GetSecurityProfileRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this GetServerTlsPolicyRequest to JSON. + * Converts this GetSecurityProfileRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for GetServerTlsPolicyRequest + * Gets the default type url for GetSecurityProfileRequest * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a CreateServerTlsPolicyRequest. */ - interface ICreateServerTlsPolicyRequest { + /** Properties of a CreateSecurityProfileRequest. */ + interface ICreateSecurityProfileRequest { - /** CreateServerTlsPolicyRequest parent */ + /** CreateSecurityProfileRequest parent */ parent?: (string|null); - /** CreateServerTlsPolicyRequest serverTlsPolicyId */ - serverTlsPolicyId?: (string|null); + /** CreateSecurityProfileRequest securityProfileId */ + securityProfileId?: (string|null); - /** CreateServerTlsPolicyRequest serverTlsPolicy */ - serverTlsPolicy?: (google.cloud.networksecurity.v1.IServerTlsPolicy|null); + /** CreateSecurityProfileRequest securityProfile */ + securityProfile?: (google.cloud.networksecurity.v1.ISecurityProfile|null); } - /** Represents a CreateServerTlsPolicyRequest. */ - class CreateServerTlsPolicyRequest implements ICreateServerTlsPolicyRequest { + /** Represents a CreateSecurityProfileRequest. */ + class CreateSecurityProfileRequest implements ICreateSecurityProfileRequest { /** - * Constructs a new CreateServerTlsPolicyRequest. + * Constructs a new CreateSecurityProfileRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.networksecurity.v1.ICreateServerTlsPolicyRequest); + constructor(properties?: google.cloud.networksecurity.v1.ICreateSecurityProfileRequest); - /** CreateServerTlsPolicyRequest parent. */ + /** CreateSecurityProfileRequest parent. */ public parent: string; - /** CreateServerTlsPolicyRequest serverTlsPolicyId. */ - public serverTlsPolicyId: string; + /** CreateSecurityProfileRequest securityProfileId. */ + public securityProfileId: string; - /** CreateServerTlsPolicyRequest serverTlsPolicy. */ - public serverTlsPolicy?: (google.cloud.networksecurity.v1.IServerTlsPolicy|null); + /** CreateSecurityProfileRequest securityProfile. */ + public securityProfile?: (google.cloud.networksecurity.v1.ISecurityProfile|null); /** - * Creates a new CreateServerTlsPolicyRequest instance using the specified properties. + * Creates a new CreateSecurityProfileRequest instance using the specified properties. * @param [properties] Properties to set - * @returns CreateServerTlsPolicyRequest instance + * @returns CreateSecurityProfileRequest instance */ - public static create(properties?: google.cloud.networksecurity.v1.ICreateServerTlsPolicyRequest): google.cloud.networksecurity.v1.CreateServerTlsPolicyRequest; + public static create(properties?: google.cloud.networksecurity.v1.ICreateSecurityProfileRequest): google.cloud.networksecurity.v1.CreateSecurityProfileRequest; /** - * Encodes the specified CreateServerTlsPolicyRequest message. Does not implicitly {@link google.cloud.networksecurity.v1.CreateServerTlsPolicyRequest.verify|verify} messages. - * @param message CreateServerTlsPolicyRequest message or plain object to encode + * Encodes the specified CreateSecurityProfileRequest message. Does not implicitly {@link google.cloud.networksecurity.v1.CreateSecurityProfileRequest.verify|verify} messages. + * @param message CreateSecurityProfileRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.networksecurity.v1.ICreateServerTlsPolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.networksecurity.v1.ICreateSecurityProfileRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified CreateServerTlsPolicyRequest message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.CreateServerTlsPolicyRequest.verify|verify} messages. - * @param message CreateServerTlsPolicyRequest message or plain object to encode + * Encodes the specified CreateSecurityProfileRequest message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.CreateSecurityProfileRequest.verify|verify} messages. + * @param message CreateSecurityProfileRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.networksecurity.v1.ICreateServerTlsPolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.networksecurity.v1.ICreateSecurityProfileRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a CreateServerTlsPolicyRequest message from the specified reader or buffer. + * Decodes a CreateSecurityProfileRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns CreateServerTlsPolicyRequest + * @returns CreateSecurityProfileRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.networksecurity.v1.CreateServerTlsPolicyRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.networksecurity.v1.CreateSecurityProfileRequest; /** - * Decodes a CreateServerTlsPolicyRequest message from the specified reader or buffer, length delimited. + * Decodes a CreateSecurityProfileRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns CreateServerTlsPolicyRequest + * @returns CreateSecurityProfileRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.networksecurity.v1.CreateServerTlsPolicyRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.networksecurity.v1.CreateSecurityProfileRequest; /** - * Verifies a CreateServerTlsPolicyRequest message. + * Verifies a CreateSecurityProfileRequest message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a CreateServerTlsPolicyRequest message from a plain object. Also converts values to their respective internal types. + * Creates a CreateSecurityProfileRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns CreateServerTlsPolicyRequest + * @returns CreateSecurityProfileRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.networksecurity.v1.CreateServerTlsPolicyRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.networksecurity.v1.CreateSecurityProfileRequest; /** - * Creates a plain object from a CreateServerTlsPolicyRequest message. Also converts values to other types if specified. - * @param message CreateServerTlsPolicyRequest + * Creates a plain object from a CreateSecurityProfileRequest message. Also converts values to other types if specified. + * @param message CreateSecurityProfileRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.networksecurity.v1.CreateServerTlsPolicyRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.networksecurity.v1.CreateSecurityProfileRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this CreateServerTlsPolicyRequest to JSON. + * Converts this CreateSecurityProfileRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for CreateServerTlsPolicyRequest + * Gets the default type url for CreateSecurityProfileRequest * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of an UpdateServerTlsPolicyRequest. */ - interface IUpdateServerTlsPolicyRequest { + /** Properties of an UpdateSecurityProfileRequest. */ + interface IUpdateSecurityProfileRequest { - /** UpdateServerTlsPolicyRequest updateMask */ + /** UpdateSecurityProfileRequest updateMask */ updateMask?: (google.protobuf.IFieldMask|null); - /** UpdateServerTlsPolicyRequest serverTlsPolicy */ - serverTlsPolicy?: (google.cloud.networksecurity.v1.IServerTlsPolicy|null); + /** UpdateSecurityProfileRequest securityProfile */ + securityProfile?: (google.cloud.networksecurity.v1.ISecurityProfile|null); } - /** Represents an UpdateServerTlsPolicyRequest. */ - class UpdateServerTlsPolicyRequest implements IUpdateServerTlsPolicyRequest { + /** Represents an UpdateSecurityProfileRequest. */ + class UpdateSecurityProfileRequest implements IUpdateSecurityProfileRequest { /** - * Constructs a new UpdateServerTlsPolicyRequest. + * Constructs a new UpdateSecurityProfileRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.networksecurity.v1.IUpdateServerTlsPolicyRequest); + constructor(properties?: google.cloud.networksecurity.v1.IUpdateSecurityProfileRequest); - /** UpdateServerTlsPolicyRequest updateMask. */ + /** UpdateSecurityProfileRequest updateMask. */ public updateMask?: (google.protobuf.IFieldMask|null); - /** UpdateServerTlsPolicyRequest serverTlsPolicy. */ - public serverTlsPolicy?: (google.cloud.networksecurity.v1.IServerTlsPolicy|null); + /** UpdateSecurityProfileRequest securityProfile. */ + public securityProfile?: (google.cloud.networksecurity.v1.ISecurityProfile|null); /** - * Creates a new UpdateServerTlsPolicyRequest instance using the specified properties. + * Creates a new UpdateSecurityProfileRequest instance using the specified properties. * @param [properties] Properties to set - * @returns UpdateServerTlsPolicyRequest instance + * @returns UpdateSecurityProfileRequest instance */ - public static create(properties?: google.cloud.networksecurity.v1.IUpdateServerTlsPolicyRequest): google.cloud.networksecurity.v1.UpdateServerTlsPolicyRequest; + public static create(properties?: google.cloud.networksecurity.v1.IUpdateSecurityProfileRequest): google.cloud.networksecurity.v1.UpdateSecurityProfileRequest; /** - * Encodes the specified UpdateServerTlsPolicyRequest message. Does not implicitly {@link google.cloud.networksecurity.v1.UpdateServerTlsPolicyRequest.verify|verify} messages. - * @param message UpdateServerTlsPolicyRequest message or plain object to encode + * Encodes the specified UpdateSecurityProfileRequest message. Does not implicitly {@link google.cloud.networksecurity.v1.UpdateSecurityProfileRequest.verify|verify} messages. + * @param message UpdateSecurityProfileRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.networksecurity.v1.IUpdateServerTlsPolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.networksecurity.v1.IUpdateSecurityProfileRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified UpdateServerTlsPolicyRequest message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.UpdateServerTlsPolicyRequest.verify|verify} messages. - * @param message UpdateServerTlsPolicyRequest message or plain object to encode + * Encodes the specified UpdateSecurityProfileRequest message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.UpdateSecurityProfileRequest.verify|verify} messages. + * @param message UpdateSecurityProfileRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.networksecurity.v1.IUpdateServerTlsPolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.networksecurity.v1.IUpdateSecurityProfileRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an UpdateServerTlsPolicyRequest message from the specified reader or buffer. + * Decodes an UpdateSecurityProfileRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns UpdateServerTlsPolicyRequest + * @returns UpdateSecurityProfileRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.networksecurity.v1.UpdateServerTlsPolicyRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.networksecurity.v1.UpdateSecurityProfileRequest; /** - * Decodes an UpdateServerTlsPolicyRequest message from the specified reader or buffer, length delimited. + * Decodes an UpdateSecurityProfileRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns UpdateServerTlsPolicyRequest + * @returns UpdateSecurityProfileRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.networksecurity.v1.UpdateServerTlsPolicyRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.networksecurity.v1.UpdateSecurityProfileRequest; /** - * Verifies an UpdateServerTlsPolicyRequest message. + * Verifies an UpdateSecurityProfileRequest message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates an UpdateServerTlsPolicyRequest message from a plain object. Also converts values to their respective internal types. + * Creates an UpdateSecurityProfileRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns UpdateServerTlsPolicyRequest + * @returns UpdateSecurityProfileRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.networksecurity.v1.UpdateServerTlsPolicyRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.networksecurity.v1.UpdateSecurityProfileRequest; /** - * Creates a plain object from an UpdateServerTlsPolicyRequest message. Also converts values to other types if specified. - * @param message UpdateServerTlsPolicyRequest + * Creates a plain object from an UpdateSecurityProfileRequest message. Also converts values to other types if specified. + * @param message UpdateSecurityProfileRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.networksecurity.v1.UpdateServerTlsPolicyRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.networksecurity.v1.UpdateSecurityProfileRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this UpdateServerTlsPolicyRequest to JSON. + * Converts this UpdateSecurityProfileRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for UpdateServerTlsPolicyRequest + * Gets the default type url for UpdateSecurityProfileRequest * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a DeleteServerTlsPolicyRequest. */ - interface IDeleteServerTlsPolicyRequest { + /** Properties of a DeleteSecurityProfileRequest. */ + interface IDeleteSecurityProfileRequest { - /** DeleteServerTlsPolicyRequest name */ + /** DeleteSecurityProfileRequest name */ name?: (string|null); + + /** DeleteSecurityProfileRequest etag */ + etag?: (string|null); } - /** Represents a DeleteServerTlsPolicyRequest. */ - class DeleteServerTlsPolicyRequest implements IDeleteServerTlsPolicyRequest { + /** Represents a DeleteSecurityProfileRequest. */ + class DeleteSecurityProfileRequest implements IDeleteSecurityProfileRequest { /** - * Constructs a new DeleteServerTlsPolicyRequest. + * Constructs a new DeleteSecurityProfileRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.networksecurity.v1.IDeleteServerTlsPolicyRequest); + constructor(properties?: google.cloud.networksecurity.v1.IDeleteSecurityProfileRequest); - /** DeleteServerTlsPolicyRequest name. */ + /** DeleteSecurityProfileRequest name. */ public name: string; + /** DeleteSecurityProfileRequest etag. */ + public etag: string; + /** - * Creates a new DeleteServerTlsPolicyRequest instance using the specified properties. + * Creates a new DeleteSecurityProfileRequest instance using the specified properties. * @param [properties] Properties to set - * @returns DeleteServerTlsPolicyRequest instance + * @returns DeleteSecurityProfileRequest instance */ - public static create(properties?: google.cloud.networksecurity.v1.IDeleteServerTlsPolicyRequest): google.cloud.networksecurity.v1.DeleteServerTlsPolicyRequest; + public static create(properties?: google.cloud.networksecurity.v1.IDeleteSecurityProfileRequest): google.cloud.networksecurity.v1.DeleteSecurityProfileRequest; /** - * Encodes the specified DeleteServerTlsPolicyRequest message. Does not implicitly {@link google.cloud.networksecurity.v1.DeleteServerTlsPolicyRequest.verify|verify} messages. - * @param message DeleteServerTlsPolicyRequest message or plain object to encode + * Encodes the specified DeleteSecurityProfileRequest message. Does not implicitly {@link google.cloud.networksecurity.v1.DeleteSecurityProfileRequest.verify|verify} messages. + * @param message DeleteSecurityProfileRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.networksecurity.v1.IDeleteServerTlsPolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.networksecurity.v1.IDeleteSecurityProfileRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified DeleteServerTlsPolicyRequest message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.DeleteServerTlsPolicyRequest.verify|verify} messages. - * @param message DeleteServerTlsPolicyRequest message or plain object to encode + * Encodes the specified DeleteSecurityProfileRequest message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.DeleteSecurityProfileRequest.verify|verify} messages. + * @param message DeleteSecurityProfileRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.networksecurity.v1.IDeleteServerTlsPolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.networksecurity.v1.IDeleteSecurityProfileRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a DeleteServerTlsPolicyRequest message from the specified reader or buffer. + * Decodes a DeleteSecurityProfileRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns DeleteServerTlsPolicyRequest + * @returns DeleteSecurityProfileRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.networksecurity.v1.DeleteServerTlsPolicyRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.networksecurity.v1.DeleteSecurityProfileRequest; /** - * Decodes a DeleteServerTlsPolicyRequest message from the specified reader or buffer, length delimited. + * Decodes a DeleteSecurityProfileRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns DeleteServerTlsPolicyRequest + * @returns DeleteSecurityProfileRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.networksecurity.v1.DeleteServerTlsPolicyRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.networksecurity.v1.DeleteSecurityProfileRequest; /** - * Verifies a DeleteServerTlsPolicyRequest message. + * Verifies a DeleteSecurityProfileRequest message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a DeleteServerTlsPolicyRequest message from a plain object. Also converts values to their respective internal types. + * Creates a DeleteSecurityProfileRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns DeleteServerTlsPolicyRequest + * @returns DeleteSecurityProfileRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.networksecurity.v1.DeleteServerTlsPolicyRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.networksecurity.v1.DeleteSecurityProfileRequest; /** - * Creates a plain object from a DeleteServerTlsPolicyRequest message. Also converts values to other types if specified. - * @param message DeleteServerTlsPolicyRequest + * Creates a plain object from a DeleteSecurityProfileRequest message. Also converts values to other types if specified. + * @param message DeleteSecurityProfileRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.networksecurity.v1.DeleteServerTlsPolicyRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.networksecurity.v1.DeleteSecurityProfileRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this DeleteServerTlsPolicyRequest to JSON. + * Converts this DeleteSecurityProfileRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for DeleteServerTlsPolicyRequest + * Gets the default type url for DeleteSecurityProfileRequest * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ @@ -41722,6 +63346,115 @@ export namespace google { IDENTIFIER = 8 } + /** Properties of a FieldInfo. */ + interface IFieldInfo { + + /** FieldInfo format */ + format?: (google.api.FieldInfo.Format|keyof typeof google.api.FieldInfo.Format|null); + } + + /** Represents a FieldInfo. */ + class FieldInfo implements IFieldInfo { + + /** + * Constructs a new FieldInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IFieldInfo); + + /** FieldInfo format. */ + public format: (google.api.FieldInfo.Format|keyof typeof google.api.FieldInfo.Format); + + /** + * Creates a new FieldInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns FieldInfo instance + */ + public static create(properties?: google.api.IFieldInfo): google.api.FieldInfo; + + /** + * Encodes the specified FieldInfo message. Does not implicitly {@link google.api.FieldInfo.verify|verify} messages. + * @param message FieldInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IFieldInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FieldInfo message, length delimited. Does not implicitly {@link google.api.FieldInfo.verify|verify} messages. + * @param message FieldInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IFieldInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FieldInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FieldInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.FieldInfo; + + /** + * Decodes a FieldInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FieldInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.FieldInfo; + + /** + * Verifies a FieldInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FieldInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FieldInfo + */ + public static fromObject(object: { [k: string]: any }): google.api.FieldInfo; + + /** + * Creates a plain object from a FieldInfo message. Also converts values to other types if specified. + * @param message FieldInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.FieldInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FieldInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FieldInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace FieldInfo { + + /** Format enum. */ + enum Format { + FORMAT_UNSPECIFIED = 0, + UUID4 = 1, + IPV4 = 2, + IPV6 = 3, + IPV4_OR_IPV6 = 4 + } + } + /** Properties of a ResourceDescriptor. */ interface IResourceDescriptor { @@ -41973,115 +63706,6 @@ export namespace google { */ public static getTypeUrl(typeUrlPrefix?: string): string; } - - /** Properties of a FieldInfo. */ - interface IFieldInfo { - - /** FieldInfo format */ - format?: (google.api.FieldInfo.Format|keyof typeof google.api.FieldInfo.Format|null); - } - - /** Represents a FieldInfo. */ - class FieldInfo implements IFieldInfo { - - /** - * Constructs a new FieldInfo. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.IFieldInfo); - - /** FieldInfo format. */ - public format: (google.api.FieldInfo.Format|keyof typeof google.api.FieldInfo.Format); - - /** - * Creates a new FieldInfo instance using the specified properties. - * @param [properties] Properties to set - * @returns FieldInfo instance - */ - public static create(properties?: google.api.IFieldInfo): google.api.FieldInfo; - - /** - * Encodes the specified FieldInfo message. Does not implicitly {@link google.api.FieldInfo.verify|verify} messages. - * @param message FieldInfo message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.api.IFieldInfo, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified FieldInfo message, length delimited. Does not implicitly {@link google.api.FieldInfo.verify|verify} messages. - * @param message FieldInfo message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.api.IFieldInfo, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a FieldInfo message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns FieldInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.FieldInfo; - - /** - * Decodes a FieldInfo message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns FieldInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.FieldInfo; - - /** - * Verifies a FieldInfo message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a FieldInfo message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns FieldInfo - */ - public static fromObject(object: { [k: string]: any }): google.api.FieldInfo; - - /** - * Creates a plain object from a FieldInfo message. Also converts values to other types if specified. - * @param message FieldInfo - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.FieldInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this FieldInfo to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for FieldInfo - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace FieldInfo { - - /** Format enum. */ - enum Format { - FORMAT_UNSPECIFIED = 0, - UUID4 = 1, - IPV4 = 2, - IPV6 = 3, - IPV4_OR_IPV6 = 4 - } - } } /** Namespace protobuf. */ @@ -44254,11 +65878,11 @@ export namespace google { /** FieldOptions .google.api.fieldBehavior */ ".google.api.fieldBehavior"?: (google.api.FieldBehavior[]|null); - /** FieldOptions .google.api.resourceReference */ - ".google.api.resourceReference"?: (google.api.IResourceReference|null); - /** FieldOptions .google.api.fieldInfo */ ".google.api.fieldInfo"?: (google.api.IFieldInfo|null); + + /** FieldOptions .google.api.resourceReference */ + ".google.api.resourceReference"?: (google.api.IResourceReference|null); } /** Represents a FieldOptions. */ @@ -46301,6 +67925,109 @@ export namespace google { public static getTypeUrl(typeUrlPrefix?: string): string; } + /** Properties of a Timestamp. */ + interface ITimestamp { + + /** Timestamp seconds */ + seconds?: (number|Long|string|null); + + /** Timestamp nanos */ + nanos?: (number|null); + } + + /** Represents a Timestamp. */ + class Timestamp implements ITimestamp { + + /** + * Constructs a new Timestamp. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.ITimestamp); + + /** Timestamp seconds. */ + public seconds: (number|Long|string); + + /** Timestamp nanos. */ + public nanos: number; + + /** + * Creates a new Timestamp instance using the specified properties. + * @param [properties] Properties to set + * @returns Timestamp instance + */ + public static create(properties?: google.protobuf.ITimestamp): google.protobuf.Timestamp; + + /** + * Encodes the specified Timestamp message. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. + * @param message Timestamp message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.ITimestamp, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Timestamp message, length delimited. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. + * @param message Timestamp message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.ITimestamp, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Timestamp message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Timestamp; + + /** + * Decodes a Timestamp message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Timestamp; + + /** + * Verifies a Timestamp message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Timestamp message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Timestamp + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Timestamp; + + /** + * Creates a plain object from a Timestamp message. Also converts values to other types if specified. + * @param message Timestamp + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Timestamp, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Timestamp to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Timestamp + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + /** Properties of an Any. */ interface IAny { @@ -46591,109 +68318,6 @@ export namespace google { */ public static getTypeUrl(typeUrlPrefix?: string): string; } - - /** Properties of a Timestamp. */ - interface ITimestamp { - - /** Timestamp seconds */ - seconds?: (number|Long|string|null); - - /** Timestamp nanos */ - nanos?: (number|null); - } - - /** Represents a Timestamp. */ - class Timestamp implements ITimestamp { - - /** - * Constructs a new Timestamp. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.ITimestamp); - - /** Timestamp seconds. */ - public seconds: (number|Long|string); - - /** Timestamp nanos. */ - public nanos: number; - - /** - * Creates a new Timestamp instance using the specified properties. - * @param [properties] Properties to set - * @returns Timestamp instance - */ - public static create(properties?: google.protobuf.ITimestamp): google.protobuf.Timestamp; - - /** - * Encodes the specified Timestamp message. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. - * @param message Timestamp message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.ITimestamp, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Timestamp message, length delimited. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. - * @param message Timestamp message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.ITimestamp, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Timestamp message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Timestamp - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Timestamp; - - /** - * Decodes a Timestamp message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Timestamp - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Timestamp; - - /** - * Verifies a Timestamp message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Timestamp message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Timestamp - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.Timestamp; - - /** - * Creates a plain object from a Timestamp message. Also converts values to other types if specified. - * @param message Timestamp - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.Timestamp, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Timestamp to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Timestamp - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } } /** Namespace longrunning. */ diff --git a/packages/google-cloud-networksecurity/protos/protos.js b/packages/google-cloud-networksecurity/protos/protos.js index 62aef76b9c5..a626cc06076 100644 --- a/packages/google-cloud-networksecurity/protos/protos.js +++ b/packages/google-cloud-networksecurity/protos/protos.js @@ -4396,6 +4396,360 @@ return ListAddressGroupReferencesResponse; })(); + v1.OperationMetadata = (function() { + + /** + * Properties of an OperationMetadata. + * @memberof google.cloud.networksecurity.v1 + * @interface IOperationMetadata + * @property {google.protobuf.ITimestamp|null} [createTime] OperationMetadata createTime + * @property {google.protobuf.ITimestamp|null} [endTime] OperationMetadata endTime + * @property {string|null} [target] OperationMetadata target + * @property {string|null} [verb] OperationMetadata verb + * @property {string|null} [statusMessage] OperationMetadata statusMessage + * @property {boolean|null} [requestedCancellation] OperationMetadata requestedCancellation + * @property {string|null} [apiVersion] OperationMetadata apiVersion + */ + + /** + * Constructs a new OperationMetadata. + * @memberof google.cloud.networksecurity.v1 + * @classdesc Represents an OperationMetadata. + * @implements IOperationMetadata + * @constructor + * @param {google.cloud.networksecurity.v1.IOperationMetadata=} [properties] Properties to set + */ + function OperationMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * OperationMetadata createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.networksecurity.v1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.createTime = null; + + /** + * OperationMetadata endTime. + * @member {google.protobuf.ITimestamp|null|undefined} endTime + * @memberof google.cloud.networksecurity.v1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.endTime = null; + + /** + * OperationMetadata target. + * @member {string} target + * @memberof google.cloud.networksecurity.v1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.target = ""; + + /** + * OperationMetadata verb. + * @member {string} verb + * @memberof google.cloud.networksecurity.v1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.verb = ""; + + /** + * OperationMetadata statusMessage. + * @member {string} statusMessage + * @memberof google.cloud.networksecurity.v1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.statusMessage = ""; + + /** + * OperationMetadata requestedCancellation. + * @member {boolean} requestedCancellation + * @memberof google.cloud.networksecurity.v1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.requestedCancellation = false; + + /** + * OperationMetadata apiVersion. + * @member {string} apiVersion + * @memberof google.cloud.networksecurity.v1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.apiVersion = ""; + + /** + * Creates a new OperationMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.networksecurity.v1.OperationMetadata + * @static + * @param {google.cloud.networksecurity.v1.IOperationMetadata=} [properties] Properties to set + * @returns {google.cloud.networksecurity.v1.OperationMetadata} OperationMetadata instance + */ + OperationMetadata.create = function create(properties) { + return new OperationMetadata(properties); + }; + + /** + * Encodes the specified OperationMetadata message. Does not implicitly {@link google.cloud.networksecurity.v1.OperationMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.networksecurity.v1.OperationMetadata + * @static + * @param {google.cloud.networksecurity.v1.IOperationMetadata} message OperationMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OperationMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.endTime != null && Object.hasOwnProperty.call(message, "endTime")) + $root.google.protobuf.Timestamp.encode(message.endTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.target != null && Object.hasOwnProperty.call(message, "target")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.target); + if (message.verb != null && Object.hasOwnProperty.call(message, "verb")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.verb); + if (message.statusMessage != null && Object.hasOwnProperty.call(message, "statusMessage")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.statusMessage); + if (message.requestedCancellation != null && Object.hasOwnProperty.call(message, "requestedCancellation")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.requestedCancellation); + if (message.apiVersion != null && Object.hasOwnProperty.call(message, "apiVersion")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.apiVersion); + return writer; + }; + + /** + * Encodes the specified OperationMetadata message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.OperationMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.networksecurity.v1.OperationMetadata + * @static + * @param {google.cloud.networksecurity.v1.IOperationMetadata} message OperationMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OperationMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OperationMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.networksecurity.v1.OperationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.networksecurity.v1.OperationMetadata} OperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OperationMetadata.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networksecurity.v1.OperationMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 2: { + message.endTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 3: { + message.target = reader.string(); + break; + } + case 4: { + message.verb = reader.string(); + break; + } + case 5: { + message.statusMessage = reader.string(); + break; + } + case 6: { + message.requestedCancellation = reader.bool(); + break; + } + case 7: { + message.apiVersion = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an OperationMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.networksecurity.v1.OperationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.networksecurity.v1.OperationMetadata} OperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OperationMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OperationMetadata message. + * @function verify + * @memberof google.cloud.networksecurity.v1.OperationMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OperationMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + if (message.endTime != null && message.hasOwnProperty("endTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.endTime); + if (error) + return "endTime." + error; + } + if (message.target != null && message.hasOwnProperty("target")) + if (!$util.isString(message.target)) + return "target: string expected"; + if (message.verb != null && message.hasOwnProperty("verb")) + if (!$util.isString(message.verb)) + return "verb: string expected"; + if (message.statusMessage != null && message.hasOwnProperty("statusMessage")) + if (!$util.isString(message.statusMessage)) + return "statusMessage: string expected"; + if (message.requestedCancellation != null && message.hasOwnProperty("requestedCancellation")) + if (typeof message.requestedCancellation !== "boolean") + return "requestedCancellation: boolean expected"; + if (message.apiVersion != null && message.hasOwnProperty("apiVersion")) + if (!$util.isString(message.apiVersion)) + return "apiVersion: string expected"; + return null; + }; + + /** + * Creates an OperationMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.networksecurity.v1.OperationMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.networksecurity.v1.OperationMetadata} OperationMetadata + */ + OperationMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networksecurity.v1.OperationMetadata) + return object; + var message = new $root.google.cloud.networksecurity.v1.OperationMetadata(); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.networksecurity.v1.OperationMetadata.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.endTime != null) { + if (typeof object.endTime !== "object") + throw TypeError(".google.cloud.networksecurity.v1.OperationMetadata.endTime: object expected"); + message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime); + } + if (object.target != null) + message.target = String(object.target); + if (object.verb != null) + message.verb = String(object.verb); + if (object.statusMessage != null) + message.statusMessage = String(object.statusMessage); + if (object.requestedCancellation != null) + message.requestedCancellation = Boolean(object.requestedCancellation); + if (object.apiVersion != null) + message.apiVersion = String(object.apiVersion); + return message; + }; + + /** + * Creates a plain object from an OperationMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.networksecurity.v1.OperationMetadata + * @static + * @param {google.cloud.networksecurity.v1.OperationMetadata} message OperationMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OperationMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.createTime = null; + object.endTime = null; + object.target = ""; + object.verb = ""; + object.statusMessage = ""; + object.requestedCancellation = false; + object.apiVersion = ""; + } + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.endTime != null && message.hasOwnProperty("endTime")) + object.endTime = $root.google.protobuf.Timestamp.toObject(message.endTime, options); + if (message.target != null && message.hasOwnProperty("target")) + object.target = message.target; + if (message.verb != null && message.hasOwnProperty("verb")) + object.verb = message.verb; + if (message.statusMessage != null && message.hasOwnProperty("statusMessage")) + object.statusMessage = message.statusMessage; + if (message.requestedCancellation != null && message.hasOwnProperty("requestedCancellation")) + object.requestedCancellation = message.requestedCancellation; + if (message.apiVersion != null && message.hasOwnProperty("apiVersion")) + object.apiVersion = message.apiVersion; + return object; + }; + + /** + * Converts this OperationMetadata to JSON. + * @function toJSON + * @memberof google.cloud.networksecurity.v1.OperationMetadata + * @instance + * @returns {Object.} JSON object + */ + OperationMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for OperationMetadata + * @function getTypeUrl + * @memberof google.cloud.networksecurity.v1.OperationMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OperationMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.networksecurity.v1.OperationMetadata"; + }; + + return OperationMetadata; + })(); + v1.AuthorizationPolicy = (function() { /** @@ -7372,33 +7726,35 @@ return DeleteAuthorizationPolicyRequest; })(); - v1.ClientTlsPolicy = (function() { + v1.AuthzPolicy = (function() { /** - * Properties of a ClientTlsPolicy. + * Properties of an AuthzPolicy. * @memberof google.cloud.networksecurity.v1 - * @interface IClientTlsPolicy - * @property {string|null} [name] ClientTlsPolicy name - * @property {string|null} [description] ClientTlsPolicy description - * @property {google.protobuf.ITimestamp|null} [createTime] ClientTlsPolicy createTime - * @property {google.protobuf.ITimestamp|null} [updateTime] ClientTlsPolicy updateTime - * @property {Object.|null} [labels] ClientTlsPolicy labels - * @property {string|null} [sni] ClientTlsPolicy sni - * @property {google.cloud.networksecurity.v1.ICertificateProvider|null} [clientCertificate] ClientTlsPolicy clientCertificate - * @property {Array.|null} [serverValidationCa] ClientTlsPolicy serverValidationCa + * @interface IAuthzPolicy + * @property {string|null} [name] AuthzPolicy name + * @property {google.protobuf.ITimestamp|null} [createTime] AuthzPolicy createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] AuthzPolicy updateTime + * @property {string|null} [description] AuthzPolicy description + * @property {Object.|null} [labels] AuthzPolicy labels + * @property {google.cloud.networksecurity.v1.AuthzPolicy.ITarget|null} [target] AuthzPolicy target + * @property {Array.|null} [httpRules] AuthzPolicy httpRules + * @property {google.cloud.networksecurity.v1.AuthzPolicy.AuthzAction|null} [action] AuthzPolicy action + * @property {google.cloud.networksecurity.v1.AuthzPolicy.ICustomProvider|null} [customProvider] AuthzPolicy customProvider + * @property {google.cloud.networksecurity.v1.AuthzPolicy.PolicyProfile|null} [policyProfile] AuthzPolicy policyProfile */ /** - * Constructs a new ClientTlsPolicy. + * Constructs a new AuthzPolicy. * @memberof google.cloud.networksecurity.v1 - * @classdesc Represents a ClientTlsPolicy. - * @implements IClientTlsPolicy + * @classdesc Represents an AuthzPolicy. + * @implements IAuthzPolicy * @constructor - * @param {google.cloud.networksecurity.v1.IClientTlsPolicy=} [properties] Properties to set + * @param {google.cloud.networksecurity.v1.IAuthzPolicy=} [properties] Properties to set */ - function ClientTlsPolicy(properties) { + function AuthzPolicy(properties) { this.labels = {}; - this.serverValidationCa = []; + this.httpRules = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -7406,142 +7762,162 @@ } /** - * ClientTlsPolicy name. + * AuthzPolicy name. * @member {string} name - * @memberof google.cloud.networksecurity.v1.ClientTlsPolicy + * @memberof google.cloud.networksecurity.v1.AuthzPolicy * @instance */ - ClientTlsPolicy.prototype.name = ""; + AuthzPolicy.prototype.name = ""; /** - * ClientTlsPolicy description. - * @member {string} description - * @memberof google.cloud.networksecurity.v1.ClientTlsPolicy + * AuthzPolicy createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.networksecurity.v1.AuthzPolicy * @instance */ - ClientTlsPolicy.prototype.description = ""; + AuthzPolicy.prototype.createTime = null; /** - * ClientTlsPolicy createTime. - * @member {google.protobuf.ITimestamp|null|undefined} createTime - * @memberof google.cloud.networksecurity.v1.ClientTlsPolicy + * AuthzPolicy updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.networksecurity.v1.AuthzPolicy * @instance */ - ClientTlsPolicy.prototype.createTime = null; + AuthzPolicy.prototype.updateTime = null; /** - * ClientTlsPolicy updateTime. - * @member {google.protobuf.ITimestamp|null|undefined} updateTime - * @memberof google.cloud.networksecurity.v1.ClientTlsPolicy + * AuthzPolicy description. + * @member {string} description + * @memberof google.cloud.networksecurity.v1.AuthzPolicy * @instance */ - ClientTlsPolicy.prototype.updateTime = null; + AuthzPolicy.prototype.description = ""; /** - * ClientTlsPolicy labels. + * AuthzPolicy labels. * @member {Object.} labels - * @memberof google.cloud.networksecurity.v1.ClientTlsPolicy + * @memberof google.cloud.networksecurity.v1.AuthzPolicy * @instance */ - ClientTlsPolicy.prototype.labels = $util.emptyObject; + AuthzPolicy.prototype.labels = $util.emptyObject; /** - * ClientTlsPolicy sni. - * @member {string} sni - * @memberof google.cloud.networksecurity.v1.ClientTlsPolicy + * AuthzPolicy target. + * @member {google.cloud.networksecurity.v1.AuthzPolicy.ITarget|null|undefined} target + * @memberof google.cloud.networksecurity.v1.AuthzPolicy * @instance */ - ClientTlsPolicy.prototype.sni = ""; + AuthzPolicy.prototype.target = null; /** - * ClientTlsPolicy clientCertificate. - * @member {google.cloud.networksecurity.v1.ICertificateProvider|null|undefined} clientCertificate - * @memberof google.cloud.networksecurity.v1.ClientTlsPolicy + * AuthzPolicy httpRules. + * @member {Array.} httpRules + * @memberof google.cloud.networksecurity.v1.AuthzPolicy * @instance */ - ClientTlsPolicy.prototype.clientCertificate = null; + AuthzPolicy.prototype.httpRules = $util.emptyArray; /** - * ClientTlsPolicy serverValidationCa. - * @member {Array.} serverValidationCa - * @memberof google.cloud.networksecurity.v1.ClientTlsPolicy + * AuthzPolicy action. + * @member {google.cloud.networksecurity.v1.AuthzPolicy.AuthzAction} action + * @memberof google.cloud.networksecurity.v1.AuthzPolicy * @instance */ - ClientTlsPolicy.prototype.serverValidationCa = $util.emptyArray; + AuthzPolicy.prototype.action = 0; /** - * Creates a new ClientTlsPolicy instance using the specified properties. + * AuthzPolicy customProvider. + * @member {google.cloud.networksecurity.v1.AuthzPolicy.ICustomProvider|null|undefined} customProvider + * @memberof google.cloud.networksecurity.v1.AuthzPolicy + * @instance + */ + AuthzPolicy.prototype.customProvider = null; + + /** + * AuthzPolicy policyProfile. + * @member {google.cloud.networksecurity.v1.AuthzPolicy.PolicyProfile} policyProfile + * @memberof google.cloud.networksecurity.v1.AuthzPolicy + * @instance + */ + AuthzPolicy.prototype.policyProfile = 0; + + /** + * Creates a new AuthzPolicy instance using the specified properties. * @function create - * @memberof google.cloud.networksecurity.v1.ClientTlsPolicy + * @memberof google.cloud.networksecurity.v1.AuthzPolicy * @static - * @param {google.cloud.networksecurity.v1.IClientTlsPolicy=} [properties] Properties to set - * @returns {google.cloud.networksecurity.v1.ClientTlsPolicy} ClientTlsPolicy instance + * @param {google.cloud.networksecurity.v1.IAuthzPolicy=} [properties] Properties to set + * @returns {google.cloud.networksecurity.v1.AuthzPolicy} AuthzPolicy instance */ - ClientTlsPolicy.create = function create(properties) { - return new ClientTlsPolicy(properties); + AuthzPolicy.create = function create(properties) { + return new AuthzPolicy(properties); }; /** - * Encodes the specified ClientTlsPolicy message. Does not implicitly {@link google.cloud.networksecurity.v1.ClientTlsPolicy.verify|verify} messages. + * Encodes the specified AuthzPolicy message. Does not implicitly {@link google.cloud.networksecurity.v1.AuthzPolicy.verify|verify} messages. * @function encode - * @memberof google.cloud.networksecurity.v1.ClientTlsPolicy + * @memberof google.cloud.networksecurity.v1.AuthzPolicy * @static - * @param {google.cloud.networksecurity.v1.IClientTlsPolicy} message ClientTlsPolicy message or plain object to encode + * @param {google.cloud.networksecurity.v1.IAuthzPolicy} message AuthzPolicy message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ClientTlsPolicy.encode = function encode(message, writer) { + AuthzPolicy.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.description != null && Object.hasOwnProperty.call(message, "description")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.description); if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) - $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) - $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.description); if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) writer.uint32(/* id 5, wireType 2 =*/42).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); - if (message.sni != null && Object.hasOwnProperty.call(message, "sni")) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.sni); - if (message.clientCertificate != null && Object.hasOwnProperty.call(message, "clientCertificate")) - $root.google.cloud.networksecurity.v1.CertificateProvider.encode(message.clientCertificate, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - if (message.serverValidationCa != null && message.serverValidationCa.length) - for (var i = 0; i < message.serverValidationCa.length; ++i) - $root.google.cloud.networksecurity.v1.ValidationCA.encode(message.serverValidationCa[i], writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.target != null && Object.hasOwnProperty.call(message, "target")) + $root.google.cloud.networksecurity.v1.AuthzPolicy.Target.encode(message.target, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.httpRules != null && message.httpRules.length) + for (var i = 0; i < message.httpRules.length; ++i) + $root.google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.encode(message.httpRules[i], writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.action != null && Object.hasOwnProperty.call(message, "action")) + writer.uint32(/* id 8, wireType 0 =*/64).int32(message.action); + if (message.customProvider != null && Object.hasOwnProperty.call(message, "customProvider")) + $root.google.cloud.networksecurity.v1.AuthzPolicy.CustomProvider.encode(message.customProvider, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + if (message.policyProfile != null && Object.hasOwnProperty.call(message, "policyProfile")) + writer.uint32(/* id 11, wireType 0 =*/88).int32(message.policyProfile); return writer; }; /** - * Encodes the specified ClientTlsPolicy message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.ClientTlsPolicy.verify|verify} messages. + * Encodes the specified AuthzPolicy message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.AuthzPolicy.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.networksecurity.v1.ClientTlsPolicy + * @memberof google.cloud.networksecurity.v1.AuthzPolicy * @static - * @param {google.cloud.networksecurity.v1.IClientTlsPolicy} message ClientTlsPolicy message or plain object to encode + * @param {google.cloud.networksecurity.v1.IAuthzPolicy} message AuthzPolicy message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ClientTlsPolicy.encodeDelimited = function encodeDelimited(message, writer) { + AuthzPolicy.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ClientTlsPolicy message from the specified reader or buffer. + * Decodes an AuthzPolicy message from the specified reader or buffer. * @function decode - * @memberof google.cloud.networksecurity.v1.ClientTlsPolicy + * @memberof google.cloud.networksecurity.v1.AuthzPolicy * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.networksecurity.v1.ClientTlsPolicy} ClientTlsPolicy + * @returns {google.cloud.networksecurity.v1.AuthzPolicy} AuthzPolicy * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ClientTlsPolicy.decode = function decode(reader, length, error) { + AuthzPolicy.decode = function decode(reader, length, error) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networksecurity.v1.ClientTlsPolicy(), key, value; + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networksecurity.v1.AuthzPolicy(), key, value; while (reader.pos < end) { var tag = reader.uint32(); if (tag === error) @@ -7552,15 +7928,15 @@ break; } case 2: { - message.description = reader.string(); + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); break; } case 3: { - message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); break; } case 4: { - message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + message.description = reader.string(); break; } case 5: { @@ -7587,17 +7963,25 @@ break; } case 6: { - message.sni = reader.string(); + message.target = $root.google.cloud.networksecurity.v1.AuthzPolicy.Target.decode(reader, reader.uint32()); break; } case 7: { - message.clientCertificate = $root.google.cloud.networksecurity.v1.CertificateProvider.decode(reader, reader.uint32()); + if (!(message.httpRules && message.httpRules.length)) + message.httpRules = []; + message.httpRules.push($root.google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.decode(reader, reader.uint32())); break; } case 8: { - if (!(message.serverValidationCa && message.serverValidationCa.length)) - message.serverValidationCa = []; - message.serverValidationCa.push($root.google.cloud.networksecurity.v1.ValidationCA.decode(reader, reader.uint32())); + message.action = reader.int32(); + break; + } + case 10: { + message.customProvider = $root.google.cloud.networksecurity.v1.AuthzPolicy.CustomProvider.decode(reader, reader.uint32()); + break; + } + case 11: { + message.policyProfile = reader.int32(); break; } default: @@ -7609,38 +7993,35 @@ }; /** - * Decodes a ClientTlsPolicy message from the specified reader or buffer, length delimited. + * Decodes an AuthzPolicy message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.networksecurity.v1.ClientTlsPolicy + * @memberof google.cloud.networksecurity.v1.AuthzPolicy * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.networksecurity.v1.ClientTlsPolicy} ClientTlsPolicy + * @returns {google.cloud.networksecurity.v1.AuthzPolicy} AuthzPolicy * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ClientTlsPolicy.decodeDelimited = function decodeDelimited(reader) { + AuthzPolicy.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ClientTlsPolicy message. + * Verifies an AuthzPolicy message. * @function verify - * @memberof google.cloud.networksecurity.v1.ClientTlsPolicy + * @memberof google.cloud.networksecurity.v1.AuthzPolicy * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ClientTlsPolicy.verify = function verify(message) { + AuthzPolicy.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.name != null && message.hasOwnProperty("name")) if (!$util.isString(message.name)) return "name: string expected"; - if (message.description != null && message.hasOwnProperty("description")) - if (!$util.isString(message.description)) - return "description: string expected"; if (message.createTime != null && message.hasOwnProperty("createTime")) { var error = $root.google.protobuf.Timestamp.verify(message.createTime); if (error) @@ -7651,6 +8032,9 @@ if (error) return "updateTime." + error; } + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; if (message.labels != null && message.hasOwnProperty("labels")) { if (!$util.isObject(message.labels)) return "labels: object expected"; @@ -7659,679 +8043,53551 @@ if (!$util.isString(message.labels[key[i]])) return "labels: string{k:string} expected"; } - if (message.sni != null && message.hasOwnProperty("sni")) - if (!$util.isString(message.sni)) - return "sni: string expected"; - if (message.clientCertificate != null && message.hasOwnProperty("clientCertificate")) { - var error = $root.google.cloud.networksecurity.v1.CertificateProvider.verify(message.clientCertificate); + if (message.target != null && message.hasOwnProperty("target")) { + var error = $root.google.cloud.networksecurity.v1.AuthzPolicy.Target.verify(message.target); if (error) - return "clientCertificate." + error; + return "target." + error; } - if (message.serverValidationCa != null && message.hasOwnProperty("serverValidationCa")) { - if (!Array.isArray(message.serverValidationCa)) - return "serverValidationCa: array expected"; - for (var i = 0; i < message.serverValidationCa.length; ++i) { - var error = $root.google.cloud.networksecurity.v1.ValidationCA.verify(message.serverValidationCa[i]); + if (message.httpRules != null && message.hasOwnProperty("httpRules")) { + if (!Array.isArray(message.httpRules)) + return "httpRules: array expected"; + for (var i = 0; i < message.httpRules.length; ++i) { + var error = $root.google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.verify(message.httpRules[i]); if (error) - return "serverValidationCa." + error; + return "httpRules." + error; + } + } + if (message.action != null && message.hasOwnProperty("action")) + switch (message.action) { + default: + return "action: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; } + if (message.customProvider != null && message.hasOwnProperty("customProvider")) { + var error = $root.google.cloud.networksecurity.v1.AuthzPolicy.CustomProvider.verify(message.customProvider); + if (error) + return "customProvider." + error; } + if (message.policyProfile != null && message.hasOwnProperty("policyProfile")) + switch (message.policyProfile) { + default: + return "policyProfile: enum value expected"; + case 0: + case 1: + case 2: + break; + } return null; }; /** - * Creates a ClientTlsPolicy message from a plain object. Also converts values to their respective internal types. + * Creates an AuthzPolicy message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.networksecurity.v1.ClientTlsPolicy + * @memberof google.cloud.networksecurity.v1.AuthzPolicy * @static * @param {Object.} object Plain object - * @returns {google.cloud.networksecurity.v1.ClientTlsPolicy} ClientTlsPolicy + * @returns {google.cloud.networksecurity.v1.AuthzPolicy} AuthzPolicy */ - ClientTlsPolicy.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.networksecurity.v1.ClientTlsPolicy) + AuthzPolicy.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networksecurity.v1.AuthzPolicy) return object; - var message = new $root.google.cloud.networksecurity.v1.ClientTlsPolicy(); + var message = new $root.google.cloud.networksecurity.v1.AuthzPolicy(); if (object.name != null) message.name = String(object.name); - if (object.description != null) - message.description = String(object.description); if (object.createTime != null) { if (typeof object.createTime !== "object") - throw TypeError(".google.cloud.networksecurity.v1.ClientTlsPolicy.createTime: object expected"); + throw TypeError(".google.cloud.networksecurity.v1.AuthzPolicy.createTime: object expected"); message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); } if (object.updateTime != null) { if (typeof object.updateTime !== "object") - throw TypeError(".google.cloud.networksecurity.v1.ClientTlsPolicy.updateTime: object expected"); + throw TypeError(".google.cloud.networksecurity.v1.AuthzPolicy.updateTime: object expected"); message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); } + if (object.description != null) + message.description = String(object.description); if (object.labels) { if (typeof object.labels !== "object") - throw TypeError(".google.cloud.networksecurity.v1.ClientTlsPolicy.labels: object expected"); + throw TypeError(".google.cloud.networksecurity.v1.AuthzPolicy.labels: object expected"); message.labels = {}; for (var keys = Object.keys(object.labels), i = 0; i < keys.length; ++i) message.labels[keys[i]] = String(object.labels[keys[i]]); } - if (object.sni != null) - message.sni = String(object.sni); - if (object.clientCertificate != null) { - if (typeof object.clientCertificate !== "object") - throw TypeError(".google.cloud.networksecurity.v1.ClientTlsPolicy.clientCertificate: object expected"); - message.clientCertificate = $root.google.cloud.networksecurity.v1.CertificateProvider.fromObject(object.clientCertificate); + if (object.target != null) { + if (typeof object.target !== "object") + throw TypeError(".google.cloud.networksecurity.v1.AuthzPolicy.target: object expected"); + message.target = $root.google.cloud.networksecurity.v1.AuthzPolicy.Target.fromObject(object.target); } - if (object.serverValidationCa) { - if (!Array.isArray(object.serverValidationCa)) - throw TypeError(".google.cloud.networksecurity.v1.ClientTlsPolicy.serverValidationCa: array expected"); - message.serverValidationCa = []; - for (var i = 0; i < object.serverValidationCa.length; ++i) { - if (typeof object.serverValidationCa[i] !== "object") - throw TypeError(".google.cloud.networksecurity.v1.ClientTlsPolicy.serverValidationCa: object expected"); - message.serverValidationCa[i] = $root.google.cloud.networksecurity.v1.ValidationCA.fromObject(object.serverValidationCa[i]); + if (object.httpRules) { + if (!Array.isArray(object.httpRules)) + throw TypeError(".google.cloud.networksecurity.v1.AuthzPolicy.httpRules: array expected"); + message.httpRules = []; + for (var i = 0; i < object.httpRules.length; ++i) { + if (typeof object.httpRules[i] !== "object") + throw TypeError(".google.cloud.networksecurity.v1.AuthzPolicy.httpRules: object expected"); + message.httpRules[i] = $root.google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.fromObject(object.httpRules[i]); + } + } + switch (object.action) { + default: + if (typeof object.action === "number") { + message.action = object.action; + break; + } + break; + case "AUTHZ_ACTION_UNSPECIFIED": + case 0: + message.action = 0; + break; + case "ALLOW": + case 1: + message.action = 1; + break; + case "DENY": + case 2: + message.action = 2; + break; + case "CUSTOM": + case 3: + message.action = 3; + break; + } + if (object.customProvider != null) { + if (typeof object.customProvider !== "object") + throw TypeError(".google.cloud.networksecurity.v1.AuthzPolicy.customProvider: object expected"); + message.customProvider = $root.google.cloud.networksecurity.v1.AuthzPolicy.CustomProvider.fromObject(object.customProvider); + } + switch (object.policyProfile) { + default: + if (typeof object.policyProfile === "number") { + message.policyProfile = object.policyProfile; + break; } + break; + case "POLICY_PROFILE_UNSPECIFIED": + case 0: + message.policyProfile = 0; + break; + case "REQUEST_AUTHZ": + case 1: + message.policyProfile = 1; + break; + case "CONTENT_AUTHZ": + case 2: + message.policyProfile = 2; + break; } return message; }; /** - * Creates a plain object from a ClientTlsPolicy message. Also converts values to other types if specified. + * Creates a plain object from an AuthzPolicy message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.networksecurity.v1.ClientTlsPolicy + * @memberof google.cloud.networksecurity.v1.AuthzPolicy * @static - * @param {google.cloud.networksecurity.v1.ClientTlsPolicy} message ClientTlsPolicy + * @param {google.cloud.networksecurity.v1.AuthzPolicy} message AuthzPolicy * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ClientTlsPolicy.toObject = function toObject(message, options) { + AuthzPolicy.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.arrays || options.defaults) - object.serverValidationCa = []; + object.httpRules = []; if (options.objects || options.defaults) object.labels = {}; if (options.defaults) { object.name = ""; - object.description = ""; object.createTime = null; object.updateTime = null; - object.sni = ""; - object.clientCertificate = null; + object.description = ""; + object.target = null; + object.action = options.enums === String ? "AUTHZ_ACTION_UNSPECIFIED" : 0; + object.customProvider = null; + object.policyProfile = options.enums === String ? "POLICY_PROFILE_UNSPECIFIED" : 0; } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; - if (message.description != null && message.hasOwnProperty("description")) - object.description = message.description; if (message.createTime != null && message.hasOwnProperty("createTime")) object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); if (message.updateTime != null && message.hasOwnProperty("updateTime")) object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; var keys2; if (message.labels && (keys2 = Object.keys(message.labels)).length) { object.labels = {}; for (var j = 0; j < keys2.length; ++j) object.labels[keys2[j]] = message.labels[keys2[j]]; } - if (message.sni != null && message.hasOwnProperty("sni")) - object.sni = message.sni; - if (message.clientCertificate != null && message.hasOwnProperty("clientCertificate")) - object.clientCertificate = $root.google.cloud.networksecurity.v1.CertificateProvider.toObject(message.clientCertificate, options); - if (message.serverValidationCa && message.serverValidationCa.length) { - object.serverValidationCa = []; - for (var j = 0; j < message.serverValidationCa.length; ++j) - object.serverValidationCa[j] = $root.google.cloud.networksecurity.v1.ValidationCA.toObject(message.serverValidationCa[j], options); + if (message.target != null && message.hasOwnProperty("target")) + object.target = $root.google.cloud.networksecurity.v1.AuthzPolicy.Target.toObject(message.target, options); + if (message.httpRules && message.httpRules.length) { + object.httpRules = []; + for (var j = 0; j < message.httpRules.length; ++j) + object.httpRules[j] = $root.google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.toObject(message.httpRules[j], options); } + if (message.action != null && message.hasOwnProperty("action")) + object.action = options.enums === String ? $root.google.cloud.networksecurity.v1.AuthzPolicy.AuthzAction[message.action] === undefined ? message.action : $root.google.cloud.networksecurity.v1.AuthzPolicy.AuthzAction[message.action] : message.action; + if (message.customProvider != null && message.hasOwnProperty("customProvider")) + object.customProvider = $root.google.cloud.networksecurity.v1.AuthzPolicy.CustomProvider.toObject(message.customProvider, options); + if (message.policyProfile != null && message.hasOwnProperty("policyProfile")) + object.policyProfile = options.enums === String ? $root.google.cloud.networksecurity.v1.AuthzPolicy.PolicyProfile[message.policyProfile] === undefined ? message.policyProfile : $root.google.cloud.networksecurity.v1.AuthzPolicy.PolicyProfile[message.policyProfile] : message.policyProfile; return object; }; /** - * Converts this ClientTlsPolicy to JSON. + * Converts this AuthzPolicy to JSON. * @function toJSON - * @memberof google.cloud.networksecurity.v1.ClientTlsPolicy + * @memberof google.cloud.networksecurity.v1.AuthzPolicy * @instance * @returns {Object.} JSON object */ - ClientTlsPolicy.prototype.toJSON = function toJSON() { + AuthzPolicy.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for ClientTlsPolicy + * Gets the default type url for AuthzPolicy * @function getTypeUrl - * @memberof google.cloud.networksecurity.v1.ClientTlsPolicy + * @memberof google.cloud.networksecurity.v1.AuthzPolicy * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - ClientTlsPolicy.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + AuthzPolicy.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.networksecurity.v1.ClientTlsPolicy"; + return typeUrlPrefix + "/google.cloud.networksecurity.v1.AuthzPolicy"; }; - return ClientTlsPolicy; - })(); - - v1.ListClientTlsPoliciesRequest = (function() { - - /** - * Properties of a ListClientTlsPoliciesRequest. - * @memberof google.cloud.networksecurity.v1 - * @interface IListClientTlsPoliciesRequest - * @property {string|null} [parent] ListClientTlsPoliciesRequest parent - * @property {number|null} [pageSize] ListClientTlsPoliciesRequest pageSize - * @property {string|null} [pageToken] ListClientTlsPoliciesRequest pageToken - */ + AuthzPolicy.Target = (function() { - /** - * Constructs a new ListClientTlsPoliciesRequest. - * @memberof google.cloud.networksecurity.v1 - * @classdesc Represents a ListClientTlsPoliciesRequest. - * @implements IListClientTlsPoliciesRequest - * @constructor - * @param {google.cloud.networksecurity.v1.IListClientTlsPoliciesRequest=} [properties] Properties to set - */ - function ListClientTlsPoliciesRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + /** + * Properties of a Target. + * @memberof google.cloud.networksecurity.v1.AuthzPolicy + * @interface ITarget + * @property {google.cloud.networksecurity.v1.AuthzPolicy.LoadBalancingScheme|null} [loadBalancingScheme] Target loadBalancingScheme + * @property {Array.|null} [resources] Target resources + */ - /** - * ListClientTlsPoliciesRequest parent. - * @member {string} parent - * @memberof google.cloud.networksecurity.v1.ListClientTlsPoliciesRequest - * @instance - */ - ListClientTlsPoliciesRequest.prototype.parent = ""; + /** + * Constructs a new Target. + * @memberof google.cloud.networksecurity.v1.AuthzPolicy + * @classdesc Represents a Target. + * @implements ITarget + * @constructor + * @param {google.cloud.networksecurity.v1.AuthzPolicy.ITarget=} [properties] Properties to set + */ + function Target(properties) { + this.resources = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * ListClientTlsPoliciesRequest pageSize. - * @member {number} pageSize - * @memberof google.cloud.networksecurity.v1.ListClientTlsPoliciesRequest - * @instance - */ - ListClientTlsPoliciesRequest.prototype.pageSize = 0; + /** + * Target loadBalancingScheme. + * @member {google.cloud.networksecurity.v1.AuthzPolicy.LoadBalancingScheme} loadBalancingScheme + * @memberof google.cloud.networksecurity.v1.AuthzPolicy.Target + * @instance + */ + Target.prototype.loadBalancingScheme = 0; - /** - * ListClientTlsPoliciesRequest pageToken. - * @member {string} pageToken - * @memberof google.cloud.networksecurity.v1.ListClientTlsPoliciesRequest - * @instance - */ - ListClientTlsPoliciesRequest.prototype.pageToken = ""; + /** + * Target resources. + * @member {Array.} resources + * @memberof google.cloud.networksecurity.v1.AuthzPolicy.Target + * @instance + */ + Target.prototype.resources = $util.emptyArray; - /** - * Creates a new ListClientTlsPoliciesRequest instance using the specified properties. - * @function create - * @memberof google.cloud.networksecurity.v1.ListClientTlsPoliciesRequest - * @static - * @param {google.cloud.networksecurity.v1.IListClientTlsPoliciesRequest=} [properties] Properties to set - * @returns {google.cloud.networksecurity.v1.ListClientTlsPoliciesRequest} ListClientTlsPoliciesRequest instance - */ - ListClientTlsPoliciesRequest.create = function create(properties) { - return new ListClientTlsPoliciesRequest(properties); - }; + /** + * Creates a new Target instance using the specified properties. + * @function create + * @memberof google.cloud.networksecurity.v1.AuthzPolicy.Target + * @static + * @param {google.cloud.networksecurity.v1.AuthzPolicy.ITarget=} [properties] Properties to set + * @returns {google.cloud.networksecurity.v1.AuthzPolicy.Target} Target instance + */ + Target.create = function create(properties) { + return new Target(properties); + }; - /** - * Encodes the specified ListClientTlsPoliciesRequest message. Does not implicitly {@link google.cloud.networksecurity.v1.ListClientTlsPoliciesRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.networksecurity.v1.ListClientTlsPoliciesRequest - * @static - * @param {google.cloud.networksecurity.v1.IListClientTlsPoliciesRequest} message ListClientTlsPoliciesRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListClientTlsPoliciesRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); - if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); - return writer; - }; + /** + * Encodes the specified Target message. Does not implicitly {@link google.cloud.networksecurity.v1.AuthzPolicy.Target.verify|verify} messages. + * @function encode + * @memberof google.cloud.networksecurity.v1.AuthzPolicy.Target + * @static + * @param {google.cloud.networksecurity.v1.AuthzPolicy.ITarget} message Target message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Target.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.resources != null && message.resources.length) + for (var i = 0; i < message.resources.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.resources[i]); + if (message.loadBalancingScheme != null && Object.hasOwnProperty.call(message, "loadBalancingScheme")) + writer.uint32(/* id 8, wireType 0 =*/64).int32(message.loadBalancingScheme); + return writer; + }; - /** - * Encodes the specified ListClientTlsPoliciesRequest message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.ListClientTlsPoliciesRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.networksecurity.v1.ListClientTlsPoliciesRequest - * @static - * @param {google.cloud.networksecurity.v1.IListClientTlsPoliciesRequest} message ListClientTlsPoliciesRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListClientTlsPoliciesRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Encodes the specified Target message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.AuthzPolicy.Target.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.networksecurity.v1.AuthzPolicy.Target + * @static + * @param {google.cloud.networksecurity.v1.AuthzPolicy.ITarget} message Target message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Target.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Decodes a ListClientTlsPoliciesRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.networksecurity.v1.ListClientTlsPoliciesRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.networksecurity.v1.ListClientTlsPoliciesRequest} ListClientTlsPoliciesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListClientTlsPoliciesRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networksecurity.v1.ListClientTlsPoliciesRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.parent = reader.string(); + /** + * Decodes a Target message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.networksecurity.v1.AuthzPolicy.Target + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.networksecurity.v1.AuthzPolicy.Target} Target + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Target.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networksecurity.v1.AuthzPolicy.Target(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) break; - } - case 2: { - message.pageSize = reader.int32(); + switch (tag >>> 3) { + case 8: { + message.loadBalancingScheme = reader.int32(); + break; + } + case 1: { + if (!(message.resources && message.resources.length)) + message.resources = []; + message.resources.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); break; } - case 3: { - message.pageToken = reader.string(); + } + return message; + }; + + /** + * Decodes a Target message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.networksecurity.v1.AuthzPolicy.Target + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.networksecurity.v1.AuthzPolicy.Target} Target + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Target.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Target message. + * @function verify + * @memberof google.cloud.networksecurity.v1.AuthzPolicy.Target + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Target.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.loadBalancingScheme != null && message.hasOwnProperty("loadBalancingScheme")) + switch (message.loadBalancingScheme) { + default: + return "loadBalancingScheme: enum value expected"; + case 0: + case 1: + case 2: + case 3: break; } + if (message.resources != null && message.hasOwnProperty("resources")) { + if (!Array.isArray(message.resources)) + return "resources: array expected"; + for (var i = 0; i < message.resources.length; ++i) + if (!$util.isString(message.resources[i])) + return "resources: string[] expected"; + } + return null; + }; + + /** + * Creates a Target message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.networksecurity.v1.AuthzPolicy.Target + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.networksecurity.v1.AuthzPolicy.Target} Target + */ + Target.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networksecurity.v1.AuthzPolicy.Target) + return object; + var message = new $root.google.cloud.networksecurity.v1.AuthzPolicy.Target(); + switch (object.loadBalancingScheme) { default: - reader.skipType(tag & 7); + if (typeof object.loadBalancingScheme === "number") { + message.loadBalancingScheme = object.loadBalancingScheme; + break; + } + break; + case "LOAD_BALANCING_SCHEME_UNSPECIFIED": + case 0: + message.loadBalancingScheme = 0; + break; + case "INTERNAL_MANAGED": + case 1: + message.loadBalancingScheme = 1; + break; + case "EXTERNAL_MANAGED": + case 2: + message.loadBalancingScheme = 2; + break; + case "INTERNAL_SELF_MANAGED": + case 3: + message.loadBalancingScheme = 3; break; } - } - return message; - }; - - /** - * Decodes a ListClientTlsPoliciesRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.networksecurity.v1.ListClientTlsPoliciesRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.networksecurity.v1.ListClientTlsPoliciesRequest} ListClientTlsPoliciesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListClientTlsPoliciesRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListClientTlsPoliciesRequest message. - * @function verify - * @memberof google.cloud.networksecurity.v1.ListClientTlsPoliciesRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListClientTlsPoliciesRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - if (!$util.isInteger(message.pageSize)) - return "pageSize: integer expected"; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - if (!$util.isString(message.pageToken)) - return "pageToken: string expected"; - return null; - }; + if (object.resources) { + if (!Array.isArray(object.resources)) + throw TypeError(".google.cloud.networksecurity.v1.AuthzPolicy.Target.resources: array expected"); + message.resources = []; + for (var i = 0; i < object.resources.length; ++i) + message.resources[i] = String(object.resources[i]); + } + return message; + }; - /** - * Creates a ListClientTlsPoliciesRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.networksecurity.v1.ListClientTlsPoliciesRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.networksecurity.v1.ListClientTlsPoliciesRequest} ListClientTlsPoliciesRequest - */ - ListClientTlsPoliciesRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.networksecurity.v1.ListClientTlsPoliciesRequest) + /** + * Creates a plain object from a Target message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.networksecurity.v1.AuthzPolicy.Target + * @static + * @param {google.cloud.networksecurity.v1.AuthzPolicy.Target} message Target + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Target.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.resources = []; + if (options.defaults) + object.loadBalancingScheme = options.enums === String ? "LOAD_BALANCING_SCHEME_UNSPECIFIED" : 0; + if (message.resources && message.resources.length) { + object.resources = []; + for (var j = 0; j < message.resources.length; ++j) + object.resources[j] = message.resources[j]; + } + if (message.loadBalancingScheme != null && message.hasOwnProperty("loadBalancingScheme")) + object.loadBalancingScheme = options.enums === String ? $root.google.cloud.networksecurity.v1.AuthzPolicy.LoadBalancingScheme[message.loadBalancingScheme] === undefined ? message.loadBalancingScheme : $root.google.cloud.networksecurity.v1.AuthzPolicy.LoadBalancingScheme[message.loadBalancingScheme] : message.loadBalancingScheme; return object; - var message = new $root.google.cloud.networksecurity.v1.ListClientTlsPoliciesRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.pageSize != null) - message.pageSize = object.pageSize | 0; - if (object.pageToken != null) - message.pageToken = String(object.pageToken); - return message; - }; + }; - /** - * Creates a plain object from a ListClientTlsPoliciesRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.networksecurity.v1.ListClientTlsPoliciesRequest - * @static - * @param {google.cloud.networksecurity.v1.ListClientTlsPoliciesRequest} message ListClientTlsPoliciesRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListClientTlsPoliciesRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.parent = ""; - object.pageSize = 0; - object.pageToken = ""; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - object.pageSize = message.pageSize; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - object.pageToken = message.pageToken; - return object; - }; + /** + * Converts this Target to JSON. + * @function toJSON + * @memberof google.cloud.networksecurity.v1.AuthzPolicy.Target + * @instance + * @returns {Object.} JSON object + */ + Target.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Converts this ListClientTlsPoliciesRequest to JSON. - * @function toJSON - * @memberof google.cloud.networksecurity.v1.ListClientTlsPoliciesRequest - * @instance - * @returns {Object.} JSON object - */ - ListClientTlsPoliciesRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Gets the default type url for Target + * @function getTypeUrl + * @memberof google.cloud.networksecurity.v1.AuthzPolicy.Target + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Target.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.networksecurity.v1.AuthzPolicy.Target"; + }; - /** - * Gets the default type url for ListClientTlsPoliciesRequest - * @function getTypeUrl - * @memberof google.cloud.networksecurity.v1.ListClientTlsPoliciesRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListClientTlsPoliciesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.networksecurity.v1.ListClientTlsPoliciesRequest"; - }; + return Target; + })(); - return ListClientTlsPoliciesRequest; - })(); + AuthzPolicy.AuthzRule = (function() { - v1.ListClientTlsPoliciesResponse = (function() { + /** + * Properties of an AuthzRule. + * @memberof google.cloud.networksecurity.v1.AuthzPolicy + * @interface IAuthzRule + * @property {google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.IFrom|null} [from] AuthzRule from + * @property {google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.ITo|null} [to] AuthzRule to + * @property {string|null} [when] AuthzRule when + */ - /** - * Properties of a ListClientTlsPoliciesResponse. - * @memberof google.cloud.networksecurity.v1 - * @interface IListClientTlsPoliciesResponse - * @property {Array.|null} [clientTlsPolicies] ListClientTlsPoliciesResponse clientTlsPolicies - * @property {string|null} [nextPageToken] ListClientTlsPoliciesResponse nextPageToken - */ + /** + * Constructs a new AuthzRule. + * @memberof google.cloud.networksecurity.v1.AuthzPolicy + * @classdesc Represents an AuthzRule. + * @implements IAuthzRule + * @constructor + * @param {google.cloud.networksecurity.v1.AuthzPolicy.IAuthzRule=} [properties] Properties to set + */ + function AuthzRule(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * Constructs a new ListClientTlsPoliciesResponse. - * @memberof google.cloud.networksecurity.v1 - * @classdesc Represents a ListClientTlsPoliciesResponse. - * @implements IListClientTlsPoliciesResponse - * @constructor - * @param {google.cloud.networksecurity.v1.IListClientTlsPoliciesResponse=} [properties] Properties to set - */ - function ListClientTlsPoliciesResponse(properties) { - this.clientTlsPolicies = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + /** + * AuthzRule from. + * @member {google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.IFrom|null|undefined} from + * @memberof google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule + * @instance + */ + AuthzRule.prototype.from = null; - /** - * ListClientTlsPoliciesResponse clientTlsPolicies. - * @member {Array.} clientTlsPolicies - * @memberof google.cloud.networksecurity.v1.ListClientTlsPoliciesResponse - * @instance - */ - ListClientTlsPoliciesResponse.prototype.clientTlsPolicies = $util.emptyArray; + /** + * AuthzRule to. + * @member {google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.ITo|null|undefined} to + * @memberof google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule + * @instance + */ + AuthzRule.prototype.to = null; - /** - * ListClientTlsPoliciesResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.cloud.networksecurity.v1.ListClientTlsPoliciesResponse - * @instance - */ - ListClientTlsPoliciesResponse.prototype.nextPageToken = ""; + /** + * AuthzRule when. + * @member {string} when + * @memberof google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule + * @instance + */ + AuthzRule.prototype.when = ""; - /** - * Creates a new ListClientTlsPoliciesResponse instance using the specified properties. - * @function create - * @memberof google.cloud.networksecurity.v1.ListClientTlsPoliciesResponse - * @static - * @param {google.cloud.networksecurity.v1.IListClientTlsPoliciesResponse=} [properties] Properties to set - * @returns {google.cloud.networksecurity.v1.ListClientTlsPoliciesResponse} ListClientTlsPoliciesResponse instance - */ - ListClientTlsPoliciesResponse.create = function create(properties) { - return new ListClientTlsPoliciesResponse(properties); - }; + /** + * Creates a new AuthzRule instance using the specified properties. + * @function create + * @memberof google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule + * @static + * @param {google.cloud.networksecurity.v1.AuthzPolicy.IAuthzRule=} [properties] Properties to set + * @returns {google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule} AuthzRule instance + */ + AuthzRule.create = function create(properties) { + return new AuthzRule(properties); + }; - /** - * Encodes the specified ListClientTlsPoliciesResponse message. Does not implicitly {@link google.cloud.networksecurity.v1.ListClientTlsPoliciesResponse.verify|verify} messages. - * @function encode - * @memberof google.cloud.networksecurity.v1.ListClientTlsPoliciesResponse - * @static - * @param {google.cloud.networksecurity.v1.IListClientTlsPoliciesResponse} message ListClientTlsPoliciesResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListClientTlsPoliciesResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.clientTlsPolicies != null && message.clientTlsPolicies.length) - for (var i = 0; i < message.clientTlsPolicies.length; ++i) - $root.google.cloud.networksecurity.v1.ClientTlsPolicy.encode(message.clientTlsPolicies[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); - return writer; - }; + /** + * Encodes the specified AuthzRule message. Does not implicitly {@link google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.verify|verify} messages. + * @function encode + * @memberof google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule + * @static + * @param {google.cloud.networksecurity.v1.AuthzPolicy.IAuthzRule} message AuthzRule message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AuthzRule.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.from != null && Object.hasOwnProperty.call(message, "from")) + $root.google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.From.encode(message.from, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.to != null && Object.hasOwnProperty.call(message, "to")) + $root.google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.To.encode(message.to, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.when != null && Object.hasOwnProperty.call(message, "when")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.when); + return writer; + }; - /** - * Encodes the specified ListClientTlsPoliciesResponse message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.ListClientTlsPoliciesResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.networksecurity.v1.ListClientTlsPoliciesResponse - * @static - * @param {google.cloud.networksecurity.v1.IListClientTlsPoliciesResponse} message ListClientTlsPoliciesResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListClientTlsPoliciesResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Encodes the specified AuthzRule message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule + * @static + * @param {google.cloud.networksecurity.v1.AuthzPolicy.IAuthzRule} message AuthzRule message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AuthzRule.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Decodes a ListClientTlsPoliciesResponse message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.networksecurity.v1.ListClientTlsPoliciesResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.networksecurity.v1.ListClientTlsPoliciesResponse} ListClientTlsPoliciesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListClientTlsPoliciesResponse.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networksecurity.v1.ListClientTlsPoliciesResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.clientTlsPolicies && message.clientTlsPolicies.length)) - message.clientTlsPolicies = []; - message.clientTlsPolicies.push($root.google.cloud.networksecurity.v1.ClientTlsPolicy.decode(reader, reader.uint32())); + /** + * Decodes an AuthzRule message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule} AuthzRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AuthzRule.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) break; - } - case 2: { - message.nextPageToken = reader.string(); + switch (tag >>> 3) { + case 1: { + message.from = $root.google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.From.decode(reader, reader.uint32()); + break; + } + case 2: { + message.to = $root.google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.To.decode(reader, reader.uint32()); + break; + } + case 3: { + message.when = reader.string(); + break; + } + default: + reader.skipType(tag & 7); break; } - default: - reader.skipType(tag & 7); - break; } - } - return message; - }; + return message; + }; - /** - * Decodes a ListClientTlsPoliciesResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.networksecurity.v1.ListClientTlsPoliciesResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.networksecurity.v1.ListClientTlsPoliciesResponse} ListClientTlsPoliciesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListClientTlsPoliciesResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * Decodes an AuthzRule message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule} AuthzRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AuthzRule.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Verifies a ListClientTlsPoliciesResponse message. - * @function verify - * @memberof google.cloud.networksecurity.v1.ListClientTlsPoliciesResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ + /** + * Verifies an AuthzRule message. + * @function verify + * @memberof google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AuthzRule.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.from != null && message.hasOwnProperty("from")) { + var error = $root.google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.From.verify(message.from); + if (error) + return "from." + error; + } + if (message.to != null && message.hasOwnProperty("to")) { + var error = $root.google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.To.verify(message.to); + if (error) + return "to." + error; + } + if (message.when != null && message.hasOwnProperty("when")) + if (!$util.isString(message.when)) + return "when: string expected"; + return null; + }; + + /** + * Creates an AuthzRule message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule} AuthzRule + */ + AuthzRule.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule) + return object; + var message = new $root.google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule(); + if (object.from != null) { + if (typeof object.from !== "object") + throw TypeError(".google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.from: object expected"); + message.from = $root.google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.From.fromObject(object.from); + } + if (object.to != null) { + if (typeof object.to !== "object") + throw TypeError(".google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.to: object expected"); + message.to = $root.google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.To.fromObject(object.to); + } + if (object.when != null) + message.when = String(object.when); + return message; + }; + + /** + * Creates a plain object from an AuthzRule message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule + * @static + * @param {google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule} message AuthzRule + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AuthzRule.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.from = null; + object.to = null; + object.when = ""; + } + if (message.from != null && message.hasOwnProperty("from")) + object.from = $root.google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.From.toObject(message.from, options); + if (message.to != null && message.hasOwnProperty("to")) + object.to = $root.google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.To.toObject(message.to, options); + if (message.when != null && message.hasOwnProperty("when")) + object.when = message.when; + return object; + }; + + /** + * Converts this AuthzRule to JSON. + * @function toJSON + * @memberof google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule + * @instance + * @returns {Object.} JSON object + */ + AuthzRule.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AuthzRule + * @function getTypeUrl + * @memberof google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AuthzRule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule"; + }; + + AuthzRule.StringMatch = (function() { + + /** + * Properties of a StringMatch. + * @memberof google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule + * @interface IStringMatch + * @property {string|null} [exact] StringMatch exact + * @property {string|null} [prefix] StringMatch prefix + * @property {string|null} [suffix] StringMatch suffix + * @property {string|null} [contains] StringMatch contains + * @property {boolean|null} [ignoreCase] StringMatch ignoreCase + */ + + /** + * Constructs a new StringMatch. + * @memberof google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule + * @classdesc Represents a StringMatch. + * @implements IStringMatch + * @constructor + * @param {google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.IStringMatch=} [properties] Properties to set + */ + function StringMatch(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * StringMatch exact. + * @member {string|null|undefined} exact + * @memberof google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.StringMatch + * @instance + */ + StringMatch.prototype.exact = null; + + /** + * StringMatch prefix. + * @member {string|null|undefined} prefix + * @memberof google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.StringMatch + * @instance + */ + StringMatch.prototype.prefix = null; + + /** + * StringMatch suffix. + * @member {string|null|undefined} suffix + * @memberof google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.StringMatch + * @instance + */ + StringMatch.prototype.suffix = null; + + /** + * StringMatch contains. + * @member {string|null|undefined} contains + * @memberof google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.StringMatch + * @instance + */ + StringMatch.prototype.contains = null; + + /** + * StringMatch ignoreCase. + * @member {boolean} ignoreCase + * @memberof google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.StringMatch + * @instance + */ + StringMatch.prototype.ignoreCase = false; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * StringMatch matchPattern. + * @member {"exact"|"prefix"|"suffix"|"contains"|undefined} matchPattern + * @memberof google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.StringMatch + * @instance + */ + Object.defineProperty(StringMatch.prototype, "matchPattern", { + get: $util.oneOfGetter($oneOfFields = ["exact", "prefix", "suffix", "contains"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new StringMatch instance using the specified properties. + * @function create + * @memberof google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.StringMatch + * @static + * @param {google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.IStringMatch=} [properties] Properties to set + * @returns {google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.StringMatch} StringMatch instance + */ + StringMatch.create = function create(properties) { + return new StringMatch(properties); + }; + + /** + * Encodes the specified StringMatch message. Does not implicitly {@link google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.StringMatch.verify|verify} messages. + * @function encode + * @memberof google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.StringMatch + * @static + * @param {google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.IStringMatch} message StringMatch message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StringMatch.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.exact != null && Object.hasOwnProperty.call(message, "exact")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.exact); + if (message.prefix != null && Object.hasOwnProperty.call(message, "prefix")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.prefix); + if (message.suffix != null && Object.hasOwnProperty.call(message, "suffix")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.suffix); + if (message.contains != null && Object.hasOwnProperty.call(message, "contains")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.contains); + if (message.ignoreCase != null && Object.hasOwnProperty.call(message, "ignoreCase")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.ignoreCase); + return writer; + }; + + /** + * Encodes the specified StringMatch message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.StringMatch.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.StringMatch + * @static + * @param {google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.IStringMatch} message StringMatch message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StringMatch.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a StringMatch message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.StringMatch + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.StringMatch} StringMatch + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StringMatch.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.StringMatch(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.exact = reader.string(); + break; + } + case 2: { + message.prefix = reader.string(); + break; + } + case 3: { + message.suffix = reader.string(); + break; + } + case 4: { + message.contains = reader.string(); + break; + } + case 5: { + message.ignoreCase = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a StringMatch message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.StringMatch + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.StringMatch} StringMatch + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StringMatch.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a StringMatch message. + * @function verify + * @memberof google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.StringMatch + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + StringMatch.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.exact != null && message.hasOwnProperty("exact")) { + properties.matchPattern = 1; + if (!$util.isString(message.exact)) + return "exact: string expected"; + } + if (message.prefix != null && message.hasOwnProperty("prefix")) { + if (properties.matchPattern === 1) + return "matchPattern: multiple values"; + properties.matchPattern = 1; + if (!$util.isString(message.prefix)) + return "prefix: string expected"; + } + if (message.suffix != null && message.hasOwnProperty("suffix")) { + if (properties.matchPattern === 1) + return "matchPattern: multiple values"; + properties.matchPattern = 1; + if (!$util.isString(message.suffix)) + return "suffix: string expected"; + } + if (message.contains != null && message.hasOwnProperty("contains")) { + if (properties.matchPattern === 1) + return "matchPattern: multiple values"; + properties.matchPattern = 1; + if (!$util.isString(message.contains)) + return "contains: string expected"; + } + if (message.ignoreCase != null && message.hasOwnProperty("ignoreCase")) + if (typeof message.ignoreCase !== "boolean") + return "ignoreCase: boolean expected"; + return null; + }; + + /** + * Creates a StringMatch message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.StringMatch + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.StringMatch} StringMatch + */ + StringMatch.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.StringMatch) + return object; + var message = new $root.google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.StringMatch(); + if (object.exact != null) + message.exact = String(object.exact); + if (object.prefix != null) + message.prefix = String(object.prefix); + if (object.suffix != null) + message.suffix = String(object.suffix); + if (object.contains != null) + message.contains = String(object.contains); + if (object.ignoreCase != null) + message.ignoreCase = Boolean(object.ignoreCase); + return message; + }; + + /** + * Creates a plain object from a StringMatch message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.StringMatch + * @static + * @param {google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.StringMatch} message StringMatch + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + StringMatch.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.ignoreCase = false; + if (message.exact != null && message.hasOwnProperty("exact")) { + object.exact = message.exact; + if (options.oneofs) + object.matchPattern = "exact"; + } + if (message.prefix != null && message.hasOwnProperty("prefix")) { + object.prefix = message.prefix; + if (options.oneofs) + object.matchPattern = "prefix"; + } + if (message.suffix != null && message.hasOwnProperty("suffix")) { + object.suffix = message.suffix; + if (options.oneofs) + object.matchPattern = "suffix"; + } + if (message.contains != null && message.hasOwnProperty("contains")) { + object.contains = message.contains; + if (options.oneofs) + object.matchPattern = "contains"; + } + if (message.ignoreCase != null && message.hasOwnProperty("ignoreCase")) + object.ignoreCase = message.ignoreCase; + return object; + }; + + /** + * Converts this StringMatch to JSON. + * @function toJSON + * @memberof google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.StringMatch + * @instance + * @returns {Object.} JSON object + */ + StringMatch.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for StringMatch + * @function getTypeUrl + * @memberof google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.StringMatch + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + StringMatch.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.StringMatch"; + }; + + return StringMatch; + })(); + + AuthzRule.IpBlock = (function() { + + /** + * Properties of an IpBlock. + * @memberof google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule + * @interface IIpBlock + * @property {string|null} [prefix] IpBlock prefix + * @property {number|null} [length] IpBlock length + */ + + /** + * Constructs a new IpBlock. + * @memberof google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule + * @classdesc Represents an IpBlock. + * @implements IIpBlock + * @constructor + * @param {google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.IIpBlock=} [properties] Properties to set + */ + function IpBlock(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * IpBlock prefix. + * @member {string} prefix + * @memberof google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.IpBlock + * @instance + */ + IpBlock.prototype.prefix = ""; + + /** + * IpBlock length. + * @member {number} length + * @memberof google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.IpBlock + * @instance + */ + IpBlock.prototype.length = 0; + + /** + * Creates a new IpBlock instance using the specified properties. + * @function create + * @memberof google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.IpBlock + * @static + * @param {google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.IIpBlock=} [properties] Properties to set + * @returns {google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.IpBlock} IpBlock instance + */ + IpBlock.create = function create(properties) { + return new IpBlock(properties); + }; + + /** + * Encodes the specified IpBlock message. Does not implicitly {@link google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.IpBlock.verify|verify} messages. + * @function encode + * @memberof google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.IpBlock + * @static + * @param {google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.IIpBlock} message IpBlock message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IpBlock.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.prefix != null && Object.hasOwnProperty.call(message, "prefix")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.prefix); + if (message.length != null && Object.hasOwnProperty.call(message, "length")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.length); + return writer; + }; + + /** + * Encodes the specified IpBlock message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.IpBlock.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.IpBlock + * @static + * @param {google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.IIpBlock} message IpBlock message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IpBlock.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an IpBlock message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.IpBlock + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.IpBlock} IpBlock + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IpBlock.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.IpBlock(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.prefix = reader.string(); + break; + } + case 2: { + message.length = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an IpBlock message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.IpBlock + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.IpBlock} IpBlock + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IpBlock.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an IpBlock message. + * @function verify + * @memberof google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.IpBlock + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + IpBlock.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.prefix != null && message.hasOwnProperty("prefix")) + if (!$util.isString(message.prefix)) + return "prefix: string expected"; + if (message.length != null && message.hasOwnProperty("length")) + if (!$util.isInteger(message.length)) + return "length: integer expected"; + return null; + }; + + /** + * Creates an IpBlock message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.IpBlock + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.IpBlock} IpBlock + */ + IpBlock.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.IpBlock) + return object; + var message = new $root.google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.IpBlock(); + if (object.prefix != null) + message.prefix = String(object.prefix); + if (object.length != null) + message.length = object.length | 0; + return message; + }; + + /** + * Creates a plain object from an IpBlock message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.IpBlock + * @static + * @param {google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.IpBlock} message IpBlock + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + IpBlock.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.prefix = ""; + object.length = 0; + } + if (message.prefix != null && message.hasOwnProperty("prefix")) + object.prefix = message.prefix; + if (message.length != null && message.hasOwnProperty("length")) + object.length = message.length; + return object; + }; + + /** + * Converts this IpBlock to JSON. + * @function toJSON + * @memberof google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.IpBlock + * @instance + * @returns {Object.} JSON object + */ + IpBlock.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for IpBlock + * @function getTypeUrl + * @memberof google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.IpBlock + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + IpBlock.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.IpBlock"; + }; + + return IpBlock; + })(); + + AuthzRule.RequestResource = (function() { + + /** + * Properties of a RequestResource. + * @memberof google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule + * @interface IRequestResource + * @property {google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.RequestResource.ITagValueIdSet|null} [tagValueIdSet] RequestResource tagValueIdSet + * @property {google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.IStringMatch|null} [iamServiceAccount] RequestResource iamServiceAccount + */ + + /** + * Constructs a new RequestResource. + * @memberof google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule + * @classdesc Represents a RequestResource. + * @implements IRequestResource + * @constructor + * @param {google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.IRequestResource=} [properties] Properties to set + */ + function RequestResource(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RequestResource tagValueIdSet. + * @member {google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.RequestResource.ITagValueIdSet|null|undefined} tagValueIdSet + * @memberof google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.RequestResource + * @instance + */ + RequestResource.prototype.tagValueIdSet = null; + + /** + * RequestResource iamServiceAccount. + * @member {google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.IStringMatch|null|undefined} iamServiceAccount + * @memberof google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.RequestResource + * @instance + */ + RequestResource.prototype.iamServiceAccount = null; + + /** + * Creates a new RequestResource instance using the specified properties. + * @function create + * @memberof google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.RequestResource + * @static + * @param {google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.IRequestResource=} [properties] Properties to set + * @returns {google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.RequestResource} RequestResource instance + */ + RequestResource.create = function create(properties) { + return new RequestResource(properties); + }; + + /** + * Encodes the specified RequestResource message. Does not implicitly {@link google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.RequestResource.verify|verify} messages. + * @function encode + * @memberof google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.RequestResource + * @static + * @param {google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.IRequestResource} message RequestResource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RequestResource.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.tagValueIdSet != null && Object.hasOwnProperty.call(message, "tagValueIdSet")) + $root.google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.RequestResource.TagValueIdSet.encode(message.tagValueIdSet, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.iamServiceAccount != null && Object.hasOwnProperty.call(message, "iamServiceAccount")) + $root.google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.StringMatch.encode(message.iamServiceAccount, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified RequestResource message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.RequestResource.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.RequestResource + * @static + * @param {google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.IRequestResource} message RequestResource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RequestResource.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RequestResource message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.RequestResource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.RequestResource} RequestResource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RequestResource.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.RequestResource(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.tagValueIdSet = $root.google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.RequestResource.TagValueIdSet.decode(reader, reader.uint32()); + break; + } + case 2: { + message.iamServiceAccount = $root.google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.StringMatch.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RequestResource message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.RequestResource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.RequestResource} RequestResource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RequestResource.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RequestResource message. + * @function verify + * @memberof google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.RequestResource + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RequestResource.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.tagValueIdSet != null && message.hasOwnProperty("tagValueIdSet")) { + var error = $root.google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.RequestResource.TagValueIdSet.verify(message.tagValueIdSet); + if (error) + return "tagValueIdSet." + error; + } + if (message.iamServiceAccount != null && message.hasOwnProperty("iamServiceAccount")) { + var error = $root.google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.StringMatch.verify(message.iamServiceAccount); + if (error) + return "iamServiceAccount." + error; + } + return null; + }; + + /** + * Creates a RequestResource message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.RequestResource + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.RequestResource} RequestResource + */ + RequestResource.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.RequestResource) + return object; + var message = new $root.google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.RequestResource(); + if (object.tagValueIdSet != null) { + if (typeof object.tagValueIdSet !== "object") + throw TypeError(".google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.RequestResource.tagValueIdSet: object expected"); + message.tagValueIdSet = $root.google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.RequestResource.TagValueIdSet.fromObject(object.tagValueIdSet); + } + if (object.iamServiceAccount != null) { + if (typeof object.iamServiceAccount !== "object") + throw TypeError(".google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.RequestResource.iamServiceAccount: object expected"); + message.iamServiceAccount = $root.google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.StringMatch.fromObject(object.iamServiceAccount); + } + return message; + }; + + /** + * Creates a plain object from a RequestResource message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.RequestResource + * @static + * @param {google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.RequestResource} message RequestResource + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RequestResource.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.tagValueIdSet = null; + object.iamServiceAccount = null; + } + if (message.tagValueIdSet != null && message.hasOwnProperty("tagValueIdSet")) + object.tagValueIdSet = $root.google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.RequestResource.TagValueIdSet.toObject(message.tagValueIdSet, options); + if (message.iamServiceAccount != null && message.hasOwnProperty("iamServiceAccount")) + object.iamServiceAccount = $root.google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.StringMatch.toObject(message.iamServiceAccount, options); + return object; + }; + + /** + * Converts this RequestResource to JSON. + * @function toJSON + * @memberof google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.RequestResource + * @instance + * @returns {Object.} JSON object + */ + RequestResource.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RequestResource + * @function getTypeUrl + * @memberof google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.RequestResource + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RequestResource.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.RequestResource"; + }; + + RequestResource.TagValueIdSet = (function() { + + /** + * Properties of a TagValueIdSet. + * @memberof google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.RequestResource + * @interface ITagValueIdSet + * @property {Array.|null} [ids] TagValueIdSet ids + */ + + /** + * Constructs a new TagValueIdSet. + * @memberof google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.RequestResource + * @classdesc Represents a TagValueIdSet. + * @implements ITagValueIdSet + * @constructor + * @param {google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.RequestResource.ITagValueIdSet=} [properties] Properties to set + */ + function TagValueIdSet(properties) { + this.ids = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TagValueIdSet ids. + * @member {Array.} ids + * @memberof google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.RequestResource.TagValueIdSet + * @instance + */ + TagValueIdSet.prototype.ids = $util.emptyArray; + + /** + * Creates a new TagValueIdSet instance using the specified properties. + * @function create + * @memberof google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.RequestResource.TagValueIdSet + * @static + * @param {google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.RequestResource.ITagValueIdSet=} [properties] Properties to set + * @returns {google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.RequestResource.TagValueIdSet} TagValueIdSet instance + */ + TagValueIdSet.create = function create(properties) { + return new TagValueIdSet(properties); + }; + + /** + * Encodes the specified TagValueIdSet message. Does not implicitly {@link google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.RequestResource.TagValueIdSet.verify|verify} messages. + * @function encode + * @memberof google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.RequestResource.TagValueIdSet + * @static + * @param {google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.RequestResource.ITagValueIdSet} message TagValueIdSet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TagValueIdSet.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.ids != null && message.ids.length) { + writer.uint32(/* id 1, wireType 2 =*/10).fork(); + for (var i = 0; i < message.ids.length; ++i) + writer.int64(message.ids[i]); + writer.ldelim(); + } + return writer; + }; + + /** + * Encodes the specified TagValueIdSet message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.RequestResource.TagValueIdSet.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.RequestResource.TagValueIdSet + * @static + * @param {google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.RequestResource.ITagValueIdSet} message TagValueIdSet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TagValueIdSet.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TagValueIdSet message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.RequestResource.TagValueIdSet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.RequestResource.TagValueIdSet} TagValueIdSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TagValueIdSet.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.RequestResource.TagValueIdSet(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.ids && message.ids.length)) + message.ids = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.ids.push(reader.int64()); + } else + message.ids.push(reader.int64()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TagValueIdSet message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.RequestResource.TagValueIdSet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.RequestResource.TagValueIdSet} TagValueIdSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TagValueIdSet.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TagValueIdSet message. + * @function verify + * @memberof google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.RequestResource.TagValueIdSet + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TagValueIdSet.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.ids != null && message.hasOwnProperty("ids")) { + if (!Array.isArray(message.ids)) + return "ids: array expected"; + for (var i = 0; i < message.ids.length; ++i) + if (!$util.isInteger(message.ids[i]) && !(message.ids[i] && $util.isInteger(message.ids[i].low) && $util.isInteger(message.ids[i].high))) + return "ids: integer|Long[] expected"; + } + return null; + }; + + /** + * Creates a TagValueIdSet message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.RequestResource.TagValueIdSet + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.RequestResource.TagValueIdSet} TagValueIdSet + */ + TagValueIdSet.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.RequestResource.TagValueIdSet) + return object; + var message = new $root.google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.RequestResource.TagValueIdSet(); + if (object.ids) { + if (!Array.isArray(object.ids)) + throw TypeError(".google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.RequestResource.TagValueIdSet.ids: array expected"); + message.ids = []; + for (var i = 0; i < object.ids.length; ++i) + if ($util.Long) + (message.ids[i] = $util.Long.fromValue(object.ids[i])).unsigned = false; + else if (typeof object.ids[i] === "string") + message.ids[i] = parseInt(object.ids[i], 10); + else if (typeof object.ids[i] === "number") + message.ids[i] = object.ids[i]; + else if (typeof object.ids[i] === "object") + message.ids[i] = new $util.LongBits(object.ids[i].low >>> 0, object.ids[i].high >>> 0).toNumber(); + } + return message; + }; + + /** + * Creates a plain object from a TagValueIdSet message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.RequestResource.TagValueIdSet + * @static + * @param {google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.RequestResource.TagValueIdSet} message TagValueIdSet + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TagValueIdSet.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.ids = []; + if (message.ids && message.ids.length) { + object.ids = []; + for (var j = 0; j < message.ids.length; ++j) + if (typeof message.ids[j] === "number") + object.ids[j] = options.longs === String ? String(message.ids[j]) : message.ids[j]; + else + object.ids[j] = options.longs === String ? $util.Long.prototype.toString.call(message.ids[j]) : options.longs === Number ? new $util.LongBits(message.ids[j].low >>> 0, message.ids[j].high >>> 0).toNumber() : message.ids[j]; + } + return object; + }; + + /** + * Converts this TagValueIdSet to JSON. + * @function toJSON + * @memberof google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.RequestResource.TagValueIdSet + * @instance + * @returns {Object.} JSON object + */ + TagValueIdSet.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TagValueIdSet + * @function getTypeUrl + * @memberof google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.RequestResource.TagValueIdSet + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TagValueIdSet.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.RequestResource.TagValueIdSet"; + }; + + return TagValueIdSet; + })(); + + return RequestResource; + })(); + + AuthzRule.HeaderMatch = (function() { + + /** + * Properties of a HeaderMatch. + * @memberof google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule + * @interface IHeaderMatch + * @property {string|null} [name] HeaderMatch name + * @property {google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.IStringMatch|null} [value] HeaderMatch value + */ + + /** + * Constructs a new HeaderMatch. + * @memberof google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule + * @classdesc Represents a HeaderMatch. + * @implements IHeaderMatch + * @constructor + * @param {google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.IHeaderMatch=} [properties] Properties to set + */ + function HeaderMatch(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * HeaderMatch name. + * @member {string} name + * @memberof google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.HeaderMatch + * @instance + */ + HeaderMatch.prototype.name = ""; + + /** + * HeaderMatch value. + * @member {google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.IStringMatch|null|undefined} value + * @memberof google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.HeaderMatch + * @instance + */ + HeaderMatch.prototype.value = null; + + /** + * Creates a new HeaderMatch instance using the specified properties. + * @function create + * @memberof google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.HeaderMatch + * @static + * @param {google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.IHeaderMatch=} [properties] Properties to set + * @returns {google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.HeaderMatch} HeaderMatch instance + */ + HeaderMatch.create = function create(properties) { + return new HeaderMatch(properties); + }; + + /** + * Encodes the specified HeaderMatch message. Does not implicitly {@link google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.HeaderMatch.verify|verify} messages. + * @function encode + * @memberof google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.HeaderMatch + * @static + * @param {google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.IHeaderMatch} message HeaderMatch message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HeaderMatch.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + $root.google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.StringMatch.encode(message.value, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified HeaderMatch message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.HeaderMatch.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.HeaderMatch + * @static + * @param {google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.IHeaderMatch} message HeaderMatch message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HeaderMatch.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a HeaderMatch message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.HeaderMatch + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.HeaderMatch} HeaderMatch + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HeaderMatch.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.HeaderMatch(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.value = $root.google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.StringMatch.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a HeaderMatch message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.HeaderMatch + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.HeaderMatch} HeaderMatch + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HeaderMatch.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a HeaderMatch message. + * @function verify + * @memberof google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.HeaderMatch + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + HeaderMatch.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.value != null && message.hasOwnProperty("value")) { + var error = $root.google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.StringMatch.verify(message.value); + if (error) + return "value." + error; + } + return null; + }; + + /** + * Creates a HeaderMatch message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.HeaderMatch + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.HeaderMatch} HeaderMatch + */ + HeaderMatch.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.HeaderMatch) + return object; + var message = new $root.google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.HeaderMatch(); + if (object.name != null) + message.name = String(object.name); + if (object.value != null) { + if (typeof object.value !== "object") + throw TypeError(".google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.HeaderMatch.value: object expected"); + message.value = $root.google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.StringMatch.fromObject(object.value); + } + return message; + }; + + /** + * Creates a plain object from a HeaderMatch message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.HeaderMatch + * @static + * @param {google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.HeaderMatch} message HeaderMatch + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + HeaderMatch.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.value = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.value != null && message.hasOwnProperty("value")) + object.value = $root.google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.StringMatch.toObject(message.value, options); + return object; + }; + + /** + * Converts this HeaderMatch to JSON. + * @function toJSON + * @memberof google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.HeaderMatch + * @instance + * @returns {Object.} JSON object + */ + HeaderMatch.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for HeaderMatch + * @function getTypeUrl + * @memberof google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.HeaderMatch + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + HeaderMatch.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.HeaderMatch"; + }; + + return HeaderMatch; + })(); + + AuthzRule.Principal = (function() { + + /** + * Properties of a Principal. + * @memberof google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule + * @interface IPrincipal + * @property {google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.Principal.PrincipalSelector|null} [principalSelector] Principal principalSelector + * @property {google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.IStringMatch|null} [principal] Principal principal + */ + + /** + * Constructs a new Principal. + * @memberof google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule + * @classdesc Represents a Principal. + * @implements IPrincipal + * @constructor + * @param {google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.IPrincipal=} [properties] Properties to set + */ + function Principal(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Principal principalSelector. + * @member {google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.Principal.PrincipalSelector} principalSelector + * @memberof google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.Principal + * @instance + */ + Principal.prototype.principalSelector = 0; + + /** + * Principal principal. + * @member {google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.IStringMatch|null|undefined} principal + * @memberof google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.Principal + * @instance + */ + Principal.prototype.principal = null; + + /** + * Creates a new Principal instance using the specified properties. + * @function create + * @memberof google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.Principal + * @static + * @param {google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.IPrincipal=} [properties] Properties to set + * @returns {google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.Principal} Principal instance + */ + Principal.create = function create(properties) { + return new Principal(properties); + }; + + /** + * Encodes the specified Principal message. Does not implicitly {@link google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.Principal.verify|verify} messages. + * @function encode + * @memberof google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.Principal + * @static + * @param {google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.IPrincipal} message Principal message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Principal.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.principalSelector != null && Object.hasOwnProperty.call(message, "principalSelector")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.principalSelector); + if (message.principal != null && Object.hasOwnProperty.call(message, "principal")) + $root.google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.StringMatch.encode(message.principal, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Principal message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.Principal.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.Principal + * @static + * @param {google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.IPrincipal} message Principal message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Principal.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Principal message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.Principal + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.Principal} Principal + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Principal.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.Principal(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.principalSelector = reader.int32(); + break; + } + case 2: { + message.principal = $root.google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.StringMatch.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Principal message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.Principal + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.Principal} Principal + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Principal.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Principal message. + * @function verify + * @memberof google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.Principal + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Principal.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.principalSelector != null && message.hasOwnProperty("principalSelector")) + switch (message.principalSelector) { + default: + return "principalSelector: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.principal != null && message.hasOwnProperty("principal")) { + var error = $root.google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.StringMatch.verify(message.principal); + if (error) + return "principal." + error; + } + return null; + }; + + /** + * Creates a Principal message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.Principal + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.Principal} Principal + */ + Principal.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.Principal) + return object; + var message = new $root.google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.Principal(); + switch (object.principalSelector) { + default: + if (typeof object.principalSelector === "number") { + message.principalSelector = object.principalSelector; + break; + } + break; + case "PRINCIPAL_SELECTOR_UNSPECIFIED": + case 0: + message.principalSelector = 0; + break; + case "CLIENT_CERT_URI_SAN": + case 1: + message.principalSelector = 1; + break; + case "CLIENT_CERT_DNS_NAME_SAN": + case 2: + message.principalSelector = 2; + break; + case "CLIENT_CERT_COMMON_NAME": + case 3: + message.principalSelector = 3; + break; + } + if (object.principal != null) { + if (typeof object.principal !== "object") + throw TypeError(".google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.Principal.principal: object expected"); + message.principal = $root.google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.StringMatch.fromObject(object.principal); + } + return message; + }; + + /** + * Creates a plain object from a Principal message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.Principal + * @static + * @param {google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.Principal} message Principal + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Principal.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.principalSelector = options.enums === String ? "PRINCIPAL_SELECTOR_UNSPECIFIED" : 0; + object.principal = null; + } + if (message.principalSelector != null && message.hasOwnProperty("principalSelector")) + object.principalSelector = options.enums === String ? $root.google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.Principal.PrincipalSelector[message.principalSelector] === undefined ? message.principalSelector : $root.google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.Principal.PrincipalSelector[message.principalSelector] : message.principalSelector; + if (message.principal != null && message.hasOwnProperty("principal")) + object.principal = $root.google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.StringMatch.toObject(message.principal, options); + return object; + }; + + /** + * Converts this Principal to JSON. + * @function toJSON + * @memberof google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.Principal + * @instance + * @returns {Object.} JSON object + */ + Principal.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Principal + * @function getTypeUrl + * @memberof google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.Principal + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Principal.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.Principal"; + }; + + /** + * PrincipalSelector enum. + * @name google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.Principal.PrincipalSelector + * @enum {number} + * @property {number} PRINCIPAL_SELECTOR_UNSPECIFIED=0 PRINCIPAL_SELECTOR_UNSPECIFIED value + * @property {number} CLIENT_CERT_URI_SAN=1 CLIENT_CERT_URI_SAN value + * @property {number} CLIENT_CERT_DNS_NAME_SAN=2 CLIENT_CERT_DNS_NAME_SAN value + * @property {number} CLIENT_CERT_COMMON_NAME=3 CLIENT_CERT_COMMON_NAME value + */ + Principal.PrincipalSelector = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "PRINCIPAL_SELECTOR_UNSPECIFIED"] = 0; + values[valuesById[1] = "CLIENT_CERT_URI_SAN"] = 1; + values[valuesById[2] = "CLIENT_CERT_DNS_NAME_SAN"] = 2; + values[valuesById[3] = "CLIENT_CERT_COMMON_NAME"] = 3; + return values; + })(); + + return Principal; + })(); + + AuthzRule.From = (function() { + + /** + * Properties of a From. + * @memberof google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule + * @interface IFrom + * @property {Array.|null} [sources] From sources + * @property {Array.|null} [notSources] From notSources + */ + + /** + * Constructs a new From. + * @memberof google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule + * @classdesc Represents a From. + * @implements IFrom + * @constructor + * @param {google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.IFrom=} [properties] Properties to set + */ + function From(properties) { + this.sources = []; + this.notSources = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * From sources. + * @member {Array.} sources + * @memberof google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.From + * @instance + */ + From.prototype.sources = $util.emptyArray; + + /** + * From notSources. + * @member {Array.} notSources + * @memberof google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.From + * @instance + */ + From.prototype.notSources = $util.emptyArray; + + /** + * Creates a new From instance using the specified properties. + * @function create + * @memberof google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.From + * @static + * @param {google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.IFrom=} [properties] Properties to set + * @returns {google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.From} From instance + */ + From.create = function create(properties) { + return new From(properties); + }; + + /** + * Encodes the specified From message. Does not implicitly {@link google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.From.verify|verify} messages. + * @function encode + * @memberof google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.From + * @static + * @param {google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.IFrom} message From message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + From.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.sources != null && message.sources.length) + for (var i = 0; i < message.sources.length; ++i) + $root.google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.From.RequestSource.encode(message.sources[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.notSources != null && message.notSources.length) + for (var i = 0; i < message.notSources.length; ++i) + $root.google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.From.RequestSource.encode(message.notSources[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified From message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.From.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.From + * @static + * @param {google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.IFrom} message From message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + From.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a From message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.From + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.From} From + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + From.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.From(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.sources && message.sources.length)) + message.sources = []; + message.sources.push($root.google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.From.RequestSource.decode(reader, reader.uint32())); + break; + } + case 2: { + if (!(message.notSources && message.notSources.length)) + message.notSources = []; + message.notSources.push($root.google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.From.RequestSource.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a From message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.From + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.From} From + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + From.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a From message. + * @function verify + * @memberof google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.From + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + From.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.sources != null && message.hasOwnProperty("sources")) { + if (!Array.isArray(message.sources)) + return "sources: array expected"; + for (var i = 0; i < message.sources.length; ++i) { + var error = $root.google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.From.RequestSource.verify(message.sources[i]); + if (error) + return "sources." + error; + } + } + if (message.notSources != null && message.hasOwnProperty("notSources")) { + if (!Array.isArray(message.notSources)) + return "notSources: array expected"; + for (var i = 0; i < message.notSources.length; ++i) { + var error = $root.google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.From.RequestSource.verify(message.notSources[i]); + if (error) + return "notSources." + error; + } + } + return null; + }; + + /** + * Creates a From message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.From + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.From} From + */ + From.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.From) + return object; + var message = new $root.google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.From(); + if (object.sources) { + if (!Array.isArray(object.sources)) + throw TypeError(".google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.From.sources: array expected"); + message.sources = []; + for (var i = 0; i < object.sources.length; ++i) { + if (typeof object.sources[i] !== "object") + throw TypeError(".google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.From.sources: object expected"); + message.sources[i] = $root.google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.From.RequestSource.fromObject(object.sources[i]); + } + } + if (object.notSources) { + if (!Array.isArray(object.notSources)) + throw TypeError(".google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.From.notSources: array expected"); + message.notSources = []; + for (var i = 0; i < object.notSources.length; ++i) { + if (typeof object.notSources[i] !== "object") + throw TypeError(".google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.From.notSources: object expected"); + message.notSources[i] = $root.google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.From.RequestSource.fromObject(object.notSources[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a From message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.From + * @static + * @param {google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.From} message From + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + From.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.sources = []; + object.notSources = []; + } + if (message.sources && message.sources.length) { + object.sources = []; + for (var j = 0; j < message.sources.length; ++j) + object.sources[j] = $root.google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.From.RequestSource.toObject(message.sources[j], options); + } + if (message.notSources && message.notSources.length) { + object.notSources = []; + for (var j = 0; j < message.notSources.length; ++j) + object.notSources[j] = $root.google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.From.RequestSource.toObject(message.notSources[j], options); + } + return object; + }; + + /** + * Converts this From to JSON. + * @function toJSON + * @memberof google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.From + * @instance + * @returns {Object.} JSON object + */ + From.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for From + * @function getTypeUrl + * @memberof google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.From + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + From.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.From"; + }; + + From.RequestSource = (function() { + + /** + * Properties of a RequestSource. + * @memberof google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.From + * @interface IRequestSource + * @property {Array.|null} [principals] RequestSource principals + * @property {Array.|null} [ipBlocks] RequestSource ipBlocks + * @property {Array.|null} [resources] RequestSource resources + */ + + /** + * Constructs a new RequestSource. + * @memberof google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.From + * @classdesc Represents a RequestSource. + * @implements IRequestSource + * @constructor + * @param {google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.From.IRequestSource=} [properties] Properties to set + */ + function RequestSource(properties) { + this.principals = []; + this.ipBlocks = []; + this.resources = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RequestSource principals. + * @member {Array.} principals + * @memberof google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.From.RequestSource + * @instance + */ + RequestSource.prototype.principals = $util.emptyArray; + + /** + * RequestSource ipBlocks. + * @member {Array.} ipBlocks + * @memberof google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.From.RequestSource + * @instance + */ + RequestSource.prototype.ipBlocks = $util.emptyArray; + + /** + * RequestSource resources. + * @member {Array.} resources + * @memberof google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.From.RequestSource + * @instance + */ + RequestSource.prototype.resources = $util.emptyArray; + + /** + * Creates a new RequestSource instance using the specified properties. + * @function create + * @memberof google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.From.RequestSource + * @static + * @param {google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.From.IRequestSource=} [properties] Properties to set + * @returns {google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.From.RequestSource} RequestSource instance + */ + RequestSource.create = function create(properties) { + return new RequestSource(properties); + }; + + /** + * Encodes the specified RequestSource message. Does not implicitly {@link google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.From.RequestSource.verify|verify} messages. + * @function encode + * @memberof google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.From.RequestSource + * @static + * @param {google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.From.IRequestSource} message RequestSource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RequestSource.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.principals != null && message.principals.length) + for (var i = 0; i < message.principals.length; ++i) + $root.google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.Principal.encode(message.principals[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.ipBlocks != null && message.ipBlocks.length) + for (var i = 0; i < message.ipBlocks.length; ++i) + $root.google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.IpBlock.encode(message.ipBlocks[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.resources != null && message.resources.length) + for (var i = 0; i < message.resources.length; ++i) + $root.google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.RequestResource.encode(message.resources[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified RequestSource message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.From.RequestSource.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.From.RequestSource + * @static + * @param {google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.From.IRequestSource} message RequestSource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RequestSource.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RequestSource message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.From.RequestSource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.From.RequestSource} RequestSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RequestSource.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.From.RequestSource(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.principals && message.principals.length)) + message.principals = []; + message.principals.push($root.google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.Principal.decode(reader, reader.uint32())); + break; + } + case 2: { + if (!(message.ipBlocks && message.ipBlocks.length)) + message.ipBlocks = []; + message.ipBlocks.push($root.google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.IpBlock.decode(reader, reader.uint32())); + break; + } + case 3: { + if (!(message.resources && message.resources.length)) + message.resources = []; + message.resources.push($root.google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.RequestResource.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RequestSource message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.From.RequestSource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.From.RequestSource} RequestSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RequestSource.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RequestSource message. + * @function verify + * @memberof google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.From.RequestSource + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RequestSource.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.principals != null && message.hasOwnProperty("principals")) { + if (!Array.isArray(message.principals)) + return "principals: array expected"; + for (var i = 0; i < message.principals.length; ++i) { + var error = $root.google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.Principal.verify(message.principals[i]); + if (error) + return "principals." + error; + } + } + if (message.ipBlocks != null && message.hasOwnProperty("ipBlocks")) { + if (!Array.isArray(message.ipBlocks)) + return "ipBlocks: array expected"; + for (var i = 0; i < message.ipBlocks.length; ++i) { + var error = $root.google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.IpBlock.verify(message.ipBlocks[i]); + if (error) + return "ipBlocks." + error; + } + } + if (message.resources != null && message.hasOwnProperty("resources")) { + if (!Array.isArray(message.resources)) + return "resources: array expected"; + for (var i = 0; i < message.resources.length; ++i) { + var error = $root.google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.RequestResource.verify(message.resources[i]); + if (error) + return "resources." + error; + } + } + return null; + }; + + /** + * Creates a RequestSource message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.From.RequestSource + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.From.RequestSource} RequestSource + */ + RequestSource.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.From.RequestSource) + return object; + var message = new $root.google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.From.RequestSource(); + if (object.principals) { + if (!Array.isArray(object.principals)) + throw TypeError(".google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.From.RequestSource.principals: array expected"); + message.principals = []; + for (var i = 0; i < object.principals.length; ++i) { + if (typeof object.principals[i] !== "object") + throw TypeError(".google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.From.RequestSource.principals: object expected"); + message.principals[i] = $root.google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.Principal.fromObject(object.principals[i]); + } + } + if (object.ipBlocks) { + if (!Array.isArray(object.ipBlocks)) + throw TypeError(".google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.From.RequestSource.ipBlocks: array expected"); + message.ipBlocks = []; + for (var i = 0; i < object.ipBlocks.length; ++i) { + if (typeof object.ipBlocks[i] !== "object") + throw TypeError(".google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.From.RequestSource.ipBlocks: object expected"); + message.ipBlocks[i] = $root.google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.IpBlock.fromObject(object.ipBlocks[i]); + } + } + if (object.resources) { + if (!Array.isArray(object.resources)) + throw TypeError(".google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.From.RequestSource.resources: array expected"); + message.resources = []; + for (var i = 0; i < object.resources.length; ++i) { + if (typeof object.resources[i] !== "object") + throw TypeError(".google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.From.RequestSource.resources: object expected"); + message.resources[i] = $root.google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.RequestResource.fromObject(object.resources[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a RequestSource message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.From.RequestSource + * @static + * @param {google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.From.RequestSource} message RequestSource + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RequestSource.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.principals = []; + object.ipBlocks = []; + object.resources = []; + } + if (message.principals && message.principals.length) { + object.principals = []; + for (var j = 0; j < message.principals.length; ++j) + object.principals[j] = $root.google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.Principal.toObject(message.principals[j], options); + } + if (message.ipBlocks && message.ipBlocks.length) { + object.ipBlocks = []; + for (var j = 0; j < message.ipBlocks.length; ++j) + object.ipBlocks[j] = $root.google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.IpBlock.toObject(message.ipBlocks[j], options); + } + if (message.resources && message.resources.length) { + object.resources = []; + for (var j = 0; j < message.resources.length; ++j) + object.resources[j] = $root.google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.RequestResource.toObject(message.resources[j], options); + } + return object; + }; + + /** + * Converts this RequestSource to JSON. + * @function toJSON + * @memberof google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.From.RequestSource + * @instance + * @returns {Object.} JSON object + */ + RequestSource.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RequestSource + * @function getTypeUrl + * @memberof google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.From.RequestSource + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RequestSource.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.From.RequestSource"; + }; + + return RequestSource; + })(); + + return From; + })(); + + AuthzRule.To = (function() { + + /** + * Properties of a To. + * @memberof google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule + * @interface ITo + * @property {Array.|null} [operations] To operations + * @property {Array.|null} [notOperations] To notOperations + */ + + /** + * Constructs a new To. + * @memberof google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule + * @classdesc Represents a To. + * @implements ITo + * @constructor + * @param {google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.ITo=} [properties] Properties to set + */ + function To(properties) { + this.operations = []; + this.notOperations = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * To operations. + * @member {Array.} operations + * @memberof google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.To + * @instance + */ + To.prototype.operations = $util.emptyArray; + + /** + * To notOperations. + * @member {Array.} notOperations + * @memberof google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.To + * @instance + */ + To.prototype.notOperations = $util.emptyArray; + + /** + * Creates a new To instance using the specified properties. + * @function create + * @memberof google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.To + * @static + * @param {google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.ITo=} [properties] Properties to set + * @returns {google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.To} To instance + */ + To.create = function create(properties) { + return new To(properties); + }; + + /** + * Encodes the specified To message. Does not implicitly {@link google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.To.verify|verify} messages. + * @function encode + * @memberof google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.To + * @static + * @param {google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.ITo} message To message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + To.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.operations != null && message.operations.length) + for (var i = 0; i < message.operations.length; ++i) + $root.google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.To.RequestOperation.encode(message.operations[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.notOperations != null && message.notOperations.length) + for (var i = 0; i < message.notOperations.length; ++i) + $root.google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.To.RequestOperation.encode(message.notOperations[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified To message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.To.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.To + * @static + * @param {google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.ITo} message To message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + To.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a To message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.To + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.To} To + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + To.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.To(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.operations && message.operations.length)) + message.operations = []; + message.operations.push($root.google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.To.RequestOperation.decode(reader, reader.uint32())); + break; + } + case 2: { + if (!(message.notOperations && message.notOperations.length)) + message.notOperations = []; + message.notOperations.push($root.google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.To.RequestOperation.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a To message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.To + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.To} To + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + To.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a To message. + * @function verify + * @memberof google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.To + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + To.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.operations != null && message.hasOwnProperty("operations")) { + if (!Array.isArray(message.operations)) + return "operations: array expected"; + for (var i = 0; i < message.operations.length; ++i) { + var error = $root.google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.To.RequestOperation.verify(message.operations[i]); + if (error) + return "operations." + error; + } + } + if (message.notOperations != null && message.hasOwnProperty("notOperations")) { + if (!Array.isArray(message.notOperations)) + return "notOperations: array expected"; + for (var i = 0; i < message.notOperations.length; ++i) { + var error = $root.google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.To.RequestOperation.verify(message.notOperations[i]); + if (error) + return "notOperations." + error; + } + } + return null; + }; + + /** + * Creates a To message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.To + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.To} To + */ + To.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.To) + return object; + var message = new $root.google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.To(); + if (object.operations) { + if (!Array.isArray(object.operations)) + throw TypeError(".google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.To.operations: array expected"); + message.operations = []; + for (var i = 0; i < object.operations.length; ++i) { + if (typeof object.operations[i] !== "object") + throw TypeError(".google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.To.operations: object expected"); + message.operations[i] = $root.google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.To.RequestOperation.fromObject(object.operations[i]); + } + } + if (object.notOperations) { + if (!Array.isArray(object.notOperations)) + throw TypeError(".google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.To.notOperations: array expected"); + message.notOperations = []; + for (var i = 0; i < object.notOperations.length; ++i) { + if (typeof object.notOperations[i] !== "object") + throw TypeError(".google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.To.notOperations: object expected"); + message.notOperations[i] = $root.google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.To.RequestOperation.fromObject(object.notOperations[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a To message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.To + * @static + * @param {google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.To} message To + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + To.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.operations = []; + object.notOperations = []; + } + if (message.operations && message.operations.length) { + object.operations = []; + for (var j = 0; j < message.operations.length; ++j) + object.operations[j] = $root.google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.To.RequestOperation.toObject(message.operations[j], options); + } + if (message.notOperations && message.notOperations.length) { + object.notOperations = []; + for (var j = 0; j < message.notOperations.length; ++j) + object.notOperations[j] = $root.google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.To.RequestOperation.toObject(message.notOperations[j], options); + } + return object; + }; + + /** + * Converts this To to JSON. + * @function toJSON + * @memberof google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.To + * @instance + * @returns {Object.} JSON object + */ + To.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for To + * @function getTypeUrl + * @memberof google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.To + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + To.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.To"; + }; + + To.RequestOperation = (function() { + + /** + * Properties of a RequestOperation. + * @memberof google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.To + * @interface IRequestOperation + * @property {google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.To.RequestOperation.IHeaderSet|null} [headerSet] RequestOperation headerSet + * @property {Array.|null} [hosts] RequestOperation hosts + * @property {Array.|null} [paths] RequestOperation paths + * @property {Array.|null} [methods] RequestOperation methods + * @property {google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.To.RequestOperation.IMCP|null} [mcp] RequestOperation mcp + */ + + /** + * Constructs a new RequestOperation. + * @memberof google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.To + * @classdesc Represents a RequestOperation. + * @implements IRequestOperation + * @constructor + * @param {google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.To.IRequestOperation=} [properties] Properties to set + */ + function RequestOperation(properties) { + this.hosts = []; + this.paths = []; + this.methods = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RequestOperation headerSet. + * @member {google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.To.RequestOperation.IHeaderSet|null|undefined} headerSet + * @memberof google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.To.RequestOperation + * @instance + */ + RequestOperation.prototype.headerSet = null; + + /** + * RequestOperation hosts. + * @member {Array.} hosts + * @memberof google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.To.RequestOperation + * @instance + */ + RequestOperation.prototype.hosts = $util.emptyArray; + + /** + * RequestOperation paths. + * @member {Array.} paths + * @memberof google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.To.RequestOperation + * @instance + */ + RequestOperation.prototype.paths = $util.emptyArray; + + /** + * RequestOperation methods. + * @member {Array.} methods + * @memberof google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.To.RequestOperation + * @instance + */ + RequestOperation.prototype.methods = $util.emptyArray; + + /** + * RequestOperation mcp. + * @member {google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.To.RequestOperation.IMCP|null|undefined} mcp + * @memberof google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.To.RequestOperation + * @instance + */ + RequestOperation.prototype.mcp = null; + + /** + * Creates a new RequestOperation instance using the specified properties. + * @function create + * @memberof google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.To.RequestOperation + * @static + * @param {google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.To.IRequestOperation=} [properties] Properties to set + * @returns {google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.To.RequestOperation} RequestOperation instance + */ + RequestOperation.create = function create(properties) { + return new RequestOperation(properties); + }; + + /** + * Encodes the specified RequestOperation message. Does not implicitly {@link google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.To.RequestOperation.verify|verify} messages. + * @function encode + * @memberof google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.To.RequestOperation + * @static + * @param {google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.To.IRequestOperation} message RequestOperation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RequestOperation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.headerSet != null && Object.hasOwnProperty.call(message, "headerSet")) + $root.google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.To.RequestOperation.HeaderSet.encode(message.headerSet, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.hosts != null && message.hosts.length) + for (var i = 0; i < message.hosts.length; ++i) + $root.google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.StringMatch.encode(message.hosts[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.paths != null && message.paths.length) + for (var i = 0; i < message.paths.length; ++i) + $root.google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.StringMatch.encode(message.paths[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.methods != null && message.methods.length) + for (var i = 0; i < message.methods.length; ++i) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.methods[i]); + if (message.mcp != null && Object.hasOwnProperty.call(message, "mcp")) + $root.google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.To.RequestOperation.MCP.encode(message.mcp, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified RequestOperation message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.To.RequestOperation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.To.RequestOperation + * @static + * @param {google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.To.IRequestOperation} message RequestOperation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RequestOperation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RequestOperation message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.To.RequestOperation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.To.RequestOperation} RequestOperation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RequestOperation.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.To.RequestOperation(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.headerSet = $root.google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.To.RequestOperation.HeaderSet.decode(reader, reader.uint32()); + break; + } + case 2: { + if (!(message.hosts && message.hosts.length)) + message.hosts = []; + message.hosts.push($root.google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.StringMatch.decode(reader, reader.uint32())); + break; + } + case 3: { + if (!(message.paths && message.paths.length)) + message.paths = []; + message.paths.push($root.google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.StringMatch.decode(reader, reader.uint32())); + break; + } + case 4: { + if (!(message.methods && message.methods.length)) + message.methods = []; + message.methods.push(reader.string()); + break; + } + case 5: { + message.mcp = $root.google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.To.RequestOperation.MCP.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RequestOperation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.To.RequestOperation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.To.RequestOperation} RequestOperation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RequestOperation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RequestOperation message. + * @function verify + * @memberof google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.To.RequestOperation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RequestOperation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.headerSet != null && message.hasOwnProperty("headerSet")) { + var error = $root.google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.To.RequestOperation.HeaderSet.verify(message.headerSet); + if (error) + return "headerSet." + error; + } + if (message.hosts != null && message.hasOwnProperty("hosts")) { + if (!Array.isArray(message.hosts)) + return "hosts: array expected"; + for (var i = 0; i < message.hosts.length; ++i) { + var error = $root.google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.StringMatch.verify(message.hosts[i]); + if (error) + return "hosts." + error; + } + } + if (message.paths != null && message.hasOwnProperty("paths")) { + if (!Array.isArray(message.paths)) + return "paths: array expected"; + for (var i = 0; i < message.paths.length; ++i) { + var error = $root.google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.StringMatch.verify(message.paths[i]); + if (error) + return "paths." + error; + } + } + if (message.methods != null && message.hasOwnProperty("methods")) { + if (!Array.isArray(message.methods)) + return "methods: array expected"; + for (var i = 0; i < message.methods.length; ++i) + if (!$util.isString(message.methods[i])) + return "methods: string[] expected"; + } + if (message.mcp != null && message.hasOwnProperty("mcp")) { + var error = $root.google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.To.RequestOperation.MCP.verify(message.mcp); + if (error) + return "mcp." + error; + } + return null; + }; + + /** + * Creates a RequestOperation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.To.RequestOperation + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.To.RequestOperation} RequestOperation + */ + RequestOperation.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.To.RequestOperation) + return object; + var message = new $root.google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.To.RequestOperation(); + if (object.headerSet != null) { + if (typeof object.headerSet !== "object") + throw TypeError(".google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.To.RequestOperation.headerSet: object expected"); + message.headerSet = $root.google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.To.RequestOperation.HeaderSet.fromObject(object.headerSet); + } + if (object.hosts) { + if (!Array.isArray(object.hosts)) + throw TypeError(".google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.To.RequestOperation.hosts: array expected"); + message.hosts = []; + for (var i = 0; i < object.hosts.length; ++i) { + if (typeof object.hosts[i] !== "object") + throw TypeError(".google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.To.RequestOperation.hosts: object expected"); + message.hosts[i] = $root.google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.StringMatch.fromObject(object.hosts[i]); + } + } + if (object.paths) { + if (!Array.isArray(object.paths)) + throw TypeError(".google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.To.RequestOperation.paths: array expected"); + message.paths = []; + for (var i = 0; i < object.paths.length; ++i) { + if (typeof object.paths[i] !== "object") + throw TypeError(".google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.To.RequestOperation.paths: object expected"); + message.paths[i] = $root.google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.StringMatch.fromObject(object.paths[i]); + } + } + if (object.methods) { + if (!Array.isArray(object.methods)) + throw TypeError(".google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.To.RequestOperation.methods: array expected"); + message.methods = []; + for (var i = 0; i < object.methods.length; ++i) + message.methods[i] = String(object.methods[i]); + } + if (object.mcp != null) { + if (typeof object.mcp !== "object") + throw TypeError(".google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.To.RequestOperation.mcp: object expected"); + message.mcp = $root.google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.To.RequestOperation.MCP.fromObject(object.mcp); + } + return message; + }; + + /** + * Creates a plain object from a RequestOperation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.To.RequestOperation + * @static + * @param {google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.To.RequestOperation} message RequestOperation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RequestOperation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.hosts = []; + object.paths = []; + object.methods = []; + } + if (options.defaults) { + object.headerSet = null; + object.mcp = null; + } + if (message.headerSet != null && message.hasOwnProperty("headerSet")) + object.headerSet = $root.google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.To.RequestOperation.HeaderSet.toObject(message.headerSet, options); + if (message.hosts && message.hosts.length) { + object.hosts = []; + for (var j = 0; j < message.hosts.length; ++j) + object.hosts[j] = $root.google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.StringMatch.toObject(message.hosts[j], options); + } + if (message.paths && message.paths.length) { + object.paths = []; + for (var j = 0; j < message.paths.length; ++j) + object.paths[j] = $root.google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.StringMatch.toObject(message.paths[j], options); + } + if (message.methods && message.methods.length) { + object.methods = []; + for (var j = 0; j < message.methods.length; ++j) + object.methods[j] = message.methods[j]; + } + if (message.mcp != null && message.hasOwnProperty("mcp")) + object.mcp = $root.google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.To.RequestOperation.MCP.toObject(message.mcp, options); + return object; + }; + + /** + * Converts this RequestOperation to JSON. + * @function toJSON + * @memberof google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.To.RequestOperation + * @instance + * @returns {Object.} JSON object + */ + RequestOperation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RequestOperation + * @function getTypeUrl + * @memberof google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.To.RequestOperation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RequestOperation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.To.RequestOperation"; + }; + + RequestOperation.HeaderSet = (function() { + + /** + * Properties of a HeaderSet. + * @memberof google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.To.RequestOperation + * @interface IHeaderSet + * @property {Array.|null} [headers] HeaderSet headers + */ + + /** + * Constructs a new HeaderSet. + * @memberof google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.To.RequestOperation + * @classdesc Represents a HeaderSet. + * @implements IHeaderSet + * @constructor + * @param {google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.To.RequestOperation.IHeaderSet=} [properties] Properties to set + */ + function HeaderSet(properties) { + this.headers = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * HeaderSet headers. + * @member {Array.} headers + * @memberof google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.To.RequestOperation.HeaderSet + * @instance + */ + HeaderSet.prototype.headers = $util.emptyArray; + + /** + * Creates a new HeaderSet instance using the specified properties. + * @function create + * @memberof google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.To.RequestOperation.HeaderSet + * @static + * @param {google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.To.RequestOperation.IHeaderSet=} [properties] Properties to set + * @returns {google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.To.RequestOperation.HeaderSet} HeaderSet instance + */ + HeaderSet.create = function create(properties) { + return new HeaderSet(properties); + }; + + /** + * Encodes the specified HeaderSet message. Does not implicitly {@link google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.To.RequestOperation.HeaderSet.verify|verify} messages. + * @function encode + * @memberof google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.To.RequestOperation.HeaderSet + * @static + * @param {google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.To.RequestOperation.IHeaderSet} message HeaderSet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HeaderSet.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.headers != null && message.headers.length) + for (var i = 0; i < message.headers.length; ++i) + $root.google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.HeaderMatch.encode(message.headers[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified HeaderSet message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.To.RequestOperation.HeaderSet.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.To.RequestOperation.HeaderSet + * @static + * @param {google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.To.RequestOperation.IHeaderSet} message HeaderSet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HeaderSet.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a HeaderSet message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.To.RequestOperation.HeaderSet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.To.RequestOperation.HeaderSet} HeaderSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HeaderSet.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.To.RequestOperation.HeaderSet(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.headers && message.headers.length)) + message.headers = []; + message.headers.push($root.google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.HeaderMatch.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a HeaderSet message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.To.RequestOperation.HeaderSet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.To.RequestOperation.HeaderSet} HeaderSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HeaderSet.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a HeaderSet message. + * @function verify + * @memberof google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.To.RequestOperation.HeaderSet + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + HeaderSet.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.headers != null && message.hasOwnProperty("headers")) { + if (!Array.isArray(message.headers)) + return "headers: array expected"; + for (var i = 0; i < message.headers.length; ++i) { + var error = $root.google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.HeaderMatch.verify(message.headers[i]); + if (error) + return "headers." + error; + } + } + return null; + }; + + /** + * Creates a HeaderSet message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.To.RequestOperation.HeaderSet + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.To.RequestOperation.HeaderSet} HeaderSet + */ + HeaderSet.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.To.RequestOperation.HeaderSet) + return object; + var message = new $root.google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.To.RequestOperation.HeaderSet(); + if (object.headers) { + if (!Array.isArray(object.headers)) + throw TypeError(".google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.To.RequestOperation.HeaderSet.headers: array expected"); + message.headers = []; + for (var i = 0; i < object.headers.length; ++i) { + if (typeof object.headers[i] !== "object") + throw TypeError(".google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.To.RequestOperation.HeaderSet.headers: object expected"); + message.headers[i] = $root.google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.HeaderMatch.fromObject(object.headers[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a HeaderSet message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.To.RequestOperation.HeaderSet + * @static + * @param {google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.To.RequestOperation.HeaderSet} message HeaderSet + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + HeaderSet.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.headers = []; + if (message.headers && message.headers.length) { + object.headers = []; + for (var j = 0; j < message.headers.length; ++j) + object.headers[j] = $root.google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.HeaderMatch.toObject(message.headers[j], options); + } + return object; + }; + + /** + * Converts this HeaderSet to JSON. + * @function toJSON + * @memberof google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.To.RequestOperation.HeaderSet + * @instance + * @returns {Object.} JSON object + */ + HeaderSet.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for HeaderSet + * @function getTypeUrl + * @memberof google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.To.RequestOperation.HeaderSet + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + HeaderSet.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.To.RequestOperation.HeaderSet"; + }; + + return HeaderSet; + })(); + + RequestOperation.MCPMethod = (function() { + + /** + * Properties of a MCPMethod. + * @memberof google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.To.RequestOperation + * @interface IMCPMethod + * @property {string|null} [name] MCPMethod name + * @property {Array.|null} [params] MCPMethod params + */ + + /** + * Constructs a new MCPMethod. + * @memberof google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.To.RequestOperation + * @classdesc Represents a MCPMethod. + * @implements IMCPMethod + * @constructor + * @param {google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.To.RequestOperation.IMCPMethod=} [properties] Properties to set + */ + function MCPMethod(properties) { + this.params = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MCPMethod name. + * @member {string} name + * @memberof google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.To.RequestOperation.MCPMethod + * @instance + */ + MCPMethod.prototype.name = ""; + + /** + * MCPMethod params. + * @member {Array.} params + * @memberof google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.To.RequestOperation.MCPMethod + * @instance + */ + MCPMethod.prototype.params = $util.emptyArray; + + /** + * Creates a new MCPMethod instance using the specified properties. + * @function create + * @memberof google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.To.RequestOperation.MCPMethod + * @static + * @param {google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.To.RequestOperation.IMCPMethod=} [properties] Properties to set + * @returns {google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.To.RequestOperation.MCPMethod} MCPMethod instance + */ + MCPMethod.create = function create(properties) { + return new MCPMethod(properties); + }; + + /** + * Encodes the specified MCPMethod message. Does not implicitly {@link google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.To.RequestOperation.MCPMethod.verify|verify} messages. + * @function encode + * @memberof google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.To.RequestOperation.MCPMethod + * @static + * @param {google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.To.RequestOperation.IMCPMethod} message MCPMethod message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MCPMethod.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.params != null && message.params.length) + for (var i = 0; i < message.params.length; ++i) + $root.google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.StringMatch.encode(message.params[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified MCPMethod message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.To.RequestOperation.MCPMethod.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.To.RequestOperation.MCPMethod + * @static + * @param {google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.To.RequestOperation.IMCPMethod} message MCPMethod message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MCPMethod.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MCPMethod message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.To.RequestOperation.MCPMethod + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.To.RequestOperation.MCPMethod} MCPMethod + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MCPMethod.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.To.RequestOperation.MCPMethod(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + if (!(message.params && message.params.length)) + message.params = []; + message.params.push($root.google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.StringMatch.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MCPMethod message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.To.RequestOperation.MCPMethod + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.To.RequestOperation.MCPMethod} MCPMethod + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MCPMethod.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MCPMethod message. + * @function verify + * @memberof google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.To.RequestOperation.MCPMethod + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MCPMethod.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.params != null && message.hasOwnProperty("params")) { + if (!Array.isArray(message.params)) + return "params: array expected"; + for (var i = 0; i < message.params.length; ++i) { + var error = $root.google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.StringMatch.verify(message.params[i]); + if (error) + return "params." + error; + } + } + return null; + }; + + /** + * Creates a MCPMethod message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.To.RequestOperation.MCPMethod + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.To.RequestOperation.MCPMethod} MCPMethod + */ + MCPMethod.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.To.RequestOperation.MCPMethod) + return object; + var message = new $root.google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.To.RequestOperation.MCPMethod(); + if (object.name != null) + message.name = String(object.name); + if (object.params) { + if (!Array.isArray(object.params)) + throw TypeError(".google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.To.RequestOperation.MCPMethod.params: array expected"); + message.params = []; + for (var i = 0; i < object.params.length; ++i) { + if (typeof object.params[i] !== "object") + throw TypeError(".google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.To.RequestOperation.MCPMethod.params: object expected"); + message.params[i] = $root.google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.StringMatch.fromObject(object.params[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a MCPMethod message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.To.RequestOperation.MCPMethod + * @static + * @param {google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.To.RequestOperation.MCPMethod} message MCPMethod + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MCPMethod.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.params = []; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.params && message.params.length) { + object.params = []; + for (var j = 0; j < message.params.length; ++j) + object.params[j] = $root.google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.StringMatch.toObject(message.params[j], options); + } + return object; + }; + + /** + * Converts this MCPMethod to JSON. + * @function toJSON + * @memberof google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.To.RequestOperation.MCPMethod + * @instance + * @returns {Object.} JSON object + */ + MCPMethod.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MCPMethod + * @function getTypeUrl + * @memberof google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.To.RequestOperation.MCPMethod + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MCPMethod.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.To.RequestOperation.MCPMethod"; + }; + + return MCPMethod; + })(); + + RequestOperation.MCP = (function() { + + /** + * Properties of a MCP. + * @memberof google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.To.RequestOperation + * @interface IMCP + * @property {google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.To.RequestOperation.BaseProtocolMethodsOption|null} [baseProtocolMethodsOption] MCP baseProtocolMethodsOption + * @property {Array.|null} [methods] MCP methods + */ + + /** + * Constructs a new MCP. + * @memberof google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.To.RequestOperation + * @classdesc Represents a MCP. + * @implements IMCP + * @constructor + * @param {google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.To.RequestOperation.IMCP=} [properties] Properties to set + */ + function MCP(properties) { + this.methods = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MCP baseProtocolMethodsOption. + * @member {google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.To.RequestOperation.BaseProtocolMethodsOption} baseProtocolMethodsOption + * @memberof google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.To.RequestOperation.MCP + * @instance + */ + MCP.prototype.baseProtocolMethodsOption = 0; + + /** + * MCP methods. + * @member {Array.} methods + * @memberof google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.To.RequestOperation.MCP + * @instance + */ + MCP.prototype.methods = $util.emptyArray; + + /** + * Creates a new MCP instance using the specified properties. + * @function create + * @memberof google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.To.RequestOperation.MCP + * @static + * @param {google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.To.RequestOperation.IMCP=} [properties] Properties to set + * @returns {google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.To.RequestOperation.MCP} MCP instance + */ + MCP.create = function create(properties) { + return new MCP(properties); + }; + + /** + * Encodes the specified MCP message. Does not implicitly {@link google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.To.RequestOperation.MCP.verify|verify} messages. + * @function encode + * @memberof google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.To.RequestOperation.MCP + * @static + * @param {google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.To.RequestOperation.IMCP} message MCP message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MCP.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.baseProtocolMethodsOption != null && Object.hasOwnProperty.call(message, "baseProtocolMethodsOption")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.baseProtocolMethodsOption); + if (message.methods != null && message.methods.length) + for (var i = 0; i < message.methods.length; ++i) + $root.google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.To.RequestOperation.MCPMethod.encode(message.methods[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified MCP message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.To.RequestOperation.MCP.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.To.RequestOperation.MCP + * @static + * @param {google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.To.RequestOperation.IMCP} message MCP message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MCP.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MCP message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.To.RequestOperation.MCP + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.To.RequestOperation.MCP} MCP + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MCP.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.To.RequestOperation.MCP(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.baseProtocolMethodsOption = reader.int32(); + break; + } + case 2: { + if (!(message.methods && message.methods.length)) + message.methods = []; + message.methods.push($root.google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.To.RequestOperation.MCPMethod.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MCP message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.To.RequestOperation.MCP + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.To.RequestOperation.MCP} MCP + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MCP.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MCP message. + * @function verify + * @memberof google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.To.RequestOperation.MCP + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MCP.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.baseProtocolMethodsOption != null && message.hasOwnProperty("baseProtocolMethodsOption")) + switch (message.baseProtocolMethodsOption) { + default: + return "baseProtocolMethodsOption: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.methods != null && message.hasOwnProperty("methods")) { + if (!Array.isArray(message.methods)) + return "methods: array expected"; + for (var i = 0; i < message.methods.length; ++i) { + var error = $root.google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.To.RequestOperation.MCPMethod.verify(message.methods[i]); + if (error) + return "methods." + error; + } + } + return null; + }; + + /** + * Creates a MCP message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.To.RequestOperation.MCP + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.To.RequestOperation.MCP} MCP + */ + MCP.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.To.RequestOperation.MCP) + return object; + var message = new $root.google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.To.RequestOperation.MCP(); + switch (object.baseProtocolMethodsOption) { + default: + if (typeof object.baseProtocolMethodsOption === "number") { + message.baseProtocolMethodsOption = object.baseProtocolMethodsOption; + break; + } + break; + case "BASE_PROTOCOL_METHODS_OPTION_UNSPECIFIED": + case 0: + message.baseProtocolMethodsOption = 0; + break; + case "SKIP_BASE_PROTOCOL_METHODS": + case 1: + message.baseProtocolMethodsOption = 1; + break; + case "MATCH_BASE_PROTOCOL_METHODS": + case 2: + message.baseProtocolMethodsOption = 2; + break; + } + if (object.methods) { + if (!Array.isArray(object.methods)) + throw TypeError(".google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.To.RequestOperation.MCP.methods: array expected"); + message.methods = []; + for (var i = 0; i < object.methods.length; ++i) { + if (typeof object.methods[i] !== "object") + throw TypeError(".google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.To.RequestOperation.MCP.methods: object expected"); + message.methods[i] = $root.google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.To.RequestOperation.MCPMethod.fromObject(object.methods[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a MCP message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.To.RequestOperation.MCP + * @static + * @param {google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.To.RequestOperation.MCP} message MCP + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MCP.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.methods = []; + if (options.defaults) + object.baseProtocolMethodsOption = options.enums === String ? "BASE_PROTOCOL_METHODS_OPTION_UNSPECIFIED" : 0; + if (message.baseProtocolMethodsOption != null && message.hasOwnProperty("baseProtocolMethodsOption")) + object.baseProtocolMethodsOption = options.enums === String ? $root.google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.To.RequestOperation.BaseProtocolMethodsOption[message.baseProtocolMethodsOption] === undefined ? message.baseProtocolMethodsOption : $root.google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.To.RequestOperation.BaseProtocolMethodsOption[message.baseProtocolMethodsOption] : message.baseProtocolMethodsOption; + if (message.methods && message.methods.length) { + object.methods = []; + for (var j = 0; j < message.methods.length; ++j) + object.methods[j] = $root.google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.To.RequestOperation.MCPMethod.toObject(message.methods[j], options); + } + return object; + }; + + /** + * Converts this MCP to JSON. + * @function toJSON + * @memberof google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.To.RequestOperation.MCP + * @instance + * @returns {Object.} JSON object + */ + MCP.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MCP + * @function getTypeUrl + * @memberof google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.To.RequestOperation.MCP + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MCP.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.To.RequestOperation.MCP"; + }; + + return MCP; + })(); + + /** + * BaseProtocolMethodsOption enum. + * @name google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.To.RequestOperation.BaseProtocolMethodsOption + * @enum {number} + * @property {number} BASE_PROTOCOL_METHODS_OPTION_UNSPECIFIED=0 BASE_PROTOCOL_METHODS_OPTION_UNSPECIFIED value + * @property {number} SKIP_BASE_PROTOCOL_METHODS=1 SKIP_BASE_PROTOCOL_METHODS value + * @property {number} MATCH_BASE_PROTOCOL_METHODS=2 MATCH_BASE_PROTOCOL_METHODS value + */ + RequestOperation.BaseProtocolMethodsOption = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "BASE_PROTOCOL_METHODS_OPTION_UNSPECIFIED"] = 0; + values[valuesById[1] = "SKIP_BASE_PROTOCOL_METHODS"] = 1; + values[valuesById[2] = "MATCH_BASE_PROTOCOL_METHODS"] = 2; + return values; + })(); + + return RequestOperation; + })(); + + return To; + })(); + + return AuthzRule; + })(); + + AuthzPolicy.CustomProvider = (function() { + + /** + * Properties of a CustomProvider. + * @memberof google.cloud.networksecurity.v1.AuthzPolicy + * @interface ICustomProvider + * @property {google.cloud.networksecurity.v1.AuthzPolicy.CustomProvider.ICloudIap|null} [cloudIap] CustomProvider cloudIap + * @property {google.cloud.networksecurity.v1.AuthzPolicy.CustomProvider.IAuthzExtension|null} [authzExtension] CustomProvider authzExtension + */ + + /** + * Constructs a new CustomProvider. + * @memberof google.cloud.networksecurity.v1.AuthzPolicy + * @classdesc Represents a CustomProvider. + * @implements ICustomProvider + * @constructor + * @param {google.cloud.networksecurity.v1.AuthzPolicy.ICustomProvider=} [properties] Properties to set + */ + function CustomProvider(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CustomProvider cloudIap. + * @member {google.cloud.networksecurity.v1.AuthzPolicy.CustomProvider.ICloudIap|null|undefined} cloudIap + * @memberof google.cloud.networksecurity.v1.AuthzPolicy.CustomProvider + * @instance + */ + CustomProvider.prototype.cloudIap = null; + + /** + * CustomProvider authzExtension. + * @member {google.cloud.networksecurity.v1.AuthzPolicy.CustomProvider.IAuthzExtension|null|undefined} authzExtension + * @memberof google.cloud.networksecurity.v1.AuthzPolicy.CustomProvider + * @instance + */ + CustomProvider.prototype.authzExtension = null; + + /** + * Creates a new CustomProvider instance using the specified properties. + * @function create + * @memberof google.cloud.networksecurity.v1.AuthzPolicy.CustomProvider + * @static + * @param {google.cloud.networksecurity.v1.AuthzPolicy.ICustomProvider=} [properties] Properties to set + * @returns {google.cloud.networksecurity.v1.AuthzPolicy.CustomProvider} CustomProvider instance + */ + CustomProvider.create = function create(properties) { + return new CustomProvider(properties); + }; + + /** + * Encodes the specified CustomProvider message. Does not implicitly {@link google.cloud.networksecurity.v1.AuthzPolicy.CustomProvider.verify|verify} messages. + * @function encode + * @memberof google.cloud.networksecurity.v1.AuthzPolicy.CustomProvider + * @static + * @param {google.cloud.networksecurity.v1.AuthzPolicy.ICustomProvider} message CustomProvider message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomProvider.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.cloudIap != null && Object.hasOwnProperty.call(message, "cloudIap")) + $root.google.cloud.networksecurity.v1.AuthzPolicy.CustomProvider.CloudIap.encode(message.cloudIap, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.authzExtension != null && Object.hasOwnProperty.call(message, "authzExtension")) + $root.google.cloud.networksecurity.v1.AuthzPolicy.CustomProvider.AuthzExtension.encode(message.authzExtension, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CustomProvider message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.AuthzPolicy.CustomProvider.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.networksecurity.v1.AuthzPolicy.CustomProvider + * @static + * @param {google.cloud.networksecurity.v1.AuthzPolicy.ICustomProvider} message CustomProvider message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomProvider.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CustomProvider message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.networksecurity.v1.AuthzPolicy.CustomProvider + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.networksecurity.v1.AuthzPolicy.CustomProvider} CustomProvider + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CustomProvider.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networksecurity.v1.AuthzPolicy.CustomProvider(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.cloudIap = $root.google.cloud.networksecurity.v1.AuthzPolicy.CustomProvider.CloudIap.decode(reader, reader.uint32()); + break; + } + case 2: { + message.authzExtension = $root.google.cloud.networksecurity.v1.AuthzPolicy.CustomProvider.AuthzExtension.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CustomProvider message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.networksecurity.v1.AuthzPolicy.CustomProvider + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.networksecurity.v1.AuthzPolicy.CustomProvider} CustomProvider + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CustomProvider.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CustomProvider message. + * @function verify + * @memberof google.cloud.networksecurity.v1.AuthzPolicy.CustomProvider + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CustomProvider.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.cloudIap != null && message.hasOwnProperty("cloudIap")) { + var error = $root.google.cloud.networksecurity.v1.AuthzPolicy.CustomProvider.CloudIap.verify(message.cloudIap); + if (error) + return "cloudIap." + error; + } + if (message.authzExtension != null && message.hasOwnProperty("authzExtension")) { + var error = $root.google.cloud.networksecurity.v1.AuthzPolicy.CustomProvider.AuthzExtension.verify(message.authzExtension); + if (error) + return "authzExtension." + error; + } + return null; + }; + + /** + * Creates a CustomProvider message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.networksecurity.v1.AuthzPolicy.CustomProvider + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.networksecurity.v1.AuthzPolicy.CustomProvider} CustomProvider + */ + CustomProvider.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networksecurity.v1.AuthzPolicy.CustomProvider) + return object; + var message = new $root.google.cloud.networksecurity.v1.AuthzPolicy.CustomProvider(); + if (object.cloudIap != null) { + if (typeof object.cloudIap !== "object") + throw TypeError(".google.cloud.networksecurity.v1.AuthzPolicy.CustomProvider.cloudIap: object expected"); + message.cloudIap = $root.google.cloud.networksecurity.v1.AuthzPolicy.CustomProvider.CloudIap.fromObject(object.cloudIap); + } + if (object.authzExtension != null) { + if (typeof object.authzExtension !== "object") + throw TypeError(".google.cloud.networksecurity.v1.AuthzPolicy.CustomProvider.authzExtension: object expected"); + message.authzExtension = $root.google.cloud.networksecurity.v1.AuthzPolicy.CustomProvider.AuthzExtension.fromObject(object.authzExtension); + } + return message; + }; + + /** + * Creates a plain object from a CustomProvider message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.networksecurity.v1.AuthzPolicy.CustomProvider + * @static + * @param {google.cloud.networksecurity.v1.AuthzPolicy.CustomProvider} message CustomProvider + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CustomProvider.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.cloudIap = null; + object.authzExtension = null; + } + if (message.cloudIap != null && message.hasOwnProperty("cloudIap")) + object.cloudIap = $root.google.cloud.networksecurity.v1.AuthzPolicy.CustomProvider.CloudIap.toObject(message.cloudIap, options); + if (message.authzExtension != null && message.hasOwnProperty("authzExtension")) + object.authzExtension = $root.google.cloud.networksecurity.v1.AuthzPolicy.CustomProvider.AuthzExtension.toObject(message.authzExtension, options); + return object; + }; + + /** + * Converts this CustomProvider to JSON. + * @function toJSON + * @memberof google.cloud.networksecurity.v1.AuthzPolicy.CustomProvider + * @instance + * @returns {Object.} JSON object + */ + CustomProvider.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CustomProvider + * @function getTypeUrl + * @memberof google.cloud.networksecurity.v1.AuthzPolicy.CustomProvider + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CustomProvider.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.networksecurity.v1.AuthzPolicy.CustomProvider"; + }; + + CustomProvider.CloudIap = (function() { + + /** + * Properties of a CloudIap. + * @memberof google.cloud.networksecurity.v1.AuthzPolicy.CustomProvider + * @interface ICloudIap + */ + + /** + * Constructs a new CloudIap. + * @memberof google.cloud.networksecurity.v1.AuthzPolicy.CustomProvider + * @classdesc Represents a CloudIap. + * @implements ICloudIap + * @constructor + * @param {google.cloud.networksecurity.v1.AuthzPolicy.CustomProvider.ICloudIap=} [properties] Properties to set + */ + function CloudIap(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Creates a new CloudIap instance using the specified properties. + * @function create + * @memberof google.cloud.networksecurity.v1.AuthzPolicy.CustomProvider.CloudIap + * @static + * @param {google.cloud.networksecurity.v1.AuthzPolicy.CustomProvider.ICloudIap=} [properties] Properties to set + * @returns {google.cloud.networksecurity.v1.AuthzPolicy.CustomProvider.CloudIap} CloudIap instance + */ + CloudIap.create = function create(properties) { + return new CloudIap(properties); + }; + + /** + * Encodes the specified CloudIap message. Does not implicitly {@link google.cloud.networksecurity.v1.AuthzPolicy.CustomProvider.CloudIap.verify|verify} messages. + * @function encode + * @memberof google.cloud.networksecurity.v1.AuthzPolicy.CustomProvider.CloudIap + * @static + * @param {google.cloud.networksecurity.v1.AuthzPolicy.CustomProvider.ICloudIap} message CloudIap message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CloudIap.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified CloudIap message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.AuthzPolicy.CustomProvider.CloudIap.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.networksecurity.v1.AuthzPolicy.CustomProvider.CloudIap + * @static + * @param {google.cloud.networksecurity.v1.AuthzPolicy.CustomProvider.ICloudIap} message CloudIap message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CloudIap.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CloudIap message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.networksecurity.v1.AuthzPolicy.CustomProvider.CloudIap + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.networksecurity.v1.AuthzPolicy.CustomProvider.CloudIap} CloudIap + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CloudIap.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networksecurity.v1.AuthzPolicy.CustomProvider.CloudIap(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CloudIap message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.networksecurity.v1.AuthzPolicy.CustomProvider.CloudIap + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.networksecurity.v1.AuthzPolicy.CustomProvider.CloudIap} CloudIap + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CloudIap.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CloudIap message. + * @function verify + * @memberof google.cloud.networksecurity.v1.AuthzPolicy.CustomProvider.CloudIap + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CloudIap.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a CloudIap message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.networksecurity.v1.AuthzPolicy.CustomProvider.CloudIap + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.networksecurity.v1.AuthzPolicy.CustomProvider.CloudIap} CloudIap + */ + CloudIap.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networksecurity.v1.AuthzPolicy.CustomProvider.CloudIap) + return object; + return new $root.google.cloud.networksecurity.v1.AuthzPolicy.CustomProvider.CloudIap(); + }; + + /** + * Creates a plain object from a CloudIap message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.networksecurity.v1.AuthzPolicy.CustomProvider.CloudIap + * @static + * @param {google.cloud.networksecurity.v1.AuthzPolicy.CustomProvider.CloudIap} message CloudIap + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CloudIap.toObject = function toObject() { + return {}; + }; + + /** + * Converts this CloudIap to JSON. + * @function toJSON + * @memberof google.cloud.networksecurity.v1.AuthzPolicy.CustomProvider.CloudIap + * @instance + * @returns {Object.} JSON object + */ + CloudIap.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CloudIap + * @function getTypeUrl + * @memberof google.cloud.networksecurity.v1.AuthzPolicy.CustomProvider.CloudIap + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CloudIap.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.networksecurity.v1.AuthzPolicy.CustomProvider.CloudIap"; + }; + + return CloudIap; + })(); + + CustomProvider.AuthzExtension = (function() { + + /** + * Properties of an AuthzExtension. + * @memberof google.cloud.networksecurity.v1.AuthzPolicy.CustomProvider + * @interface IAuthzExtension + * @property {Array.|null} [resources] AuthzExtension resources + */ + + /** + * Constructs a new AuthzExtension. + * @memberof google.cloud.networksecurity.v1.AuthzPolicy.CustomProvider + * @classdesc Represents an AuthzExtension. + * @implements IAuthzExtension + * @constructor + * @param {google.cloud.networksecurity.v1.AuthzPolicy.CustomProvider.IAuthzExtension=} [properties] Properties to set + */ + function AuthzExtension(properties) { + this.resources = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AuthzExtension resources. + * @member {Array.} resources + * @memberof google.cloud.networksecurity.v1.AuthzPolicy.CustomProvider.AuthzExtension + * @instance + */ + AuthzExtension.prototype.resources = $util.emptyArray; + + /** + * Creates a new AuthzExtension instance using the specified properties. + * @function create + * @memberof google.cloud.networksecurity.v1.AuthzPolicy.CustomProvider.AuthzExtension + * @static + * @param {google.cloud.networksecurity.v1.AuthzPolicy.CustomProvider.IAuthzExtension=} [properties] Properties to set + * @returns {google.cloud.networksecurity.v1.AuthzPolicy.CustomProvider.AuthzExtension} AuthzExtension instance + */ + AuthzExtension.create = function create(properties) { + return new AuthzExtension(properties); + }; + + /** + * Encodes the specified AuthzExtension message. Does not implicitly {@link google.cloud.networksecurity.v1.AuthzPolicy.CustomProvider.AuthzExtension.verify|verify} messages. + * @function encode + * @memberof google.cloud.networksecurity.v1.AuthzPolicy.CustomProvider.AuthzExtension + * @static + * @param {google.cloud.networksecurity.v1.AuthzPolicy.CustomProvider.IAuthzExtension} message AuthzExtension message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AuthzExtension.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.resources != null && message.resources.length) + for (var i = 0; i < message.resources.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.resources[i]); + return writer; + }; + + /** + * Encodes the specified AuthzExtension message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.AuthzPolicy.CustomProvider.AuthzExtension.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.networksecurity.v1.AuthzPolicy.CustomProvider.AuthzExtension + * @static + * @param {google.cloud.networksecurity.v1.AuthzPolicy.CustomProvider.IAuthzExtension} message AuthzExtension message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AuthzExtension.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AuthzExtension message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.networksecurity.v1.AuthzPolicy.CustomProvider.AuthzExtension + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.networksecurity.v1.AuthzPolicy.CustomProvider.AuthzExtension} AuthzExtension + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AuthzExtension.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networksecurity.v1.AuthzPolicy.CustomProvider.AuthzExtension(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.resources && message.resources.length)) + message.resources = []; + message.resources.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AuthzExtension message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.networksecurity.v1.AuthzPolicy.CustomProvider.AuthzExtension + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.networksecurity.v1.AuthzPolicy.CustomProvider.AuthzExtension} AuthzExtension + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AuthzExtension.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AuthzExtension message. + * @function verify + * @memberof google.cloud.networksecurity.v1.AuthzPolicy.CustomProvider.AuthzExtension + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AuthzExtension.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.resources != null && message.hasOwnProperty("resources")) { + if (!Array.isArray(message.resources)) + return "resources: array expected"; + for (var i = 0; i < message.resources.length; ++i) + if (!$util.isString(message.resources[i])) + return "resources: string[] expected"; + } + return null; + }; + + /** + * Creates an AuthzExtension message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.networksecurity.v1.AuthzPolicy.CustomProvider.AuthzExtension + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.networksecurity.v1.AuthzPolicy.CustomProvider.AuthzExtension} AuthzExtension + */ + AuthzExtension.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networksecurity.v1.AuthzPolicy.CustomProvider.AuthzExtension) + return object; + var message = new $root.google.cloud.networksecurity.v1.AuthzPolicy.CustomProvider.AuthzExtension(); + if (object.resources) { + if (!Array.isArray(object.resources)) + throw TypeError(".google.cloud.networksecurity.v1.AuthzPolicy.CustomProvider.AuthzExtension.resources: array expected"); + message.resources = []; + for (var i = 0; i < object.resources.length; ++i) + message.resources[i] = String(object.resources[i]); + } + return message; + }; + + /** + * Creates a plain object from an AuthzExtension message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.networksecurity.v1.AuthzPolicy.CustomProvider.AuthzExtension + * @static + * @param {google.cloud.networksecurity.v1.AuthzPolicy.CustomProvider.AuthzExtension} message AuthzExtension + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AuthzExtension.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.resources = []; + if (message.resources && message.resources.length) { + object.resources = []; + for (var j = 0; j < message.resources.length; ++j) + object.resources[j] = message.resources[j]; + } + return object; + }; + + /** + * Converts this AuthzExtension to JSON. + * @function toJSON + * @memberof google.cloud.networksecurity.v1.AuthzPolicy.CustomProvider.AuthzExtension + * @instance + * @returns {Object.} JSON object + */ + AuthzExtension.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AuthzExtension + * @function getTypeUrl + * @memberof google.cloud.networksecurity.v1.AuthzPolicy.CustomProvider.AuthzExtension + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AuthzExtension.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.networksecurity.v1.AuthzPolicy.CustomProvider.AuthzExtension"; + }; + + return AuthzExtension; + })(); + + return CustomProvider; + })(); + + /** + * LoadBalancingScheme enum. + * @name google.cloud.networksecurity.v1.AuthzPolicy.LoadBalancingScheme + * @enum {number} + * @property {number} LOAD_BALANCING_SCHEME_UNSPECIFIED=0 LOAD_BALANCING_SCHEME_UNSPECIFIED value + * @property {number} INTERNAL_MANAGED=1 INTERNAL_MANAGED value + * @property {number} EXTERNAL_MANAGED=2 EXTERNAL_MANAGED value + * @property {number} INTERNAL_SELF_MANAGED=3 INTERNAL_SELF_MANAGED value + */ + AuthzPolicy.LoadBalancingScheme = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "LOAD_BALANCING_SCHEME_UNSPECIFIED"] = 0; + values[valuesById[1] = "INTERNAL_MANAGED"] = 1; + values[valuesById[2] = "EXTERNAL_MANAGED"] = 2; + values[valuesById[3] = "INTERNAL_SELF_MANAGED"] = 3; + return values; + })(); + + /** + * AuthzAction enum. + * @name google.cloud.networksecurity.v1.AuthzPolicy.AuthzAction + * @enum {number} + * @property {number} AUTHZ_ACTION_UNSPECIFIED=0 AUTHZ_ACTION_UNSPECIFIED value + * @property {number} ALLOW=1 ALLOW value + * @property {number} DENY=2 DENY value + * @property {number} CUSTOM=3 CUSTOM value + */ + AuthzPolicy.AuthzAction = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "AUTHZ_ACTION_UNSPECIFIED"] = 0; + values[valuesById[1] = "ALLOW"] = 1; + values[valuesById[2] = "DENY"] = 2; + values[valuesById[3] = "CUSTOM"] = 3; + return values; + })(); + + /** + * PolicyProfile enum. + * @name google.cloud.networksecurity.v1.AuthzPolicy.PolicyProfile + * @enum {number} + * @property {number} POLICY_PROFILE_UNSPECIFIED=0 POLICY_PROFILE_UNSPECIFIED value + * @property {number} REQUEST_AUTHZ=1 REQUEST_AUTHZ value + * @property {number} CONTENT_AUTHZ=2 CONTENT_AUTHZ value + */ + AuthzPolicy.PolicyProfile = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "POLICY_PROFILE_UNSPECIFIED"] = 0; + values[valuesById[1] = "REQUEST_AUTHZ"] = 1; + values[valuesById[2] = "CONTENT_AUTHZ"] = 2; + return values; + })(); + + return AuthzPolicy; + })(); + + v1.CreateAuthzPolicyRequest = (function() { + + /** + * Properties of a CreateAuthzPolicyRequest. + * @memberof google.cloud.networksecurity.v1 + * @interface ICreateAuthzPolicyRequest + * @property {string|null} [parent] CreateAuthzPolicyRequest parent + * @property {string|null} [authzPolicyId] CreateAuthzPolicyRequest authzPolicyId + * @property {google.cloud.networksecurity.v1.IAuthzPolicy|null} [authzPolicy] CreateAuthzPolicyRequest authzPolicy + * @property {string|null} [requestId] CreateAuthzPolicyRequest requestId + */ + + /** + * Constructs a new CreateAuthzPolicyRequest. + * @memberof google.cloud.networksecurity.v1 + * @classdesc Represents a CreateAuthzPolicyRequest. + * @implements ICreateAuthzPolicyRequest + * @constructor + * @param {google.cloud.networksecurity.v1.ICreateAuthzPolicyRequest=} [properties] Properties to set + */ + function CreateAuthzPolicyRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateAuthzPolicyRequest parent. + * @member {string} parent + * @memberof google.cloud.networksecurity.v1.CreateAuthzPolicyRequest + * @instance + */ + CreateAuthzPolicyRequest.prototype.parent = ""; + + /** + * CreateAuthzPolicyRequest authzPolicyId. + * @member {string} authzPolicyId + * @memberof google.cloud.networksecurity.v1.CreateAuthzPolicyRequest + * @instance + */ + CreateAuthzPolicyRequest.prototype.authzPolicyId = ""; + + /** + * CreateAuthzPolicyRequest authzPolicy. + * @member {google.cloud.networksecurity.v1.IAuthzPolicy|null|undefined} authzPolicy + * @memberof google.cloud.networksecurity.v1.CreateAuthzPolicyRequest + * @instance + */ + CreateAuthzPolicyRequest.prototype.authzPolicy = null; + + /** + * CreateAuthzPolicyRequest requestId. + * @member {string} requestId + * @memberof google.cloud.networksecurity.v1.CreateAuthzPolicyRequest + * @instance + */ + CreateAuthzPolicyRequest.prototype.requestId = ""; + + /** + * Creates a new CreateAuthzPolicyRequest instance using the specified properties. + * @function create + * @memberof google.cloud.networksecurity.v1.CreateAuthzPolicyRequest + * @static + * @param {google.cloud.networksecurity.v1.ICreateAuthzPolicyRequest=} [properties] Properties to set + * @returns {google.cloud.networksecurity.v1.CreateAuthzPolicyRequest} CreateAuthzPolicyRequest instance + */ + CreateAuthzPolicyRequest.create = function create(properties) { + return new CreateAuthzPolicyRequest(properties); + }; + + /** + * Encodes the specified CreateAuthzPolicyRequest message. Does not implicitly {@link google.cloud.networksecurity.v1.CreateAuthzPolicyRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.networksecurity.v1.CreateAuthzPolicyRequest + * @static + * @param {google.cloud.networksecurity.v1.ICreateAuthzPolicyRequest} message CreateAuthzPolicyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateAuthzPolicyRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.authzPolicyId != null && Object.hasOwnProperty.call(message, "authzPolicyId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.authzPolicyId); + if (message.authzPolicy != null && Object.hasOwnProperty.call(message, "authzPolicy")) + $root.google.cloud.networksecurity.v1.AuthzPolicy.encode(message.authzPolicy, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.requestId); + return writer; + }; + + /** + * Encodes the specified CreateAuthzPolicyRequest message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.CreateAuthzPolicyRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.networksecurity.v1.CreateAuthzPolicyRequest + * @static + * @param {google.cloud.networksecurity.v1.ICreateAuthzPolicyRequest} message CreateAuthzPolicyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateAuthzPolicyRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateAuthzPolicyRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.networksecurity.v1.CreateAuthzPolicyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.networksecurity.v1.CreateAuthzPolicyRequest} CreateAuthzPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateAuthzPolicyRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networksecurity.v1.CreateAuthzPolicyRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.authzPolicyId = reader.string(); + break; + } + case 3: { + message.authzPolicy = $root.google.cloud.networksecurity.v1.AuthzPolicy.decode(reader, reader.uint32()); + break; + } + case 4: { + message.requestId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateAuthzPolicyRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.networksecurity.v1.CreateAuthzPolicyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.networksecurity.v1.CreateAuthzPolicyRequest} CreateAuthzPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateAuthzPolicyRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateAuthzPolicyRequest message. + * @function verify + * @memberof google.cloud.networksecurity.v1.CreateAuthzPolicyRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateAuthzPolicyRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.authzPolicyId != null && message.hasOwnProperty("authzPolicyId")) + if (!$util.isString(message.authzPolicyId)) + return "authzPolicyId: string expected"; + if (message.authzPolicy != null && message.hasOwnProperty("authzPolicy")) { + var error = $root.google.cloud.networksecurity.v1.AuthzPolicy.verify(message.authzPolicy); + if (error) + return "authzPolicy." + error; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + return null; + }; + + /** + * Creates a CreateAuthzPolicyRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.networksecurity.v1.CreateAuthzPolicyRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.networksecurity.v1.CreateAuthzPolicyRequest} CreateAuthzPolicyRequest + */ + CreateAuthzPolicyRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networksecurity.v1.CreateAuthzPolicyRequest) + return object; + var message = new $root.google.cloud.networksecurity.v1.CreateAuthzPolicyRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.authzPolicyId != null) + message.authzPolicyId = String(object.authzPolicyId); + if (object.authzPolicy != null) { + if (typeof object.authzPolicy !== "object") + throw TypeError(".google.cloud.networksecurity.v1.CreateAuthzPolicyRequest.authzPolicy: object expected"); + message.authzPolicy = $root.google.cloud.networksecurity.v1.AuthzPolicy.fromObject(object.authzPolicy); + } + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from a CreateAuthzPolicyRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.networksecurity.v1.CreateAuthzPolicyRequest + * @static + * @param {google.cloud.networksecurity.v1.CreateAuthzPolicyRequest} message CreateAuthzPolicyRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateAuthzPolicyRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.authzPolicyId = ""; + object.authzPolicy = null; + object.requestId = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.authzPolicyId != null && message.hasOwnProperty("authzPolicyId")) + object.authzPolicyId = message.authzPolicyId; + if (message.authzPolicy != null && message.hasOwnProperty("authzPolicy")) + object.authzPolicy = $root.google.cloud.networksecurity.v1.AuthzPolicy.toObject(message.authzPolicy, options); + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + return object; + }; + + /** + * Converts this CreateAuthzPolicyRequest to JSON. + * @function toJSON + * @memberof google.cloud.networksecurity.v1.CreateAuthzPolicyRequest + * @instance + * @returns {Object.} JSON object + */ + CreateAuthzPolicyRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateAuthzPolicyRequest + * @function getTypeUrl + * @memberof google.cloud.networksecurity.v1.CreateAuthzPolicyRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateAuthzPolicyRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.networksecurity.v1.CreateAuthzPolicyRequest"; + }; + + return CreateAuthzPolicyRequest; + })(); + + v1.ListAuthzPoliciesRequest = (function() { + + /** + * Properties of a ListAuthzPoliciesRequest. + * @memberof google.cloud.networksecurity.v1 + * @interface IListAuthzPoliciesRequest + * @property {string|null} [parent] ListAuthzPoliciesRequest parent + * @property {number|null} [pageSize] ListAuthzPoliciesRequest pageSize + * @property {string|null} [pageToken] ListAuthzPoliciesRequest pageToken + * @property {string|null} [filter] ListAuthzPoliciesRequest filter + * @property {string|null} [orderBy] ListAuthzPoliciesRequest orderBy + */ + + /** + * Constructs a new ListAuthzPoliciesRequest. + * @memberof google.cloud.networksecurity.v1 + * @classdesc Represents a ListAuthzPoliciesRequest. + * @implements IListAuthzPoliciesRequest + * @constructor + * @param {google.cloud.networksecurity.v1.IListAuthzPoliciesRequest=} [properties] Properties to set + */ + function ListAuthzPoliciesRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListAuthzPoliciesRequest parent. + * @member {string} parent + * @memberof google.cloud.networksecurity.v1.ListAuthzPoliciesRequest + * @instance + */ + ListAuthzPoliciesRequest.prototype.parent = ""; + + /** + * ListAuthzPoliciesRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.networksecurity.v1.ListAuthzPoliciesRequest + * @instance + */ + ListAuthzPoliciesRequest.prototype.pageSize = 0; + + /** + * ListAuthzPoliciesRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.networksecurity.v1.ListAuthzPoliciesRequest + * @instance + */ + ListAuthzPoliciesRequest.prototype.pageToken = ""; + + /** + * ListAuthzPoliciesRequest filter. + * @member {string} filter + * @memberof google.cloud.networksecurity.v1.ListAuthzPoliciesRequest + * @instance + */ + ListAuthzPoliciesRequest.prototype.filter = ""; + + /** + * ListAuthzPoliciesRequest orderBy. + * @member {string} orderBy + * @memberof google.cloud.networksecurity.v1.ListAuthzPoliciesRequest + * @instance + */ + ListAuthzPoliciesRequest.prototype.orderBy = ""; + + /** + * Creates a new ListAuthzPoliciesRequest instance using the specified properties. + * @function create + * @memberof google.cloud.networksecurity.v1.ListAuthzPoliciesRequest + * @static + * @param {google.cloud.networksecurity.v1.IListAuthzPoliciesRequest=} [properties] Properties to set + * @returns {google.cloud.networksecurity.v1.ListAuthzPoliciesRequest} ListAuthzPoliciesRequest instance + */ + ListAuthzPoliciesRequest.create = function create(properties) { + return new ListAuthzPoliciesRequest(properties); + }; + + /** + * Encodes the specified ListAuthzPoliciesRequest message. Does not implicitly {@link google.cloud.networksecurity.v1.ListAuthzPoliciesRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.networksecurity.v1.ListAuthzPoliciesRequest + * @static + * @param {google.cloud.networksecurity.v1.IListAuthzPoliciesRequest} message ListAuthzPoliciesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListAuthzPoliciesRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.filter); + if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.orderBy); + return writer; + }; + + /** + * Encodes the specified ListAuthzPoliciesRequest message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.ListAuthzPoliciesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.networksecurity.v1.ListAuthzPoliciesRequest + * @static + * @param {google.cloud.networksecurity.v1.IListAuthzPoliciesRequest} message ListAuthzPoliciesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListAuthzPoliciesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListAuthzPoliciesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.networksecurity.v1.ListAuthzPoliciesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.networksecurity.v1.ListAuthzPoliciesRequest} ListAuthzPoliciesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListAuthzPoliciesRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networksecurity.v1.ListAuthzPoliciesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + case 4: { + message.filter = reader.string(); + break; + } + case 5: { + message.orderBy = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListAuthzPoliciesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.networksecurity.v1.ListAuthzPoliciesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.networksecurity.v1.ListAuthzPoliciesRequest} ListAuthzPoliciesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListAuthzPoliciesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListAuthzPoliciesRequest message. + * @function verify + * @memberof google.cloud.networksecurity.v1.ListAuthzPoliciesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListAuthzPoliciesRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + if (!$util.isString(message.orderBy)) + return "orderBy: string expected"; + return null; + }; + + /** + * Creates a ListAuthzPoliciesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.networksecurity.v1.ListAuthzPoliciesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.networksecurity.v1.ListAuthzPoliciesRequest} ListAuthzPoliciesRequest + */ + ListAuthzPoliciesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networksecurity.v1.ListAuthzPoliciesRequest) + return object; + var message = new $root.google.cloud.networksecurity.v1.ListAuthzPoliciesRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.filter != null) + message.filter = String(object.filter); + if (object.orderBy != null) + message.orderBy = String(object.orderBy); + return message; + }; + + /** + * Creates a plain object from a ListAuthzPoliciesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.networksecurity.v1.ListAuthzPoliciesRequest + * @static + * @param {google.cloud.networksecurity.v1.ListAuthzPoliciesRequest} message ListAuthzPoliciesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListAuthzPoliciesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + object.filter = ""; + object.orderBy = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + object.orderBy = message.orderBy; + return object; + }; + + /** + * Converts this ListAuthzPoliciesRequest to JSON. + * @function toJSON + * @memberof google.cloud.networksecurity.v1.ListAuthzPoliciesRequest + * @instance + * @returns {Object.} JSON object + */ + ListAuthzPoliciesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListAuthzPoliciesRequest + * @function getTypeUrl + * @memberof google.cloud.networksecurity.v1.ListAuthzPoliciesRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListAuthzPoliciesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.networksecurity.v1.ListAuthzPoliciesRequest"; + }; + + return ListAuthzPoliciesRequest; + })(); + + v1.ListAuthzPoliciesResponse = (function() { + + /** + * Properties of a ListAuthzPoliciesResponse. + * @memberof google.cloud.networksecurity.v1 + * @interface IListAuthzPoliciesResponse + * @property {Array.|null} [authzPolicies] ListAuthzPoliciesResponse authzPolicies + * @property {string|null} [nextPageToken] ListAuthzPoliciesResponse nextPageToken + * @property {Array.|null} [unreachable] ListAuthzPoliciesResponse unreachable + */ + + /** + * Constructs a new ListAuthzPoliciesResponse. + * @memberof google.cloud.networksecurity.v1 + * @classdesc Represents a ListAuthzPoliciesResponse. + * @implements IListAuthzPoliciesResponse + * @constructor + * @param {google.cloud.networksecurity.v1.IListAuthzPoliciesResponse=} [properties] Properties to set + */ + function ListAuthzPoliciesResponse(properties) { + this.authzPolicies = []; + this.unreachable = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListAuthzPoliciesResponse authzPolicies. + * @member {Array.} authzPolicies + * @memberof google.cloud.networksecurity.v1.ListAuthzPoliciesResponse + * @instance + */ + ListAuthzPoliciesResponse.prototype.authzPolicies = $util.emptyArray; + + /** + * ListAuthzPoliciesResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.networksecurity.v1.ListAuthzPoliciesResponse + * @instance + */ + ListAuthzPoliciesResponse.prototype.nextPageToken = ""; + + /** + * ListAuthzPoliciesResponse unreachable. + * @member {Array.} unreachable + * @memberof google.cloud.networksecurity.v1.ListAuthzPoliciesResponse + * @instance + */ + ListAuthzPoliciesResponse.prototype.unreachable = $util.emptyArray; + + /** + * Creates a new ListAuthzPoliciesResponse instance using the specified properties. + * @function create + * @memberof google.cloud.networksecurity.v1.ListAuthzPoliciesResponse + * @static + * @param {google.cloud.networksecurity.v1.IListAuthzPoliciesResponse=} [properties] Properties to set + * @returns {google.cloud.networksecurity.v1.ListAuthzPoliciesResponse} ListAuthzPoliciesResponse instance + */ + ListAuthzPoliciesResponse.create = function create(properties) { + return new ListAuthzPoliciesResponse(properties); + }; + + /** + * Encodes the specified ListAuthzPoliciesResponse message. Does not implicitly {@link google.cloud.networksecurity.v1.ListAuthzPoliciesResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.networksecurity.v1.ListAuthzPoliciesResponse + * @static + * @param {google.cloud.networksecurity.v1.IListAuthzPoliciesResponse} message ListAuthzPoliciesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListAuthzPoliciesResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.authzPolicies != null && message.authzPolicies.length) + for (var i = 0; i < message.authzPolicies.length; ++i) + $root.google.cloud.networksecurity.v1.AuthzPolicy.encode(message.authzPolicies[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + if (message.unreachable != null && message.unreachable.length) + for (var i = 0; i < message.unreachable.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.unreachable[i]); + return writer; + }; + + /** + * Encodes the specified ListAuthzPoliciesResponse message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.ListAuthzPoliciesResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.networksecurity.v1.ListAuthzPoliciesResponse + * @static + * @param {google.cloud.networksecurity.v1.IListAuthzPoliciesResponse} message ListAuthzPoliciesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListAuthzPoliciesResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListAuthzPoliciesResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.networksecurity.v1.ListAuthzPoliciesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.networksecurity.v1.ListAuthzPoliciesResponse} ListAuthzPoliciesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListAuthzPoliciesResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networksecurity.v1.ListAuthzPoliciesResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.authzPolicies && message.authzPolicies.length)) + message.authzPolicies = []; + message.authzPolicies.push($root.google.cloud.networksecurity.v1.AuthzPolicy.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + case 3: { + if (!(message.unreachable && message.unreachable.length)) + message.unreachable = []; + message.unreachable.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListAuthzPoliciesResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.networksecurity.v1.ListAuthzPoliciesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.networksecurity.v1.ListAuthzPoliciesResponse} ListAuthzPoliciesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListAuthzPoliciesResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListAuthzPoliciesResponse message. + * @function verify + * @memberof google.cloud.networksecurity.v1.ListAuthzPoliciesResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListAuthzPoliciesResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.authzPolicies != null && message.hasOwnProperty("authzPolicies")) { + if (!Array.isArray(message.authzPolicies)) + return "authzPolicies: array expected"; + for (var i = 0; i < message.authzPolicies.length; ++i) { + var error = $root.google.cloud.networksecurity.v1.AuthzPolicy.verify(message.authzPolicies[i]); + if (error) + return "authzPolicies." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + if (message.unreachable != null && message.hasOwnProperty("unreachable")) { + if (!Array.isArray(message.unreachable)) + return "unreachable: array expected"; + for (var i = 0; i < message.unreachable.length; ++i) + if (!$util.isString(message.unreachable[i])) + return "unreachable: string[] expected"; + } + return null; + }; + + /** + * Creates a ListAuthzPoliciesResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.networksecurity.v1.ListAuthzPoliciesResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.networksecurity.v1.ListAuthzPoliciesResponse} ListAuthzPoliciesResponse + */ + ListAuthzPoliciesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networksecurity.v1.ListAuthzPoliciesResponse) + return object; + var message = new $root.google.cloud.networksecurity.v1.ListAuthzPoliciesResponse(); + if (object.authzPolicies) { + if (!Array.isArray(object.authzPolicies)) + throw TypeError(".google.cloud.networksecurity.v1.ListAuthzPoliciesResponse.authzPolicies: array expected"); + message.authzPolicies = []; + for (var i = 0; i < object.authzPolicies.length; ++i) { + if (typeof object.authzPolicies[i] !== "object") + throw TypeError(".google.cloud.networksecurity.v1.ListAuthzPoliciesResponse.authzPolicies: object expected"); + message.authzPolicies[i] = $root.google.cloud.networksecurity.v1.AuthzPolicy.fromObject(object.authzPolicies[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.unreachable) { + if (!Array.isArray(object.unreachable)) + throw TypeError(".google.cloud.networksecurity.v1.ListAuthzPoliciesResponse.unreachable: array expected"); + message.unreachable = []; + for (var i = 0; i < object.unreachable.length; ++i) + message.unreachable[i] = String(object.unreachable[i]); + } + return message; + }; + + /** + * Creates a plain object from a ListAuthzPoliciesResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.networksecurity.v1.ListAuthzPoliciesResponse + * @static + * @param {google.cloud.networksecurity.v1.ListAuthzPoliciesResponse} message ListAuthzPoliciesResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListAuthzPoliciesResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.authzPolicies = []; + object.unreachable = []; + } + if (options.defaults) + object.nextPageToken = ""; + if (message.authzPolicies && message.authzPolicies.length) { + object.authzPolicies = []; + for (var j = 0; j < message.authzPolicies.length; ++j) + object.authzPolicies[j] = $root.google.cloud.networksecurity.v1.AuthzPolicy.toObject(message.authzPolicies[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + if (message.unreachable && message.unreachable.length) { + object.unreachable = []; + for (var j = 0; j < message.unreachable.length; ++j) + object.unreachable[j] = message.unreachable[j]; + } + return object; + }; + + /** + * Converts this ListAuthzPoliciesResponse to JSON. + * @function toJSON + * @memberof google.cloud.networksecurity.v1.ListAuthzPoliciesResponse + * @instance + * @returns {Object.} JSON object + */ + ListAuthzPoliciesResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListAuthzPoliciesResponse + * @function getTypeUrl + * @memberof google.cloud.networksecurity.v1.ListAuthzPoliciesResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListAuthzPoliciesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.networksecurity.v1.ListAuthzPoliciesResponse"; + }; + + return ListAuthzPoliciesResponse; + })(); + + v1.GetAuthzPolicyRequest = (function() { + + /** + * Properties of a GetAuthzPolicyRequest. + * @memberof google.cloud.networksecurity.v1 + * @interface IGetAuthzPolicyRequest + * @property {string|null} [name] GetAuthzPolicyRequest name + */ + + /** + * Constructs a new GetAuthzPolicyRequest. + * @memberof google.cloud.networksecurity.v1 + * @classdesc Represents a GetAuthzPolicyRequest. + * @implements IGetAuthzPolicyRequest + * @constructor + * @param {google.cloud.networksecurity.v1.IGetAuthzPolicyRequest=} [properties] Properties to set + */ + function GetAuthzPolicyRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetAuthzPolicyRequest name. + * @member {string} name + * @memberof google.cloud.networksecurity.v1.GetAuthzPolicyRequest + * @instance + */ + GetAuthzPolicyRequest.prototype.name = ""; + + /** + * Creates a new GetAuthzPolicyRequest instance using the specified properties. + * @function create + * @memberof google.cloud.networksecurity.v1.GetAuthzPolicyRequest + * @static + * @param {google.cloud.networksecurity.v1.IGetAuthzPolicyRequest=} [properties] Properties to set + * @returns {google.cloud.networksecurity.v1.GetAuthzPolicyRequest} GetAuthzPolicyRequest instance + */ + GetAuthzPolicyRequest.create = function create(properties) { + return new GetAuthzPolicyRequest(properties); + }; + + /** + * Encodes the specified GetAuthzPolicyRequest message. Does not implicitly {@link google.cloud.networksecurity.v1.GetAuthzPolicyRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.networksecurity.v1.GetAuthzPolicyRequest + * @static + * @param {google.cloud.networksecurity.v1.IGetAuthzPolicyRequest} message GetAuthzPolicyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetAuthzPolicyRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified GetAuthzPolicyRequest message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.GetAuthzPolicyRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.networksecurity.v1.GetAuthzPolicyRequest + * @static + * @param {google.cloud.networksecurity.v1.IGetAuthzPolicyRequest} message GetAuthzPolicyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetAuthzPolicyRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetAuthzPolicyRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.networksecurity.v1.GetAuthzPolicyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.networksecurity.v1.GetAuthzPolicyRequest} GetAuthzPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetAuthzPolicyRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networksecurity.v1.GetAuthzPolicyRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetAuthzPolicyRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.networksecurity.v1.GetAuthzPolicyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.networksecurity.v1.GetAuthzPolicyRequest} GetAuthzPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetAuthzPolicyRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetAuthzPolicyRequest message. + * @function verify + * @memberof google.cloud.networksecurity.v1.GetAuthzPolicyRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetAuthzPolicyRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a GetAuthzPolicyRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.networksecurity.v1.GetAuthzPolicyRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.networksecurity.v1.GetAuthzPolicyRequest} GetAuthzPolicyRequest + */ + GetAuthzPolicyRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networksecurity.v1.GetAuthzPolicyRequest) + return object; + var message = new $root.google.cloud.networksecurity.v1.GetAuthzPolicyRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetAuthzPolicyRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.networksecurity.v1.GetAuthzPolicyRequest + * @static + * @param {google.cloud.networksecurity.v1.GetAuthzPolicyRequest} message GetAuthzPolicyRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetAuthzPolicyRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this GetAuthzPolicyRequest to JSON. + * @function toJSON + * @memberof google.cloud.networksecurity.v1.GetAuthzPolicyRequest + * @instance + * @returns {Object.} JSON object + */ + GetAuthzPolicyRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetAuthzPolicyRequest + * @function getTypeUrl + * @memberof google.cloud.networksecurity.v1.GetAuthzPolicyRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetAuthzPolicyRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.networksecurity.v1.GetAuthzPolicyRequest"; + }; + + return GetAuthzPolicyRequest; + })(); + + v1.UpdateAuthzPolicyRequest = (function() { + + /** + * Properties of an UpdateAuthzPolicyRequest. + * @memberof google.cloud.networksecurity.v1 + * @interface IUpdateAuthzPolicyRequest + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateAuthzPolicyRequest updateMask + * @property {google.cloud.networksecurity.v1.IAuthzPolicy|null} [authzPolicy] UpdateAuthzPolicyRequest authzPolicy + * @property {string|null} [requestId] UpdateAuthzPolicyRequest requestId + */ + + /** + * Constructs a new UpdateAuthzPolicyRequest. + * @memberof google.cloud.networksecurity.v1 + * @classdesc Represents an UpdateAuthzPolicyRequest. + * @implements IUpdateAuthzPolicyRequest + * @constructor + * @param {google.cloud.networksecurity.v1.IUpdateAuthzPolicyRequest=} [properties] Properties to set + */ + function UpdateAuthzPolicyRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateAuthzPolicyRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.networksecurity.v1.UpdateAuthzPolicyRequest + * @instance + */ + UpdateAuthzPolicyRequest.prototype.updateMask = null; + + /** + * UpdateAuthzPolicyRequest authzPolicy. + * @member {google.cloud.networksecurity.v1.IAuthzPolicy|null|undefined} authzPolicy + * @memberof google.cloud.networksecurity.v1.UpdateAuthzPolicyRequest + * @instance + */ + UpdateAuthzPolicyRequest.prototype.authzPolicy = null; + + /** + * UpdateAuthzPolicyRequest requestId. + * @member {string} requestId + * @memberof google.cloud.networksecurity.v1.UpdateAuthzPolicyRequest + * @instance + */ + UpdateAuthzPolicyRequest.prototype.requestId = ""; + + /** + * Creates a new UpdateAuthzPolicyRequest instance using the specified properties. + * @function create + * @memberof google.cloud.networksecurity.v1.UpdateAuthzPolicyRequest + * @static + * @param {google.cloud.networksecurity.v1.IUpdateAuthzPolicyRequest=} [properties] Properties to set + * @returns {google.cloud.networksecurity.v1.UpdateAuthzPolicyRequest} UpdateAuthzPolicyRequest instance + */ + UpdateAuthzPolicyRequest.create = function create(properties) { + return new UpdateAuthzPolicyRequest(properties); + }; + + /** + * Encodes the specified UpdateAuthzPolicyRequest message. Does not implicitly {@link google.cloud.networksecurity.v1.UpdateAuthzPolicyRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.networksecurity.v1.UpdateAuthzPolicyRequest + * @static + * @param {google.cloud.networksecurity.v1.IUpdateAuthzPolicyRequest} message UpdateAuthzPolicyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateAuthzPolicyRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.authzPolicy != null && Object.hasOwnProperty.call(message, "authzPolicy")) + $root.google.cloud.networksecurity.v1.AuthzPolicy.encode(message.authzPolicy, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.requestId); + return writer; + }; + + /** + * Encodes the specified UpdateAuthzPolicyRequest message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.UpdateAuthzPolicyRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.networksecurity.v1.UpdateAuthzPolicyRequest + * @static + * @param {google.cloud.networksecurity.v1.IUpdateAuthzPolicyRequest} message UpdateAuthzPolicyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateAuthzPolicyRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateAuthzPolicyRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.networksecurity.v1.UpdateAuthzPolicyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.networksecurity.v1.UpdateAuthzPolicyRequest} UpdateAuthzPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateAuthzPolicyRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networksecurity.v1.UpdateAuthzPolicyRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + case 2: { + message.authzPolicy = $root.google.cloud.networksecurity.v1.AuthzPolicy.decode(reader, reader.uint32()); + break; + } + case 3: { + message.requestId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateAuthzPolicyRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.networksecurity.v1.UpdateAuthzPolicyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.networksecurity.v1.UpdateAuthzPolicyRequest} UpdateAuthzPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateAuthzPolicyRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateAuthzPolicyRequest message. + * @function verify + * @memberof google.cloud.networksecurity.v1.UpdateAuthzPolicyRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateAuthzPolicyRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + if (message.authzPolicy != null && message.hasOwnProperty("authzPolicy")) { + var error = $root.google.cloud.networksecurity.v1.AuthzPolicy.verify(message.authzPolicy); + if (error) + return "authzPolicy." + error; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + return null; + }; + + /** + * Creates an UpdateAuthzPolicyRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.networksecurity.v1.UpdateAuthzPolicyRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.networksecurity.v1.UpdateAuthzPolicyRequest} UpdateAuthzPolicyRequest + */ + UpdateAuthzPolicyRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networksecurity.v1.UpdateAuthzPolicyRequest) + return object; + var message = new $root.google.cloud.networksecurity.v1.UpdateAuthzPolicyRequest(); + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.networksecurity.v1.UpdateAuthzPolicyRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + if (object.authzPolicy != null) { + if (typeof object.authzPolicy !== "object") + throw TypeError(".google.cloud.networksecurity.v1.UpdateAuthzPolicyRequest.authzPolicy: object expected"); + message.authzPolicy = $root.google.cloud.networksecurity.v1.AuthzPolicy.fromObject(object.authzPolicy); + } + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from an UpdateAuthzPolicyRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.networksecurity.v1.UpdateAuthzPolicyRequest + * @static + * @param {google.cloud.networksecurity.v1.UpdateAuthzPolicyRequest} message UpdateAuthzPolicyRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateAuthzPolicyRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.updateMask = null; + object.authzPolicy = null; + object.requestId = ""; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + if (message.authzPolicy != null && message.hasOwnProperty("authzPolicy")) + object.authzPolicy = $root.google.cloud.networksecurity.v1.AuthzPolicy.toObject(message.authzPolicy, options); + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + return object; + }; + + /** + * Converts this UpdateAuthzPolicyRequest to JSON. + * @function toJSON + * @memberof google.cloud.networksecurity.v1.UpdateAuthzPolicyRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateAuthzPolicyRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateAuthzPolicyRequest + * @function getTypeUrl + * @memberof google.cloud.networksecurity.v1.UpdateAuthzPolicyRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateAuthzPolicyRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.networksecurity.v1.UpdateAuthzPolicyRequest"; + }; + + return UpdateAuthzPolicyRequest; + })(); + + v1.DeleteAuthzPolicyRequest = (function() { + + /** + * Properties of a DeleteAuthzPolicyRequest. + * @memberof google.cloud.networksecurity.v1 + * @interface IDeleteAuthzPolicyRequest + * @property {string|null} [name] DeleteAuthzPolicyRequest name + * @property {string|null} [requestId] DeleteAuthzPolicyRequest requestId + */ + + /** + * Constructs a new DeleteAuthzPolicyRequest. + * @memberof google.cloud.networksecurity.v1 + * @classdesc Represents a DeleteAuthzPolicyRequest. + * @implements IDeleteAuthzPolicyRequest + * @constructor + * @param {google.cloud.networksecurity.v1.IDeleteAuthzPolicyRequest=} [properties] Properties to set + */ + function DeleteAuthzPolicyRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteAuthzPolicyRequest name. + * @member {string} name + * @memberof google.cloud.networksecurity.v1.DeleteAuthzPolicyRequest + * @instance + */ + DeleteAuthzPolicyRequest.prototype.name = ""; + + /** + * DeleteAuthzPolicyRequest requestId. + * @member {string} requestId + * @memberof google.cloud.networksecurity.v1.DeleteAuthzPolicyRequest + * @instance + */ + DeleteAuthzPolicyRequest.prototype.requestId = ""; + + /** + * Creates a new DeleteAuthzPolicyRequest instance using the specified properties. + * @function create + * @memberof google.cloud.networksecurity.v1.DeleteAuthzPolicyRequest + * @static + * @param {google.cloud.networksecurity.v1.IDeleteAuthzPolicyRequest=} [properties] Properties to set + * @returns {google.cloud.networksecurity.v1.DeleteAuthzPolicyRequest} DeleteAuthzPolicyRequest instance + */ + DeleteAuthzPolicyRequest.create = function create(properties) { + return new DeleteAuthzPolicyRequest(properties); + }; + + /** + * Encodes the specified DeleteAuthzPolicyRequest message. Does not implicitly {@link google.cloud.networksecurity.v1.DeleteAuthzPolicyRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.networksecurity.v1.DeleteAuthzPolicyRequest + * @static + * @param {google.cloud.networksecurity.v1.IDeleteAuthzPolicyRequest} message DeleteAuthzPolicyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteAuthzPolicyRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.requestId); + return writer; + }; + + /** + * Encodes the specified DeleteAuthzPolicyRequest message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.DeleteAuthzPolicyRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.networksecurity.v1.DeleteAuthzPolicyRequest + * @static + * @param {google.cloud.networksecurity.v1.IDeleteAuthzPolicyRequest} message DeleteAuthzPolicyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteAuthzPolicyRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteAuthzPolicyRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.networksecurity.v1.DeleteAuthzPolicyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.networksecurity.v1.DeleteAuthzPolicyRequest} DeleteAuthzPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteAuthzPolicyRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networksecurity.v1.DeleteAuthzPolicyRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.requestId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteAuthzPolicyRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.networksecurity.v1.DeleteAuthzPolicyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.networksecurity.v1.DeleteAuthzPolicyRequest} DeleteAuthzPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteAuthzPolicyRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteAuthzPolicyRequest message. + * @function verify + * @memberof google.cloud.networksecurity.v1.DeleteAuthzPolicyRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteAuthzPolicyRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + return null; + }; + + /** + * Creates a DeleteAuthzPolicyRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.networksecurity.v1.DeleteAuthzPolicyRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.networksecurity.v1.DeleteAuthzPolicyRequest} DeleteAuthzPolicyRequest + */ + DeleteAuthzPolicyRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networksecurity.v1.DeleteAuthzPolicyRequest) + return object; + var message = new $root.google.cloud.networksecurity.v1.DeleteAuthzPolicyRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from a DeleteAuthzPolicyRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.networksecurity.v1.DeleteAuthzPolicyRequest + * @static + * @param {google.cloud.networksecurity.v1.DeleteAuthzPolicyRequest} message DeleteAuthzPolicyRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteAuthzPolicyRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.requestId = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + return object; + }; + + /** + * Converts this DeleteAuthzPolicyRequest to JSON. + * @function toJSON + * @memberof google.cloud.networksecurity.v1.DeleteAuthzPolicyRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteAuthzPolicyRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteAuthzPolicyRequest + * @function getTypeUrl + * @memberof google.cloud.networksecurity.v1.DeleteAuthzPolicyRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteAuthzPolicyRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.networksecurity.v1.DeleteAuthzPolicyRequest"; + }; + + return DeleteAuthzPolicyRequest; + })(); + + v1.BackendAuthenticationConfig = (function() { + + /** + * Properties of a BackendAuthenticationConfig. + * @memberof google.cloud.networksecurity.v1 + * @interface IBackendAuthenticationConfig + * @property {string|null} [name] BackendAuthenticationConfig name + * @property {string|null} [description] BackendAuthenticationConfig description + * @property {google.protobuf.ITimestamp|null} [createTime] BackendAuthenticationConfig createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] BackendAuthenticationConfig updateTime + * @property {Object.|null} [labels] BackendAuthenticationConfig labels + * @property {string|null} [clientCertificate] BackendAuthenticationConfig clientCertificate + * @property {string|null} [trustConfig] BackendAuthenticationConfig trustConfig + * @property {google.cloud.networksecurity.v1.BackendAuthenticationConfig.WellKnownRoots|null} [wellKnownRoots] BackendAuthenticationConfig wellKnownRoots + * @property {string|null} [etag] BackendAuthenticationConfig etag + */ + + /** + * Constructs a new BackendAuthenticationConfig. + * @memberof google.cloud.networksecurity.v1 + * @classdesc Represents a BackendAuthenticationConfig. + * @implements IBackendAuthenticationConfig + * @constructor + * @param {google.cloud.networksecurity.v1.IBackendAuthenticationConfig=} [properties] Properties to set + */ + function BackendAuthenticationConfig(properties) { + this.labels = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BackendAuthenticationConfig name. + * @member {string} name + * @memberof google.cloud.networksecurity.v1.BackendAuthenticationConfig + * @instance + */ + BackendAuthenticationConfig.prototype.name = ""; + + /** + * BackendAuthenticationConfig description. + * @member {string} description + * @memberof google.cloud.networksecurity.v1.BackendAuthenticationConfig + * @instance + */ + BackendAuthenticationConfig.prototype.description = ""; + + /** + * BackendAuthenticationConfig createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.networksecurity.v1.BackendAuthenticationConfig + * @instance + */ + BackendAuthenticationConfig.prototype.createTime = null; + + /** + * BackendAuthenticationConfig updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.networksecurity.v1.BackendAuthenticationConfig + * @instance + */ + BackendAuthenticationConfig.prototype.updateTime = null; + + /** + * BackendAuthenticationConfig labels. + * @member {Object.} labels + * @memberof google.cloud.networksecurity.v1.BackendAuthenticationConfig + * @instance + */ + BackendAuthenticationConfig.prototype.labels = $util.emptyObject; + + /** + * BackendAuthenticationConfig clientCertificate. + * @member {string} clientCertificate + * @memberof google.cloud.networksecurity.v1.BackendAuthenticationConfig + * @instance + */ + BackendAuthenticationConfig.prototype.clientCertificate = ""; + + /** + * BackendAuthenticationConfig trustConfig. + * @member {string} trustConfig + * @memberof google.cloud.networksecurity.v1.BackendAuthenticationConfig + * @instance + */ + BackendAuthenticationConfig.prototype.trustConfig = ""; + + /** + * BackendAuthenticationConfig wellKnownRoots. + * @member {google.cloud.networksecurity.v1.BackendAuthenticationConfig.WellKnownRoots} wellKnownRoots + * @memberof google.cloud.networksecurity.v1.BackendAuthenticationConfig + * @instance + */ + BackendAuthenticationConfig.prototype.wellKnownRoots = 0; + + /** + * BackendAuthenticationConfig etag. + * @member {string} etag + * @memberof google.cloud.networksecurity.v1.BackendAuthenticationConfig + * @instance + */ + BackendAuthenticationConfig.prototype.etag = ""; + + /** + * Creates a new BackendAuthenticationConfig instance using the specified properties. + * @function create + * @memberof google.cloud.networksecurity.v1.BackendAuthenticationConfig + * @static + * @param {google.cloud.networksecurity.v1.IBackendAuthenticationConfig=} [properties] Properties to set + * @returns {google.cloud.networksecurity.v1.BackendAuthenticationConfig} BackendAuthenticationConfig instance + */ + BackendAuthenticationConfig.create = function create(properties) { + return new BackendAuthenticationConfig(properties); + }; + + /** + * Encodes the specified BackendAuthenticationConfig message. Does not implicitly {@link google.cloud.networksecurity.v1.BackendAuthenticationConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.networksecurity.v1.BackendAuthenticationConfig + * @static + * @param {google.cloud.networksecurity.v1.IBackendAuthenticationConfig} message BackendAuthenticationConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BackendAuthenticationConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.description); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) + for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) + writer.uint32(/* id 5, wireType 2 =*/42).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); + if (message.clientCertificate != null && Object.hasOwnProperty.call(message, "clientCertificate")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.clientCertificate); + if (message.trustConfig != null && Object.hasOwnProperty.call(message, "trustConfig")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.trustConfig); + if (message.wellKnownRoots != null && Object.hasOwnProperty.call(message, "wellKnownRoots")) + writer.uint32(/* id 8, wireType 0 =*/64).int32(message.wellKnownRoots); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 9, wireType 2 =*/74).string(message.etag); + return writer; + }; + + /** + * Encodes the specified BackendAuthenticationConfig message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.BackendAuthenticationConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.networksecurity.v1.BackendAuthenticationConfig + * @static + * @param {google.cloud.networksecurity.v1.IBackendAuthenticationConfig} message BackendAuthenticationConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BackendAuthenticationConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BackendAuthenticationConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.networksecurity.v1.BackendAuthenticationConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.networksecurity.v1.BackendAuthenticationConfig} BackendAuthenticationConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BackendAuthenticationConfig.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networksecurity.v1.BackendAuthenticationConfig(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.description = reader.string(); + break; + } + case 3: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 4: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 5: { + if (message.labels === $util.emptyObject) + message.labels = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.labels[key] = value; + break; + } + case 6: { + message.clientCertificate = reader.string(); + break; + } + case 7: { + message.trustConfig = reader.string(); + break; + } + case 8: { + message.wellKnownRoots = reader.int32(); + break; + } + case 9: { + message.etag = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BackendAuthenticationConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.networksecurity.v1.BackendAuthenticationConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.networksecurity.v1.BackendAuthenticationConfig} BackendAuthenticationConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BackendAuthenticationConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BackendAuthenticationConfig message. + * @function verify + * @memberof google.cloud.networksecurity.v1.BackendAuthenticationConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BackendAuthenticationConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime); + if (error) + return "updateTime." + error; + } + if (message.labels != null && message.hasOwnProperty("labels")) { + if (!$util.isObject(message.labels)) + return "labels: object expected"; + var key = Object.keys(message.labels); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.labels[key[i]])) + return "labels: string{k:string} expected"; + } + if (message.clientCertificate != null && message.hasOwnProperty("clientCertificate")) + if (!$util.isString(message.clientCertificate)) + return "clientCertificate: string expected"; + if (message.trustConfig != null && message.hasOwnProperty("trustConfig")) + if (!$util.isString(message.trustConfig)) + return "trustConfig: string expected"; + if (message.wellKnownRoots != null && message.hasOwnProperty("wellKnownRoots")) + switch (message.wellKnownRoots) { + default: + return "wellKnownRoots: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.etag != null && message.hasOwnProperty("etag")) + if (!$util.isString(message.etag)) + return "etag: string expected"; + return null; + }; + + /** + * Creates a BackendAuthenticationConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.networksecurity.v1.BackendAuthenticationConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.networksecurity.v1.BackendAuthenticationConfig} BackendAuthenticationConfig + */ + BackendAuthenticationConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networksecurity.v1.BackendAuthenticationConfig) + return object; + var message = new $root.google.cloud.networksecurity.v1.BackendAuthenticationConfig(); + if (object.name != null) + message.name = String(object.name); + if (object.description != null) + message.description = String(object.description); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.networksecurity.v1.BackendAuthenticationConfig.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.updateTime != null) { + if (typeof object.updateTime !== "object") + throw TypeError(".google.cloud.networksecurity.v1.BackendAuthenticationConfig.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.cloud.networksecurity.v1.BackendAuthenticationConfig.labels: object expected"); + message.labels = {}; + for (var keys = Object.keys(object.labels), i = 0; i < keys.length; ++i) + message.labels[keys[i]] = String(object.labels[keys[i]]); + } + if (object.clientCertificate != null) + message.clientCertificate = String(object.clientCertificate); + if (object.trustConfig != null) + message.trustConfig = String(object.trustConfig); + switch (object.wellKnownRoots) { + default: + if (typeof object.wellKnownRoots === "number") { + message.wellKnownRoots = object.wellKnownRoots; + break; + } + break; + case "WELL_KNOWN_ROOTS_UNSPECIFIED": + case 0: + message.wellKnownRoots = 0; + break; + case "NONE": + case 1: + message.wellKnownRoots = 1; + break; + case "PUBLIC_ROOTS": + case 2: + message.wellKnownRoots = 2; + break; + } + if (object.etag != null) + message.etag = String(object.etag); + return message; + }; + + /** + * Creates a plain object from a BackendAuthenticationConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.networksecurity.v1.BackendAuthenticationConfig + * @static + * @param {google.cloud.networksecurity.v1.BackendAuthenticationConfig} message BackendAuthenticationConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BackendAuthenticationConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.labels = {}; + if (options.defaults) { + object.name = ""; + object.description = ""; + object.createTime = null; + object.updateTime = null; + object.clientCertificate = ""; + object.trustConfig = ""; + object.wellKnownRoots = options.enums === String ? "WELL_KNOWN_ROOTS_UNSPECIFIED" : 0; + object.etag = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.updateTime != null && message.hasOwnProperty("updateTime")) + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); + var keys2; + if (message.labels && (keys2 = Object.keys(message.labels)).length) { + object.labels = {}; + for (var j = 0; j < keys2.length; ++j) + object.labels[keys2[j]] = message.labels[keys2[j]]; + } + if (message.clientCertificate != null && message.hasOwnProperty("clientCertificate")) + object.clientCertificate = message.clientCertificate; + if (message.trustConfig != null && message.hasOwnProperty("trustConfig")) + object.trustConfig = message.trustConfig; + if (message.wellKnownRoots != null && message.hasOwnProperty("wellKnownRoots")) + object.wellKnownRoots = options.enums === String ? $root.google.cloud.networksecurity.v1.BackendAuthenticationConfig.WellKnownRoots[message.wellKnownRoots] === undefined ? message.wellKnownRoots : $root.google.cloud.networksecurity.v1.BackendAuthenticationConfig.WellKnownRoots[message.wellKnownRoots] : message.wellKnownRoots; + if (message.etag != null && message.hasOwnProperty("etag")) + object.etag = message.etag; + return object; + }; + + /** + * Converts this BackendAuthenticationConfig to JSON. + * @function toJSON + * @memberof google.cloud.networksecurity.v1.BackendAuthenticationConfig + * @instance + * @returns {Object.} JSON object + */ + BackendAuthenticationConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BackendAuthenticationConfig + * @function getTypeUrl + * @memberof google.cloud.networksecurity.v1.BackendAuthenticationConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BackendAuthenticationConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.networksecurity.v1.BackendAuthenticationConfig"; + }; + + /** + * WellKnownRoots enum. + * @name google.cloud.networksecurity.v1.BackendAuthenticationConfig.WellKnownRoots + * @enum {number} + * @property {number} WELL_KNOWN_ROOTS_UNSPECIFIED=0 WELL_KNOWN_ROOTS_UNSPECIFIED value + * @property {number} NONE=1 NONE value + * @property {number} PUBLIC_ROOTS=2 PUBLIC_ROOTS value + */ + BackendAuthenticationConfig.WellKnownRoots = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "WELL_KNOWN_ROOTS_UNSPECIFIED"] = 0; + values[valuesById[1] = "NONE"] = 1; + values[valuesById[2] = "PUBLIC_ROOTS"] = 2; + return values; + })(); + + return BackendAuthenticationConfig; + })(); + + v1.ListBackendAuthenticationConfigsRequest = (function() { + + /** + * Properties of a ListBackendAuthenticationConfigsRequest. + * @memberof google.cloud.networksecurity.v1 + * @interface IListBackendAuthenticationConfigsRequest + * @property {string|null} [parent] ListBackendAuthenticationConfigsRequest parent + * @property {number|null} [pageSize] ListBackendAuthenticationConfigsRequest pageSize + * @property {string|null} [pageToken] ListBackendAuthenticationConfigsRequest pageToken + */ + + /** + * Constructs a new ListBackendAuthenticationConfigsRequest. + * @memberof google.cloud.networksecurity.v1 + * @classdesc Represents a ListBackendAuthenticationConfigsRequest. + * @implements IListBackendAuthenticationConfigsRequest + * @constructor + * @param {google.cloud.networksecurity.v1.IListBackendAuthenticationConfigsRequest=} [properties] Properties to set + */ + function ListBackendAuthenticationConfigsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListBackendAuthenticationConfigsRequest parent. + * @member {string} parent + * @memberof google.cloud.networksecurity.v1.ListBackendAuthenticationConfigsRequest + * @instance + */ + ListBackendAuthenticationConfigsRequest.prototype.parent = ""; + + /** + * ListBackendAuthenticationConfigsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.networksecurity.v1.ListBackendAuthenticationConfigsRequest + * @instance + */ + ListBackendAuthenticationConfigsRequest.prototype.pageSize = 0; + + /** + * ListBackendAuthenticationConfigsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.networksecurity.v1.ListBackendAuthenticationConfigsRequest + * @instance + */ + ListBackendAuthenticationConfigsRequest.prototype.pageToken = ""; + + /** + * Creates a new ListBackendAuthenticationConfigsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.networksecurity.v1.ListBackendAuthenticationConfigsRequest + * @static + * @param {google.cloud.networksecurity.v1.IListBackendAuthenticationConfigsRequest=} [properties] Properties to set + * @returns {google.cloud.networksecurity.v1.ListBackendAuthenticationConfigsRequest} ListBackendAuthenticationConfigsRequest instance + */ + ListBackendAuthenticationConfigsRequest.create = function create(properties) { + return new ListBackendAuthenticationConfigsRequest(properties); + }; + + /** + * Encodes the specified ListBackendAuthenticationConfigsRequest message. Does not implicitly {@link google.cloud.networksecurity.v1.ListBackendAuthenticationConfigsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.networksecurity.v1.ListBackendAuthenticationConfigsRequest + * @static + * @param {google.cloud.networksecurity.v1.IListBackendAuthenticationConfigsRequest} message ListBackendAuthenticationConfigsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListBackendAuthenticationConfigsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + return writer; + }; + + /** + * Encodes the specified ListBackendAuthenticationConfigsRequest message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.ListBackendAuthenticationConfigsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.networksecurity.v1.ListBackendAuthenticationConfigsRequest + * @static + * @param {google.cloud.networksecurity.v1.IListBackendAuthenticationConfigsRequest} message ListBackendAuthenticationConfigsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListBackendAuthenticationConfigsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListBackendAuthenticationConfigsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.networksecurity.v1.ListBackendAuthenticationConfigsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.networksecurity.v1.ListBackendAuthenticationConfigsRequest} ListBackendAuthenticationConfigsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListBackendAuthenticationConfigsRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networksecurity.v1.ListBackendAuthenticationConfigsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListBackendAuthenticationConfigsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.networksecurity.v1.ListBackendAuthenticationConfigsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.networksecurity.v1.ListBackendAuthenticationConfigsRequest} ListBackendAuthenticationConfigsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListBackendAuthenticationConfigsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListBackendAuthenticationConfigsRequest message. + * @function verify + * @memberof google.cloud.networksecurity.v1.ListBackendAuthenticationConfigsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListBackendAuthenticationConfigsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + return null; + }; + + /** + * Creates a ListBackendAuthenticationConfigsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.networksecurity.v1.ListBackendAuthenticationConfigsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.networksecurity.v1.ListBackendAuthenticationConfigsRequest} ListBackendAuthenticationConfigsRequest + */ + ListBackendAuthenticationConfigsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networksecurity.v1.ListBackendAuthenticationConfigsRequest) + return object; + var message = new $root.google.cloud.networksecurity.v1.ListBackendAuthenticationConfigsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + return message; + }; + + /** + * Creates a plain object from a ListBackendAuthenticationConfigsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.networksecurity.v1.ListBackendAuthenticationConfigsRequest + * @static + * @param {google.cloud.networksecurity.v1.ListBackendAuthenticationConfigsRequest} message ListBackendAuthenticationConfigsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListBackendAuthenticationConfigsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + return object; + }; + + /** + * Converts this ListBackendAuthenticationConfigsRequest to JSON. + * @function toJSON + * @memberof google.cloud.networksecurity.v1.ListBackendAuthenticationConfigsRequest + * @instance + * @returns {Object.} JSON object + */ + ListBackendAuthenticationConfigsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListBackendAuthenticationConfigsRequest + * @function getTypeUrl + * @memberof google.cloud.networksecurity.v1.ListBackendAuthenticationConfigsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListBackendAuthenticationConfigsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.networksecurity.v1.ListBackendAuthenticationConfigsRequest"; + }; + + return ListBackendAuthenticationConfigsRequest; + })(); + + v1.ListBackendAuthenticationConfigsResponse = (function() { + + /** + * Properties of a ListBackendAuthenticationConfigsResponse. + * @memberof google.cloud.networksecurity.v1 + * @interface IListBackendAuthenticationConfigsResponse + * @property {Array.|null} [backendAuthenticationConfigs] ListBackendAuthenticationConfigsResponse backendAuthenticationConfigs + * @property {string|null} [nextPageToken] ListBackendAuthenticationConfigsResponse nextPageToken + * @property {Array.|null} [unreachable] ListBackendAuthenticationConfigsResponse unreachable + */ + + /** + * Constructs a new ListBackendAuthenticationConfigsResponse. + * @memberof google.cloud.networksecurity.v1 + * @classdesc Represents a ListBackendAuthenticationConfigsResponse. + * @implements IListBackendAuthenticationConfigsResponse + * @constructor + * @param {google.cloud.networksecurity.v1.IListBackendAuthenticationConfigsResponse=} [properties] Properties to set + */ + function ListBackendAuthenticationConfigsResponse(properties) { + this.backendAuthenticationConfigs = []; + this.unreachable = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListBackendAuthenticationConfigsResponse backendAuthenticationConfigs. + * @member {Array.} backendAuthenticationConfigs + * @memberof google.cloud.networksecurity.v1.ListBackendAuthenticationConfigsResponse + * @instance + */ + ListBackendAuthenticationConfigsResponse.prototype.backendAuthenticationConfigs = $util.emptyArray; + + /** + * ListBackendAuthenticationConfigsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.networksecurity.v1.ListBackendAuthenticationConfigsResponse + * @instance + */ + ListBackendAuthenticationConfigsResponse.prototype.nextPageToken = ""; + + /** + * ListBackendAuthenticationConfigsResponse unreachable. + * @member {Array.} unreachable + * @memberof google.cloud.networksecurity.v1.ListBackendAuthenticationConfigsResponse + * @instance + */ + ListBackendAuthenticationConfigsResponse.prototype.unreachable = $util.emptyArray; + + /** + * Creates a new ListBackendAuthenticationConfigsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.networksecurity.v1.ListBackendAuthenticationConfigsResponse + * @static + * @param {google.cloud.networksecurity.v1.IListBackendAuthenticationConfigsResponse=} [properties] Properties to set + * @returns {google.cloud.networksecurity.v1.ListBackendAuthenticationConfigsResponse} ListBackendAuthenticationConfigsResponse instance + */ + ListBackendAuthenticationConfigsResponse.create = function create(properties) { + return new ListBackendAuthenticationConfigsResponse(properties); + }; + + /** + * Encodes the specified ListBackendAuthenticationConfigsResponse message. Does not implicitly {@link google.cloud.networksecurity.v1.ListBackendAuthenticationConfigsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.networksecurity.v1.ListBackendAuthenticationConfigsResponse + * @static + * @param {google.cloud.networksecurity.v1.IListBackendAuthenticationConfigsResponse} message ListBackendAuthenticationConfigsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListBackendAuthenticationConfigsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.backendAuthenticationConfigs != null && message.backendAuthenticationConfigs.length) + for (var i = 0; i < message.backendAuthenticationConfigs.length; ++i) + $root.google.cloud.networksecurity.v1.BackendAuthenticationConfig.encode(message.backendAuthenticationConfigs[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + if (message.unreachable != null && message.unreachable.length) + for (var i = 0; i < message.unreachable.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.unreachable[i]); + return writer; + }; + + /** + * Encodes the specified ListBackendAuthenticationConfigsResponse message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.ListBackendAuthenticationConfigsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.networksecurity.v1.ListBackendAuthenticationConfigsResponse + * @static + * @param {google.cloud.networksecurity.v1.IListBackendAuthenticationConfigsResponse} message ListBackendAuthenticationConfigsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListBackendAuthenticationConfigsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListBackendAuthenticationConfigsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.networksecurity.v1.ListBackendAuthenticationConfigsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.networksecurity.v1.ListBackendAuthenticationConfigsResponse} ListBackendAuthenticationConfigsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListBackendAuthenticationConfigsResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networksecurity.v1.ListBackendAuthenticationConfigsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.backendAuthenticationConfigs && message.backendAuthenticationConfigs.length)) + message.backendAuthenticationConfigs = []; + message.backendAuthenticationConfigs.push($root.google.cloud.networksecurity.v1.BackendAuthenticationConfig.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + case 3: { + if (!(message.unreachable && message.unreachable.length)) + message.unreachable = []; + message.unreachable.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListBackendAuthenticationConfigsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.networksecurity.v1.ListBackendAuthenticationConfigsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.networksecurity.v1.ListBackendAuthenticationConfigsResponse} ListBackendAuthenticationConfigsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListBackendAuthenticationConfigsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListBackendAuthenticationConfigsResponse message. + * @function verify + * @memberof google.cloud.networksecurity.v1.ListBackendAuthenticationConfigsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListBackendAuthenticationConfigsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.backendAuthenticationConfigs != null && message.hasOwnProperty("backendAuthenticationConfigs")) { + if (!Array.isArray(message.backendAuthenticationConfigs)) + return "backendAuthenticationConfigs: array expected"; + for (var i = 0; i < message.backendAuthenticationConfigs.length; ++i) { + var error = $root.google.cloud.networksecurity.v1.BackendAuthenticationConfig.verify(message.backendAuthenticationConfigs[i]); + if (error) + return "backendAuthenticationConfigs." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + if (message.unreachable != null && message.hasOwnProperty("unreachable")) { + if (!Array.isArray(message.unreachable)) + return "unreachable: array expected"; + for (var i = 0; i < message.unreachable.length; ++i) + if (!$util.isString(message.unreachable[i])) + return "unreachable: string[] expected"; + } + return null; + }; + + /** + * Creates a ListBackendAuthenticationConfigsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.networksecurity.v1.ListBackendAuthenticationConfigsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.networksecurity.v1.ListBackendAuthenticationConfigsResponse} ListBackendAuthenticationConfigsResponse + */ + ListBackendAuthenticationConfigsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networksecurity.v1.ListBackendAuthenticationConfigsResponse) + return object; + var message = new $root.google.cloud.networksecurity.v1.ListBackendAuthenticationConfigsResponse(); + if (object.backendAuthenticationConfigs) { + if (!Array.isArray(object.backendAuthenticationConfigs)) + throw TypeError(".google.cloud.networksecurity.v1.ListBackendAuthenticationConfigsResponse.backendAuthenticationConfigs: array expected"); + message.backendAuthenticationConfigs = []; + for (var i = 0; i < object.backendAuthenticationConfigs.length; ++i) { + if (typeof object.backendAuthenticationConfigs[i] !== "object") + throw TypeError(".google.cloud.networksecurity.v1.ListBackendAuthenticationConfigsResponse.backendAuthenticationConfigs: object expected"); + message.backendAuthenticationConfigs[i] = $root.google.cloud.networksecurity.v1.BackendAuthenticationConfig.fromObject(object.backendAuthenticationConfigs[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.unreachable) { + if (!Array.isArray(object.unreachable)) + throw TypeError(".google.cloud.networksecurity.v1.ListBackendAuthenticationConfigsResponse.unreachable: array expected"); + message.unreachable = []; + for (var i = 0; i < object.unreachable.length; ++i) + message.unreachable[i] = String(object.unreachable[i]); + } + return message; + }; + + /** + * Creates a plain object from a ListBackendAuthenticationConfigsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.networksecurity.v1.ListBackendAuthenticationConfigsResponse + * @static + * @param {google.cloud.networksecurity.v1.ListBackendAuthenticationConfigsResponse} message ListBackendAuthenticationConfigsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListBackendAuthenticationConfigsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.backendAuthenticationConfigs = []; + object.unreachable = []; + } + if (options.defaults) + object.nextPageToken = ""; + if (message.backendAuthenticationConfigs && message.backendAuthenticationConfigs.length) { + object.backendAuthenticationConfigs = []; + for (var j = 0; j < message.backendAuthenticationConfigs.length; ++j) + object.backendAuthenticationConfigs[j] = $root.google.cloud.networksecurity.v1.BackendAuthenticationConfig.toObject(message.backendAuthenticationConfigs[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + if (message.unreachable && message.unreachable.length) { + object.unreachable = []; + for (var j = 0; j < message.unreachable.length; ++j) + object.unreachable[j] = message.unreachable[j]; + } + return object; + }; + + /** + * Converts this ListBackendAuthenticationConfigsResponse to JSON. + * @function toJSON + * @memberof google.cloud.networksecurity.v1.ListBackendAuthenticationConfigsResponse + * @instance + * @returns {Object.} JSON object + */ + ListBackendAuthenticationConfigsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListBackendAuthenticationConfigsResponse + * @function getTypeUrl + * @memberof google.cloud.networksecurity.v1.ListBackendAuthenticationConfigsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListBackendAuthenticationConfigsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.networksecurity.v1.ListBackendAuthenticationConfigsResponse"; + }; + + return ListBackendAuthenticationConfigsResponse; + })(); + + v1.GetBackendAuthenticationConfigRequest = (function() { + + /** + * Properties of a GetBackendAuthenticationConfigRequest. + * @memberof google.cloud.networksecurity.v1 + * @interface IGetBackendAuthenticationConfigRequest + * @property {string|null} [name] GetBackendAuthenticationConfigRequest name + */ + + /** + * Constructs a new GetBackendAuthenticationConfigRequest. + * @memberof google.cloud.networksecurity.v1 + * @classdesc Represents a GetBackendAuthenticationConfigRequest. + * @implements IGetBackendAuthenticationConfigRequest + * @constructor + * @param {google.cloud.networksecurity.v1.IGetBackendAuthenticationConfigRequest=} [properties] Properties to set + */ + function GetBackendAuthenticationConfigRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetBackendAuthenticationConfigRequest name. + * @member {string} name + * @memberof google.cloud.networksecurity.v1.GetBackendAuthenticationConfigRequest + * @instance + */ + GetBackendAuthenticationConfigRequest.prototype.name = ""; + + /** + * Creates a new GetBackendAuthenticationConfigRequest instance using the specified properties. + * @function create + * @memberof google.cloud.networksecurity.v1.GetBackendAuthenticationConfigRequest + * @static + * @param {google.cloud.networksecurity.v1.IGetBackendAuthenticationConfigRequest=} [properties] Properties to set + * @returns {google.cloud.networksecurity.v1.GetBackendAuthenticationConfigRequest} GetBackendAuthenticationConfigRequest instance + */ + GetBackendAuthenticationConfigRequest.create = function create(properties) { + return new GetBackendAuthenticationConfigRequest(properties); + }; + + /** + * Encodes the specified GetBackendAuthenticationConfigRequest message. Does not implicitly {@link google.cloud.networksecurity.v1.GetBackendAuthenticationConfigRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.networksecurity.v1.GetBackendAuthenticationConfigRequest + * @static + * @param {google.cloud.networksecurity.v1.IGetBackendAuthenticationConfigRequest} message GetBackendAuthenticationConfigRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetBackendAuthenticationConfigRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified GetBackendAuthenticationConfigRequest message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.GetBackendAuthenticationConfigRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.networksecurity.v1.GetBackendAuthenticationConfigRequest + * @static + * @param {google.cloud.networksecurity.v1.IGetBackendAuthenticationConfigRequest} message GetBackendAuthenticationConfigRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetBackendAuthenticationConfigRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetBackendAuthenticationConfigRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.networksecurity.v1.GetBackendAuthenticationConfigRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.networksecurity.v1.GetBackendAuthenticationConfigRequest} GetBackendAuthenticationConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetBackendAuthenticationConfigRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networksecurity.v1.GetBackendAuthenticationConfigRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetBackendAuthenticationConfigRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.networksecurity.v1.GetBackendAuthenticationConfigRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.networksecurity.v1.GetBackendAuthenticationConfigRequest} GetBackendAuthenticationConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetBackendAuthenticationConfigRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetBackendAuthenticationConfigRequest message. + * @function verify + * @memberof google.cloud.networksecurity.v1.GetBackendAuthenticationConfigRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetBackendAuthenticationConfigRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a GetBackendAuthenticationConfigRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.networksecurity.v1.GetBackendAuthenticationConfigRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.networksecurity.v1.GetBackendAuthenticationConfigRequest} GetBackendAuthenticationConfigRequest + */ + GetBackendAuthenticationConfigRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networksecurity.v1.GetBackendAuthenticationConfigRequest) + return object; + var message = new $root.google.cloud.networksecurity.v1.GetBackendAuthenticationConfigRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetBackendAuthenticationConfigRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.networksecurity.v1.GetBackendAuthenticationConfigRequest + * @static + * @param {google.cloud.networksecurity.v1.GetBackendAuthenticationConfigRequest} message GetBackendAuthenticationConfigRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetBackendAuthenticationConfigRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this GetBackendAuthenticationConfigRequest to JSON. + * @function toJSON + * @memberof google.cloud.networksecurity.v1.GetBackendAuthenticationConfigRequest + * @instance + * @returns {Object.} JSON object + */ + GetBackendAuthenticationConfigRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetBackendAuthenticationConfigRequest + * @function getTypeUrl + * @memberof google.cloud.networksecurity.v1.GetBackendAuthenticationConfigRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetBackendAuthenticationConfigRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.networksecurity.v1.GetBackendAuthenticationConfigRequest"; + }; + + return GetBackendAuthenticationConfigRequest; + })(); + + v1.CreateBackendAuthenticationConfigRequest = (function() { + + /** + * Properties of a CreateBackendAuthenticationConfigRequest. + * @memberof google.cloud.networksecurity.v1 + * @interface ICreateBackendAuthenticationConfigRequest + * @property {string|null} [parent] CreateBackendAuthenticationConfigRequest parent + * @property {string|null} [backendAuthenticationConfigId] CreateBackendAuthenticationConfigRequest backendAuthenticationConfigId + * @property {google.cloud.networksecurity.v1.IBackendAuthenticationConfig|null} [backendAuthenticationConfig] CreateBackendAuthenticationConfigRequest backendAuthenticationConfig + */ + + /** + * Constructs a new CreateBackendAuthenticationConfigRequest. + * @memberof google.cloud.networksecurity.v1 + * @classdesc Represents a CreateBackendAuthenticationConfigRequest. + * @implements ICreateBackendAuthenticationConfigRequest + * @constructor + * @param {google.cloud.networksecurity.v1.ICreateBackendAuthenticationConfigRequest=} [properties] Properties to set + */ + function CreateBackendAuthenticationConfigRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateBackendAuthenticationConfigRequest parent. + * @member {string} parent + * @memberof google.cloud.networksecurity.v1.CreateBackendAuthenticationConfigRequest + * @instance + */ + CreateBackendAuthenticationConfigRequest.prototype.parent = ""; + + /** + * CreateBackendAuthenticationConfigRequest backendAuthenticationConfigId. + * @member {string} backendAuthenticationConfigId + * @memberof google.cloud.networksecurity.v1.CreateBackendAuthenticationConfigRequest + * @instance + */ + CreateBackendAuthenticationConfigRequest.prototype.backendAuthenticationConfigId = ""; + + /** + * CreateBackendAuthenticationConfigRequest backendAuthenticationConfig. + * @member {google.cloud.networksecurity.v1.IBackendAuthenticationConfig|null|undefined} backendAuthenticationConfig + * @memberof google.cloud.networksecurity.v1.CreateBackendAuthenticationConfigRequest + * @instance + */ + CreateBackendAuthenticationConfigRequest.prototype.backendAuthenticationConfig = null; + + /** + * Creates a new CreateBackendAuthenticationConfigRequest instance using the specified properties. + * @function create + * @memberof google.cloud.networksecurity.v1.CreateBackendAuthenticationConfigRequest + * @static + * @param {google.cloud.networksecurity.v1.ICreateBackendAuthenticationConfigRequest=} [properties] Properties to set + * @returns {google.cloud.networksecurity.v1.CreateBackendAuthenticationConfigRequest} CreateBackendAuthenticationConfigRequest instance + */ + CreateBackendAuthenticationConfigRequest.create = function create(properties) { + return new CreateBackendAuthenticationConfigRequest(properties); + }; + + /** + * Encodes the specified CreateBackendAuthenticationConfigRequest message. Does not implicitly {@link google.cloud.networksecurity.v1.CreateBackendAuthenticationConfigRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.networksecurity.v1.CreateBackendAuthenticationConfigRequest + * @static + * @param {google.cloud.networksecurity.v1.ICreateBackendAuthenticationConfigRequest} message CreateBackendAuthenticationConfigRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateBackendAuthenticationConfigRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.backendAuthenticationConfigId != null && Object.hasOwnProperty.call(message, "backendAuthenticationConfigId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.backendAuthenticationConfigId); + if (message.backendAuthenticationConfig != null && Object.hasOwnProperty.call(message, "backendAuthenticationConfig")) + $root.google.cloud.networksecurity.v1.BackendAuthenticationConfig.encode(message.backendAuthenticationConfig, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreateBackendAuthenticationConfigRequest message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.CreateBackendAuthenticationConfigRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.networksecurity.v1.CreateBackendAuthenticationConfigRequest + * @static + * @param {google.cloud.networksecurity.v1.ICreateBackendAuthenticationConfigRequest} message CreateBackendAuthenticationConfigRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateBackendAuthenticationConfigRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateBackendAuthenticationConfigRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.networksecurity.v1.CreateBackendAuthenticationConfigRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.networksecurity.v1.CreateBackendAuthenticationConfigRequest} CreateBackendAuthenticationConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateBackendAuthenticationConfigRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networksecurity.v1.CreateBackendAuthenticationConfigRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.backendAuthenticationConfigId = reader.string(); + break; + } + case 3: { + message.backendAuthenticationConfig = $root.google.cloud.networksecurity.v1.BackendAuthenticationConfig.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateBackendAuthenticationConfigRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.networksecurity.v1.CreateBackendAuthenticationConfigRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.networksecurity.v1.CreateBackendAuthenticationConfigRequest} CreateBackendAuthenticationConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateBackendAuthenticationConfigRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateBackendAuthenticationConfigRequest message. + * @function verify + * @memberof google.cloud.networksecurity.v1.CreateBackendAuthenticationConfigRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateBackendAuthenticationConfigRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.backendAuthenticationConfigId != null && message.hasOwnProperty("backendAuthenticationConfigId")) + if (!$util.isString(message.backendAuthenticationConfigId)) + return "backendAuthenticationConfigId: string expected"; + if (message.backendAuthenticationConfig != null && message.hasOwnProperty("backendAuthenticationConfig")) { + var error = $root.google.cloud.networksecurity.v1.BackendAuthenticationConfig.verify(message.backendAuthenticationConfig); + if (error) + return "backendAuthenticationConfig." + error; + } + return null; + }; + + /** + * Creates a CreateBackendAuthenticationConfigRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.networksecurity.v1.CreateBackendAuthenticationConfigRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.networksecurity.v1.CreateBackendAuthenticationConfigRequest} CreateBackendAuthenticationConfigRequest + */ + CreateBackendAuthenticationConfigRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networksecurity.v1.CreateBackendAuthenticationConfigRequest) + return object; + var message = new $root.google.cloud.networksecurity.v1.CreateBackendAuthenticationConfigRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.backendAuthenticationConfigId != null) + message.backendAuthenticationConfigId = String(object.backendAuthenticationConfigId); + if (object.backendAuthenticationConfig != null) { + if (typeof object.backendAuthenticationConfig !== "object") + throw TypeError(".google.cloud.networksecurity.v1.CreateBackendAuthenticationConfigRequest.backendAuthenticationConfig: object expected"); + message.backendAuthenticationConfig = $root.google.cloud.networksecurity.v1.BackendAuthenticationConfig.fromObject(object.backendAuthenticationConfig); + } + return message; + }; + + /** + * Creates a plain object from a CreateBackendAuthenticationConfigRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.networksecurity.v1.CreateBackendAuthenticationConfigRequest + * @static + * @param {google.cloud.networksecurity.v1.CreateBackendAuthenticationConfigRequest} message CreateBackendAuthenticationConfigRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateBackendAuthenticationConfigRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.backendAuthenticationConfigId = ""; + object.backendAuthenticationConfig = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.backendAuthenticationConfigId != null && message.hasOwnProperty("backendAuthenticationConfigId")) + object.backendAuthenticationConfigId = message.backendAuthenticationConfigId; + if (message.backendAuthenticationConfig != null && message.hasOwnProperty("backendAuthenticationConfig")) + object.backendAuthenticationConfig = $root.google.cloud.networksecurity.v1.BackendAuthenticationConfig.toObject(message.backendAuthenticationConfig, options); + return object; + }; + + /** + * Converts this CreateBackendAuthenticationConfigRequest to JSON. + * @function toJSON + * @memberof google.cloud.networksecurity.v1.CreateBackendAuthenticationConfigRequest + * @instance + * @returns {Object.} JSON object + */ + CreateBackendAuthenticationConfigRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateBackendAuthenticationConfigRequest + * @function getTypeUrl + * @memberof google.cloud.networksecurity.v1.CreateBackendAuthenticationConfigRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateBackendAuthenticationConfigRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.networksecurity.v1.CreateBackendAuthenticationConfigRequest"; + }; + + return CreateBackendAuthenticationConfigRequest; + })(); + + v1.UpdateBackendAuthenticationConfigRequest = (function() { + + /** + * Properties of an UpdateBackendAuthenticationConfigRequest. + * @memberof google.cloud.networksecurity.v1 + * @interface IUpdateBackendAuthenticationConfigRequest + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateBackendAuthenticationConfigRequest updateMask + * @property {google.cloud.networksecurity.v1.IBackendAuthenticationConfig|null} [backendAuthenticationConfig] UpdateBackendAuthenticationConfigRequest backendAuthenticationConfig + */ + + /** + * Constructs a new UpdateBackendAuthenticationConfigRequest. + * @memberof google.cloud.networksecurity.v1 + * @classdesc Represents an UpdateBackendAuthenticationConfigRequest. + * @implements IUpdateBackendAuthenticationConfigRequest + * @constructor + * @param {google.cloud.networksecurity.v1.IUpdateBackendAuthenticationConfigRequest=} [properties] Properties to set + */ + function UpdateBackendAuthenticationConfigRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateBackendAuthenticationConfigRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.networksecurity.v1.UpdateBackendAuthenticationConfigRequest + * @instance + */ + UpdateBackendAuthenticationConfigRequest.prototype.updateMask = null; + + /** + * UpdateBackendAuthenticationConfigRequest backendAuthenticationConfig. + * @member {google.cloud.networksecurity.v1.IBackendAuthenticationConfig|null|undefined} backendAuthenticationConfig + * @memberof google.cloud.networksecurity.v1.UpdateBackendAuthenticationConfigRequest + * @instance + */ + UpdateBackendAuthenticationConfigRequest.prototype.backendAuthenticationConfig = null; + + /** + * Creates a new UpdateBackendAuthenticationConfigRequest instance using the specified properties. + * @function create + * @memberof google.cloud.networksecurity.v1.UpdateBackendAuthenticationConfigRequest + * @static + * @param {google.cloud.networksecurity.v1.IUpdateBackendAuthenticationConfigRequest=} [properties] Properties to set + * @returns {google.cloud.networksecurity.v1.UpdateBackendAuthenticationConfigRequest} UpdateBackendAuthenticationConfigRequest instance + */ + UpdateBackendAuthenticationConfigRequest.create = function create(properties) { + return new UpdateBackendAuthenticationConfigRequest(properties); + }; + + /** + * Encodes the specified UpdateBackendAuthenticationConfigRequest message. Does not implicitly {@link google.cloud.networksecurity.v1.UpdateBackendAuthenticationConfigRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.networksecurity.v1.UpdateBackendAuthenticationConfigRequest + * @static + * @param {google.cloud.networksecurity.v1.IUpdateBackendAuthenticationConfigRequest} message UpdateBackendAuthenticationConfigRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateBackendAuthenticationConfigRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.backendAuthenticationConfig != null && Object.hasOwnProperty.call(message, "backendAuthenticationConfig")) + $root.google.cloud.networksecurity.v1.BackendAuthenticationConfig.encode(message.backendAuthenticationConfig, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified UpdateBackendAuthenticationConfigRequest message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.UpdateBackendAuthenticationConfigRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.networksecurity.v1.UpdateBackendAuthenticationConfigRequest + * @static + * @param {google.cloud.networksecurity.v1.IUpdateBackendAuthenticationConfigRequest} message UpdateBackendAuthenticationConfigRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateBackendAuthenticationConfigRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateBackendAuthenticationConfigRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.networksecurity.v1.UpdateBackendAuthenticationConfigRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.networksecurity.v1.UpdateBackendAuthenticationConfigRequest} UpdateBackendAuthenticationConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateBackendAuthenticationConfigRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networksecurity.v1.UpdateBackendAuthenticationConfigRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + case 2: { + message.backendAuthenticationConfig = $root.google.cloud.networksecurity.v1.BackendAuthenticationConfig.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateBackendAuthenticationConfigRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.networksecurity.v1.UpdateBackendAuthenticationConfigRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.networksecurity.v1.UpdateBackendAuthenticationConfigRequest} UpdateBackendAuthenticationConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateBackendAuthenticationConfigRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateBackendAuthenticationConfigRequest message. + * @function verify + * @memberof google.cloud.networksecurity.v1.UpdateBackendAuthenticationConfigRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateBackendAuthenticationConfigRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + if (message.backendAuthenticationConfig != null && message.hasOwnProperty("backendAuthenticationConfig")) { + var error = $root.google.cloud.networksecurity.v1.BackendAuthenticationConfig.verify(message.backendAuthenticationConfig); + if (error) + return "backendAuthenticationConfig." + error; + } + return null; + }; + + /** + * Creates an UpdateBackendAuthenticationConfigRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.networksecurity.v1.UpdateBackendAuthenticationConfigRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.networksecurity.v1.UpdateBackendAuthenticationConfigRequest} UpdateBackendAuthenticationConfigRequest + */ + UpdateBackendAuthenticationConfigRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networksecurity.v1.UpdateBackendAuthenticationConfigRequest) + return object; + var message = new $root.google.cloud.networksecurity.v1.UpdateBackendAuthenticationConfigRequest(); + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.networksecurity.v1.UpdateBackendAuthenticationConfigRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + if (object.backendAuthenticationConfig != null) { + if (typeof object.backendAuthenticationConfig !== "object") + throw TypeError(".google.cloud.networksecurity.v1.UpdateBackendAuthenticationConfigRequest.backendAuthenticationConfig: object expected"); + message.backendAuthenticationConfig = $root.google.cloud.networksecurity.v1.BackendAuthenticationConfig.fromObject(object.backendAuthenticationConfig); + } + return message; + }; + + /** + * Creates a plain object from an UpdateBackendAuthenticationConfigRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.networksecurity.v1.UpdateBackendAuthenticationConfigRequest + * @static + * @param {google.cloud.networksecurity.v1.UpdateBackendAuthenticationConfigRequest} message UpdateBackendAuthenticationConfigRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateBackendAuthenticationConfigRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.updateMask = null; + object.backendAuthenticationConfig = null; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + if (message.backendAuthenticationConfig != null && message.hasOwnProperty("backendAuthenticationConfig")) + object.backendAuthenticationConfig = $root.google.cloud.networksecurity.v1.BackendAuthenticationConfig.toObject(message.backendAuthenticationConfig, options); + return object; + }; + + /** + * Converts this UpdateBackendAuthenticationConfigRequest to JSON. + * @function toJSON + * @memberof google.cloud.networksecurity.v1.UpdateBackendAuthenticationConfigRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateBackendAuthenticationConfigRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateBackendAuthenticationConfigRequest + * @function getTypeUrl + * @memberof google.cloud.networksecurity.v1.UpdateBackendAuthenticationConfigRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateBackendAuthenticationConfigRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.networksecurity.v1.UpdateBackendAuthenticationConfigRequest"; + }; + + return UpdateBackendAuthenticationConfigRequest; + })(); + + v1.DeleteBackendAuthenticationConfigRequest = (function() { + + /** + * Properties of a DeleteBackendAuthenticationConfigRequest. + * @memberof google.cloud.networksecurity.v1 + * @interface IDeleteBackendAuthenticationConfigRequest + * @property {string|null} [name] DeleteBackendAuthenticationConfigRequest name + * @property {string|null} [etag] DeleteBackendAuthenticationConfigRequest etag + */ + + /** + * Constructs a new DeleteBackendAuthenticationConfigRequest. + * @memberof google.cloud.networksecurity.v1 + * @classdesc Represents a DeleteBackendAuthenticationConfigRequest. + * @implements IDeleteBackendAuthenticationConfigRequest + * @constructor + * @param {google.cloud.networksecurity.v1.IDeleteBackendAuthenticationConfigRequest=} [properties] Properties to set + */ + function DeleteBackendAuthenticationConfigRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteBackendAuthenticationConfigRequest name. + * @member {string} name + * @memberof google.cloud.networksecurity.v1.DeleteBackendAuthenticationConfigRequest + * @instance + */ + DeleteBackendAuthenticationConfigRequest.prototype.name = ""; + + /** + * DeleteBackendAuthenticationConfigRequest etag. + * @member {string} etag + * @memberof google.cloud.networksecurity.v1.DeleteBackendAuthenticationConfigRequest + * @instance + */ + DeleteBackendAuthenticationConfigRequest.prototype.etag = ""; + + /** + * Creates a new DeleteBackendAuthenticationConfigRequest instance using the specified properties. + * @function create + * @memberof google.cloud.networksecurity.v1.DeleteBackendAuthenticationConfigRequest + * @static + * @param {google.cloud.networksecurity.v1.IDeleteBackendAuthenticationConfigRequest=} [properties] Properties to set + * @returns {google.cloud.networksecurity.v1.DeleteBackendAuthenticationConfigRequest} DeleteBackendAuthenticationConfigRequest instance + */ + DeleteBackendAuthenticationConfigRequest.create = function create(properties) { + return new DeleteBackendAuthenticationConfigRequest(properties); + }; + + /** + * Encodes the specified DeleteBackendAuthenticationConfigRequest message. Does not implicitly {@link google.cloud.networksecurity.v1.DeleteBackendAuthenticationConfigRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.networksecurity.v1.DeleteBackendAuthenticationConfigRequest + * @static + * @param {google.cloud.networksecurity.v1.IDeleteBackendAuthenticationConfigRequest} message DeleteBackendAuthenticationConfigRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteBackendAuthenticationConfigRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.etag); + return writer; + }; + + /** + * Encodes the specified DeleteBackendAuthenticationConfigRequest message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.DeleteBackendAuthenticationConfigRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.networksecurity.v1.DeleteBackendAuthenticationConfigRequest + * @static + * @param {google.cloud.networksecurity.v1.IDeleteBackendAuthenticationConfigRequest} message DeleteBackendAuthenticationConfigRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteBackendAuthenticationConfigRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteBackendAuthenticationConfigRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.networksecurity.v1.DeleteBackendAuthenticationConfigRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.networksecurity.v1.DeleteBackendAuthenticationConfigRequest} DeleteBackendAuthenticationConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteBackendAuthenticationConfigRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networksecurity.v1.DeleteBackendAuthenticationConfigRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.etag = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteBackendAuthenticationConfigRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.networksecurity.v1.DeleteBackendAuthenticationConfigRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.networksecurity.v1.DeleteBackendAuthenticationConfigRequest} DeleteBackendAuthenticationConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteBackendAuthenticationConfigRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteBackendAuthenticationConfigRequest message. + * @function verify + * @memberof google.cloud.networksecurity.v1.DeleteBackendAuthenticationConfigRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteBackendAuthenticationConfigRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.etag != null && message.hasOwnProperty("etag")) + if (!$util.isString(message.etag)) + return "etag: string expected"; + return null; + }; + + /** + * Creates a DeleteBackendAuthenticationConfigRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.networksecurity.v1.DeleteBackendAuthenticationConfigRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.networksecurity.v1.DeleteBackendAuthenticationConfigRequest} DeleteBackendAuthenticationConfigRequest + */ + DeleteBackendAuthenticationConfigRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networksecurity.v1.DeleteBackendAuthenticationConfigRequest) + return object; + var message = new $root.google.cloud.networksecurity.v1.DeleteBackendAuthenticationConfigRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.etag != null) + message.etag = String(object.etag); + return message; + }; + + /** + * Creates a plain object from a DeleteBackendAuthenticationConfigRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.networksecurity.v1.DeleteBackendAuthenticationConfigRequest + * @static + * @param {google.cloud.networksecurity.v1.DeleteBackendAuthenticationConfigRequest} message DeleteBackendAuthenticationConfigRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteBackendAuthenticationConfigRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.etag = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.etag != null && message.hasOwnProperty("etag")) + object.etag = message.etag; + return object; + }; + + /** + * Converts this DeleteBackendAuthenticationConfigRequest to JSON. + * @function toJSON + * @memberof google.cloud.networksecurity.v1.DeleteBackendAuthenticationConfigRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteBackendAuthenticationConfigRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteBackendAuthenticationConfigRequest + * @function getTypeUrl + * @memberof google.cloud.networksecurity.v1.DeleteBackendAuthenticationConfigRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteBackendAuthenticationConfigRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.networksecurity.v1.DeleteBackendAuthenticationConfigRequest"; + }; + + return DeleteBackendAuthenticationConfigRequest; + })(); + + v1.ClientTlsPolicy = (function() { + + /** + * Properties of a ClientTlsPolicy. + * @memberof google.cloud.networksecurity.v1 + * @interface IClientTlsPolicy + * @property {string|null} [name] ClientTlsPolicy name + * @property {string|null} [description] ClientTlsPolicy description + * @property {google.protobuf.ITimestamp|null} [createTime] ClientTlsPolicy createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] ClientTlsPolicy updateTime + * @property {Object.|null} [labels] ClientTlsPolicy labels + * @property {string|null} [sni] ClientTlsPolicy sni + * @property {google.cloud.networksecurity.v1.ICertificateProvider|null} [clientCertificate] ClientTlsPolicy clientCertificate + * @property {Array.|null} [serverValidationCa] ClientTlsPolicy serverValidationCa + */ + + /** + * Constructs a new ClientTlsPolicy. + * @memberof google.cloud.networksecurity.v1 + * @classdesc Represents a ClientTlsPolicy. + * @implements IClientTlsPolicy + * @constructor + * @param {google.cloud.networksecurity.v1.IClientTlsPolicy=} [properties] Properties to set + */ + function ClientTlsPolicy(properties) { + this.labels = {}; + this.serverValidationCa = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ClientTlsPolicy name. + * @member {string} name + * @memberof google.cloud.networksecurity.v1.ClientTlsPolicy + * @instance + */ + ClientTlsPolicy.prototype.name = ""; + + /** + * ClientTlsPolicy description. + * @member {string} description + * @memberof google.cloud.networksecurity.v1.ClientTlsPolicy + * @instance + */ + ClientTlsPolicy.prototype.description = ""; + + /** + * ClientTlsPolicy createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.networksecurity.v1.ClientTlsPolicy + * @instance + */ + ClientTlsPolicy.prototype.createTime = null; + + /** + * ClientTlsPolicy updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.networksecurity.v1.ClientTlsPolicy + * @instance + */ + ClientTlsPolicy.prototype.updateTime = null; + + /** + * ClientTlsPolicy labels. + * @member {Object.} labels + * @memberof google.cloud.networksecurity.v1.ClientTlsPolicy + * @instance + */ + ClientTlsPolicy.prototype.labels = $util.emptyObject; + + /** + * ClientTlsPolicy sni. + * @member {string} sni + * @memberof google.cloud.networksecurity.v1.ClientTlsPolicy + * @instance + */ + ClientTlsPolicy.prototype.sni = ""; + + /** + * ClientTlsPolicy clientCertificate. + * @member {google.cloud.networksecurity.v1.ICertificateProvider|null|undefined} clientCertificate + * @memberof google.cloud.networksecurity.v1.ClientTlsPolicy + * @instance + */ + ClientTlsPolicy.prototype.clientCertificate = null; + + /** + * ClientTlsPolicy serverValidationCa. + * @member {Array.} serverValidationCa + * @memberof google.cloud.networksecurity.v1.ClientTlsPolicy + * @instance + */ + ClientTlsPolicy.prototype.serverValidationCa = $util.emptyArray; + + /** + * Creates a new ClientTlsPolicy instance using the specified properties. + * @function create + * @memberof google.cloud.networksecurity.v1.ClientTlsPolicy + * @static + * @param {google.cloud.networksecurity.v1.IClientTlsPolicy=} [properties] Properties to set + * @returns {google.cloud.networksecurity.v1.ClientTlsPolicy} ClientTlsPolicy instance + */ + ClientTlsPolicy.create = function create(properties) { + return new ClientTlsPolicy(properties); + }; + + /** + * Encodes the specified ClientTlsPolicy message. Does not implicitly {@link google.cloud.networksecurity.v1.ClientTlsPolicy.verify|verify} messages. + * @function encode + * @memberof google.cloud.networksecurity.v1.ClientTlsPolicy + * @static + * @param {google.cloud.networksecurity.v1.IClientTlsPolicy} message ClientTlsPolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ClientTlsPolicy.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.description); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) + for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) + writer.uint32(/* id 5, wireType 2 =*/42).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); + if (message.sni != null && Object.hasOwnProperty.call(message, "sni")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.sni); + if (message.clientCertificate != null && Object.hasOwnProperty.call(message, "clientCertificate")) + $root.google.cloud.networksecurity.v1.CertificateProvider.encode(message.clientCertificate, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.serverValidationCa != null && message.serverValidationCa.length) + for (var i = 0; i < message.serverValidationCa.length; ++i) + $root.google.cloud.networksecurity.v1.ValidationCA.encode(message.serverValidationCa[i], writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ClientTlsPolicy message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.ClientTlsPolicy.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.networksecurity.v1.ClientTlsPolicy + * @static + * @param {google.cloud.networksecurity.v1.IClientTlsPolicy} message ClientTlsPolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ClientTlsPolicy.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ClientTlsPolicy message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.networksecurity.v1.ClientTlsPolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.networksecurity.v1.ClientTlsPolicy} ClientTlsPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ClientTlsPolicy.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networksecurity.v1.ClientTlsPolicy(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.description = reader.string(); + break; + } + case 3: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 4: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 5: { + if (message.labels === $util.emptyObject) + message.labels = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.labels[key] = value; + break; + } + case 6: { + message.sni = reader.string(); + break; + } + case 7: { + message.clientCertificate = $root.google.cloud.networksecurity.v1.CertificateProvider.decode(reader, reader.uint32()); + break; + } + case 8: { + if (!(message.serverValidationCa && message.serverValidationCa.length)) + message.serverValidationCa = []; + message.serverValidationCa.push($root.google.cloud.networksecurity.v1.ValidationCA.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ClientTlsPolicy message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.networksecurity.v1.ClientTlsPolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.networksecurity.v1.ClientTlsPolicy} ClientTlsPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ClientTlsPolicy.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ClientTlsPolicy message. + * @function verify + * @memberof google.cloud.networksecurity.v1.ClientTlsPolicy + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ClientTlsPolicy.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime); + if (error) + return "updateTime." + error; + } + if (message.labels != null && message.hasOwnProperty("labels")) { + if (!$util.isObject(message.labels)) + return "labels: object expected"; + var key = Object.keys(message.labels); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.labels[key[i]])) + return "labels: string{k:string} expected"; + } + if (message.sni != null && message.hasOwnProperty("sni")) + if (!$util.isString(message.sni)) + return "sni: string expected"; + if (message.clientCertificate != null && message.hasOwnProperty("clientCertificate")) { + var error = $root.google.cloud.networksecurity.v1.CertificateProvider.verify(message.clientCertificate); + if (error) + return "clientCertificate." + error; + } + if (message.serverValidationCa != null && message.hasOwnProperty("serverValidationCa")) { + if (!Array.isArray(message.serverValidationCa)) + return "serverValidationCa: array expected"; + for (var i = 0; i < message.serverValidationCa.length; ++i) { + var error = $root.google.cloud.networksecurity.v1.ValidationCA.verify(message.serverValidationCa[i]); + if (error) + return "serverValidationCa." + error; + } + } + return null; + }; + + /** + * Creates a ClientTlsPolicy message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.networksecurity.v1.ClientTlsPolicy + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.networksecurity.v1.ClientTlsPolicy} ClientTlsPolicy + */ + ClientTlsPolicy.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networksecurity.v1.ClientTlsPolicy) + return object; + var message = new $root.google.cloud.networksecurity.v1.ClientTlsPolicy(); + if (object.name != null) + message.name = String(object.name); + if (object.description != null) + message.description = String(object.description); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.networksecurity.v1.ClientTlsPolicy.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.updateTime != null) { + if (typeof object.updateTime !== "object") + throw TypeError(".google.cloud.networksecurity.v1.ClientTlsPolicy.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.cloud.networksecurity.v1.ClientTlsPolicy.labels: object expected"); + message.labels = {}; + for (var keys = Object.keys(object.labels), i = 0; i < keys.length; ++i) + message.labels[keys[i]] = String(object.labels[keys[i]]); + } + if (object.sni != null) + message.sni = String(object.sni); + if (object.clientCertificate != null) { + if (typeof object.clientCertificate !== "object") + throw TypeError(".google.cloud.networksecurity.v1.ClientTlsPolicy.clientCertificate: object expected"); + message.clientCertificate = $root.google.cloud.networksecurity.v1.CertificateProvider.fromObject(object.clientCertificate); + } + if (object.serverValidationCa) { + if (!Array.isArray(object.serverValidationCa)) + throw TypeError(".google.cloud.networksecurity.v1.ClientTlsPolicy.serverValidationCa: array expected"); + message.serverValidationCa = []; + for (var i = 0; i < object.serverValidationCa.length; ++i) { + if (typeof object.serverValidationCa[i] !== "object") + throw TypeError(".google.cloud.networksecurity.v1.ClientTlsPolicy.serverValidationCa: object expected"); + message.serverValidationCa[i] = $root.google.cloud.networksecurity.v1.ValidationCA.fromObject(object.serverValidationCa[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a ClientTlsPolicy message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.networksecurity.v1.ClientTlsPolicy + * @static + * @param {google.cloud.networksecurity.v1.ClientTlsPolicy} message ClientTlsPolicy + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ClientTlsPolicy.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.serverValidationCa = []; + if (options.objects || options.defaults) + object.labels = {}; + if (options.defaults) { + object.name = ""; + object.description = ""; + object.createTime = null; + object.updateTime = null; + object.sni = ""; + object.clientCertificate = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.updateTime != null && message.hasOwnProperty("updateTime")) + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); + var keys2; + if (message.labels && (keys2 = Object.keys(message.labels)).length) { + object.labels = {}; + for (var j = 0; j < keys2.length; ++j) + object.labels[keys2[j]] = message.labels[keys2[j]]; + } + if (message.sni != null && message.hasOwnProperty("sni")) + object.sni = message.sni; + if (message.clientCertificate != null && message.hasOwnProperty("clientCertificate")) + object.clientCertificate = $root.google.cloud.networksecurity.v1.CertificateProvider.toObject(message.clientCertificate, options); + if (message.serverValidationCa && message.serverValidationCa.length) { + object.serverValidationCa = []; + for (var j = 0; j < message.serverValidationCa.length; ++j) + object.serverValidationCa[j] = $root.google.cloud.networksecurity.v1.ValidationCA.toObject(message.serverValidationCa[j], options); + } + return object; + }; + + /** + * Converts this ClientTlsPolicy to JSON. + * @function toJSON + * @memberof google.cloud.networksecurity.v1.ClientTlsPolicy + * @instance + * @returns {Object.} JSON object + */ + ClientTlsPolicy.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ClientTlsPolicy + * @function getTypeUrl + * @memberof google.cloud.networksecurity.v1.ClientTlsPolicy + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ClientTlsPolicy.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.networksecurity.v1.ClientTlsPolicy"; + }; + + return ClientTlsPolicy; + })(); + + v1.ListClientTlsPoliciesRequest = (function() { + + /** + * Properties of a ListClientTlsPoliciesRequest. + * @memberof google.cloud.networksecurity.v1 + * @interface IListClientTlsPoliciesRequest + * @property {string|null} [parent] ListClientTlsPoliciesRequest parent + * @property {number|null} [pageSize] ListClientTlsPoliciesRequest pageSize + * @property {string|null} [pageToken] ListClientTlsPoliciesRequest pageToken + */ + + /** + * Constructs a new ListClientTlsPoliciesRequest. + * @memberof google.cloud.networksecurity.v1 + * @classdesc Represents a ListClientTlsPoliciesRequest. + * @implements IListClientTlsPoliciesRequest + * @constructor + * @param {google.cloud.networksecurity.v1.IListClientTlsPoliciesRequest=} [properties] Properties to set + */ + function ListClientTlsPoliciesRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListClientTlsPoliciesRequest parent. + * @member {string} parent + * @memberof google.cloud.networksecurity.v1.ListClientTlsPoliciesRequest + * @instance + */ + ListClientTlsPoliciesRequest.prototype.parent = ""; + + /** + * ListClientTlsPoliciesRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.networksecurity.v1.ListClientTlsPoliciesRequest + * @instance + */ + ListClientTlsPoliciesRequest.prototype.pageSize = 0; + + /** + * ListClientTlsPoliciesRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.networksecurity.v1.ListClientTlsPoliciesRequest + * @instance + */ + ListClientTlsPoliciesRequest.prototype.pageToken = ""; + + /** + * Creates a new ListClientTlsPoliciesRequest instance using the specified properties. + * @function create + * @memberof google.cloud.networksecurity.v1.ListClientTlsPoliciesRequest + * @static + * @param {google.cloud.networksecurity.v1.IListClientTlsPoliciesRequest=} [properties] Properties to set + * @returns {google.cloud.networksecurity.v1.ListClientTlsPoliciesRequest} ListClientTlsPoliciesRequest instance + */ + ListClientTlsPoliciesRequest.create = function create(properties) { + return new ListClientTlsPoliciesRequest(properties); + }; + + /** + * Encodes the specified ListClientTlsPoliciesRequest message. Does not implicitly {@link google.cloud.networksecurity.v1.ListClientTlsPoliciesRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.networksecurity.v1.ListClientTlsPoliciesRequest + * @static + * @param {google.cloud.networksecurity.v1.IListClientTlsPoliciesRequest} message ListClientTlsPoliciesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListClientTlsPoliciesRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + return writer; + }; + + /** + * Encodes the specified ListClientTlsPoliciesRequest message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.ListClientTlsPoliciesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.networksecurity.v1.ListClientTlsPoliciesRequest + * @static + * @param {google.cloud.networksecurity.v1.IListClientTlsPoliciesRequest} message ListClientTlsPoliciesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListClientTlsPoliciesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListClientTlsPoliciesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.networksecurity.v1.ListClientTlsPoliciesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.networksecurity.v1.ListClientTlsPoliciesRequest} ListClientTlsPoliciesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListClientTlsPoliciesRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networksecurity.v1.ListClientTlsPoliciesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListClientTlsPoliciesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.networksecurity.v1.ListClientTlsPoliciesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.networksecurity.v1.ListClientTlsPoliciesRequest} ListClientTlsPoliciesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListClientTlsPoliciesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListClientTlsPoliciesRequest message. + * @function verify + * @memberof google.cloud.networksecurity.v1.ListClientTlsPoliciesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListClientTlsPoliciesRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + return null; + }; + + /** + * Creates a ListClientTlsPoliciesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.networksecurity.v1.ListClientTlsPoliciesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.networksecurity.v1.ListClientTlsPoliciesRequest} ListClientTlsPoliciesRequest + */ + ListClientTlsPoliciesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networksecurity.v1.ListClientTlsPoliciesRequest) + return object; + var message = new $root.google.cloud.networksecurity.v1.ListClientTlsPoliciesRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + return message; + }; + + /** + * Creates a plain object from a ListClientTlsPoliciesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.networksecurity.v1.ListClientTlsPoliciesRequest + * @static + * @param {google.cloud.networksecurity.v1.ListClientTlsPoliciesRequest} message ListClientTlsPoliciesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListClientTlsPoliciesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + return object; + }; + + /** + * Converts this ListClientTlsPoliciesRequest to JSON. + * @function toJSON + * @memberof google.cloud.networksecurity.v1.ListClientTlsPoliciesRequest + * @instance + * @returns {Object.} JSON object + */ + ListClientTlsPoliciesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListClientTlsPoliciesRequest + * @function getTypeUrl + * @memberof google.cloud.networksecurity.v1.ListClientTlsPoliciesRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListClientTlsPoliciesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.networksecurity.v1.ListClientTlsPoliciesRequest"; + }; + + return ListClientTlsPoliciesRequest; + })(); + + v1.ListClientTlsPoliciesResponse = (function() { + + /** + * Properties of a ListClientTlsPoliciesResponse. + * @memberof google.cloud.networksecurity.v1 + * @interface IListClientTlsPoliciesResponse + * @property {Array.|null} [clientTlsPolicies] ListClientTlsPoliciesResponse clientTlsPolicies + * @property {string|null} [nextPageToken] ListClientTlsPoliciesResponse nextPageToken + */ + + /** + * Constructs a new ListClientTlsPoliciesResponse. + * @memberof google.cloud.networksecurity.v1 + * @classdesc Represents a ListClientTlsPoliciesResponse. + * @implements IListClientTlsPoliciesResponse + * @constructor + * @param {google.cloud.networksecurity.v1.IListClientTlsPoliciesResponse=} [properties] Properties to set + */ + function ListClientTlsPoliciesResponse(properties) { + this.clientTlsPolicies = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListClientTlsPoliciesResponse clientTlsPolicies. + * @member {Array.} clientTlsPolicies + * @memberof google.cloud.networksecurity.v1.ListClientTlsPoliciesResponse + * @instance + */ + ListClientTlsPoliciesResponse.prototype.clientTlsPolicies = $util.emptyArray; + + /** + * ListClientTlsPoliciesResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.networksecurity.v1.ListClientTlsPoliciesResponse + * @instance + */ + ListClientTlsPoliciesResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListClientTlsPoliciesResponse instance using the specified properties. + * @function create + * @memberof google.cloud.networksecurity.v1.ListClientTlsPoliciesResponse + * @static + * @param {google.cloud.networksecurity.v1.IListClientTlsPoliciesResponse=} [properties] Properties to set + * @returns {google.cloud.networksecurity.v1.ListClientTlsPoliciesResponse} ListClientTlsPoliciesResponse instance + */ + ListClientTlsPoliciesResponse.create = function create(properties) { + return new ListClientTlsPoliciesResponse(properties); + }; + + /** + * Encodes the specified ListClientTlsPoliciesResponse message. Does not implicitly {@link google.cloud.networksecurity.v1.ListClientTlsPoliciesResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.networksecurity.v1.ListClientTlsPoliciesResponse + * @static + * @param {google.cloud.networksecurity.v1.IListClientTlsPoliciesResponse} message ListClientTlsPoliciesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListClientTlsPoliciesResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.clientTlsPolicies != null && message.clientTlsPolicies.length) + for (var i = 0; i < message.clientTlsPolicies.length; ++i) + $root.google.cloud.networksecurity.v1.ClientTlsPolicy.encode(message.clientTlsPolicies[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + return writer; + }; + + /** + * Encodes the specified ListClientTlsPoliciesResponse message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.ListClientTlsPoliciesResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.networksecurity.v1.ListClientTlsPoliciesResponse + * @static + * @param {google.cloud.networksecurity.v1.IListClientTlsPoliciesResponse} message ListClientTlsPoliciesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListClientTlsPoliciesResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListClientTlsPoliciesResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.networksecurity.v1.ListClientTlsPoliciesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.networksecurity.v1.ListClientTlsPoliciesResponse} ListClientTlsPoliciesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListClientTlsPoliciesResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networksecurity.v1.ListClientTlsPoliciesResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.clientTlsPolicies && message.clientTlsPolicies.length)) + message.clientTlsPolicies = []; + message.clientTlsPolicies.push($root.google.cloud.networksecurity.v1.ClientTlsPolicy.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListClientTlsPoliciesResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.networksecurity.v1.ListClientTlsPoliciesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.networksecurity.v1.ListClientTlsPoliciesResponse} ListClientTlsPoliciesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListClientTlsPoliciesResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListClientTlsPoliciesResponse message. + * @function verify + * @memberof google.cloud.networksecurity.v1.ListClientTlsPoliciesResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ ListClientTlsPoliciesResponse.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.clientTlsPolicies != null && message.hasOwnProperty("clientTlsPolicies")) { - if (!Array.isArray(message.clientTlsPolicies)) - return "clientTlsPolicies: array expected"; - for (var i = 0; i < message.clientTlsPolicies.length; ++i) { - var error = $root.google.cloud.networksecurity.v1.ClientTlsPolicy.verify(message.clientTlsPolicies[i]); - if (error) - return "clientTlsPolicies." + error; + if (message.clientTlsPolicies != null && message.hasOwnProperty("clientTlsPolicies")) { + if (!Array.isArray(message.clientTlsPolicies)) + return "clientTlsPolicies: array expected"; + for (var i = 0; i < message.clientTlsPolicies.length; ++i) { + var error = $root.google.cloud.networksecurity.v1.ClientTlsPolicy.verify(message.clientTlsPolicies[i]); + if (error) + return "clientTlsPolicies." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListClientTlsPoliciesResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.networksecurity.v1.ListClientTlsPoliciesResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.networksecurity.v1.ListClientTlsPoliciesResponse} ListClientTlsPoliciesResponse + */ + ListClientTlsPoliciesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networksecurity.v1.ListClientTlsPoliciesResponse) + return object; + var message = new $root.google.cloud.networksecurity.v1.ListClientTlsPoliciesResponse(); + if (object.clientTlsPolicies) { + if (!Array.isArray(object.clientTlsPolicies)) + throw TypeError(".google.cloud.networksecurity.v1.ListClientTlsPoliciesResponse.clientTlsPolicies: array expected"); + message.clientTlsPolicies = []; + for (var i = 0; i < object.clientTlsPolicies.length; ++i) { + if (typeof object.clientTlsPolicies[i] !== "object") + throw TypeError(".google.cloud.networksecurity.v1.ListClientTlsPoliciesResponse.clientTlsPolicies: object expected"); + message.clientTlsPolicies[i] = $root.google.cloud.networksecurity.v1.ClientTlsPolicy.fromObject(object.clientTlsPolicies[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListClientTlsPoliciesResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.networksecurity.v1.ListClientTlsPoliciesResponse + * @static + * @param {google.cloud.networksecurity.v1.ListClientTlsPoliciesResponse} message ListClientTlsPoliciesResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListClientTlsPoliciesResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.clientTlsPolicies = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.clientTlsPolicies && message.clientTlsPolicies.length) { + object.clientTlsPolicies = []; + for (var j = 0; j < message.clientTlsPolicies.length; ++j) + object.clientTlsPolicies[j] = $root.google.cloud.networksecurity.v1.ClientTlsPolicy.toObject(message.clientTlsPolicies[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListClientTlsPoliciesResponse to JSON. + * @function toJSON + * @memberof google.cloud.networksecurity.v1.ListClientTlsPoliciesResponse + * @instance + * @returns {Object.} JSON object + */ + ListClientTlsPoliciesResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListClientTlsPoliciesResponse + * @function getTypeUrl + * @memberof google.cloud.networksecurity.v1.ListClientTlsPoliciesResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListClientTlsPoliciesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.networksecurity.v1.ListClientTlsPoliciesResponse"; + }; + + return ListClientTlsPoliciesResponse; + })(); + + v1.GetClientTlsPolicyRequest = (function() { + + /** + * Properties of a GetClientTlsPolicyRequest. + * @memberof google.cloud.networksecurity.v1 + * @interface IGetClientTlsPolicyRequest + * @property {string|null} [name] GetClientTlsPolicyRequest name + */ + + /** + * Constructs a new GetClientTlsPolicyRequest. + * @memberof google.cloud.networksecurity.v1 + * @classdesc Represents a GetClientTlsPolicyRequest. + * @implements IGetClientTlsPolicyRequest + * @constructor + * @param {google.cloud.networksecurity.v1.IGetClientTlsPolicyRequest=} [properties] Properties to set + */ + function GetClientTlsPolicyRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetClientTlsPolicyRequest name. + * @member {string} name + * @memberof google.cloud.networksecurity.v1.GetClientTlsPolicyRequest + * @instance + */ + GetClientTlsPolicyRequest.prototype.name = ""; + + /** + * Creates a new GetClientTlsPolicyRequest instance using the specified properties. + * @function create + * @memberof google.cloud.networksecurity.v1.GetClientTlsPolicyRequest + * @static + * @param {google.cloud.networksecurity.v1.IGetClientTlsPolicyRequest=} [properties] Properties to set + * @returns {google.cloud.networksecurity.v1.GetClientTlsPolicyRequest} GetClientTlsPolicyRequest instance + */ + GetClientTlsPolicyRequest.create = function create(properties) { + return new GetClientTlsPolicyRequest(properties); + }; + + /** + * Encodes the specified GetClientTlsPolicyRequest message. Does not implicitly {@link google.cloud.networksecurity.v1.GetClientTlsPolicyRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.networksecurity.v1.GetClientTlsPolicyRequest + * @static + * @param {google.cloud.networksecurity.v1.IGetClientTlsPolicyRequest} message GetClientTlsPolicyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetClientTlsPolicyRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified GetClientTlsPolicyRequest message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.GetClientTlsPolicyRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.networksecurity.v1.GetClientTlsPolicyRequest + * @static + * @param {google.cloud.networksecurity.v1.IGetClientTlsPolicyRequest} message GetClientTlsPolicyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetClientTlsPolicyRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetClientTlsPolicyRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.networksecurity.v1.GetClientTlsPolicyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.networksecurity.v1.GetClientTlsPolicyRequest} GetClientTlsPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetClientTlsPolicyRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networksecurity.v1.GetClientTlsPolicyRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetClientTlsPolicyRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.networksecurity.v1.GetClientTlsPolicyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.networksecurity.v1.GetClientTlsPolicyRequest} GetClientTlsPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetClientTlsPolicyRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetClientTlsPolicyRequest message. + * @function verify + * @memberof google.cloud.networksecurity.v1.GetClientTlsPolicyRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetClientTlsPolicyRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a GetClientTlsPolicyRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.networksecurity.v1.GetClientTlsPolicyRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.networksecurity.v1.GetClientTlsPolicyRequest} GetClientTlsPolicyRequest + */ + GetClientTlsPolicyRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networksecurity.v1.GetClientTlsPolicyRequest) + return object; + var message = new $root.google.cloud.networksecurity.v1.GetClientTlsPolicyRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetClientTlsPolicyRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.networksecurity.v1.GetClientTlsPolicyRequest + * @static + * @param {google.cloud.networksecurity.v1.GetClientTlsPolicyRequest} message GetClientTlsPolicyRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetClientTlsPolicyRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this GetClientTlsPolicyRequest to JSON. + * @function toJSON + * @memberof google.cloud.networksecurity.v1.GetClientTlsPolicyRequest + * @instance + * @returns {Object.} JSON object + */ + GetClientTlsPolicyRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetClientTlsPolicyRequest + * @function getTypeUrl + * @memberof google.cloud.networksecurity.v1.GetClientTlsPolicyRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetClientTlsPolicyRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.networksecurity.v1.GetClientTlsPolicyRequest"; + }; + + return GetClientTlsPolicyRequest; + })(); + + v1.CreateClientTlsPolicyRequest = (function() { + + /** + * Properties of a CreateClientTlsPolicyRequest. + * @memberof google.cloud.networksecurity.v1 + * @interface ICreateClientTlsPolicyRequest + * @property {string|null} [parent] CreateClientTlsPolicyRequest parent + * @property {string|null} [clientTlsPolicyId] CreateClientTlsPolicyRequest clientTlsPolicyId + * @property {google.cloud.networksecurity.v1.IClientTlsPolicy|null} [clientTlsPolicy] CreateClientTlsPolicyRequest clientTlsPolicy + */ + + /** + * Constructs a new CreateClientTlsPolicyRequest. + * @memberof google.cloud.networksecurity.v1 + * @classdesc Represents a CreateClientTlsPolicyRequest. + * @implements ICreateClientTlsPolicyRequest + * @constructor + * @param {google.cloud.networksecurity.v1.ICreateClientTlsPolicyRequest=} [properties] Properties to set + */ + function CreateClientTlsPolicyRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateClientTlsPolicyRequest parent. + * @member {string} parent + * @memberof google.cloud.networksecurity.v1.CreateClientTlsPolicyRequest + * @instance + */ + CreateClientTlsPolicyRequest.prototype.parent = ""; + + /** + * CreateClientTlsPolicyRequest clientTlsPolicyId. + * @member {string} clientTlsPolicyId + * @memberof google.cloud.networksecurity.v1.CreateClientTlsPolicyRequest + * @instance + */ + CreateClientTlsPolicyRequest.prototype.clientTlsPolicyId = ""; + + /** + * CreateClientTlsPolicyRequest clientTlsPolicy. + * @member {google.cloud.networksecurity.v1.IClientTlsPolicy|null|undefined} clientTlsPolicy + * @memberof google.cloud.networksecurity.v1.CreateClientTlsPolicyRequest + * @instance + */ + CreateClientTlsPolicyRequest.prototype.clientTlsPolicy = null; + + /** + * Creates a new CreateClientTlsPolicyRequest instance using the specified properties. + * @function create + * @memberof google.cloud.networksecurity.v1.CreateClientTlsPolicyRequest + * @static + * @param {google.cloud.networksecurity.v1.ICreateClientTlsPolicyRequest=} [properties] Properties to set + * @returns {google.cloud.networksecurity.v1.CreateClientTlsPolicyRequest} CreateClientTlsPolicyRequest instance + */ + CreateClientTlsPolicyRequest.create = function create(properties) { + return new CreateClientTlsPolicyRequest(properties); + }; + + /** + * Encodes the specified CreateClientTlsPolicyRequest message. Does not implicitly {@link google.cloud.networksecurity.v1.CreateClientTlsPolicyRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.networksecurity.v1.CreateClientTlsPolicyRequest + * @static + * @param {google.cloud.networksecurity.v1.ICreateClientTlsPolicyRequest} message CreateClientTlsPolicyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateClientTlsPolicyRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.clientTlsPolicyId != null && Object.hasOwnProperty.call(message, "clientTlsPolicyId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.clientTlsPolicyId); + if (message.clientTlsPolicy != null && Object.hasOwnProperty.call(message, "clientTlsPolicy")) + $root.google.cloud.networksecurity.v1.ClientTlsPolicy.encode(message.clientTlsPolicy, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreateClientTlsPolicyRequest message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.CreateClientTlsPolicyRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.networksecurity.v1.CreateClientTlsPolicyRequest + * @static + * @param {google.cloud.networksecurity.v1.ICreateClientTlsPolicyRequest} message CreateClientTlsPolicyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateClientTlsPolicyRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateClientTlsPolicyRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.networksecurity.v1.CreateClientTlsPolicyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.networksecurity.v1.CreateClientTlsPolicyRequest} CreateClientTlsPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateClientTlsPolicyRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networksecurity.v1.CreateClientTlsPolicyRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.clientTlsPolicyId = reader.string(); + break; + } + case 3: { + message.clientTlsPolicy = $root.google.cloud.networksecurity.v1.ClientTlsPolicy.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateClientTlsPolicyRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.networksecurity.v1.CreateClientTlsPolicyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.networksecurity.v1.CreateClientTlsPolicyRequest} CreateClientTlsPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateClientTlsPolicyRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateClientTlsPolicyRequest message. + * @function verify + * @memberof google.cloud.networksecurity.v1.CreateClientTlsPolicyRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateClientTlsPolicyRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.clientTlsPolicyId != null && message.hasOwnProperty("clientTlsPolicyId")) + if (!$util.isString(message.clientTlsPolicyId)) + return "clientTlsPolicyId: string expected"; + if (message.clientTlsPolicy != null && message.hasOwnProperty("clientTlsPolicy")) { + var error = $root.google.cloud.networksecurity.v1.ClientTlsPolicy.verify(message.clientTlsPolicy); + if (error) + return "clientTlsPolicy." + error; + } + return null; + }; + + /** + * Creates a CreateClientTlsPolicyRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.networksecurity.v1.CreateClientTlsPolicyRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.networksecurity.v1.CreateClientTlsPolicyRequest} CreateClientTlsPolicyRequest + */ + CreateClientTlsPolicyRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networksecurity.v1.CreateClientTlsPolicyRequest) + return object; + var message = new $root.google.cloud.networksecurity.v1.CreateClientTlsPolicyRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.clientTlsPolicyId != null) + message.clientTlsPolicyId = String(object.clientTlsPolicyId); + if (object.clientTlsPolicy != null) { + if (typeof object.clientTlsPolicy !== "object") + throw TypeError(".google.cloud.networksecurity.v1.CreateClientTlsPolicyRequest.clientTlsPolicy: object expected"); + message.clientTlsPolicy = $root.google.cloud.networksecurity.v1.ClientTlsPolicy.fromObject(object.clientTlsPolicy); + } + return message; + }; + + /** + * Creates a plain object from a CreateClientTlsPolicyRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.networksecurity.v1.CreateClientTlsPolicyRequest + * @static + * @param {google.cloud.networksecurity.v1.CreateClientTlsPolicyRequest} message CreateClientTlsPolicyRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateClientTlsPolicyRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.clientTlsPolicyId = ""; + object.clientTlsPolicy = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.clientTlsPolicyId != null && message.hasOwnProperty("clientTlsPolicyId")) + object.clientTlsPolicyId = message.clientTlsPolicyId; + if (message.clientTlsPolicy != null && message.hasOwnProperty("clientTlsPolicy")) + object.clientTlsPolicy = $root.google.cloud.networksecurity.v1.ClientTlsPolicy.toObject(message.clientTlsPolicy, options); + return object; + }; + + /** + * Converts this CreateClientTlsPolicyRequest to JSON. + * @function toJSON + * @memberof google.cloud.networksecurity.v1.CreateClientTlsPolicyRequest + * @instance + * @returns {Object.} JSON object + */ + CreateClientTlsPolicyRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateClientTlsPolicyRequest + * @function getTypeUrl + * @memberof google.cloud.networksecurity.v1.CreateClientTlsPolicyRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateClientTlsPolicyRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.networksecurity.v1.CreateClientTlsPolicyRequest"; + }; + + return CreateClientTlsPolicyRequest; + })(); + + v1.UpdateClientTlsPolicyRequest = (function() { + + /** + * Properties of an UpdateClientTlsPolicyRequest. + * @memberof google.cloud.networksecurity.v1 + * @interface IUpdateClientTlsPolicyRequest + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateClientTlsPolicyRequest updateMask + * @property {google.cloud.networksecurity.v1.IClientTlsPolicy|null} [clientTlsPolicy] UpdateClientTlsPolicyRequest clientTlsPolicy + */ + + /** + * Constructs a new UpdateClientTlsPolicyRequest. + * @memberof google.cloud.networksecurity.v1 + * @classdesc Represents an UpdateClientTlsPolicyRequest. + * @implements IUpdateClientTlsPolicyRequest + * @constructor + * @param {google.cloud.networksecurity.v1.IUpdateClientTlsPolicyRequest=} [properties] Properties to set + */ + function UpdateClientTlsPolicyRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateClientTlsPolicyRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.networksecurity.v1.UpdateClientTlsPolicyRequest + * @instance + */ + UpdateClientTlsPolicyRequest.prototype.updateMask = null; + + /** + * UpdateClientTlsPolicyRequest clientTlsPolicy. + * @member {google.cloud.networksecurity.v1.IClientTlsPolicy|null|undefined} clientTlsPolicy + * @memberof google.cloud.networksecurity.v1.UpdateClientTlsPolicyRequest + * @instance + */ + UpdateClientTlsPolicyRequest.prototype.clientTlsPolicy = null; + + /** + * Creates a new UpdateClientTlsPolicyRequest instance using the specified properties. + * @function create + * @memberof google.cloud.networksecurity.v1.UpdateClientTlsPolicyRequest + * @static + * @param {google.cloud.networksecurity.v1.IUpdateClientTlsPolicyRequest=} [properties] Properties to set + * @returns {google.cloud.networksecurity.v1.UpdateClientTlsPolicyRequest} UpdateClientTlsPolicyRequest instance + */ + UpdateClientTlsPolicyRequest.create = function create(properties) { + return new UpdateClientTlsPolicyRequest(properties); + }; + + /** + * Encodes the specified UpdateClientTlsPolicyRequest message. Does not implicitly {@link google.cloud.networksecurity.v1.UpdateClientTlsPolicyRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.networksecurity.v1.UpdateClientTlsPolicyRequest + * @static + * @param {google.cloud.networksecurity.v1.IUpdateClientTlsPolicyRequest} message UpdateClientTlsPolicyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateClientTlsPolicyRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.clientTlsPolicy != null && Object.hasOwnProperty.call(message, "clientTlsPolicy")) + $root.google.cloud.networksecurity.v1.ClientTlsPolicy.encode(message.clientTlsPolicy, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified UpdateClientTlsPolicyRequest message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.UpdateClientTlsPolicyRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.networksecurity.v1.UpdateClientTlsPolicyRequest + * @static + * @param {google.cloud.networksecurity.v1.IUpdateClientTlsPolicyRequest} message UpdateClientTlsPolicyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateClientTlsPolicyRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateClientTlsPolicyRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.networksecurity.v1.UpdateClientTlsPolicyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.networksecurity.v1.UpdateClientTlsPolicyRequest} UpdateClientTlsPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateClientTlsPolicyRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networksecurity.v1.UpdateClientTlsPolicyRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + case 2: { + message.clientTlsPolicy = $root.google.cloud.networksecurity.v1.ClientTlsPolicy.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateClientTlsPolicyRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.networksecurity.v1.UpdateClientTlsPolicyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.networksecurity.v1.UpdateClientTlsPolicyRequest} UpdateClientTlsPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateClientTlsPolicyRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateClientTlsPolicyRequest message. + * @function verify + * @memberof google.cloud.networksecurity.v1.UpdateClientTlsPolicyRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateClientTlsPolicyRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + if (message.clientTlsPolicy != null && message.hasOwnProperty("clientTlsPolicy")) { + var error = $root.google.cloud.networksecurity.v1.ClientTlsPolicy.verify(message.clientTlsPolicy); + if (error) + return "clientTlsPolicy." + error; + } + return null; + }; + + /** + * Creates an UpdateClientTlsPolicyRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.networksecurity.v1.UpdateClientTlsPolicyRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.networksecurity.v1.UpdateClientTlsPolicyRequest} UpdateClientTlsPolicyRequest + */ + UpdateClientTlsPolicyRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networksecurity.v1.UpdateClientTlsPolicyRequest) + return object; + var message = new $root.google.cloud.networksecurity.v1.UpdateClientTlsPolicyRequest(); + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.networksecurity.v1.UpdateClientTlsPolicyRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + if (object.clientTlsPolicy != null) { + if (typeof object.clientTlsPolicy !== "object") + throw TypeError(".google.cloud.networksecurity.v1.UpdateClientTlsPolicyRequest.clientTlsPolicy: object expected"); + message.clientTlsPolicy = $root.google.cloud.networksecurity.v1.ClientTlsPolicy.fromObject(object.clientTlsPolicy); + } + return message; + }; + + /** + * Creates a plain object from an UpdateClientTlsPolicyRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.networksecurity.v1.UpdateClientTlsPolicyRequest + * @static + * @param {google.cloud.networksecurity.v1.UpdateClientTlsPolicyRequest} message UpdateClientTlsPolicyRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateClientTlsPolicyRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.updateMask = null; + object.clientTlsPolicy = null; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + if (message.clientTlsPolicy != null && message.hasOwnProperty("clientTlsPolicy")) + object.clientTlsPolicy = $root.google.cloud.networksecurity.v1.ClientTlsPolicy.toObject(message.clientTlsPolicy, options); + return object; + }; + + /** + * Converts this UpdateClientTlsPolicyRequest to JSON. + * @function toJSON + * @memberof google.cloud.networksecurity.v1.UpdateClientTlsPolicyRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateClientTlsPolicyRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateClientTlsPolicyRequest + * @function getTypeUrl + * @memberof google.cloud.networksecurity.v1.UpdateClientTlsPolicyRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateClientTlsPolicyRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.networksecurity.v1.UpdateClientTlsPolicyRequest"; + }; + + return UpdateClientTlsPolicyRequest; + })(); + + v1.DeleteClientTlsPolicyRequest = (function() { + + /** + * Properties of a DeleteClientTlsPolicyRequest. + * @memberof google.cloud.networksecurity.v1 + * @interface IDeleteClientTlsPolicyRequest + * @property {string|null} [name] DeleteClientTlsPolicyRequest name + */ + + /** + * Constructs a new DeleteClientTlsPolicyRequest. + * @memberof google.cloud.networksecurity.v1 + * @classdesc Represents a DeleteClientTlsPolicyRequest. + * @implements IDeleteClientTlsPolicyRequest + * @constructor + * @param {google.cloud.networksecurity.v1.IDeleteClientTlsPolicyRequest=} [properties] Properties to set + */ + function DeleteClientTlsPolicyRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteClientTlsPolicyRequest name. + * @member {string} name + * @memberof google.cloud.networksecurity.v1.DeleteClientTlsPolicyRequest + * @instance + */ + DeleteClientTlsPolicyRequest.prototype.name = ""; + + /** + * Creates a new DeleteClientTlsPolicyRequest instance using the specified properties. + * @function create + * @memberof google.cloud.networksecurity.v1.DeleteClientTlsPolicyRequest + * @static + * @param {google.cloud.networksecurity.v1.IDeleteClientTlsPolicyRequest=} [properties] Properties to set + * @returns {google.cloud.networksecurity.v1.DeleteClientTlsPolicyRequest} DeleteClientTlsPolicyRequest instance + */ + DeleteClientTlsPolicyRequest.create = function create(properties) { + return new DeleteClientTlsPolicyRequest(properties); + }; + + /** + * Encodes the specified DeleteClientTlsPolicyRequest message. Does not implicitly {@link google.cloud.networksecurity.v1.DeleteClientTlsPolicyRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.networksecurity.v1.DeleteClientTlsPolicyRequest + * @static + * @param {google.cloud.networksecurity.v1.IDeleteClientTlsPolicyRequest} message DeleteClientTlsPolicyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteClientTlsPolicyRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified DeleteClientTlsPolicyRequest message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.DeleteClientTlsPolicyRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.networksecurity.v1.DeleteClientTlsPolicyRequest + * @static + * @param {google.cloud.networksecurity.v1.IDeleteClientTlsPolicyRequest} message DeleteClientTlsPolicyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteClientTlsPolicyRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteClientTlsPolicyRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.networksecurity.v1.DeleteClientTlsPolicyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.networksecurity.v1.DeleteClientTlsPolicyRequest} DeleteClientTlsPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteClientTlsPolicyRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networksecurity.v1.DeleteClientTlsPolicyRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteClientTlsPolicyRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.networksecurity.v1.DeleteClientTlsPolicyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.networksecurity.v1.DeleteClientTlsPolicyRequest} DeleteClientTlsPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteClientTlsPolicyRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteClientTlsPolicyRequest message. + * @function verify + * @memberof google.cloud.networksecurity.v1.DeleteClientTlsPolicyRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteClientTlsPolicyRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a DeleteClientTlsPolicyRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.networksecurity.v1.DeleteClientTlsPolicyRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.networksecurity.v1.DeleteClientTlsPolicyRequest} DeleteClientTlsPolicyRequest + */ + DeleteClientTlsPolicyRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networksecurity.v1.DeleteClientTlsPolicyRequest) + return object; + var message = new $root.google.cloud.networksecurity.v1.DeleteClientTlsPolicyRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a DeleteClientTlsPolicyRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.networksecurity.v1.DeleteClientTlsPolicyRequest + * @static + * @param {google.cloud.networksecurity.v1.DeleteClientTlsPolicyRequest} message DeleteClientTlsPolicyRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteClientTlsPolicyRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this DeleteClientTlsPolicyRequest to JSON. + * @function toJSON + * @memberof google.cloud.networksecurity.v1.DeleteClientTlsPolicyRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteClientTlsPolicyRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteClientTlsPolicyRequest + * @function getTypeUrl + * @memberof google.cloud.networksecurity.v1.DeleteClientTlsPolicyRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteClientTlsPolicyRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.networksecurity.v1.DeleteClientTlsPolicyRequest"; + }; + + return DeleteClientTlsPolicyRequest; + })(); + + v1.GrpcEndpoint = (function() { + + /** + * Properties of a GrpcEndpoint. + * @memberof google.cloud.networksecurity.v1 + * @interface IGrpcEndpoint + * @property {string|null} [targetUri] GrpcEndpoint targetUri + */ + + /** + * Constructs a new GrpcEndpoint. + * @memberof google.cloud.networksecurity.v1 + * @classdesc Represents a GrpcEndpoint. + * @implements IGrpcEndpoint + * @constructor + * @param {google.cloud.networksecurity.v1.IGrpcEndpoint=} [properties] Properties to set + */ + function GrpcEndpoint(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GrpcEndpoint targetUri. + * @member {string} targetUri + * @memberof google.cloud.networksecurity.v1.GrpcEndpoint + * @instance + */ + GrpcEndpoint.prototype.targetUri = ""; + + /** + * Creates a new GrpcEndpoint instance using the specified properties. + * @function create + * @memberof google.cloud.networksecurity.v1.GrpcEndpoint + * @static + * @param {google.cloud.networksecurity.v1.IGrpcEndpoint=} [properties] Properties to set + * @returns {google.cloud.networksecurity.v1.GrpcEndpoint} GrpcEndpoint instance + */ + GrpcEndpoint.create = function create(properties) { + return new GrpcEndpoint(properties); + }; + + /** + * Encodes the specified GrpcEndpoint message. Does not implicitly {@link google.cloud.networksecurity.v1.GrpcEndpoint.verify|verify} messages. + * @function encode + * @memberof google.cloud.networksecurity.v1.GrpcEndpoint + * @static + * @param {google.cloud.networksecurity.v1.IGrpcEndpoint} message GrpcEndpoint message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GrpcEndpoint.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.targetUri != null && Object.hasOwnProperty.call(message, "targetUri")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.targetUri); + return writer; + }; + + /** + * Encodes the specified GrpcEndpoint message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.GrpcEndpoint.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.networksecurity.v1.GrpcEndpoint + * @static + * @param {google.cloud.networksecurity.v1.IGrpcEndpoint} message GrpcEndpoint message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GrpcEndpoint.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GrpcEndpoint message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.networksecurity.v1.GrpcEndpoint + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.networksecurity.v1.GrpcEndpoint} GrpcEndpoint + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GrpcEndpoint.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networksecurity.v1.GrpcEndpoint(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.targetUri = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GrpcEndpoint message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.networksecurity.v1.GrpcEndpoint + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.networksecurity.v1.GrpcEndpoint} GrpcEndpoint + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GrpcEndpoint.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GrpcEndpoint message. + * @function verify + * @memberof google.cloud.networksecurity.v1.GrpcEndpoint + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GrpcEndpoint.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.targetUri != null && message.hasOwnProperty("targetUri")) + if (!$util.isString(message.targetUri)) + return "targetUri: string expected"; + return null; + }; + + /** + * Creates a GrpcEndpoint message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.networksecurity.v1.GrpcEndpoint + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.networksecurity.v1.GrpcEndpoint} GrpcEndpoint + */ + GrpcEndpoint.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networksecurity.v1.GrpcEndpoint) + return object; + var message = new $root.google.cloud.networksecurity.v1.GrpcEndpoint(); + if (object.targetUri != null) + message.targetUri = String(object.targetUri); + return message; + }; + + /** + * Creates a plain object from a GrpcEndpoint message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.networksecurity.v1.GrpcEndpoint + * @static + * @param {google.cloud.networksecurity.v1.GrpcEndpoint} message GrpcEndpoint + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GrpcEndpoint.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.targetUri = ""; + if (message.targetUri != null && message.hasOwnProperty("targetUri")) + object.targetUri = message.targetUri; + return object; + }; + + /** + * Converts this GrpcEndpoint to JSON. + * @function toJSON + * @memberof google.cloud.networksecurity.v1.GrpcEndpoint + * @instance + * @returns {Object.} JSON object + */ + GrpcEndpoint.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GrpcEndpoint + * @function getTypeUrl + * @memberof google.cloud.networksecurity.v1.GrpcEndpoint + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GrpcEndpoint.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.networksecurity.v1.GrpcEndpoint"; + }; + + return GrpcEndpoint; + })(); + + v1.ValidationCA = (function() { + + /** + * Properties of a ValidationCA. + * @memberof google.cloud.networksecurity.v1 + * @interface IValidationCA + * @property {google.cloud.networksecurity.v1.IGrpcEndpoint|null} [grpcEndpoint] ValidationCA grpcEndpoint + * @property {google.cloud.networksecurity.v1.ICertificateProviderInstance|null} [certificateProviderInstance] ValidationCA certificateProviderInstance + */ + + /** + * Constructs a new ValidationCA. + * @memberof google.cloud.networksecurity.v1 + * @classdesc Represents a ValidationCA. + * @implements IValidationCA + * @constructor + * @param {google.cloud.networksecurity.v1.IValidationCA=} [properties] Properties to set + */ + function ValidationCA(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ValidationCA grpcEndpoint. + * @member {google.cloud.networksecurity.v1.IGrpcEndpoint|null|undefined} grpcEndpoint + * @memberof google.cloud.networksecurity.v1.ValidationCA + * @instance + */ + ValidationCA.prototype.grpcEndpoint = null; + + /** + * ValidationCA certificateProviderInstance. + * @member {google.cloud.networksecurity.v1.ICertificateProviderInstance|null|undefined} certificateProviderInstance + * @memberof google.cloud.networksecurity.v1.ValidationCA + * @instance + */ + ValidationCA.prototype.certificateProviderInstance = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ValidationCA type. + * @member {"grpcEndpoint"|"certificateProviderInstance"|undefined} type + * @memberof google.cloud.networksecurity.v1.ValidationCA + * @instance + */ + Object.defineProperty(ValidationCA.prototype, "type", { + get: $util.oneOfGetter($oneOfFields = ["grpcEndpoint", "certificateProviderInstance"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ValidationCA instance using the specified properties. + * @function create + * @memberof google.cloud.networksecurity.v1.ValidationCA + * @static + * @param {google.cloud.networksecurity.v1.IValidationCA=} [properties] Properties to set + * @returns {google.cloud.networksecurity.v1.ValidationCA} ValidationCA instance + */ + ValidationCA.create = function create(properties) { + return new ValidationCA(properties); + }; + + /** + * Encodes the specified ValidationCA message. Does not implicitly {@link google.cloud.networksecurity.v1.ValidationCA.verify|verify} messages. + * @function encode + * @memberof google.cloud.networksecurity.v1.ValidationCA + * @static + * @param {google.cloud.networksecurity.v1.IValidationCA} message ValidationCA message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ValidationCA.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.grpcEndpoint != null && Object.hasOwnProperty.call(message, "grpcEndpoint")) + $root.google.cloud.networksecurity.v1.GrpcEndpoint.encode(message.grpcEndpoint, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.certificateProviderInstance != null && Object.hasOwnProperty.call(message, "certificateProviderInstance")) + $root.google.cloud.networksecurity.v1.CertificateProviderInstance.encode(message.certificateProviderInstance, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ValidationCA message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.ValidationCA.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.networksecurity.v1.ValidationCA + * @static + * @param {google.cloud.networksecurity.v1.IValidationCA} message ValidationCA message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ValidationCA.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ValidationCA message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.networksecurity.v1.ValidationCA + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.networksecurity.v1.ValidationCA} ValidationCA + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ValidationCA.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networksecurity.v1.ValidationCA(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 2: { + message.grpcEndpoint = $root.google.cloud.networksecurity.v1.GrpcEndpoint.decode(reader, reader.uint32()); + break; + } + case 3: { + message.certificateProviderInstance = $root.google.cloud.networksecurity.v1.CertificateProviderInstance.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ValidationCA message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.networksecurity.v1.ValidationCA + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.networksecurity.v1.ValidationCA} ValidationCA + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ValidationCA.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ValidationCA message. + * @function verify + * @memberof google.cloud.networksecurity.v1.ValidationCA + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ValidationCA.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.grpcEndpoint != null && message.hasOwnProperty("grpcEndpoint")) { + properties.type = 1; + { + var error = $root.google.cloud.networksecurity.v1.GrpcEndpoint.verify(message.grpcEndpoint); + if (error) + return "grpcEndpoint." + error; + } + } + if (message.certificateProviderInstance != null && message.hasOwnProperty("certificateProviderInstance")) { + if (properties.type === 1) + return "type: multiple values"; + properties.type = 1; + { + var error = $root.google.cloud.networksecurity.v1.CertificateProviderInstance.verify(message.certificateProviderInstance); + if (error) + return "certificateProviderInstance." + error; + } + } + return null; + }; + + /** + * Creates a ValidationCA message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.networksecurity.v1.ValidationCA + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.networksecurity.v1.ValidationCA} ValidationCA + */ + ValidationCA.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networksecurity.v1.ValidationCA) + return object; + var message = new $root.google.cloud.networksecurity.v1.ValidationCA(); + if (object.grpcEndpoint != null) { + if (typeof object.grpcEndpoint !== "object") + throw TypeError(".google.cloud.networksecurity.v1.ValidationCA.grpcEndpoint: object expected"); + message.grpcEndpoint = $root.google.cloud.networksecurity.v1.GrpcEndpoint.fromObject(object.grpcEndpoint); + } + if (object.certificateProviderInstance != null) { + if (typeof object.certificateProviderInstance !== "object") + throw TypeError(".google.cloud.networksecurity.v1.ValidationCA.certificateProviderInstance: object expected"); + message.certificateProviderInstance = $root.google.cloud.networksecurity.v1.CertificateProviderInstance.fromObject(object.certificateProviderInstance); + } + return message; + }; + + /** + * Creates a plain object from a ValidationCA message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.networksecurity.v1.ValidationCA + * @static + * @param {google.cloud.networksecurity.v1.ValidationCA} message ValidationCA + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ValidationCA.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.grpcEndpoint != null && message.hasOwnProperty("grpcEndpoint")) { + object.grpcEndpoint = $root.google.cloud.networksecurity.v1.GrpcEndpoint.toObject(message.grpcEndpoint, options); + if (options.oneofs) + object.type = "grpcEndpoint"; + } + if (message.certificateProviderInstance != null && message.hasOwnProperty("certificateProviderInstance")) { + object.certificateProviderInstance = $root.google.cloud.networksecurity.v1.CertificateProviderInstance.toObject(message.certificateProviderInstance, options); + if (options.oneofs) + object.type = "certificateProviderInstance"; + } + return object; + }; + + /** + * Converts this ValidationCA to JSON. + * @function toJSON + * @memberof google.cloud.networksecurity.v1.ValidationCA + * @instance + * @returns {Object.} JSON object + */ + ValidationCA.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ValidationCA + * @function getTypeUrl + * @memberof google.cloud.networksecurity.v1.ValidationCA + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ValidationCA.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.networksecurity.v1.ValidationCA"; + }; + + return ValidationCA; + })(); + + v1.CertificateProviderInstance = (function() { + + /** + * Properties of a CertificateProviderInstance. + * @memberof google.cloud.networksecurity.v1 + * @interface ICertificateProviderInstance + * @property {string|null} [pluginInstance] CertificateProviderInstance pluginInstance + */ + + /** + * Constructs a new CertificateProviderInstance. + * @memberof google.cloud.networksecurity.v1 + * @classdesc Represents a CertificateProviderInstance. + * @implements ICertificateProviderInstance + * @constructor + * @param {google.cloud.networksecurity.v1.ICertificateProviderInstance=} [properties] Properties to set + */ + function CertificateProviderInstance(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CertificateProviderInstance pluginInstance. + * @member {string} pluginInstance + * @memberof google.cloud.networksecurity.v1.CertificateProviderInstance + * @instance + */ + CertificateProviderInstance.prototype.pluginInstance = ""; + + /** + * Creates a new CertificateProviderInstance instance using the specified properties. + * @function create + * @memberof google.cloud.networksecurity.v1.CertificateProviderInstance + * @static + * @param {google.cloud.networksecurity.v1.ICertificateProviderInstance=} [properties] Properties to set + * @returns {google.cloud.networksecurity.v1.CertificateProviderInstance} CertificateProviderInstance instance + */ + CertificateProviderInstance.create = function create(properties) { + return new CertificateProviderInstance(properties); + }; + + /** + * Encodes the specified CertificateProviderInstance message. Does not implicitly {@link google.cloud.networksecurity.v1.CertificateProviderInstance.verify|verify} messages. + * @function encode + * @memberof google.cloud.networksecurity.v1.CertificateProviderInstance + * @static + * @param {google.cloud.networksecurity.v1.ICertificateProviderInstance} message CertificateProviderInstance message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CertificateProviderInstance.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.pluginInstance != null && Object.hasOwnProperty.call(message, "pluginInstance")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.pluginInstance); + return writer; + }; + + /** + * Encodes the specified CertificateProviderInstance message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.CertificateProviderInstance.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.networksecurity.v1.CertificateProviderInstance + * @static + * @param {google.cloud.networksecurity.v1.ICertificateProviderInstance} message CertificateProviderInstance message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CertificateProviderInstance.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CertificateProviderInstance message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.networksecurity.v1.CertificateProviderInstance + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.networksecurity.v1.CertificateProviderInstance} CertificateProviderInstance + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CertificateProviderInstance.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networksecurity.v1.CertificateProviderInstance(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.pluginInstance = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CertificateProviderInstance message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.networksecurity.v1.CertificateProviderInstance + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.networksecurity.v1.CertificateProviderInstance} CertificateProviderInstance + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CertificateProviderInstance.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CertificateProviderInstance message. + * @function verify + * @memberof google.cloud.networksecurity.v1.CertificateProviderInstance + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CertificateProviderInstance.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.pluginInstance != null && message.hasOwnProperty("pluginInstance")) + if (!$util.isString(message.pluginInstance)) + return "pluginInstance: string expected"; + return null; + }; + + /** + * Creates a CertificateProviderInstance message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.networksecurity.v1.CertificateProviderInstance + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.networksecurity.v1.CertificateProviderInstance} CertificateProviderInstance + */ + CertificateProviderInstance.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networksecurity.v1.CertificateProviderInstance) + return object; + var message = new $root.google.cloud.networksecurity.v1.CertificateProviderInstance(); + if (object.pluginInstance != null) + message.pluginInstance = String(object.pluginInstance); + return message; + }; + + /** + * Creates a plain object from a CertificateProviderInstance message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.networksecurity.v1.CertificateProviderInstance + * @static + * @param {google.cloud.networksecurity.v1.CertificateProviderInstance} message CertificateProviderInstance + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CertificateProviderInstance.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.pluginInstance = ""; + if (message.pluginInstance != null && message.hasOwnProperty("pluginInstance")) + object.pluginInstance = message.pluginInstance; + return object; + }; + + /** + * Converts this CertificateProviderInstance to JSON. + * @function toJSON + * @memberof google.cloud.networksecurity.v1.CertificateProviderInstance + * @instance + * @returns {Object.} JSON object + */ + CertificateProviderInstance.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CertificateProviderInstance + * @function getTypeUrl + * @memberof google.cloud.networksecurity.v1.CertificateProviderInstance + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CertificateProviderInstance.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.networksecurity.v1.CertificateProviderInstance"; + }; + + return CertificateProviderInstance; + })(); + + v1.CertificateProvider = (function() { + + /** + * Properties of a CertificateProvider. + * @memberof google.cloud.networksecurity.v1 + * @interface ICertificateProvider + * @property {google.cloud.networksecurity.v1.IGrpcEndpoint|null} [grpcEndpoint] CertificateProvider grpcEndpoint + * @property {google.cloud.networksecurity.v1.ICertificateProviderInstance|null} [certificateProviderInstance] CertificateProvider certificateProviderInstance + */ + + /** + * Constructs a new CertificateProvider. + * @memberof google.cloud.networksecurity.v1 + * @classdesc Represents a CertificateProvider. + * @implements ICertificateProvider + * @constructor + * @param {google.cloud.networksecurity.v1.ICertificateProvider=} [properties] Properties to set + */ + function CertificateProvider(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CertificateProvider grpcEndpoint. + * @member {google.cloud.networksecurity.v1.IGrpcEndpoint|null|undefined} grpcEndpoint + * @memberof google.cloud.networksecurity.v1.CertificateProvider + * @instance + */ + CertificateProvider.prototype.grpcEndpoint = null; + + /** + * CertificateProvider certificateProviderInstance. + * @member {google.cloud.networksecurity.v1.ICertificateProviderInstance|null|undefined} certificateProviderInstance + * @memberof google.cloud.networksecurity.v1.CertificateProvider + * @instance + */ + CertificateProvider.prototype.certificateProviderInstance = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * CertificateProvider type. + * @member {"grpcEndpoint"|"certificateProviderInstance"|undefined} type + * @memberof google.cloud.networksecurity.v1.CertificateProvider + * @instance + */ + Object.defineProperty(CertificateProvider.prototype, "type", { + get: $util.oneOfGetter($oneOfFields = ["grpcEndpoint", "certificateProviderInstance"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new CertificateProvider instance using the specified properties. + * @function create + * @memberof google.cloud.networksecurity.v1.CertificateProvider + * @static + * @param {google.cloud.networksecurity.v1.ICertificateProvider=} [properties] Properties to set + * @returns {google.cloud.networksecurity.v1.CertificateProvider} CertificateProvider instance + */ + CertificateProvider.create = function create(properties) { + return new CertificateProvider(properties); + }; + + /** + * Encodes the specified CertificateProvider message. Does not implicitly {@link google.cloud.networksecurity.v1.CertificateProvider.verify|verify} messages. + * @function encode + * @memberof google.cloud.networksecurity.v1.CertificateProvider + * @static + * @param {google.cloud.networksecurity.v1.ICertificateProvider} message CertificateProvider message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CertificateProvider.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.grpcEndpoint != null && Object.hasOwnProperty.call(message, "grpcEndpoint")) + $root.google.cloud.networksecurity.v1.GrpcEndpoint.encode(message.grpcEndpoint, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.certificateProviderInstance != null && Object.hasOwnProperty.call(message, "certificateProviderInstance")) + $root.google.cloud.networksecurity.v1.CertificateProviderInstance.encode(message.certificateProviderInstance, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CertificateProvider message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.CertificateProvider.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.networksecurity.v1.CertificateProvider + * @static + * @param {google.cloud.networksecurity.v1.ICertificateProvider} message CertificateProvider message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CertificateProvider.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CertificateProvider message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.networksecurity.v1.CertificateProvider + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.networksecurity.v1.CertificateProvider} CertificateProvider + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CertificateProvider.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networksecurity.v1.CertificateProvider(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 2: { + message.grpcEndpoint = $root.google.cloud.networksecurity.v1.GrpcEndpoint.decode(reader, reader.uint32()); + break; + } + case 3: { + message.certificateProviderInstance = $root.google.cloud.networksecurity.v1.CertificateProviderInstance.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CertificateProvider message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.networksecurity.v1.CertificateProvider + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.networksecurity.v1.CertificateProvider} CertificateProvider + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CertificateProvider.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CertificateProvider message. + * @function verify + * @memberof google.cloud.networksecurity.v1.CertificateProvider + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CertificateProvider.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.grpcEndpoint != null && message.hasOwnProperty("grpcEndpoint")) { + properties.type = 1; + { + var error = $root.google.cloud.networksecurity.v1.GrpcEndpoint.verify(message.grpcEndpoint); + if (error) + return "grpcEndpoint." + error; + } + } + if (message.certificateProviderInstance != null && message.hasOwnProperty("certificateProviderInstance")) { + if (properties.type === 1) + return "type: multiple values"; + properties.type = 1; + { + var error = $root.google.cloud.networksecurity.v1.CertificateProviderInstance.verify(message.certificateProviderInstance); + if (error) + return "certificateProviderInstance." + error; + } + } + return null; + }; + + /** + * Creates a CertificateProvider message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.networksecurity.v1.CertificateProvider + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.networksecurity.v1.CertificateProvider} CertificateProvider + */ + CertificateProvider.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networksecurity.v1.CertificateProvider) + return object; + var message = new $root.google.cloud.networksecurity.v1.CertificateProvider(); + if (object.grpcEndpoint != null) { + if (typeof object.grpcEndpoint !== "object") + throw TypeError(".google.cloud.networksecurity.v1.CertificateProvider.grpcEndpoint: object expected"); + message.grpcEndpoint = $root.google.cloud.networksecurity.v1.GrpcEndpoint.fromObject(object.grpcEndpoint); + } + if (object.certificateProviderInstance != null) { + if (typeof object.certificateProviderInstance !== "object") + throw TypeError(".google.cloud.networksecurity.v1.CertificateProvider.certificateProviderInstance: object expected"); + message.certificateProviderInstance = $root.google.cloud.networksecurity.v1.CertificateProviderInstance.fromObject(object.certificateProviderInstance); + } + return message; + }; + + /** + * Creates a plain object from a CertificateProvider message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.networksecurity.v1.CertificateProvider + * @static + * @param {google.cloud.networksecurity.v1.CertificateProvider} message CertificateProvider + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CertificateProvider.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.grpcEndpoint != null && message.hasOwnProperty("grpcEndpoint")) { + object.grpcEndpoint = $root.google.cloud.networksecurity.v1.GrpcEndpoint.toObject(message.grpcEndpoint, options); + if (options.oneofs) + object.type = "grpcEndpoint"; + } + if (message.certificateProviderInstance != null && message.hasOwnProperty("certificateProviderInstance")) { + object.certificateProviderInstance = $root.google.cloud.networksecurity.v1.CertificateProviderInstance.toObject(message.certificateProviderInstance, options); + if (options.oneofs) + object.type = "certificateProviderInstance"; + } + return object; + }; + + /** + * Converts this CertificateProvider to JSON. + * @function toJSON + * @memberof google.cloud.networksecurity.v1.CertificateProvider + * @instance + * @returns {Object.} JSON object + */ + CertificateProvider.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CertificateProvider + * @function getTypeUrl + * @memberof google.cloud.networksecurity.v1.CertificateProvider + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CertificateProvider.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.networksecurity.v1.CertificateProvider"; + }; + + return CertificateProvider; + })(); + + v1.DnsThreatDetectorService = (function() { + + /** + * Constructs a new DnsThreatDetectorService service. + * @memberof google.cloud.networksecurity.v1 + * @classdesc Represents a DnsThreatDetectorService + * @extends $protobuf.rpc.Service + * @constructor + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + */ + function DnsThreatDetectorService(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (DnsThreatDetectorService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = DnsThreatDetectorService; + + /** + * Creates new DnsThreatDetectorService service using the specified rpc implementation. + * @function create + * @memberof google.cloud.networksecurity.v1.DnsThreatDetectorService + * @static + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + * @returns {DnsThreatDetectorService} RPC service. Useful where requests and/or responses are streamed. + */ + DnsThreatDetectorService.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.networksecurity.v1.DnsThreatDetectorService|listDnsThreatDetectors}. + * @memberof google.cloud.networksecurity.v1.DnsThreatDetectorService + * @typedef ListDnsThreatDetectorsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.networksecurity.v1.ListDnsThreatDetectorsResponse} [response] ListDnsThreatDetectorsResponse + */ + + /** + * Calls ListDnsThreatDetectors. + * @function listDnsThreatDetectors + * @memberof google.cloud.networksecurity.v1.DnsThreatDetectorService + * @instance + * @param {google.cloud.networksecurity.v1.IListDnsThreatDetectorsRequest} request ListDnsThreatDetectorsRequest message or plain object + * @param {google.cloud.networksecurity.v1.DnsThreatDetectorService.ListDnsThreatDetectorsCallback} callback Node-style callback called with the error, if any, and ListDnsThreatDetectorsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DnsThreatDetectorService.prototype.listDnsThreatDetectors = function listDnsThreatDetectors(request, callback) { + return this.rpcCall(listDnsThreatDetectors, $root.google.cloud.networksecurity.v1.ListDnsThreatDetectorsRequest, $root.google.cloud.networksecurity.v1.ListDnsThreatDetectorsResponse, request, callback); + }, "name", { value: "ListDnsThreatDetectors" }); + + /** + * Calls ListDnsThreatDetectors. + * @function listDnsThreatDetectors + * @memberof google.cloud.networksecurity.v1.DnsThreatDetectorService + * @instance + * @param {google.cloud.networksecurity.v1.IListDnsThreatDetectorsRequest} request ListDnsThreatDetectorsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.networksecurity.v1.DnsThreatDetectorService|getDnsThreatDetector}. + * @memberof google.cloud.networksecurity.v1.DnsThreatDetectorService + * @typedef GetDnsThreatDetectorCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.networksecurity.v1.DnsThreatDetector} [response] DnsThreatDetector + */ + + /** + * Calls GetDnsThreatDetector. + * @function getDnsThreatDetector + * @memberof google.cloud.networksecurity.v1.DnsThreatDetectorService + * @instance + * @param {google.cloud.networksecurity.v1.IGetDnsThreatDetectorRequest} request GetDnsThreatDetectorRequest message or plain object + * @param {google.cloud.networksecurity.v1.DnsThreatDetectorService.GetDnsThreatDetectorCallback} callback Node-style callback called with the error, if any, and DnsThreatDetector + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DnsThreatDetectorService.prototype.getDnsThreatDetector = function getDnsThreatDetector(request, callback) { + return this.rpcCall(getDnsThreatDetector, $root.google.cloud.networksecurity.v1.GetDnsThreatDetectorRequest, $root.google.cloud.networksecurity.v1.DnsThreatDetector, request, callback); + }, "name", { value: "GetDnsThreatDetector" }); + + /** + * Calls GetDnsThreatDetector. + * @function getDnsThreatDetector + * @memberof google.cloud.networksecurity.v1.DnsThreatDetectorService + * @instance + * @param {google.cloud.networksecurity.v1.IGetDnsThreatDetectorRequest} request GetDnsThreatDetectorRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.networksecurity.v1.DnsThreatDetectorService|createDnsThreatDetector}. + * @memberof google.cloud.networksecurity.v1.DnsThreatDetectorService + * @typedef CreateDnsThreatDetectorCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.networksecurity.v1.DnsThreatDetector} [response] DnsThreatDetector + */ + + /** + * Calls CreateDnsThreatDetector. + * @function createDnsThreatDetector + * @memberof google.cloud.networksecurity.v1.DnsThreatDetectorService + * @instance + * @param {google.cloud.networksecurity.v1.ICreateDnsThreatDetectorRequest} request CreateDnsThreatDetectorRequest message or plain object + * @param {google.cloud.networksecurity.v1.DnsThreatDetectorService.CreateDnsThreatDetectorCallback} callback Node-style callback called with the error, if any, and DnsThreatDetector + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DnsThreatDetectorService.prototype.createDnsThreatDetector = function createDnsThreatDetector(request, callback) { + return this.rpcCall(createDnsThreatDetector, $root.google.cloud.networksecurity.v1.CreateDnsThreatDetectorRequest, $root.google.cloud.networksecurity.v1.DnsThreatDetector, request, callback); + }, "name", { value: "CreateDnsThreatDetector" }); + + /** + * Calls CreateDnsThreatDetector. + * @function createDnsThreatDetector + * @memberof google.cloud.networksecurity.v1.DnsThreatDetectorService + * @instance + * @param {google.cloud.networksecurity.v1.ICreateDnsThreatDetectorRequest} request CreateDnsThreatDetectorRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.networksecurity.v1.DnsThreatDetectorService|updateDnsThreatDetector}. + * @memberof google.cloud.networksecurity.v1.DnsThreatDetectorService + * @typedef UpdateDnsThreatDetectorCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.networksecurity.v1.DnsThreatDetector} [response] DnsThreatDetector + */ + + /** + * Calls UpdateDnsThreatDetector. + * @function updateDnsThreatDetector + * @memberof google.cloud.networksecurity.v1.DnsThreatDetectorService + * @instance + * @param {google.cloud.networksecurity.v1.IUpdateDnsThreatDetectorRequest} request UpdateDnsThreatDetectorRequest message or plain object + * @param {google.cloud.networksecurity.v1.DnsThreatDetectorService.UpdateDnsThreatDetectorCallback} callback Node-style callback called with the error, if any, and DnsThreatDetector + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DnsThreatDetectorService.prototype.updateDnsThreatDetector = function updateDnsThreatDetector(request, callback) { + return this.rpcCall(updateDnsThreatDetector, $root.google.cloud.networksecurity.v1.UpdateDnsThreatDetectorRequest, $root.google.cloud.networksecurity.v1.DnsThreatDetector, request, callback); + }, "name", { value: "UpdateDnsThreatDetector" }); + + /** + * Calls UpdateDnsThreatDetector. + * @function updateDnsThreatDetector + * @memberof google.cloud.networksecurity.v1.DnsThreatDetectorService + * @instance + * @param {google.cloud.networksecurity.v1.IUpdateDnsThreatDetectorRequest} request UpdateDnsThreatDetectorRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.networksecurity.v1.DnsThreatDetectorService|deleteDnsThreatDetector}. + * @memberof google.cloud.networksecurity.v1.DnsThreatDetectorService + * @typedef DeleteDnsThreatDetectorCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteDnsThreatDetector. + * @function deleteDnsThreatDetector + * @memberof google.cloud.networksecurity.v1.DnsThreatDetectorService + * @instance + * @param {google.cloud.networksecurity.v1.IDeleteDnsThreatDetectorRequest} request DeleteDnsThreatDetectorRequest message or plain object + * @param {google.cloud.networksecurity.v1.DnsThreatDetectorService.DeleteDnsThreatDetectorCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DnsThreatDetectorService.prototype.deleteDnsThreatDetector = function deleteDnsThreatDetector(request, callback) { + return this.rpcCall(deleteDnsThreatDetector, $root.google.cloud.networksecurity.v1.DeleteDnsThreatDetectorRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteDnsThreatDetector" }); + + /** + * Calls DeleteDnsThreatDetector. + * @function deleteDnsThreatDetector + * @memberof google.cloud.networksecurity.v1.DnsThreatDetectorService + * @instance + * @param {google.cloud.networksecurity.v1.IDeleteDnsThreatDetectorRequest} request DeleteDnsThreatDetectorRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return DnsThreatDetectorService; + })(); + + v1.DnsThreatDetector = (function() { + + /** + * Properties of a DnsThreatDetector. + * @memberof google.cloud.networksecurity.v1 + * @interface IDnsThreatDetector + * @property {string|null} [name] DnsThreatDetector name + * @property {google.protobuf.ITimestamp|null} [createTime] DnsThreatDetector createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] DnsThreatDetector updateTime + * @property {Object.|null} [labels] DnsThreatDetector labels + * @property {Array.|null} [excludedNetworks] DnsThreatDetector excludedNetworks + * @property {google.cloud.networksecurity.v1.DnsThreatDetector.Provider|null} [provider] DnsThreatDetector provider + */ + + /** + * Constructs a new DnsThreatDetector. + * @memberof google.cloud.networksecurity.v1 + * @classdesc Represents a DnsThreatDetector. + * @implements IDnsThreatDetector + * @constructor + * @param {google.cloud.networksecurity.v1.IDnsThreatDetector=} [properties] Properties to set + */ + function DnsThreatDetector(properties) { + this.labels = {}; + this.excludedNetworks = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DnsThreatDetector name. + * @member {string} name + * @memberof google.cloud.networksecurity.v1.DnsThreatDetector + * @instance + */ + DnsThreatDetector.prototype.name = ""; + + /** + * DnsThreatDetector createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.networksecurity.v1.DnsThreatDetector + * @instance + */ + DnsThreatDetector.prototype.createTime = null; + + /** + * DnsThreatDetector updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.networksecurity.v1.DnsThreatDetector + * @instance + */ + DnsThreatDetector.prototype.updateTime = null; + + /** + * DnsThreatDetector labels. + * @member {Object.} labels + * @memberof google.cloud.networksecurity.v1.DnsThreatDetector + * @instance + */ + DnsThreatDetector.prototype.labels = $util.emptyObject; + + /** + * DnsThreatDetector excludedNetworks. + * @member {Array.} excludedNetworks + * @memberof google.cloud.networksecurity.v1.DnsThreatDetector + * @instance + */ + DnsThreatDetector.prototype.excludedNetworks = $util.emptyArray; + + /** + * DnsThreatDetector provider. + * @member {google.cloud.networksecurity.v1.DnsThreatDetector.Provider} provider + * @memberof google.cloud.networksecurity.v1.DnsThreatDetector + * @instance + */ + DnsThreatDetector.prototype.provider = 0; + + /** + * Creates a new DnsThreatDetector instance using the specified properties. + * @function create + * @memberof google.cloud.networksecurity.v1.DnsThreatDetector + * @static + * @param {google.cloud.networksecurity.v1.IDnsThreatDetector=} [properties] Properties to set + * @returns {google.cloud.networksecurity.v1.DnsThreatDetector} DnsThreatDetector instance + */ + DnsThreatDetector.create = function create(properties) { + return new DnsThreatDetector(properties); + }; + + /** + * Encodes the specified DnsThreatDetector message. Does not implicitly {@link google.cloud.networksecurity.v1.DnsThreatDetector.verify|verify} messages. + * @function encode + * @memberof google.cloud.networksecurity.v1.DnsThreatDetector + * @static + * @param {google.cloud.networksecurity.v1.IDnsThreatDetector} message DnsThreatDetector message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DnsThreatDetector.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) + for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) + writer.uint32(/* id 4, wireType 2 =*/34).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); + if (message.excludedNetworks != null && message.excludedNetworks.length) + for (var i = 0; i < message.excludedNetworks.length; ++i) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.excludedNetworks[i]); + if (message.provider != null && Object.hasOwnProperty.call(message, "provider")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.provider); + return writer; + }; + + /** + * Encodes the specified DnsThreatDetector message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.DnsThreatDetector.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.networksecurity.v1.DnsThreatDetector + * @static + * @param {google.cloud.networksecurity.v1.IDnsThreatDetector} message DnsThreatDetector message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DnsThreatDetector.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DnsThreatDetector message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.networksecurity.v1.DnsThreatDetector + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.networksecurity.v1.DnsThreatDetector} DnsThreatDetector + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DnsThreatDetector.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networksecurity.v1.DnsThreatDetector(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 3: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 4: { + if (message.labels === $util.emptyObject) + message.labels = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.labels[key] = value; + break; + } + case 5: { + if (!(message.excludedNetworks && message.excludedNetworks.length)) + message.excludedNetworks = []; + message.excludedNetworks.push(reader.string()); + break; + } + case 6: { + message.provider = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DnsThreatDetector message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.networksecurity.v1.DnsThreatDetector + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.networksecurity.v1.DnsThreatDetector} DnsThreatDetector + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DnsThreatDetector.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DnsThreatDetector message. + * @function verify + * @memberof google.cloud.networksecurity.v1.DnsThreatDetector + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DnsThreatDetector.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime); + if (error) + return "updateTime." + error; + } + if (message.labels != null && message.hasOwnProperty("labels")) { + if (!$util.isObject(message.labels)) + return "labels: object expected"; + var key = Object.keys(message.labels); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.labels[key[i]])) + return "labels: string{k:string} expected"; + } + if (message.excludedNetworks != null && message.hasOwnProperty("excludedNetworks")) { + if (!Array.isArray(message.excludedNetworks)) + return "excludedNetworks: array expected"; + for (var i = 0; i < message.excludedNetworks.length; ++i) + if (!$util.isString(message.excludedNetworks[i])) + return "excludedNetworks: string[] expected"; + } + if (message.provider != null && message.hasOwnProperty("provider")) + switch (message.provider) { + default: + return "provider: enum value expected"; + case 0: + case 1: + break; + } + return null; + }; + + /** + * Creates a DnsThreatDetector message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.networksecurity.v1.DnsThreatDetector + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.networksecurity.v1.DnsThreatDetector} DnsThreatDetector + */ + DnsThreatDetector.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networksecurity.v1.DnsThreatDetector) + return object; + var message = new $root.google.cloud.networksecurity.v1.DnsThreatDetector(); + if (object.name != null) + message.name = String(object.name); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.networksecurity.v1.DnsThreatDetector.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.updateTime != null) { + if (typeof object.updateTime !== "object") + throw TypeError(".google.cloud.networksecurity.v1.DnsThreatDetector.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.cloud.networksecurity.v1.DnsThreatDetector.labels: object expected"); + message.labels = {}; + for (var keys = Object.keys(object.labels), i = 0; i < keys.length; ++i) + message.labels[keys[i]] = String(object.labels[keys[i]]); + } + if (object.excludedNetworks) { + if (!Array.isArray(object.excludedNetworks)) + throw TypeError(".google.cloud.networksecurity.v1.DnsThreatDetector.excludedNetworks: array expected"); + message.excludedNetworks = []; + for (var i = 0; i < object.excludedNetworks.length; ++i) + message.excludedNetworks[i] = String(object.excludedNetworks[i]); + } + switch (object.provider) { + default: + if (typeof object.provider === "number") { + message.provider = object.provider; + break; + } + break; + case "PROVIDER_UNSPECIFIED": + case 0: + message.provider = 0; + break; + case "INFOBLOX": + case 1: + message.provider = 1; + break; + } + return message; + }; + + /** + * Creates a plain object from a DnsThreatDetector message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.networksecurity.v1.DnsThreatDetector + * @static + * @param {google.cloud.networksecurity.v1.DnsThreatDetector} message DnsThreatDetector + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DnsThreatDetector.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.excludedNetworks = []; + if (options.objects || options.defaults) + object.labels = {}; + if (options.defaults) { + object.name = ""; + object.createTime = null; + object.updateTime = null; + object.provider = options.enums === String ? "PROVIDER_UNSPECIFIED" : 0; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.updateTime != null && message.hasOwnProperty("updateTime")) + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); + var keys2; + if (message.labels && (keys2 = Object.keys(message.labels)).length) { + object.labels = {}; + for (var j = 0; j < keys2.length; ++j) + object.labels[keys2[j]] = message.labels[keys2[j]]; + } + if (message.excludedNetworks && message.excludedNetworks.length) { + object.excludedNetworks = []; + for (var j = 0; j < message.excludedNetworks.length; ++j) + object.excludedNetworks[j] = message.excludedNetworks[j]; + } + if (message.provider != null && message.hasOwnProperty("provider")) + object.provider = options.enums === String ? $root.google.cloud.networksecurity.v1.DnsThreatDetector.Provider[message.provider] === undefined ? message.provider : $root.google.cloud.networksecurity.v1.DnsThreatDetector.Provider[message.provider] : message.provider; + return object; + }; + + /** + * Converts this DnsThreatDetector to JSON. + * @function toJSON + * @memberof google.cloud.networksecurity.v1.DnsThreatDetector + * @instance + * @returns {Object.} JSON object + */ + DnsThreatDetector.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DnsThreatDetector + * @function getTypeUrl + * @memberof google.cloud.networksecurity.v1.DnsThreatDetector + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DnsThreatDetector.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.networksecurity.v1.DnsThreatDetector"; + }; + + /** + * Provider enum. + * @name google.cloud.networksecurity.v1.DnsThreatDetector.Provider + * @enum {number} + * @property {number} PROVIDER_UNSPECIFIED=0 PROVIDER_UNSPECIFIED value + * @property {number} INFOBLOX=1 INFOBLOX value + */ + DnsThreatDetector.Provider = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "PROVIDER_UNSPECIFIED"] = 0; + values[valuesById[1] = "INFOBLOX"] = 1; + return values; + })(); + + return DnsThreatDetector; + })(); + + v1.ListDnsThreatDetectorsRequest = (function() { + + /** + * Properties of a ListDnsThreatDetectorsRequest. + * @memberof google.cloud.networksecurity.v1 + * @interface IListDnsThreatDetectorsRequest + * @property {string|null} [parent] ListDnsThreatDetectorsRequest parent + * @property {number|null} [pageSize] ListDnsThreatDetectorsRequest pageSize + * @property {string|null} [pageToken] ListDnsThreatDetectorsRequest pageToken + */ + + /** + * Constructs a new ListDnsThreatDetectorsRequest. + * @memberof google.cloud.networksecurity.v1 + * @classdesc Represents a ListDnsThreatDetectorsRequest. + * @implements IListDnsThreatDetectorsRequest + * @constructor + * @param {google.cloud.networksecurity.v1.IListDnsThreatDetectorsRequest=} [properties] Properties to set + */ + function ListDnsThreatDetectorsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListDnsThreatDetectorsRequest parent. + * @member {string} parent + * @memberof google.cloud.networksecurity.v1.ListDnsThreatDetectorsRequest + * @instance + */ + ListDnsThreatDetectorsRequest.prototype.parent = ""; + + /** + * ListDnsThreatDetectorsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.networksecurity.v1.ListDnsThreatDetectorsRequest + * @instance + */ + ListDnsThreatDetectorsRequest.prototype.pageSize = 0; + + /** + * ListDnsThreatDetectorsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.networksecurity.v1.ListDnsThreatDetectorsRequest + * @instance + */ + ListDnsThreatDetectorsRequest.prototype.pageToken = ""; + + /** + * Creates a new ListDnsThreatDetectorsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.networksecurity.v1.ListDnsThreatDetectorsRequest + * @static + * @param {google.cloud.networksecurity.v1.IListDnsThreatDetectorsRequest=} [properties] Properties to set + * @returns {google.cloud.networksecurity.v1.ListDnsThreatDetectorsRequest} ListDnsThreatDetectorsRequest instance + */ + ListDnsThreatDetectorsRequest.create = function create(properties) { + return new ListDnsThreatDetectorsRequest(properties); + }; + + /** + * Encodes the specified ListDnsThreatDetectorsRequest message. Does not implicitly {@link google.cloud.networksecurity.v1.ListDnsThreatDetectorsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.networksecurity.v1.ListDnsThreatDetectorsRequest + * @static + * @param {google.cloud.networksecurity.v1.IListDnsThreatDetectorsRequest} message ListDnsThreatDetectorsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListDnsThreatDetectorsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + return writer; + }; + + /** + * Encodes the specified ListDnsThreatDetectorsRequest message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.ListDnsThreatDetectorsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.networksecurity.v1.ListDnsThreatDetectorsRequest + * @static + * @param {google.cloud.networksecurity.v1.IListDnsThreatDetectorsRequest} message ListDnsThreatDetectorsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListDnsThreatDetectorsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListDnsThreatDetectorsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.networksecurity.v1.ListDnsThreatDetectorsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.networksecurity.v1.ListDnsThreatDetectorsRequest} ListDnsThreatDetectorsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListDnsThreatDetectorsRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networksecurity.v1.ListDnsThreatDetectorsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListDnsThreatDetectorsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.networksecurity.v1.ListDnsThreatDetectorsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.networksecurity.v1.ListDnsThreatDetectorsRequest} ListDnsThreatDetectorsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListDnsThreatDetectorsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListDnsThreatDetectorsRequest message. + * @function verify + * @memberof google.cloud.networksecurity.v1.ListDnsThreatDetectorsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListDnsThreatDetectorsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + return null; + }; + + /** + * Creates a ListDnsThreatDetectorsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.networksecurity.v1.ListDnsThreatDetectorsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.networksecurity.v1.ListDnsThreatDetectorsRequest} ListDnsThreatDetectorsRequest + */ + ListDnsThreatDetectorsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networksecurity.v1.ListDnsThreatDetectorsRequest) + return object; + var message = new $root.google.cloud.networksecurity.v1.ListDnsThreatDetectorsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + return message; + }; + + /** + * Creates a plain object from a ListDnsThreatDetectorsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.networksecurity.v1.ListDnsThreatDetectorsRequest + * @static + * @param {google.cloud.networksecurity.v1.ListDnsThreatDetectorsRequest} message ListDnsThreatDetectorsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListDnsThreatDetectorsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + return object; + }; + + /** + * Converts this ListDnsThreatDetectorsRequest to JSON. + * @function toJSON + * @memberof google.cloud.networksecurity.v1.ListDnsThreatDetectorsRequest + * @instance + * @returns {Object.} JSON object + */ + ListDnsThreatDetectorsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListDnsThreatDetectorsRequest + * @function getTypeUrl + * @memberof google.cloud.networksecurity.v1.ListDnsThreatDetectorsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListDnsThreatDetectorsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.networksecurity.v1.ListDnsThreatDetectorsRequest"; + }; + + return ListDnsThreatDetectorsRequest; + })(); + + v1.ListDnsThreatDetectorsResponse = (function() { + + /** + * Properties of a ListDnsThreatDetectorsResponse. + * @memberof google.cloud.networksecurity.v1 + * @interface IListDnsThreatDetectorsResponse + * @property {Array.|null} [dnsThreatDetectors] ListDnsThreatDetectorsResponse dnsThreatDetectors + * @property {string|null} [nextPageToken] ListDnsThreatDetectorsResponse nextPageToken + * @property {Array.|null} [unreachable] ListDnsThreatDetectorsResponse unreachable + */ + + /** + * Constructs a new ListDnsThreatDetectorsResponse. + * @memberof google.cloud.networksecurity.v1 + * @classdesc Represents a ListDnsThreatDetectorsResponse. + * @implements IListDnsThreatDetectorsResponse + * @constructor + * @param {google.cloud.networksecurity.v1.IListDnsThreatDetectorsResponse=} [properties] Properties to set + */ + function ListDnsThreatDetectorsResponse(properties) { + this.dnsThreatDetectors = []; + this.unreachable = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListDnsThreatDetectorsResponse dnsThreatDetectors. + * @member {Array.} dnsThreatDetectors + * @memberof google.cloud.networksecurity.v1.ListDnsThreatDetectorsResponse + * @instance + */ + ListDnsThreatDetectorsResponse.prototype.dnsThreatDetectors = $util.emptyArray; + + /** + * ListDnsThreatDetectorsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.networksecurity.v1.ListDnsThreatDetectorsResponse + * @instance + */ + ListDnsThreatDetectorsResponse.prototype.nextPageToken = ""; + + /** + * ListDnsThreatDetectorsResponse unreachable. + * @member {Array.} unreachable + * @memberof google.cloud.networksecurity.v1.ListDnsThreatDetectorsResponse + * @instance + */ + ListDnsThreatDetectorsResponse.prototype.unreachable = $util.emptyArray; + + /** + * Creates a new ListDnsThreatDetectorsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.networksecurity.v1.ListDnsThreatDetectorsResponse + * @static + * @param {google.cloud.networksecurity.v1.IListDnsThreatDetectorsResponse=} [properties] Properties to set + * @returns {google.cloud.networksecurity.v1.ListDnsThreatDetectorsResponse} ListDnsThreatDetectorsResponse instance + */ + ListDnsThreatDetectorsResponse.create = function create(properties) { + return new ListDnsThreatDetectorsResponse(properties); + }; + + /** + * Encodes the specified ListDnsThreatDetectorsResponse message. Does not implicitly {@link google.cloud.networksecurity.v1.ListDnsThreatDetectorsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.networksecurity.v1.ListDnsThreatDetectorsResponse + * @static + * @param {google.cloud.networksecurity.v1.IListDnsThreatDetectorsResponse} message ListDnsThreatDetectorsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListDnsThreatDetectorsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.dnsThreatDetectors != null && message.dnsThreatDetectors.length) + for (var i = 0; i < message.dnsThreatDetectors.length; ++i) + $root.google.cloud.networksecurity.v1.DnsThreatDetector.encode(message.dnsThreatDetectors[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + if (message.unreachable != null && message.unreachable.length) + for (var i = 0; i < message.unreachable.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.unreachable[i]); + return writer; + }; + + /** + * Encodes the specified ListDnsThreatDetectorsResponse message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.ListDnsThreatDetectorsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.networksecurity.v1.ListDnsThreatDetectorsResponse + * @static + * @param {google.cloud.networksecurity.v1.IListDnsThreatDetectorsResponse} message ListDnsThreatDetectorsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListDnsThreatDetectorsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListDnsThreatDetectorsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.networksecurity.v1.ListDnsThreatDetectorsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.networksecurity.v1.ListDnsThreatDetectorsResponse} ListDnsThreatDetectorsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListDnsThreatDetectorsResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networksecurity.v1.ListDnsThreatDetectorsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.dnsThreatDetectors && message.dnsThreatDetectors.length)) + message.dnsThreatDetectors = []; + message.dnsThreatDetectors.push($root.google.cloud.networksecurity.v1.DnsThreatDetector.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + case 3: { + if (!(message.unreachable && message.unreachable.length)) + message.unreachable = []; + message.unreachable.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListDnsThreatDetectorsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.networksecurity.v1.ListDnsThreatDetectorsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.networksecurity.v1.ListDnsThreatDetectorsResponse} ListDnsThreatDetectorsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListDnsThreatDetectorsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListDnsThreatDetectorsResponse message. + * @function verify + * @memberof google.cloud.networksecurity.v1.ListDnsThreatDetectorsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListDnsThreatDetectorsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.dnsThreatDetectors != null && message.hasOwnProperty("dnsThreatDetectors")) { + if (!Array.isArray(message.dnsThreatDetectors)) + return "dnsThreatDetectors: array expected"; + for (var i = 0; i < message.dnsThreatDetectors.length; ++i) { + var error = $root.google.cloud.networksecurity.v1.DnsThreatDetector.verify(message.dnsThreatDetectors[i]); + if (error) + return "dnsThreatDetectors." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + if (message.unreachable != null && message.hasOwnProperty("unreachable")) { + if (!Array.isArray(message.unreachable)) + return "unreachable: array expected"; + for (var i = 0; i < message.unreachable.length; ++i) + if (!$util.isString(message.unreachable[i])) + return "unreachable: string[] expected"; + } + return null; + }; + + /** + * Creates a ListDnsThreatDetectorsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.networksecurity.v1.ListDnsThreatDetectorsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.networksecurity.v1.ListDnsThreatDetectorsResponse} ListDnsThreatDetectorsResponse + */ + ListDnsThreatDetectorsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networksecurity.v1.ListDnsThreatDetectorsResponse) + return object; + var message = new $root.google.cloud.networksecurity.v1.ListDnsThreatDetectorsResponse(); + if (object.dnsThreatDetectors) { + if (!Array.isArray(object.dnsThreatDetectors)) + throw TypeError(".google.cloud.networksecurity.v1.ListDnsThreatDetectorsResponse.dnsThreatDetectors: array expected"); + message.dnsThreatDetectors = []; + for (var i = 0; i < object.dnsThreatDetectors.length; ++i) { + if (typeof object.dnsThreatDetectors[i] !== "object") + throw TypeError(".google.cloud.networksecurity.v1.ListDnsThreatDetectorsResponse.dnsThreatDetectors: object expected"); + message.dnsThreatDetectors[i] = $root.google.cloud.networksecurity.v1.DnsThreatDetector.fromObject(object.dnsThreatDetectors[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.unreachable) { + if (!Array.isArray(object.unreachable)) + throw TypeError(".google.cloud.networksecurity.v1.ListDnsThreatDetectorsResponse.unreachable: array expected"); + message.unreachable = []; + for (var i = 0; i < object.unreachable.length; ++i) + message.unreachable[i] = String(object.unreachable[i]); + } + return message; + }; + + /** + * Creates a plain object from a ListDnsThreatDetectorsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.networksecurity.v1.ListDnsThreatDetectorsResponse + * @static + * @param {google.cloud.networksecurity.v1.ListDnsThreatDetectorsResponse} message ListDnsThreatDetectorsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListDnsThreatDetectorsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.dnsThreatDetectors = []; + object.unreachable = []; + } + if (options.defaults) + object.nextPageToken = ""; + if (message.dnsThreatDetectors && message.dnsThreatDetectors.length) { + object.dnsThreatDetectors = []; + for (var j = 0; j < message.dnsThreatDetectors.length; ++j) + object.dnsThreatDetectors[j] = $root.google.cloud.networksecurity.v1.DnsThreatDetector.toObject(message.dnsThreatDetectors[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + if (message.unreachable && message.unreachable.length) { + object.unreachable = []; + for (var j = 0; j < message.unreachable.length; ++j) + object.unreachable[j] = message.unreachable[j]; + } + return object; + }; + + /** + * Converts this ListDnsThreatDetectorsResponse to JSON. + * @function toJSON + * @memberof google.cloud.networksecurity.v1.ListDnsThreatDetectorsResponse + * @instance + * @returns {Object.} JSON object + */ + ListDnsThreatDetectorsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListDnsThreatDetectorsResponse + * @function getTypeUrl + * @memberof google.cloud.networksecurity.v1.ListDnsThreatDetectorsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListDnsThreatDetectorsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.networksecurity.v1.ListDnsThreatDetectorsResponse"; + }; + + return ListDnsThreatDetectorsResponse; + })(); + + v1.GetDnsThreatDetectorRequest = (function() { + + /** + * Properties of a GetDnsThreatDetectorRequest. + * @memberof google.cloud.networksecurity.v1 + * @interface IGetDnsThreatDetectorRequest + * @property {string|null} [name] GetDnsThreatDetectorRequest name + */ + + /** + * Constructs a new GetDnsThreatDetectorRequest. + * @memberof google.cloud.networksecurity.v1 + * @classdesc Represents a GetDnsThreatDetectorRequest. + * @implements IGetDnsThreatDetectorRequest + * @constructor + * @param {google.cloud.networksecurity.v1.IGetDnsThreatDetectorRequest=} [properties] Properties to set + */ + function GetDnsThreatDetectorRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetDnsThreatDetectorRequest name. + * @member {string} name + * @memberof google.cloud.networksecurity.v1.GetDnsThreatDetectorRequest + * @instance + */ + GetDnsThreatDetectorRequest.prototype.name = ""; + + /** + * Creates a new GetDnsThreatDetectorRequest instance using the specified properties. + * @function create + * @memberof google.cloud.networksecurity.v1.GetDnsThreatDetectorRequest + * @static + * @param {google.cloud.networksecurity.v1.IGetDnsThreatDetectorRequest=} [properties] Properties to set + * @returns {google.cloud.networksecurity.v1.GetDnsThreatDetectorRequest} GetDnsThreatDetectorRequest instance + */ + GetDnsThreatDetectorRequest.create = function create(properties) { + return new GetDnsThreatDetectorRequest(properties); + }; + + /** + * Encodes the specified GetDnsThreatDetectorRequest message. Does not implicitly {@link google.cloud.networksecurity.v1.GetDnsThreatDetectorRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.networksecurity.v1.GetDnsThreatDetectorRequest + * @static + * @param {google.cloud.networksecurity.v1.IGetDnsThreatDetectorRequest} message GetDnsThreatDetectorRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetDnsThreatDetectorRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified GetDnsThreatDetectorRequest message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.GetDnsThreatDetectorRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.networksecurity.v1.GetDnsThreatDetectorRequest + * @static + * @param {google.cloud.networksecurity.v1.IGetDnsThreatDetectorRequest} message GetDnsThreatDetectorRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetDnsThreatDetectorRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetDnsThreatDetectorRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.networksecurity.v1.GetDnsThreatDetectorRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.networksecurity.v1.GetDnsThreatDetectorRequest} GetDnsThreatDetectorRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetDnsThreatDetectorRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networksecurity.v1.GetDnsThreatDetectorRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetDnsThreatDetectorRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.networksecurity.v1.GetDnsThreatDetectorRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.networksecurity.v1.GetDnsThreatDetectorRequest} GetDnsThreatDetectorRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetDnsThreatDetectorRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetDnsThreatDetectorRequest message. + * @function verify + * @memberof google.cloud.networksecurity.v1.GetDnsThreatDetectorRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetDnsThreatDetectorRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a GetDnsThreatDetectorRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.networksecurity.v1.GetDnsThreatDetectorRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.networksecurity.v1.GetDnsThreatDetectorRequest} GetDnsThreatDetectorRequest + */ + GetDnsThreatDetectorRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networksecurity.v1.GetDnsThreatDetectorRequest) + return object; + var message = new $root.google.cloud.networksecurity.v1.GetDnsThreatDetectorRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetDnsThreatDetectorRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.networksecurity.v1.GetDnsThreatDetectorRequest + * @static + * @param {google.cloud.networksecurity.v1.GetDnsThreatDetectorRequest} message GetDnsThreatDetectorRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetDnsThreatDetectorRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this GetDnsThreatDetectorRequest to JSON. + * @function toJSON + * @memberof google.cloud.networksecurity.v1.GetDnsThreatDetectorRequest + * @instance + * @returns {Object.} JSON object + */ + GetDnsThreatDetectorRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetDnsThreatDetectorRequest + * @function getTypeUrl + * @memberof google.cloud.networksecurity.v1.GetDnsThreatDetectorRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetDnsThreatDetectorRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.networksecurity.v1.GetDnsThreatDetectorRequest"; + }; + + return GetDnsThreatDetectorRequest; + })(); + + v1.CreateDnsThreatDetectorRequest = (function() { + + /** + * Properties of a CreateDnsThreatDetectorRequest. + * @memberof google.cloud.networksecurity.v1 + * @interface ICreateDnsThreatDetectorRequest + * @property {string|null} [parent] CreateDnsThreatDetectorRequest parent + * @property {string|null} [dnsThreatDetectorId] CreateDnsThreatDetectorRequest dnsThreatDetectorId + * @property {google.cloud.networksecurity.v1.IDnsThreatDetector|null} [dnsThreatDetector] CreateDnsThreatDetectorRequest dnsThreatDetector + */ + + /** + * Constructs a new CreateDnsThreatDetectorRequest. + * @memberof google.cloud.networksecurity.v1 + * @classdesc Represents a CreateDnsThreatDetectorRequest. + * @implements ICreateDnsThreatDetectorRequest + * @constructor + * @param {google.cloud.networksecurity.v1.ICreateDnsThreatDetectorRequest=} [properties] Properties to set + */ + function CreateDnsThreatDetectorRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateDnsThreatDetectorRequest parent. + * @member {string} parent + * @memberof google.cloud.networksecurity.v1.CreateDnsThreatDetectorRequest + * @instance + */ + CreateDnsThreatDetectorRequest.prototype.parent = ""; + + /** + * CreateDnsThreatDetectorRequest dnsThreatDetectorId. + * @member {string} dnsThreatDetectorId + * @memberof google.cloud.networksecurity.v1.CreateDnsThreatDetectorRequest + * @instance + */ + CreateDnsThreatDetectorRequest.prototype.dnsThreatDetectorId = ""; + + /** + * CreateDnsThreatDetectorRequest dnsThreatDetector. + * @member {google.cloud.networksecurity.v1.IDnsThreatDetector|null|undefined} dnsThreatDetector + * @memberof google.cloud.networksecurity.v1.CreateDnsThreatDetectorRequest + * @instance + */ + CreateDnsThreatDetectorRequest.prototype.dnsThreatDetector = null; + + /** + * Creates a new CreateDnsThreatDetectorRequest instance using the specified properties. + * @function create + * @memberof google.cloud.networksecurity.v1.CreateDnsThreatDetectorRequest + * @static + * @param {google.cloud.networksecurity.v1.ICreateDnsThreatDetectorRequest=} [properties] Properties to set + * @returns {google.cloud.networksecurity.v1.CreateDnsThreatDetectorRequest} CreateDnsThreatDetectorRequest instance + */ + CreateDnsThreatDetectorRequest.create = function create(properties) { + return new CreateDnsThreatDetectorRequest(properties); + }; + + /** + * Encodes the specified CreateDnsThreatDetectorRequest message. Does not implicitly {@link google.cloud.networksecurity.v1.CreateDnsThreatDetectorRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.networksecurity.v1.CreateDnsThreatDetectorRequest + * @static + * @param {google.cloud.networksecurity.v1.ICreateDnsThreatDetectorRequest} message CreateDnsThreatDetectorRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateDnsThreatDetectorRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.dnsThreatDetectorId != null && Object.hasOwnProperty.call(message, "dnsThreatDetectorId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.dnsThreatDetectorId); + if (message.dnsThreatDetector != null && Object.hasOwnProperty.call(message, "dnsThreatDetector")) + $root.google.cloud.networksecurity.v1.DnsThreatDetector.encode(message.dnsThreatDetector, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreateDnsThreatDetectorRequest message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.CreateDnsThreatDetectorRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.networksecurity.v1.CreateDnsThreatDetectorRequest + * @static + * @param {google.cloud.networksecurity.v1.ICreateDnsThreatDetectorRequest} message CreateDnsThreatDetectorRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateDnsThreatDetectorRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateDnsThreatDetectorRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.networksecurity.v1.CreateDnsThreatDetectorRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.networksecurity.v1.CreateDnsThreatDetectorRequest} CreateDnsThreatDetectorRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateDnsThreatDetectorRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networksecurity.v1.CreateDnsThreatDetectorRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.dnsThreatDetectorId = reader.string(); + break; + } + case 3: { + message.dnsThreatDetector = $root.google.cloud.networksecurity.v1.DnsThreatDetector.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateDnsThreatDetectorRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.networksecurity.v1.CreateDnsThreatDetectorRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.networksecurity.v1.CreateDnsThreatDetectorRequest} CreateDnsThreatDetectorRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateDnsThreatDetectorRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateDnsThreatDetectorRequest message. + * @function verify + * @memberof google.cloud.networksecurity.v1.CreateDnsThreatDetectorRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateDnsThreatDetectorRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.dnsThreatDetectorId != null && message.hasOwnProperty("dnsThreatDetectorId")) + if (!$util.isString(message.dnsThreatDetectorId)) + return "dnsThreatDetectorId: string expected"; + if (message.dnsThreatDetector != null && message.hasOwnProperty("dnsThreatDetector")) { + var error = $root.google.cloud.networksecurity.v1.DnsThreatDetector.verify(message.dnsThreatDetector); + if (error) + return "dnsThreatDetector." + error; + } + return null; + }; + + /** + * Creates a CreateDnsThreatDetectorRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.networksecurity.v1.CreateDnsThreatDetectorRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.networksecurity.v1.CreateDnsThreatDetectorRequest} CreateDnsThreatDetectorRequest + */ + CreateDnsThreatDetectorRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networksecurity.v1.CreateDnsThreatDetectorRequest) + return object; + var message = new $root.google.cloud.networksecurity.v1.CreateDnsThreatDetectorRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.dnsThreatDetectorId != null) + message.dnsThreatDetectorId = String(object.dnsThreatDetectorId); + if (object.dnsThreatDetector != null) { + if (typeof object.dnsThreatDetector !== "object") + throw TypeError(".google.cloud.networksecurity.v1.CreateDnsThreatDetectorRequest.dnsThreatDetector: object expected"); + message.dnsThreatDetector = $root.google.cloud.networksecurity.v1.DnsThreatDetector.fromObject(object.dnsThreatDetector); + } + return message; + }; + + /** + * Creates a plain object from a CreateDnsThreatDetectorRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.networksecurity.v1.CreateDnsThreatDetectorRequest + * @static + * @param {google.cloud.networksecurity.v1.CreateDnsThreatDetectorRequest} message CreateDnsThreatDetectorRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateDnsThreatDetectorRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.dnsThreatDetectorId = ""; + object.dnsThreatDetector = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.dnsThreatDetectorId != null && message.hasOwnProperty("dnsThreatDetectorId")) + object.dnsThreatDetectorId = message.dnsThreatDetectorId; + if (message.dnsThreatDetector != null && message.hasOwnProperty("dnsThreatDetector")) + object.dnsThreatDetector = $root.google.cloud.networksecurity.v1.DnsThreatDetector.toObject(message.dnsThreatDetector, options); + return object; + }; + + /** + * Converts this CreateDnsThreatDetectorRequest to JSON. + * @function toJSON + * @memberof google.cloud.networksecurity.v1.CreateDnsThreatDetectorRequest + * @instance + * @returns {Object.} JSON object + */ + CreateDnsThreatDetectorRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateDnsThreatDetectorRequest + * @function getTypeUrl + * @memberof google.cloud.networksecurity.v1.CreateDnsThreatDetectorRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateDnsThreatDetectorRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.networksecurity.v1.CreateDnsThreatDetectorRequest"; + }; + + return CreateDnsThreatDetectorRequest; + })(); + + v1.UpdateDnsThreatDetectorRequest = (function() { + + /** + * Properties of an UpdateDnsThreatDetectorRequest. + * @memberof google.cloud.networksecurity.v1 + * @interface IUpdateDnsThreatDetectorRequest + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateDnsThreatDetectorRequest updateMask + * @property {google.cloud.networksecurity.v1.IDnsThreatDetector|null} [dnsThreatDetector] UpdateDnsThreatDetectorRequest dnsThreatDetector + */ + + /** + * Constructs a new UpdateDnsThreatDetectorRequest. + * @memberof google.cloud.networksecurity.v1 + * @classdesc Represents an UpdateDnsThreatDetectorRequest. + * @implements IUpdateDnsThreatDetectorRequest + * @constructor + * @param {google.cloud.networksecurity.v1.IUpdateDnsThreatDetectorRequest=} [properties] Properties to set + */ + function UpdateDnsThreatDetectorRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateDnsThreatDetectorRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.networksecurity.v1.UpdateDnsThreatDetectorRequest + * @instance + */ + UpdateDnsThreatDetectorRequest.prototype.updateMask = null; + + /** + * UpdateDnsThreatDetectorRequest dnsThreatDetector. + * @member {google.cloud.networksecurity.v1.IDnsThreatDetector|null|undefined} dnsThreatDetector + * @memberof google.cloud.networksecurity.v1.UpdateDnsThreatDetectorRequest + * @instance + */ + UpdateDnsThreatDetectorRequest.prototype.dnsThreatDetector = null; + + /** + * Creates a new UpdateDnsThreatDetectorRequest instance using the specified properties. + * @function create + * @memberof google.cloud.networksecurity.v1.UpdateDnsThreatDetectorRequest + * @static + * @param {google.cloud.networksecurity.v1.IUpdateDnsThreatDetectorRequest=} [properties] Properties to set + * @returns {google.cloud.networksecurity.v1.UpdateDnsThreatDetectorRequest} UpdateDnsThreatDetectorRequest instance + */ + UpdateDnsThreatDetectorRequest.create = function create(properties) { + return new UpdateDnsThreatDetectorRequest(properties); + }; + + /** + * Encodes the specified UpdateDnsThreatDetectorRequest message. Does not implicitly {@link google.cloud.networksecurity.v1.UpdateDnsThreatDetectorRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.networksecurity.v1.UpdateDnsThreatDetectorRequest + * @static + * @param {google.cloud.networksecurity.v1.IUpdateDnsThreatDetectorRequest} message UpdateDnsThreatDetectorRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateDnsThreatDetectorRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.dnsThreatDetector != null && Object.hasOwnProperty.call(message, "dnsThreatDetector")) + $root.google.cloud.networksecurity.v1.DnsThreatDetector.encode(message.dnsThreatDetector, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified UpdateDnsThreatDetectorRequest message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.UpdateDnsThreatDetectorRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.networksecurity.v1.UpdateDnsThreatDetectorRequest + * @static + * @param {google.cloud.networksecurity.v1.IUpdateDnsThreatDetectorRequest} message UpdateDnsThreatDetectorRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateDnsThreatDetectorRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateDnsThreatDetectorRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.networksecurity.v1.UpdateDnsThreatDetectorRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.networksecurity.v1.UpdateDnsThreatDetectorRequest} UpdateDnsThreatDetectorRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateDnsThreatDetectorRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networksecurity.v1.UpdateDnsThreatDetectorRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + case 2: { + message.dnsThreatDetector = $root.google.cloud.networksecurity.v1.DnsThreatDetector.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateDnsThreatDetectorRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.networksecurity.v1.UpdateDnsThreatDetectorRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.networksecurity.v1.UpdateDnsThreatDetectorRequest} UpdateDnsThreatDetectorRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateDnsThreatDetectorRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateDnsThreatDetectorRequest message. + * @function verify + * @memberof google.cloud.networksecurity.v1.UpdateDnsThreatDetectorRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateDnsThreatDetectorRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + if (message.dnsThreatDetector != null && message.hasOwnProperty("dnsThreatDetector")) { + var error = $root.google.cloud.networksecurity.v1.DnsThreatDetector.verify(message.dnsThreatDetector); + if (error) + return "dnsThreatDetector." + error; + } + return null; + }; + + /** + * Creates an UpdateDnsThreatDetectorRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.networksecurity.v1.UpdateDnsThreatDetectorRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.networksecurity.v1.UpdateDnsThreatDetectorRequest} UpdateDnsThreatDetectorRequest + */ + UpdateDnsThreatDetectorRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networksecurity.v1.UpdateDnsThreatDetectorRequest) + return object; + var message = new $root.google.cloud.networksecurity.v1.UpdateDnsThreatDetectorRequest(); + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.networksecurity.v1.UpdateDnsThreatDetectorRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + if (object.dnsThreatDetector != null) { + if (typeof object.dnsThreatDetector !== "object") + throw TypeError(".google.cloud.networksecurity.v1.UpdateDnsThreatDetectorRequest.dnsThreatDetector: object expected"); + message.dnsThreatDetector = $root.google.cloud.networksecurity.v1.DnsThreatDetector.fromObject(object.dnsThreatDetector); + } + return message; + }; + + /** + * Creates a plain object from an UpdateDnsThreatDetectorRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.networksecurity.v1.UpdateDnsThreatDetectorRequest + * @static + * @param {google.cloud.networksecurity.v1.UpdateDnsThreatDetectorRequest} message UpdateDnsThreatDetectorRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateDnsThreatDetectorRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.updateMask = null; + object.dnsThreatDetector = null; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + if (message.dnsThreatDetector != null && message.hasOwnProperty("dnsThreatDetector")) + object.dnsThreatDetector = $root.google.cloud.networksecurity.v1.DnsThreatDetector.toObject(message.dnsThreatDetector, options); + return object; + }; + + /** + * Converts this UpdateDnsThreatDetectorRequest to JSON. + * @function toJSON + * @memberof google.cloud.networksecurity.v1.UpdateDnsThreatDetectorRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateDnsThreatDetectorRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateDnsThreatDetectorRequest + * @function getTypeUrl + * @memberof google.cloud.networksecurity.v1.UpdateDnsThreatDetectorRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateDnsThreatDetectorRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.networksecurity.v1.UpdateDnsThreatDetectorRequest"; + }; + + return UpdateDnsThreatDetectorRequest; + })(); + + v1.DeleteDnsThreatDetectorRequest = (function() { + + /** + * Properties of a DeleteDnsThreatDetectorRequest. + * @memberof google.cloud.networksecurity.v1 + * @interface IDeleteDnsThreatDetectorRequest + * @property {string|null} [name] DeleteDnsThreatDetectorRequest name + */ + + /** + * Constructs a new DeleteDnsThreatDetectorRequest. + * @memberof google.cloud.networksecurity.v1 + * @classdesc Represents a DeleteDnsThreatDetectorRequest. + * @implements IDeleteDnsThreatDetectorRequest + * @constructor + * @param {google.cloud.networksecurity.v1.IDeleteDnsThreatDetectorRequest=} [properties] Properties to set + */ + function DeleteDnsThreatDetectorRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteDnsThreatDetectorRequest name. + * @member {string} name + * @memberof google.cloud.networksecurity.v1.DeleteDnsThreatDetectorRequest + * @instance + */ + DeleteDnsThreatDetectorRequest.prototype.name = ""; + + /** + * Creates a new DeleteDnsThreatDetectorRequest instance using the specified properties. + * @function create + * @memberof google.cloud.networksecurity.v1.DeleteDnsThreatDetectorRequest + * @static + * @param {google.cloud.networksecurity.v1.IDeleteDnsThreatDetectorRequest=} [properties] Properties to set + * @returns {google.cloud.networksecurity.v1.DeleteDnsThreatDetectorRequest} DeleteDnsThreatDetectorRequest instance + */ + DeleteDnsThreatDetectorRequest.create = function create(properties) { + return new DeleteDnsThreatDetectorRequest(properties); + }; + + /** + * Encodes the specified DeleteDnsThreatDetectorRequest message. Does not implicitly {@link google.cloud.networksecurity.v1.DeleteDnsThreatDetectorRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.networksecurity.v1.DeleteDnsThreatDetectorRequest + * @static + * @param {google.cloud.networksecurity.v1.IDeleteDnsThreatDetectorRequest} message DeleteDnsThreatDetectorRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteDnsThreatDetectorRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified DeleteDnsThreatDetectorRequest message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.DeleteDnsThreatDetectorRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.networksecurity.v1.DeleteDnsThreatDetectorRequest + * @static + * @param {google.cloud.networksecurity.v1.IDeleteDnsThreatDetectorRequest} message DeleteDnsThreatDetectorRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteDnsThreatDetectorRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteDnsThreatDetectorRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.networksecurity.v1.DeleteDnsThreatDetectorRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.networksecurity.v1.DeleteDnsThreatDetectorRequest} DeleteDnsThreatDetectorRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteDnsThreatDetectorRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networksecurity.v1.DeleteDnsThreatDetectorRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteDnsThreatDetectorRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.networksecurity.v1.DeleteDnsThreatDetectorRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.networksecurity.v1.DeleteDnsThreatDetectorRequest} DeleteDnsThreatDetectorRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteDnsThreatDetectorRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteDnsThreatDetectorRequest message. + * @function verify + * @memberof google.cloud.networksecurity.v1.DeleteDnsThreatDetectorRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteDnsThreatDetectorRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a DeleteDnsThreatDetectorRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.networksecurity.v1.DeleteDnsThreatDetectorRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.networksecurity.v1.DeleteDnsThreatDetectorRequest} DeleteDnsThreatDetectorRequest + */ + DeleteDnsThreatDetectorRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networksecurity.v1.DeleteDnsThreatDetectorRequest) + return object; + var message = new $root.google.cloud.networksecurity.v1.DeleteDnsThreatDetectorRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a DeleteDnsThreatDetectorRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.networksecurity.v1.DeleteDnsThreatDetectorRequest + * @static + * @param {google.cloud.networksecurity.v1.DeleteDnsThreatDetectorRequest} message DeleteDnsThreatDetectorRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteDnsThreatDetectorRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this DeleteDnsThreatDetectorRequest to JSON. + * @function toJSON + * @memberof google.cloud.networksecurity.v1.DeleteDnsThreatDetectorRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteDnsThreatDetectorRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteDnsThreatDetectorRequest + * @function getTypeUrl + * @memberof google.cloud.networksecurity.v1.DeleteDnsThreatDetectorRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteDnsThreatDetectorRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.networksecurity.v1.DeleteDnsThreatDetectorRequest"; + }; + + return DeleteDnsThreatDetectorRequest; + })(); + + v1.FirewallActivation = (function() { + + /** + * Constructs a new FirewallActivation service. + * @memberof google.cloud.networksecurity.v1 + * @classdesc Represents a FirewallActivation + * @extends $protobuf.rpc.Service + * @constructor + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + */ + function FirewallActivation(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (FirewallActivation.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = FirewallActivation; + + /** + * Creates new FirewallActivation service using the specified rpc implementation. + * @function create + * @memberof google.cloud.networksecurity.v1.FirewallActivation + * @static + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + * @returns {FirewallActivation} RPC service. Useful where requests and/or responses are streamed. + */ + FirewallActivation.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.networksecurity.v1.FirewallActivation|listFirewallEndpoints}. + * @memberof google.cloud.networksecurity.v1.FirewallActivation + * @typedef ListFirewallEndpointsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.networksecurity.v1.ListFirewallEndpointsResponse} [response] ListFirewallEndpointsResponse + */ + + /** + * Calls ListFirewallEndpoints. + * @function listFirewallEndpoints + * @memberof google.cloud.networksecurity.v1.FirewallActivation + * @instance + * @param {google.cloud.networksecurity.v1.IListFirewallEndpointsRequest} request ListFirewallEndpointsRequest message or plain object + * @param {google.cloud.networksecurity.v1.FirewallActivation.ListFirewallEndpointsCallback} callback Node-style callback called with the error, if any, and ListFirewallEndpointsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(FirewallActivation.prototype.listFirewallEndpoints = function listFirewallEndpoints(request, callback) { + return this.rpcCall(listFirewallEndpoints, $root.google.cloud.networksecurity.v1.ListFirewallEndpointsRequest, $root.google.cloud.networksecurity.v1.ListFirewallEndpointsResponse, request, callback); + }, "name", { value: "ListFirewallEndpoints" }); + + /** + * Calls ListFirewallEndpoints. + * @function listFirewallEndpoints + * @memberof google.cloud.networksecurity.v1.FirewallActivation + * @instance + * @param {google.cloud.networksecurity.v1.IListFirewallEndpointsRequest} request ListFirewallEndpointsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.networksecurity.v1.FirewallActivation|getFirewallEndpoint}. + * @memberof google.cloud.networksecurity.v1.FirewallActivation + * @typedef GetFirewallEndpointCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.networksecurity.v1.FirewallEndpoint} [response] FirewallEndpoint + */ + + /** + * Calls GetFirewallEndpoint. + * @function getFirewallEndpoint + * @memberof google.cloud.networksecurity.v1.FirewallActivation + * @instance + * @param {google.cloud.networksecurity.v1.IGetFirewallEndpointRequest} request GetFirewallEndpointRequest message or plain object + * @param {google.cloud.networksecurity.v1.FirewallActivation.GetFirewallEndpointCallback} callback Node-style callback called with the error, if any, and FirewallEndpoint + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(FirewallActivation.prototype.getFirewallEndpoint = function getFirewallEndpoint(request, callback) { + return this.rpcCall(getFirewallEndpoint, $root.google.cloud.networksecurity.v1.GetFirewallEndpointRequest, $root.google.cloud.networksecurity.v1.FirewallEndpoint, request, callback); + }, "name", { value: "GetFirewallEndpoint" }); + + /** + * Calls GetFirewallEndpoint. + * @function getFirewallEndpoint + * @memberof google.cloud.networksecurity.v1.FirewallActivation + * @instance + * @param {google.cloud.networksecurity.v1.IGetFirewallEndpointRequest} request GetFirewallEndpointRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.networksecurity.v1.FirewallActivation|createFirewallEndpoint}. + * @memberof google.cloud.networksecurity.v1.FirewallActivation + * @typedef CreateFirewallEndpointCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls CreateFirewallEndpoint. + * @function createFirewallEndpoint + * @memberof google.cloud.networksecurity.v1.FirewallActivation + * @instance + * @param {google.cloud.networksecurity.v1.ICreateFirewallEndpointRequest} request CreateFirewallEndpointRequest message or plain object + * @param {google.cloud.networksecurity.v1.FirewallActivation.CreateFirewallEndpointCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(FirewallActivation.prototype.createFirewallEndpoint = function createFirewallEndpoint(request, callback) { + return this.rpcCall(createFirewallEndpoint, $root.google.cloud.networksecurity.v1.CreateFirewallEndpointRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "CreateFirewallEndpoint" }); + + /** + * Calls CreateFirewallEndpoint. + * @function createFirewallEndpoint + * @memberof google.cloud.networksecurity.v1.FirewallActivation + * @instance + * @param {google.cloud.networksecurity.v1.ICreateFirewallEndpointRequest} request CreateFirewallEndpointRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.networksecurity.v1.FirewallActivation|deleteFirewallEndpoint}. + * @memberof google.cloud.networksecurity.v1.FirewallActivation + * @typedef DeleteFirewallEndpointCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls DeleteFirewallEndpoint. + * @function deleteFirewallEndpoint + * @memberof google.cloud.networksecurity.v1.FirewallActivation + * @instance + * @param {google.cloud.networksecurity.v1.IDeleteFirewallEndpointRequest} request DeleteFirewallEndpointRequest message or plain object + * @param {google.cloud.networksecurity.v1.FirewallActivation.DeleteFirewallEndpointCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(FirewallActivation.prototype.deleteFirewallEndpoint = function deleteFirewallEndpoint(request, callback) { + return this.rpcCall(deleteFirewallEndpoint, $root.google.cloud.networksecurity.v1.DeleteFirewallEndpointRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "DeleteFirewallEndpoint" }); + + /** + * Calls DeleteFirewallEndpoint. + * @function deleteFirewallEndpoint + * @memberof google.cloud.networksecurity.v1.FirewallActivation + * @instance + * @param {google.cloud.networksecurity.v1.IDeleteFirewallEndpointRequest} request DeleteFirewallEndpointRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.networksecurity.v1.FirewallActivation|updateFirewallEndpoint}. + * @memberof google.cloud.networksecurity.v1.FirewallActivation + * @typedef UpdateFirewallEndpointCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls UpdateFirewallEndpoint. + * @function updateFirewallEndpoint + * @memberof google.cloud.networksecurity.v1.FirewallActivation + * @instance + * @param {google.cloud.networksecurity.v1.IUpdateFirewallEndpointRequest} request UpdateFirewallEndpointRequest message or plain object + * @param {google.cloud.networksecurity.v1.FirewallActivation.UpdateFirewallEndpointCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(FirewallActivation.prototype.updateFirewallEndpoint = function updateFirewallEndpoint(request, callback) { + return this.rpcCall(updateFirewallEndpoint, $root.google.cloud.networksecurity.v1.UpdateFirewallEndpointRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "UpdateFirewallEndpoint" }); + + /** + * Calls UpdateFirewallEndpoint. + * @function updateFirewallEndpoint + * @memberof google.cloud.networksecurity.v1.FirewallActivation + * @instance + * @param {google.cloud.networksecurity.v1.IUpdateFirewallEndpointRequest} request UpdateFirewallEndpointRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.networksecurity.v1.FirewallActivation|listFirewallEndpointAssociations}. + * @memberof google.cloud.networksecurity.v1.FirewallActivation + * @typedef ListFirewallEndpointAssociationsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.networksecurity.v1.ListFirewallEndpointAssociationsResponse} [response] ListFirewallEndpointAssociationsResponse + */ + + /** + * Calls ListFirewallEndpointAssociations. + * @function listFirewallEndpointAssociations + * @memberof google.cloud.networksecurity.v1.FirewallActivation + * @instance + * @param {google.cloud.networksecurity.v1.IListFirewallEndpointAssociationsRequest} request ListFirewallEndpointAssociationsRequest message or plain object + * @param {google.cloud.networksecurity.v1.FirewallActivation.ListFirewallEndpointAssociationsCallback} callback Node-style callback called with the error, if any, and ListFirewallEndpointAssociationsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(FirewallActivation.prototype.listFirewallEndpointAssociations = function listFirewallEndpointAssociations(request, callback) { + return this.rpcCall(listFirewallEndpointAssociations, $root.google.cloud.networksecurity.v1.ListFirewallEndpointAssociationsRequest, $root.google.cloud.networksecurity.v1.ListFirewallEndpointAssociationsResponse, request, callback); + }, "name", { value: "ListFirewallEndpointAssociations" }); + + /** + * Calls ListFirewallEndpointAssociations. + * @function listFirewallEndpointAssociations + * @memberof google.cloud.networksecurity.v1.FirewallActivation + * @instance + * @param {google.cloud.networksecurity.v1.IListFirewallEndpointAssociationsRequest} request ListFirewallEndpointAssociationsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.networksecurity.v1.FirewallActivation|getFirewallEndpointAssociation}. + * @memberof google.cloud.networksecurity.v1.FirewallActivation + * @typedef GetFirewallEndpointAssociationCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.networksecurity.v1.FirewallEndpointAssociation} [response] FirewallEndpointAssociation + */ + + /** + * Calls GetFirewallEndpointAssociation. + * @function getFirewallEndpointAssociation + * @memberof google.cloud.networksecurity.v1.FirewallActivation + * @instance + * @param {google.cloud.networksecurity.v1.IGetFirewallEndpointAssociationRequest} request GetFirewallEndpointAssociationRequest message or plain object + * @param {google.cloud.networksecurity.v1.FirewallActivation.GetFirewallEndpointAssociationCallback} callback Node-style callback called with the error, if any, and FirewallEndpointAssociation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(FirewallActivation.prototype.getFirewallEndpointAssociation = function getFirewallEndpointAssociation(request, callback) { + return this.rpcCall(getFirewallEndpointAssociation, $root.google.cloud.networksecurity.v1.GetFirewallEndpointAssociationRequest, $root.google.cloud.networksecurity.v1.FirewallEndpointAssociation, request, callback); + }, "name", { value: "GetFirewallEndpointAssociation" }); + + /** + * Calls GetFirewallEndpointAssociation. + * @function getFirewallEndpointAssociation + * @memberof google.cloud.networksecurity.v1.FirewallActivation + * @instance + * @param {google.cloud.networksecurity.v1.IGetFirewallEndpointAssociationRequest} request GetFirewallEndpointAssociationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.networksecurity.v1.FirewallActivation|createFirewallEndpointAssociation}. + * @memberof google.cloud.networksecurity.v1.FirewallActivation + * @typedef CreateFirewallEndpointAssociationCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls CreateFirewallEndpointAssociation. + * @function createFirewallEndpointAssociation + * @memberof google.cloud.networksecurity.v1.FirewallActivation + * @instance + * @param {google.cloud.networksecurity.v1.ICreateFirewallEndpointAssociationRequest} request CreateFirewallEndpointAssociationRequest message or plain object + * @param {google.cloud.networksecurity.v1.FirewallActivation.CreateFirewallEndpointAssociationCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(FirewallActivation.prototype.createFirewallEndpointAssociation = function createFirewallEndpointAssociation(request, callback) { + return this.rpcCall(createFirewallEndpointAssociation, $root.google.cloud.networksecurity.v1.CreateFirewallEndpointAssociationRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "CreateFirewallEndpointAssociation" }); + + /** + * Calls CreateFirewallEndpointAssociation. + * @function createFirewallEndpointAssociation + * @memberof google.cloud.networksecurity.v1.FirewallActivation + * @instance + * @param {google.cloud.networksecurity.v1.ICreateFirewallEndpointAssociationRequest} request CreateFirewallEndpointAssociationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.networksecurity.v1.FirewallActivation|deleteFirewallEndpointAssociation}. + * @memberof google.cloud.networksecurity.v1.FirewallActivation + * @typedef DeleteFirewallEndpointAssociationCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls DeleteFirewallEndpointAssociation. + * @function deleteFirewallEndpointAssociation + * @memberof google.cloud.networksecurity.v1.FirewallActivation + * @instance + * @param {google.cloud.networksecurity.v1.IDeleteFirewallEndpointAssociationRequest} request DeleteFirewallEndpointAssociationRequest message or plain object + * @param {google.cloud.networksecurity.v1.FirewallActivation.DeleteFirewallEndpointAssociationCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(FirewallActivation.prototype.deleteFirewallEndpointAssociation = function deleteFirewallEndpointAssociation(request, callback) { + return this.rpcCall(deleteFirewallEndpointAssociation, $root.google.cloud.networksecurity.v1.DeleteFirewallEndpointAssociationRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "DeleteFirewallEndpointAssociation" }); + + /** + * Calls DeleteFirewallEndpointAssociation. + * @function deleteFirewallEndpointAssociation + * @memberof google.cloud.networksecurity.v1.FirewallActivation + * @instance + * @param {google.cloud.networksecurity.v1.IDeleteFirewallEndpointAssociationRequest} request DeleteFirewallEndpointAssociationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.networksecurity.v1.FirewallActivation|updateFirewallEndpointAssociation}. + * @memberof google.cloud.networksecurity.v1.FirewallActivation + * @typedef UpdateFirewallEndpointAssociationCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls UpdateFirewallEndpointAssociation. + * @function updateFirewallEndpointAssociation + * @memberof google.cloud.networksecurity.v1.FirewallActivation + * @instance + * @param {google.cloud.networksecurity.v1.IUpdateFirewallEndpointAssociationRequest} request UpdateFirewallEndpointAssociationRequest message or plain object + * @param {google.cloud.networksecurity.v1.FirewallActivation.UpdateFirewallEndpointAssociationCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(FirewallActivation.prototype.updateFirewallEndpointAssociation = function updateFirewallEndpointAssociation(request, callback) { + return this.rpcCall(updateFirewallEndpointAssociation, $root.google.cloud.networksecurity.v1.UpdateFirewallEndpointAssociationRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "UpdateFirewallEndpointAssociation" }); + + /** + * Calls UpdateFirewallEndpointAssociation. + * @function updateFirewallEndpointAssociation + * @memberof google.cloud.networksecurity.v1.FirewallActivation + * @instance + * @param {google.cloud.networksecurity.v1.IUpdateFirewallEndpointAssociationRequest} request UpdateFirewallEndpointAssociationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return FirewallActivation; + })(); + + v1.FirewallEndpoint = (function() { + + /** + * Properties of a FirewallEndpoint. + * @memberof google.cloud.networksecurity.v1 + * @interface IFirewallEndpoint + * @property {string|null} [name] FirewallEndpoint name + * @property {string|null} [description] FirewallEndpoint description + * @property {google.protobuf.ITimestamp|null} [createTime] FirewallEndpoint createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] FirewallEndpoint updateTime + * @property {Object.|null} [labels] FirewallEndpoint labels + * @property {google.cloud.networksecurity.v1.FirewallEndpoint.State|null} [state] FirewallEndpoint state + * @property {boolean|null} [reconciling] FirewallEndpoint reconciling + * @property {Array.|null} [associatedNetworks] FirewallEndpoint associatedNetworks + * @property {Array.|null} [associations] FirewallEndpoint associations + * @property {boolean|null} [satisfiesPzs] FirewallEndpoint satisfiesPzs + * @property {boolean|null} [satisfiesPzi] FirewallEndpoint satisfiesPzi + * @property {string|null} [billingProjectId] FirewallEndpoint billingProjectId + * @property {google.cloud.networksecurity.v1.FirewallEndpoint.IEndpointSettings|null} [endpointSettings] FirewallEndpoint endpointSettings + */ + + /** + * Constructs a new FirewallEndpoint. + * @memberof google.cloud.networksecurity.v1 + * @classdesc Represents a FirewallEndpoint. + * @implements IFirewallEndpoint + * @constructor + * @param {google.cloud.networksecurity.v1.IFirewallEndpoint=} [properties] Properties to set + */ + function FirewallEndpoint(properties) { + this.labels = {}; + this.associatedNetworks = []; + this.associations = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FirewallEndpoint name. + * @member {string} name + * @memberof google.cloud.networksecurity.v1.FirewallEndpoint + * @instance + */ + FirewallEndpoint.prototype.name = ""; + + /** + * FirewallEndpoint description. + * @member {string} description + * @memberof google.cloud.networksecurity.v1.FirewallEndpoint + * @instance + */ + FirewallEndpoint.prototype.description = ""; + + /** + * FirewallEndpoint createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.networksecurity.v1.FirewallEndpoint + * @instance + */ + FirewallEndpoint.prototype.createTime = null; + + /** + * FirewallEndpoint updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.networksecurity.v1.FirewallEndpoint + * @instance + */ + FirewallEndpoint.prototype.updateTime = null; + + /** + * FirewallEndpoint labels. + * @member {Object.} labels + * @memberof google.cloud.networksecurity.v1.FirewallEndpoint + * @instance + */ + FirewallEndpoint.prototype.labels = $util.emptyObject; + + /** + * FirewallEndpoint state. + * @member {google.cloud.networksecurity.v1.FirewallEndpoint.State} state + * @memberof google.cloud.networksecurity.v1.FirewallEndpoint + * @instance + */ + FirewallEndpoint.prototype.state = 0; + + /** + * FirewallEndpoint reconciling. + * @member {boolean} reconciling + * @memberof google.cloud.networksecurity.v1.FirewallEndpoint + * @instance + */ + FirewallEndpoint.prototype.reconciling = false; + + /** + * FirewallEndpoint associatedNetworks. + * @member {Array.} associatedNetworks + * @memberof google.cloud.networksecurity.v1.FirewallEndpoint + * @instance + */ + FirewallEndpoint.prototype.associatedNetworks = $util.emptyArray; + + /** + * FirewallEndpoint associations. + * @member {Array.} associations + * @memberof google.cloud.networksecurity.v1.FirewallEndpoint + * @instance + */ + FirewallEndpoint.prototype.associations = $util.emptyArray; + + /** + * FirewallEndpoint satisfiesPzs. + * @member {boolean|null|undefined} satisfiesPzs + * @memberof google.cloud.networksecurity.v1.FirewallEndpoint + * @instance + */ + FirewallEndpoint.prototype.satisfiesPzs = null; + + /** + * FirewallEndpoint satisfiesPzi. + * @member {boolean|null|undefined} satisfiesPzi + * @memberof google.cloud.networksecurity.v1.FirewallEndpoint + * @instance + */ + FirewallEndpoint.prototype.satisfiesPzi = null; + + /** + * FirewallEndpoint billingProjectId. + * @member {string} billingProjectId + * @memberof google.cloud.networksecurity.v1.FirewallEndpoint + * @instance + */ + FirewallEndpoint.prototype.billingProjectId = ""; + + /** + * FirewallEndpoint endpointSettings. + * @member {google.cloud.networksecurity.v1.FirewallEndpoint.IEndpointSettings|null|undefined} endpointSettings + * @memberof google.cloud.networksecurity.v1.FirewallEndpoint + * @instance + */ + FirewallEndpoint.prototype.endpointSettings = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(FirewallEndpoint.prototype, "_satisfiesPzs", { + get: $util.oneOfGetter($oneOfFields = ["satisfiesPzs"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(FirewallEndpoint.prototype, "_satisfiesPzi", { + get: $util.oneOfGetter($oneOfFields = ["satisfiesPzi"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new FirewallEndpoint instance using the specified properties. + * @function create + * @memberof google.cloud.networksecurity.v1.FirewallEndpoint + * @static + * @param {google.cloud.networksecurity.v1.IFirewallEndpoint=} [properties] Properties to set + * @returns {google.cloud.networksecurity.v1.FirewallEndpoint} FirewallEndpoint instance + */ + FirewallEndpoint.create = function create(properties) { + return new FirewallEndpoint(properties); + }; + + /** + * Encodes the specified FirewallEndpoint message. Does not implicitly {@link google.cloud.networksecurity.v1.FirewallEndpoint.verify|verify} messages. + * @function encode + * @memberof google.cloud.networksecurity.v1.FirewallEndpoint + * @static + * @param {google.cloud.networksecurity.v1.IFirewallEndpoint} message FirewallEndpoint message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FirewallEndpoint.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) + for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) + writer.uint32(/* id 4, wireType 2 =*/34).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.state); + if (message.reconciling != null && Object.hasOwnProperty.call(message, "reconciling")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.reconciling); + if (message.associatedNetworks != null && message.associatedNetworks.length) + for (var i = 0; i < message.associatedNetworks.length; ++i) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.associatedNetworks[i]); + if (message.billingProjectId != null && Object.hasOwnProperty.call(message, "billingProjectId")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.billingProjectId); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 9, wireType 2 =*/74).string(message.description); + if (message.associations != null && message.associations.length) + for (var i = 0; i < message.associations.length; ++i) + $root.google.cloud.networksecurity.v1.FirewallEndpoint.AssociationReference.encode(message.associations[i], writer.uint32(/* id 13, wireType 2 =*/106).fork()).ldelim(); + if (message.satisfiesPzs != null && Object.hasOwnProperty.call(message, "satisfiesPzs")) + writer.uint32(/* id 14, wireType 0 =*/112).bool(message.satisfiesPzs); + if (message.satisfiesPzi != null && Object.hasOwnProperty.call(message, "satisfiesPzi")) + writer.uint32(/* id 15, wireType 0 =*/120).bool(message.satisfiesPzi); + if (message.endpointSettings != null && Object.hasOwnProperty.call(message, "endpointSettings")) + $root.google.cloud.networksecurity.v1.FirewallEndpoint.EndpointSettings.encode(message.endpointSettings, writer.uint32(/* id 19, wireType 2 =*/154).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified FirewallEndpoint message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.FirewallEndpoint.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.networksecurity.v1.FirewallEndpoint + * @static + * @param {google.cloud.networksecurity.v1.IFirewallEndpoint} message FirewallEndpoint message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FirewallEndpoint.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FirewallEndpoint message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.networksecurity.v1.FirewallEndpoint + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.networksecurity.v1.FirewallEndpoint} FirewallEndpoint + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FirewallEndpoint.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networksecurity.v1.FirewallEndpoint(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 9: { + message.description = reader.string(); + break; + } + case 2: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 3: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 4: { + if (message.labels === $util.emptyObject) + message.labels = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.labels[key] = value; + break; + } + case 5: { + message.state = reader.int32(); + break; + } + case 6: { + message.reconciling = reader.bool(); + break; + } + case 7: { + if (!(message.associatedNetworks && message.associatedNetworks.length)) + message.associatedNetworks = []; + message.associatedNetworks.push(reader.string()); + break; + } + case 13: { + if (!(message.associations && message.associations.length)) + message.associations = []; + message.associations.push($root.google.cloud.networksecurity.v1.FirewallEndpoint.AssociationReference.decode(reader, reader.uint32())); + break; + } + case 14: { + message.satisfiesPzs = reader.bool(); + break; + } + case 15: { + message.satisfiesPzi = reader.bool(); + break; + } + case 8: { + message.billingProjectId = reader.string(); + break; + } + case 19: { + message.endpointSettings = $root.google.cloud.networksecurity.v1.FirewallEndpoint.EndpointSettings.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FirewallEndpoint message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.networksecurity.v1.FirewallEndpoint + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.networksecurity.v1.FirewallEndpoint} FirewallEndpoint + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FirewallEndpoint.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FirewallEndpoint message. + * @function verify + * @memberof google.cloud.networksecurity.v1.FirewallEndpoint + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FirewallEndpoint.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime); + if (error) + return "updateTime." + error; + } + if (message.labels != null && message.hasOwnProperty("labels")) { + if (!$util.isObject(message.labels)) + return "labels: object expected"; + var key = Object.keys(message.labels); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.labels[key[i]])) + return "labels: string{k:string} expected"; + } + if (message.state != null && message.hasOwnProperty("state")) + switch (message.state) { + default: + return "state: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + break; + } + if (message.reconciling != null && message.hasOwnProperty("reconciling")) + if (typeof message.reconciling !== "boolean") + return "reconciling: boolean expected"; + if (message.associatedNetworks != null && message.hasOwnProperty("associatedNetworks")) { + if (!Array.isArray(message.associatedNetworks)) + return "associatedNetworks: array expected"; + for (var i = 0; i < message.associatedNetworks.length; ++i) + if (!$util.isString(message.associatedNetworks[i])) + return "associatedNetworks: string[] expected"; + } + if (message.associations != null && message.hasOwnProperty("associations")) { + if (!Array.isArray(message.associations)) + return "associations: array expected"; + for (var i = 0; i < message.associations.length; ++i) { + var error = $root.google.cloud.networksecurity.v1.FirewallEndpoint.AssociationReference.verify(message.associations[i]); + if (error) + return "associations." + error; + } + } + if (message.satisfiesPzs != null && message.hasOwnProperty("satisfiesPzs")) { + properties._satisfiesPzs = 1; + if (typeof message.satisfiesPzs !== "boolean") + return "satisfiesPzs: boolean expected"; + } + if (message.satisfiesPzi != null && message.hasOwnProperty("satisfiesPzi")) { + properties._satisfiesPzi = 1; + if (typeof message.satisfiesPzi !== "boolean") + return "satisfiesPzi: boolean expected"; + } + if (message.billingProjectId != null && message.hasOwnProperty("billingProjectId")) + if (!$util.isString(message.billingProjectId)) + return "billingProjectId: string expected"; + if (message.endpointSettings != null && message.hasOwnProperty("endpointSettings")) { + var error = $root.google.cloud.networksecurity.v1.FirewallEndpoint.EndpointSettings.verify(message.endpointSettings); + if (error) + return "endpointSettings." + error; + } + return null; + }; + + /** + * Creates a FirewallEndpoint message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.networksecurity.v1.FirewallEndpoint + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.networksecurity.v1.FirewallEndpoint} FirewallEndpoint + */ + FirewallEndpoint.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networksecurity.v1.FirewallEndpoint) + return object; + var message = new $root.google.cloud.networksecurity.v1.FirewallEndpoint(); + if (object.name != null) + message.name = String(object.name); + if (object.description != null) + message.description = String(object.description); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.networksecurity.v1.FirewallEndpoint.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.updateTime != null) { + if (typeof object.updateTime !== "object") + throw TypeError(".google.cloud.networksecurity.v1.FirewallEndpoint.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.cloud.networksecurity.v1.FirewallEndpoint.labels: object expected"); + message.labels = {}; + for (var keys = Object.keys(object.labels), i = 0; i < keys.length; ++i) + message.labels[keys[i]] = String(object.labels[keys[i]]); + } + switch (object.state) { + default: + if (typeof object.state === "number") { + message.state = object.state; + break; + } + break; + case "STATE_UNSPECIFIED": + case 0: + message.state = 0; + break; + case "CREATING": + case 1: + message.state = 1; + break; + case "ACTIVE": + case 2: + message.state = 2; + break; + case "DELETING": + case 3: + message.state = 3; + break; + case "INACTIVE": + case 4: + message.state = 4; + break; + } + if (object.reconciling != null) + message.reconciling = Boolean(object.reconciling); + if (object.associatedNetworks) { + if (!Array.isArray(object.associatedNetworks)) + throw TypeError(".google.cloud.networksecurity.v1.FirewallEndpoint.associatedNetworks: array expected"); + message.associatedNetworks = []; + for (var i = 0; i < object.associatedNetworks.length; ++i) + message.associatedNetworks[i] = String(object.associatedNetworks[i]); + } + if (object.associations) { + if (!Array.isArray(object.associations)) + throw TypeError(".google.cloud.networksecurity.v1.FirewallEndpoint.associations: array expected"); + message.associations = []; + for (var i = 0; i < object.associations.length; ++i) { + if (typeof object.associations[i] !== "object") + throw TypeError(".google.cloud.networksecurity.v1.FirewallEndpoint.associations: object expected"); + message.associations[i] = $root.google.cloud.networksecurity.v1.FirewallEndpoint.AssociationReference.fromObject(object.associations[i]); + } + } + if (object.satisfiesPzs != null) + message.satisfiesPzs = Boolean(object.satisfiesPzs); + if (object.satisfiesPzi != null) + message.satisfiesPzi = Boolean(object.satisfiesPzi); + if (object.billingProjectId != null) + message.billingProjectId = String(object.billingProjectId); + if (object.endpointSettings != null) { + if (typeof object.endpointSettings !== "object") + throw TypeError(".google.cloud.networksecurity.v1.FirewallEndpoint.endpointSettings: object expected"); + message.endpointSettings = $root.google.cloud.networksecurity.v1.FirewallEndpoint.EndpointSettings.fromObject(object.endpointSettings); + } + return message; + }; + + /** + * Creates a plain object from a FirewallEndpoint message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.networksecurity.v1.FirewallEndpoint + * @static + * @param {google.cloud.networksecurity.v1.FirewallEndpoint} message FirewallEndpoint + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FirewallEndpoint.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.associatedNetworks = []; + object.associations = []; + } + if (options.objects || options.defaults) + object.labels = {}; + if (options.defaults) { + object.name = ""; + object.createTime = null; + object.updateTime = null; + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + object.reconciling = false; + object.billingProjectId = ""; + object.description = ""; + object.endpointSettings = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.updateTime != null && message.hasOwnProperty("updateTime")) + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); + var keys2; + if (message.labels && (keys2 = Object.keys(message.labels)).length) { + object.labels = {}; + for (var j = 0; j < keys2.length; ++j) + object.labels[keys2[j]] = message.labels[keys2[j]]; + } + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.networksecurity.v1.FirewallEndpoint.State[message.state] === undefined ? message.state : $root.google.cloud.networksecurity.v1.FirewallEndpoint.State[message.state] : message.state; + if (message.reconciling != null && message.hasOwnProperty("reconciling")) + object.reconciling = message.reconciling; + if (message.associatedNetworks && message.associatedNetworks.length) { + object.associatedNetworks = []; + for (var j = 0; j < message.associatedNetworks.length; ++j) + object.associatedNetworks[j] = message.associatedNetworks[j]; + } + if (message.billingProjectId != null && message.hasOwnProperty("billingProjectId")) + object.billingProjectId = message.billingProjectId; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.associations && message.associations.length) { + object.associations = []; + for (var j = 0; j < message.associations.length; ++j) + object.associations[j] = $root.google.cloud.networksecurity.v1.FirewallEndpoint.AssociationReference.toObject(message.associations[j], options); + } + if (message.satisfiesPzs != null && message.hasOwnProperty("satisfiesPzs")) { + object.satisfiesPzs = message.satisfiesPzs; + if (options.oneofs) + object._satisfiesPzs = "satisfiesPzs"; + } + if (message.satisfiesPzi != null && message.hasOwnProperty("satisfiesPzi")) { + object.satisfiesPzi = message.satisfiesPzi; + if (options.oneofs) + object._satisfiesPzi = "satisfiesPzi"; + } + if (message.endpointSettings != null && message.hasOwnProperty("endpointSettings")) + object.endpointSettings = $root.google.cloud.networksecurity.v1.FirewallEndpoint.EndpointSettings.toObject(message.endpointSettings, options); + return object; + }; + + /** + * Converts this FirewallEndpoint to JSON. + * @function toJSON + * @memberof google.cloud.networksecurity.v1.FirewallEndpoint + * @instance + * @returns {Object.} JSON object + */ + FirewallEndpoint.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FirewallEndpoint + * @function getTypeUrl + * @memberof google.cloud.networksecurity.v1.FirewallEndpoint + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FirewallEndpoint.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.networksecurity.v1.FirewallEndpoint"; + }; + + FirewallEndpoint.AssociationReference = (function() { + + /** + * Properties of an AssociationReference. + * @memberof google.cloud.networksecurity.v1.FirewallEndpoint + * @interface IAssociationReference + * @property {string|null} [name] AssociationReference name + * @property {string|null} [network] AssociationReference network + */ + + /** + * Constructs a new AssociationReference. + * @memberof google.cloud.networksecurity.v1.FirewallEndpoint + * @classdesc Represents an AssociationReference. + * @implements IAssociationReference + * @constructor + * @param {google.cloud.networksecurity.v1.FirewallEndpoint.IAssociationReference=} [properties] Properties to set + */ + function AssociationReference(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AssociationReference name. + * @member {string} name + * @memberof google.cloud.networksecurity.v1.FirewallEndpoint.AssociationReference + * @instance + */ + AssociationReference.prototype.name = ""; + + /** + * AssociationReference network. + * @member {string} network + * @memberof google.cloud.networksecurity.v1.FirewallEndpoint.AssociationReference + * @instance + */ + AssociationReference.prototype.network = ""; + + /** + * Creates a new AssociationReference instance using the specified properties. + * @function create + * @memberof google.cloud.networksecurity.v1.FirewallEndpoint.AssociationReference + * @static + * @param {google.cloud.networksecurity.v1.FirewallEndpoint.IAssociationReference=} [properties] Properties to set + * @returns {google.cloud.networksecurity.v1.FirewallEndpoint.AssociationReference} AssociationReference instance + */ + AssociationReference.create = function create(properties) { + return new AssociationReference(properties); + }; + + /** + * Encodes the specified AssociationReference message. Does not implicitly {@link google.cloud.networksecurity.v1.FirewallEndpoint.AssociationReference.verify|verify} messages. + * @function encode + * @memberof google.cloud.networksecurity.v1.FirewallEndpoint.AssociationReference + * @static + * @param {google.cloud.networksecurity.v1.FirewallEndpoint.IAssociationReference} message AssociationReference message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AssociationReference.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.network != null && Object.hasOwnProperty.call(message, "network")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.network); + return writer; + }; + + /** + * Encodes the specified AssociationReference message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.FirewallEndpoint.AssociationReference.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.networksecurity.v1.FirewallEndpoint.AssociationReference + * @static + * @param {google.cloud.networksecurity.v1.FirewallEndpoint.IAssociationReference} message AssociationReference message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AssociationReference.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AssociationReference message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.networksecurity.v1.FirewallEndpoint.AssociationReference + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.networksecurity.v1.FirewallEndpoint.AssociationReference} AssociationReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AssociationReference.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networksecurity.v1.FirewallEndpoint.AssociationReference(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.network = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AssociationReference message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.networksecurity.v1.FirewallEndpoint.AssociationReference + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.networksecurity.v1.FirewallEndpoint.AssociationReference} AssociationReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AssociationReference.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AssociationReference message. + * @function verify + * @memberof google.cloud.networksecurity.v1.FirewallEndpoint.AssociationReference + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AssociationReference.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.network != null && message.hasOwnProperty("network")) + if (!$util.isString(message.network)) + return "network: string expected"; + return null; + }; + + /** + * Creates an AssociationReference message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.networksecurity.v1.FirewallEndpoint.AssociationReference + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.networksecurity.v1.FirewallEndpoint.AssociationReference} AssociationReference + */ + AssociationReference.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networksecurity.v1.FirewallEndpoint.AssociationReference) + return object; + var message = new $root.google.cloud.networksecurity.v1.FirewallEndpoint.AssociationReference(); + if (object.name != null) + message.name = String(object.name); + if (object.network != null) + message.network = String(object.network); + return message; + }; + + /** + * Creates a plain object from an AssociationReference message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.networksecurity.v1.FirewallEndpoint.AssociationReference + * @static + * @param {google.cloud.networksecurity.v1.FirewallEndpoint.AssociationReference} message AssociationReference + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AssociationReference.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.network = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.network != null && message.hasOwnProperty("network")) + object.network = message.network; + return object; + }; + + /** + * Converts this AssociationReference to JSON. + * @function toJSON + * @memberof google.cloud.networksecurity.v1.FirewallEndpoint.AssociationReference + * @instance + * @returns {Object.} JSON object + */ + AssociationReference.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AssociationReference + * @function getTypeUrl + * @memberof google.cloud.networksecurity.v1.FirewallEndpoint.AssociationReference + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AssociationReference.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.networksecurity.v1.FirewallEndpoint.AssociationReference"; + }; + + return AssociationReference; + })(); + + FirewallEndpoint.EndpointSettings = (function() { + + /** + * Properties of an EndpointSettings. + * @memberof google.cloud.networksecurity.v1.FirewallEndpoint + * @interface IEndpointSettings + * @property {boolean|null} [jumboFramesEnabled] EndpointSettings jumboFramesEnabled + */ + + /** + * Constructs a new EndpointSettings. + * @memberof google.cloud.networksecurity.v1.FirewallEndpoint + * @classdesc Represents an EndpointSettings. + * @implements IEndpointSettings + * @constructor + * @param {google.cloud.networksecurity.v1.FirewallEndpoint.IEndpointSettings=} [properties] Properties to set + */ + function EndpointSettings(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EndpointSettings jumboFramesEnabled. + * @member {boolean} jumboFramesEnabled + * @memberof google.cloud.networksecurity.v1.FirewallEndpoint.EndpointSettings + * @instance + */ + EndpointSettings.prototype.jumboFramesEnabled = false; + + /** + * Creates a new EndpointSettings instance using the specified properties. + * @function create + * @memberof google.cloud.networksecurity.v1.FirewallEndpoint.EndpointSettings + * @static + * @param {google.cloud.networksecurity.v1.FirewallEndpoint.IEndpointSettings=} [properties] Properties to set + * @returns {google.cloud.networksecurity.v1.FirewallEndpoint.EndpointSettings} EndpointSettings instance + */ + EndpointSettings.create = function create(properties) { + return new EndpointSettings(properties); + }; + + /** + * Encodes the specified EndpointSettings message. Does not implicitly {@link google.cloud.networksecurity.v1.FirewallEndpoint.EndpointSettings.verify|verify} messages. + * @function encode + * @memberof google.cloud.networksecurity.v1.FirewallEndpoint.EndpointSettings + * @static + * @param {google.cloud.networksecurity.v1.FirewallEndpoint.IEndpointSettings} message EndpointSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EndpointSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.jumboFramesEnabled != null && Object.hasOwnProperty.call(message, "jumboFramesEnabled")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.jumboFramesEnabled); + return writer; + }; + + /** + * Encodes the specified EndpointSettings message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.FirewallEndpoint.EndpointSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.networksecurity.v1.FirewallEndpoint.EndpointSettings + * @static + * @param {google.cloud.networksecurity.v1.FirewallEndpoint.IEndpointSettings} message EndpointSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EndpointSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EndpointSettings message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.networksecurity.v1.FirewallEndpoint.EndpointSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.networksecurity.v1.FirewallEndpoint.EndpointSettings} EndpointSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EndpointSettings.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networksecurity.v1.FirewallEndpoint.EndpointSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.jumboFramesEnabled = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EndpointSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.networksecurity.v1.FirewallEndpoint.EndpointSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.networksecurity.v1.FirewallEndpoint.EndpointSettings} EndpointSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EndpointSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EndpointSettings message. + * @function verify + * @memberof google.cloud.networksecurity.v1.FirewallEndpoint.EndpointSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EndpointSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.jumboFramesEnabled != null && message.hasOwnProperty("jumboFramesEnabled")) + if (typeof message.jumboFramesEnabled !== "boolean") + return "jumboFramesEnabled: boolean expected"; + return null; + }; + + /** + * Creates an EndpointSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.networksecurity.v1.FirewallEndpoint.EndpointSettings + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.networksecurity.v1.FirewallEndpoint.EndpointSettings} EndpointSettings + */ + EndpointSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networksecurity.v1.FirewallEndpoint.EndpointSettings) + return object; + var message = new $root.google.cloud.networksecurity.v1.FirewallEndpoint.EndpointSettings(); + if (object.jumboFramesEnabled != null) + message.jumboFramesEnabled = Boolean(object.jumboFramesEnabled); + return message; + }; + + /** + * Creates a plain object from an EndpointSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.networksecurity.v1.FirewallEndpoint.EndpointSettings + * @static + * @param {google.cloud.networksecurity.v1.FirewallEndpoint.EndpointSettings} message EndpointSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EndpointSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.jumboFramesEnabled = false; + if (message.jumboFramesEnabled != null && message.hasOwnProperty("jumboFramesEnabled")) + object.jumboFramesEnabled = message.jumboFramesEnabled; + return object; + }; + + /** + * Converts this EndpointSettings to JSON. + * @function toJSON + * @memberof google.cloud.networksecurity.v1.FirewallEndpoint.EndpointSettings + * @instance + * @returns {Object.} JSON object + */ + EndpointSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EndpointSettings + * @function getTypeUrl + * @memberof google.cloud.networksecurity.v1.FirewallEndpoint.EndpointSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EndpointSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.networksecurity.v1.FirewallEndpoint.EndpointSettings"; + }; + + return EndpointSettings; + })(); + + /** + * State enum. + * @name google.cloud.networksecurity.v1.FirewallEndpoint.State + * @enum {number} + * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value + * @property {number} CREATING=1 CREATING value + * @property {number} ACTIVE=2 ACTIVE value + * @property {number} DELETING=3 DELETING value + * @property {number} INACTIVE=4 INACTIVE value + */ + FirewallEndpoint.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "CREATING"] = 1; + values[valuesById[2] = "ACTIVE"] = 2; + values[valuesById[3] = "DELETING"] = 3; + values[valuesById[4] = "INACTIVE"] = 4; + return values; + })(); + + return FirewallEndpoint; + })(); + + v1.ListFirewallEndpointsRequest = (function() { + + /** + * Properties of a ListFirewallEndpointsRequest. + * @memberof google.cloud.networksecurity.v1 + * @interface IListFirewallEndpointsRequest + * @property {string|null} [parent] ListFirewallEndpointsRequest parent + * @property {number|null} [pageSize] ListFirewallEndpointsRequest pageSize + * @property {string|null} [pageToken] ListFirewallEndpointsRequest pageToken + * @property {string|null} [filter] ListFirewallEndpointsRequest filter + * @property {string|null} [orderBy] ListFirewallEndpointsRequest orderBy + */ + + /** + * Constructs a new ListFirewallEndpointsRequest. + * @memberof google.cloud.networksecurity.v1 + * @classdesc Represents a ListFirewallEndpointsRequest. + * @implements IListFirewallEndpointsRequest + * @constructor + * @param {google.cloud.networksecurity.v1.IListFirewallEndpointsRequest=} [properties] Properties to set + */ + function ListFirewallEndpointsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListFirewallEndpointsRequest parent. + * @member {string} parent + * @memberof google.cloud.networksecurity.v1.ListFirewallEndpointsRequest + * @instance + */ + ListFirewallEndpointsRequest.prototype.parent = ""; + + /** + * ListFirewallEndpointsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.networksecurity.v1.ListFirewallEndpointsRequest + * @instance + */ + ListFirewallEndpointsRequest.prototype.pageSize = 0; + + /** + * ListFirewallEndpointsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.networksecurity.v1.ListFirewallEndpointsRequest + * @instance + */ + ListFirewallEndpointsRequest.prototype.pageToken = ""; + + /** + * ListFirewallEndpointsRequest filter. + * @member {string} filter + * @memberof google.cloud.networksecurity.v1.ListFirewallEndpointsRequest + * @instance + */ + ListFirewallEndpointsRequest.prototype.filter = ""; + + /** + * ListFirewallEndpointsRequest orderBy. + * @member {string} orderBy + * @memberof google.cloud.networksecurity.v1.ListFirewallEndpointsRequest + * @instance + */ + ListFirewallEndpointsRequest.prototype.orderBy = ""; + + /** + * Creates a new ListFirewallEndpointsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.networksecurity.v1.ListFirewallEndpointsRequest + * @static + * @param {google.cloud.networksecurity.v1.IListFirewallEndpointsRequest=} [properties] Properties to set + * @returns {google.cloud.networksecurity.v1.ListFirewallEndpointsRequest} ListFirewallEndpointsRequest instance + */ + ListFirewallEndpointsRequest.create = function create(properties) { + return new ListFirewallEndpointsRequest(properties); + }; + + /** + * Encodes the specified ListFirewallEndpointsRequest message. Does not implicitly {@link google.cloud.networksecurity.v1.ListFirewallEndpointsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.networksecurity.v1.ListFirewallEndpointsRequest + * @static + * @param {google.cloud.networksecurity.v1.IListFirewallEndpointsRequest} message ListFirewallEndpointsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListFirewallEndpointsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.filter); + if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.orderBy); + return writer; + }; + + /** + * Encodes the specified ListFirewallEndpointsRequest message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.ListFirewallEndpointsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.networksecurity.v1.ListFirewallEndpointsRequest + * @static + * @param {google.cloud.networksecurity.v1.IListFirewallEndpointsRequest} message ListFirewallEndpointsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListFirewallEndpointsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListFirewallEndpointsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.networksecurity.v1.ListFirewallEndpointsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.networksecurity.v1.ListFirewallEndpointsRequest} ListFirewallEndpointsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListFirewallEndpointsRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networksecurity.v1.ListFirewallEndpointsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + case 4: { + message.filter = reader.string(); + break; + } + case 5: { + message.orderBy = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListFirewallEndpointsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.networksecurity.v1.ListFirewallEndpointsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.networksecurity.v1.ListFirewallEndpointsRequest} ListFirewallEndpointsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListFirewallEndpointsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListFirewallEndpointsRequest message. + * @function verify + * @memberof google.cloud.networksecurity.v1.ListFirewallEndpointsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListFirewallEndpointsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + if (!$util.isString(message.orderBy)) + return "orderBy: string expected"; + return null; + }; + + /** + * Creates a ListFirewallEndpointsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.networksecurity.v1.ListFirewallEndpointsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.networksecurity.v1.ListFirewallEndpointsRequest} ListFirewallEndpointsRequest + */ + ListFirewallEndpointsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networksecurity.v1.ListFirewallEndpointsRequest) + return object; + var message = new $root.google.cloud.networksecurity.v1.ListFirewallEndpointsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.filter != null) + message.filter = String(object.filter); + if (object.orderBy != null) + message.orderBy = String(object.orderBy); + return message; + }; + + /** + * Creates a plain object from a ListFirewallEndpointsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.networksecurity.v1.ListFirewallEndpointsRequest + * @static + * @param {google.cloud.networksecurity.v1.ListFirewallEndpointsRequest} message ListFirewallEndpointsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListFirewallEndpointsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + object.filter = ""; + object.orderBy = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + object.orderBy = message.orderBy; + return object; + }; + + /** + * Converts this ListFirewallEndpointsRequest to JSON. + * @function toJSON + * @memberof google.cloud.networksecurity.v1.ListFirewallEndpointsRequest + * @instance + * @returns {Object.} JSON object + */ + ListFirewallEndpointsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListFirewallEndpointsRequest + * @function getTypeUrl + * @memberof google.cloud.networksecurity.v1.ListFirewallEndpointsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListFirewallEndpointsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.networksecurity.v1.ListFirewallEndpointsRequest"; + }; + + return ListFirewallEndpointsRequest; + })(); + + v1.ListFirewallEndpointsResponse = (function() { + + /** + * Properties of a ListFirewallEndpointsResponse. + * @memberof google.cloud.networksecurity.v1 + * @interface IListFirewallEndpointsResponse + * @property {Array.|null} [firewallEndpoints] ListFirewallEndpointsResponse firewallEndpoints + * @property {string|null} [nextPageToken] ListFirewallEndpointsResponse nextPageToken + * @property {Array.|null} [unreachable] ListFirewallEndpointsResponse unreachable + */ + + /** + * Constructs a new ListFirewallEndpointsResponse. + * @memberof google.cloud.networksecurity.v1 + * @classdesc Represents a ListFirewallEndpointsResponse. + * @implements IListFirewallEndpointsResponse + * @constructor + * @param {google.cloud.networksecurity.v1.IListFirewallEndpointsResponse=} [properties] Properties to set + */ + function ListFirewallEndpointsResponse(properties) { + this.firewallEndpoints = []; + this.unreachable = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListFirewallEndpointsResponse firewallEndpoints. + * @member {Array.} firewallEndpoints + * @memberof google.cloud.networksecurity.v1.ListFirewallEndpointsResponse + * @instance + */ + ListFirewallEndpointsResponse.prototype.firewallEndpoints = $util.emptyArray; + + /** + * ListFirewallEndpointsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.networksecurity.v1.ListFirewallEndpointsResponse + * @instance + */ + ListFirewallEndpointsResponse.prototype.nextPageToken = ""; + + /** + * ListFirewallEndpointsResponse unreachable. + * @member {Array.} unreachable + * @memberof google.cloud.networksecurity.v1.ListFirewallEndpointsResponse + * @instance + */ + ListFirewallEndpointsResponse.prototype.unreachable = $util.emptyArray; + + /** + * Creates a new ListFirewallEndpointsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.networksecurity.v1.ListFirewallEndpointsResponse + * @static + * @param {google.cloud.networksecurity.v1.IListFirewallEndpointsResponse=} [properties] Properties to set + * @returns {google.cloud.networksecurity.v1.ListFirewallEndpointsResponse} ListFirewallEndpointsResponse instance + */ + ListFirewallEndpointsResponse.create = function create(properties) { + return new ListFirewallEndpointsResponse(properties); + }; + + /** + * Encodes the specified ListFirewallEndpointsResponse message. Does not implicitly {@link google.cloud.networksecurity.v1.ListFirewallEndpointsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.networksecurity.v1.ListFirewallEndpointsResponse + * @static + * @param {google.cloud.networksecurity.v1.IListFirewallEndpointsResponse} message ListFirewallEndpointsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListFirewallEndpointsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.firewallEndpoints != null && message.firewallEndpoints.length) + for (var i = 0; i < message.firewallEndpoints.length; ++i) + $root.google.cloud.networksecurity.v1.FirewallEndpoint.encode(message.firewallEndpoints[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + if (message.unreachable != null && message.unreachable.length) + for (var i = 0; i < message.unreachable.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.unreachable[i]); + return writer; + }; + + /** + * Encodes the specified ListFirewallEndpointsResponse message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.ListFirewallEndpointsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.networksecurity.v1.ListFirewallEndpointsResponse + * @static + * @param {google.cloud.networksecurity.v1.IListFirewallEndpointsResponse} message ListFirewallEndpointsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListFirewallEndpointsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListFirewallEndpointsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.networksecurity.v1.ListFirewallEndpointsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.networksecurity.v1.ListFirewallEndpointsResponse} ListFirewallEndpointsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListFirewallEndpointsResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networksecurity.v1.ListFirewallEndpointsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.firewallEndpoints && message.firewallEndpoints.length)) + message.firewallEndpoints = []; + message.firewallEndpoints.push($root.google.cloud.networksecurity.v1.FirewallEndpoint.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + case 3: { + if (!(message.unreachable && message.unreachable.length)) + message.unreachable = []; + message.unreachable.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListFirewallEndpointsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.networksecurity.v1.ListFirewallEndpointsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.networksecurity.v1.ListFirewallEndpointsResponse} ListFirewallEndpointsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListFirewallEndpointsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListFirewallEndpointsResponse message. + * @function verify + * @memberof google.cloud.networksecurity.v1.ListFirewallEndpointsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListFirewallEndpointsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.firewallEndpoints != null && message.hasOwnProperty("firewallEndpoints")) { + if (!Array.isArray(message.firewallEndpoints)) + return "firewallEndpoints: array expected"; + for (var i = 0; i < message.firewallEndpoints.length; ++i) { + var error = $root.google.cloud.networksecurity.v1.FirewallEndpoint.verify(message.firewallEndpoints[i]); + if (error) + return "firewallEndpoints." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + if (message.unreachable != null && message.hasOwnProperty("unreachable")) { + if (!Array.isArray(message.unreachable)) + return "unreachable: array expected"; + for (var i = 0; i < message.unreachable.length; ++i) + if (!$util.isString(message.unreachable[i])) + return "unreachable: string[] expected"; + } + return null; + }; + + /** + * Creates a ListFirewallEndpointsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.networksecurity.v1.ListFirewallEndpointsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.networksecurity.v1.ListFirewallEndpointsResponse} ListFirewallEndpointsResponse + */ + ListFirewallEndpointsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networksecurity.v1.ListFirewallEndpointsResponse) + return object; + var message = new $root.google.cloud.networksecurity.v1.ListFirewallEndpointsResponse(); + if (object.firewallEndpoints) { + if (!Array.isArray(object.firewallEndpoints)) + throw TypeError(".google.cloud.networksecurity.v1.ListFirewallEndpointsResponse.firewallEndpoints: array expected"); + message.firewallEndpoints = []; + for (var i = 0; i < object.firewallEndpoints.length; ++i) { + if (typeof object.firewallEndpoints[i] !== "object") + throw TypeError(".google.cloud.networksecurity.v1.ListFirewallEndpointsResponse.firewallEndpoints: object expected"); + message.firewallEndpoints[i] = $root.google.cloud.networksecurity.v1.FirewallEndpoint.fromObject(object.firewallEndpoints[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.unreachable) { + if (!Array.isArray(object.unreachable)) + throw TypeError(".google.cloud.networksecurity.v1.ListFirewallEndpointsResponse.unreachable: array expected"); + message.unreachable = []; + for (var i = 0; i < object.unreachable.length; ++i) + message.unreachable[i] = String(object.unreachable[i]); + } + return message; + }; + + /** + * Creates a plain object from a ListFirewallEndpointsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.networksecurity.v1.ListFirewallEndpointsResponse + * @static + * @param {google.cloud.networksecurity.v1.ListFirewallEndpointsResponse} message ListFirewallEndpointsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListFirewallEndpointsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.firewallEndpoints = []; + object.unreachable = []; + } + if (options.defaults) + object.nextPageToken = ""; + if (message.firewallEndpoints && message.firewallEndpoints.length) { + object.firewallEndpoints = []; + for (var j = 0; j < message.firewallEndpoints.length; ++j) + object.firewallEndpoints[j] = $root.google.cloud.networksecurity.v1.FirewallEndpoint.toObject(message.firewallEndpoints[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + if (message.unreachable && message.unreachable.length) { + object.unreachable = []; + for (var j = 0; j < message.unreachable.length; ++j) + object.unreachable[j] = message.unreachable[j]; + } + return object; + }; + + /** + * Converts this ListFirewallEndpointsResponse to JSON. + * @function toJSON + * @memberof google.cloud.networksecurity.v1.ListFirewallEndpointsResponse + * @instance + * @returns {Object.} JSON object + */ + ListFirewallEndpointsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListFirewallEndpointsResponse + * @function getTypeUrl + * @memberof google.cloud.networksecurity.v1.ListFirewallEndpointsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListFirewallEndpointsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.networksecurity.v1.ListFirewallEndpointsResponse"; + }; + + return ListFirewallEndpointsResponse; + })(); + + v1.GetFirewallEndpointRequest = (function() { + + /** + * Properties of a GetFirewallEndpointRequest. + * @memberof google.cloud.networksecurity.v1 + * @interface IGetFirewallEndpointRequest + * @property {string|null} [name] GetFirewallEndpointRequest name + */ + + /** + * Constructs a new GetFirewallEndpointRequest. + * @memberof google.cloud.networksecurity.v1 + * @classdesc Represents a GetFirewallEndpointRequest. + * @implements IGetFirewallEndpointRequest + * @constructor + * @param {google.cloud.networksecurity.v1.IGetFirewallEndpointRequest=} [properties] Properties to set + */ + function GetFirewallEndpointRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetFirewallEndpointRequest name. + * @member {string} name + * @memberof google.cloud.networksecurity.v1.GetFirewallEndpointRequest + * @instance + */ + GetFirewallEndpointRequest.prototype.name = ""; + + /** + * Creates a new GetFirewallEndpointRequest instance using the specified properties. + * @function create + * @memberof google.cloud.networksecurity.v1.GetFirewallEndpointRequest + * @static + * @param {google.cloud.networksecurity.v1.IGetFirewallEndpointRequest=} [properties] Properties to set + * @returns {google.cloud.networksecurity.v1.GetFirewallEndpointRequest} GetFirewallEndpointRequest instance + */ + GetFirewallEndpointRequest.create = function create(properties) { + return new GetFirewallEndpointRequest(properties); + }; + + /** + * Encodes the specified GetFirewallEndpointRequest message. Does not implicitly {@link google.cloud.networksecurity.v1.GetFirewallEndpointRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.networksecurity.v1.GetFirewallEndpointRequest + * @static + * @param {google.cloud.networksecurity.v1.IGetFirewallEndpointRequest} message GetFirewallEndpointRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetFirewallEndpointRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified GetFirewallEndpointRequest message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.GetFirewallEndpointRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.networksecurity.v1.GetFirewallEndpointRequest + * @static + * @param {google.cloud.networksecurity.v1.IGetFirewallEndpointRequest} message GetFirewallEndpointRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetFirewallEndpointRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetFirewallEndpointRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.networksecurity.v1.GetFirewallEndpointRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.networksecurity.v1.GetFirewallEndpointRequest} GetFirewallEndpointRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetFirewallEndpointRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networksecurity.v1.GetFirewallEndpointRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetFirewallEndpointRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.networksecurity.v1.GetFirewallEndpointRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.networksecurity.v1.GetFirewallEndpointRequest} GetFirewallEndpointRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetFirewallEndpointRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetFirewallEndpointRequest message. + * @function verify + * @memberof google.cloud.networksecurity.v1.GetFirewallEndpointRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetFirewallEndpointRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a GetFirewallEndpointRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.networksecurity.v1.GetFirewallEndpointRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.networksecurity.v1.GetFirewallEndpointRequest} GetFirewallEndpointRequest + */ + GetFirewallEndpointRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networksecurity.v1.GetFirewallEndpointRequest) + return object; + var message = new $root.google.cloud.networksecurity.v1.GetFirewallEndpointRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetFirewallEndpointRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.networksecurity.v1.GetFirewallEndpointRequest + * @static + * @param {google.cloud.networksecurity.v1.GetFirewallEndpointRequest} message GetFirewallEndpointRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetFirewallEndpointRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this GetFirewallEndpointRequest to JSON. + * @function toJSON + * @memberof google.cloud.networksecurity.v1.GetFirewallEndpointRequest + * @instance + * @returns {Object.} JSON object + */ + GetFirewallEndpointRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetFirewallEndpointRequest + * @function getTypeUrl + * @memberof google.cloud.networksecurity.v1.GetFirewallEndpointRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetFirewallEndpointRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.networksecurity.v1.GetFirewallEndpointRequest"; + }; + + return GetFirewallEndpointRequest; + })(); + + v1.CreateFirewallEndpointRequest = (function() { + + /** + * Properties of a CreateFirewallEndpointRequest. + * @memberof google.cloud.networksecurity.v1 + * @interface ICreateFirewallEndpointRequest + * @property {string|null} [parent] CreateFirewallEndpointRequest parent + * @property {string|null} [firewallEndpointId] CreateFirewallEndpointRequest firewallEndpointId + * @property {google.cloud.networksecurity.v1.IFirewallEndpoint|null} [firewallEndpoint] CreateFirewallEndpointRequest firewallEndpoint + * @property {string|null} [requestId] CreateFirewallEndpointRequest requestId + */ + + /** + * Constructs a new CreateFirewallEndpointRequest. + * @memberof google.cloud.networksecurity.v1 + * @classdesc Represents a CreateFirewallEndpointRequest. + * @implements ICreateFirewallEndpointRequest + * @constructor + * @param {google.cloud.networksecurity.v1.ICreateFirewallEndpointRequest=} [properties] Properties to set + */ + function CreateFirewallEndpointRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateFirewallEndpointRequest parent. + * @member {string} parent + * @memberof google.cloud.networksecurity.v1.CreateFirewallEndpointRequest + * @instance + */ + CreateFirewallEndpointRequest.prototype.parent = ""; + + /** + * CreateFirewallEndpointRequest firewallEndpointId. + * @member {string} firewallEndpointId + * @memberof google.cloud.networksecurity.v1.CreateFirewallEndpointRequest + * @instance + */ + CreateFirewallEndpointRequest.prototype.firewallEndpointId = ""; + + /** + * CreateFirewallEndpointRequest firewallEndpoint. + * @member {google.cloud.networksecurity.v1.IFirewallEndpoint|null|undefined} firewallEndpoint + * @memberof google.cloud.networksecurity.v1.CreateFirewallEndpointRequest + * @instance + */ + CreateFirewallEndpointRequest.prototype.firewallEndpoint = null; + + /** + * CreateFirewallEndpointRequest requestId. + * @member {string} requestId + * @memberof google.cloud.networksecurity.v1.CreateFirewallEndpointRequest + * @instance + */ + CreateFirewallEndpointRequest.prototype.requestId = ""; + + /** + * Creates a new CreateFirewallEndpointRequest instance using the specified properties. + * @function create + * @memberof google.cloud.networksecurity.v1.CreateFirewallEndpointRequest + * @static + * @param {google.cloud.networksecurity.v1.ICreateFirewallEndpointRequest=} [properties] Properties to set + * @returns {google.cloud.networksecurity.v1.CreateFirewallEndpointRequest} CreateFirewallEndpointRequest instance + */ + CreateFirewallEndpointRequest.create = function create(properties) { + return new CreateFirewallEndpointRequest(properties); + }; + + /** + * Encodes the specified CreateFirewallEndpointRequest message. Does not implicitly {@link google.cloud.networksecurity.v1.CreateFirewallEndpointRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.networksecurity.v1.CreateFirewallEndpointRequest + * @static + * @param {google.cloud.networksecurity.v1.ICreateFirewallEndpointRequest} message CreateFirewallEndpointRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateFirewallEndpointRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.firewallEndpointId != null && Object.hasOwnProperty.call(message, "firewallEndpointId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.firewallEndpointId); + if (message.firewallEndpoint != null && Object.hasOwnProperty.call(message, "firewallEndpoint")) + $root.google.cloud.networksecurity.v1.FirewallEndpoint.encode(message.firewallEndpoint, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.requestId); + return writer; + }; + + /** + * Encodes the specified CreateFirewallEndpointRequest message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.CreateFirewallEndpointRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.networksecurity.v1.CreateFirewallEndpointRequest + * @static + * @param {google.cloud.networksecurity.v1.ICreateFirewallEndpointRequest} message CreateFirewallEndpointRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateFirewallEndpointRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateFirewallEndpointRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.networksecurity.v1.CreateFirewallEndpointRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.networksecurity.v1.CreateFirewallEndpointRequest} CreateFirewallEndpointRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateFirewallEndpointRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networksecurity.v1.CreateFirewallEndpointRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.firewallEndpointId = reader.string(); + break; + } + case 3: { + message.firewallEndpoint = $root.google.cloud.networksecurity.v1.FirewallEndpoint.decode(reader, reader.uint32()); + break; + } + case 4: { + message.requestId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateFirewallEndpointRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.networksecurity.v1.CreateFirewallEndpointRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.networksecurity.v1.CreateFirewallEndpointRequest} CreateFirewallEndpointRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateFirewallEndpointRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateFirewallEndpointRequest message. + * @function verify + * @memberof google.cloud.networksecurity.v1.CreateFirewallEndpointRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateFirewallEndpointRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.firewallEndpointId != null && message.hasOwnProperty("firewallEndpointId")) + if (!$util.isString(message.firewallEndpointId)) + return "firewallEndpointId: string expected"; + if (message.firewallEndpoint != null && message.hasOwnProperty("firewallEndpoint")) { + var error = $root.google.cloud.networksecurity.v1.FirewallEndpoint.verify(message.firewallEndpoint); + if (error) + return "firewallEndpoint." + error; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + return null; + }; + + /** + * Creates a CreateFirewallEndpointRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.networksecurity.v1.CreateFirewallEndpointRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.networksecurity.v1.CreateFirewallEndpointRequest} CreateFirewallEndpointRequest + */ + CreateFirewallEndpointRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networksecurity.v1.CreateFirewallEndpointRequest) + return object; + var message = new $root.google.cloud.networksecurity.v1.CreateFirewallEndpointRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.firewallEndpointId != null) + message.firewallEndpointId = String(object.firewallEndpointId); + if (object.firewallEndpoint != null) { + if (typeof object.firewallEndpoint !== "object") + throw TypeError(".google.cloud.networksecurity.v1.CreateFirewallEndpointRequest.firewallEndpoint: object expected"); + message.firewallEndpoint = $root.google.cloud.networksecurity.v1.FirewallEndpoint.fromObject(object.firewallEndpoint); + } + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from a CreateFirewallEndpointRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.networksecurity.v1.CreateFirewallEndpointRequest + * @static + * @param {google.cloud.networksecurity.v1.CreateFirewallEndpointRequest} message CreateFirewallEndpointRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateFirewallEndpointRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.firewallEndpointId = ""; + object.firewallEndpoint = null; + object.requestId = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.firewallEndpointId != null && message.hasOwnProperty("firewallEndpointId")) + object.firewallEndpointId = message.firewallEndpointId; + if (message.firewallEndpoint != null && message.hasOwnProperty("firewallEndpoint")) + object.firewallEndpoint = $root.google.cloud.networksecurity.v1.FirewallEndpoint.toObject(message.firewallEndpoint, options); + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + return object; + }; + + /** + * Converts this CreateFirewallEndpointRequest to JSON. + * @function toJSON + * @memberof google.cloud.networksecurity.v1.CreateFirewallEndpointRequest + * @instance + * @returns {Object.} JSON object + */ + CreateFirewallEndpointRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateFirewallEndpointRequest + * @function getTypeUrl + * @memberof google.cloud.networksecurity.v1.CreateFirewallEndpointRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateFirewallEndpointRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.networksecurity.v1.CreateFirewallEndpointRequest"; + }; + + return CreateFirewallEndpointRequest; + })(); + + v1.UpdateFirewallEndpointRequest = (function() { + + /** + * Properties of an UpdateFirewallEndpointRequest. + * @memberof google.cloud.networksecurity.v1 + * @interface IUpdateFirewallEndpointRequest + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateFirewallEndpointRequest updateMask + * @property {google.cloud.networksecurity.v1.IFirewallEndpoint|null} [firewallEndpoint] UpdateFirewallEndpointRequest firewallEndpoint + * @property {string|null} [requestId] UpdateFirewallEndpointRequest requestId + */ + + /** + * Constructs a new UpdateFirewallEndpointRequest. + * @memberof google.cloud.networksecurity.v1 + * @classdesc Represents an UpdateFirewallEndpointRequest. + * @implements IUpdateFirewallEndpointRequest + * @constructor + * @param {google.cloud.networksecurity.v1.IUpdateFirewallEndpointRequest=} [properties] Properties to set + */ + function UpdateFirewallEndpointRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateFirewallEndpointRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.networksecurity.v1.UpdateFirewallEndpointRequest + * @instance + */ + UpdateFirewallEndpointRequest.prototype.updateMask = null; + + /** + * UpdateFirewallEndpointRequest firewallEndpoint. + * @member {google.cloud.networksecurity.v1.IFirewallEndpoint|null|undefined} firewallEndpoint + * @memberof google.cloud.networksecurity.v1.UpdateFirewallEndpointRequest + * @instance + */ + UpdateFirewallEndpointRequest.prototype.firewallEndpoint = null; + + /** + * UpdateFirewallEndpointRequest requestId. + * @member {string} requestId + * @memberof google.cloud.networksecurity.v1.UpdateFirewallEndpointRequest + * @instance + */ + UpdateFirewallEndpointRequest.prototype.requestId = ""; + + /** + * Creates a new UpdateFirewallEndpointRequest instance using the specified properties. + * @function create + * @memberof google.cloud.networksecurity.v1.UpdateFirewallEndpointRequest + * @static + * @param {google.cloud.networksecurity.v1.IUpdateFirewallEndpointRequest=} [properties] Properties to set + * @returns {google.cloud.networksecurity.v1.UpdateFirewallEndpointRequest} UpdateFirewallEndpointRequest instance + */ + UpdateFirewallEndpointRequest.create = function create(properties) { + return new UpdateFirewallEndpointRequest(properties); + }; + + /** + * Encodes the specified UpdateFirewallEndpointRequest message. Does not implicitly {@link google.cloud.networksecurity.v1.UpdateFirewallEndpointRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.networksecurity.v1.UpdateFirewallEndpointRequest + * @static + * @param {google.cloud.networksecurity.v1.IUpdateFirewallEndpointRequest} message UpdateFirewallEndpointRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateFirewallEndpointRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.firewallEndpoint != null && Object.hasOwnProperty.call(message, "firewallEndpoint")) + $root.google.cloud.networksecurity.v1.FirewallEndpoint.encode(message.firewallEndpoint, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.requestId); + return writer; + }; + + /** + * Encodes the specified UpdateFirewallEndpointRequest message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.UpdateFirewallEndpointRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.networksecurity.v1.UpdateFirewallEndpointRequest + * @static + * @param {google.cloud.networksecurity.v1.IUpdateFirewallEndpointRequest} message UpdateFirewallEndpointRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateFirewallEndpointRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateFirewallEndpointRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.networksecurity.v1.UpdateFirewallEndpointRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.networksecurity.v1.UpdateFirewallEndpointRequest} UpdateFirewallEndpointRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateFirewallEndpointRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networksecurity.v1.UpdateFirewallEndpointRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + case 2: { + message.firewallEndpoint = $root.google.cloud.networksecurity.v1.FirewallEndpoint.decode(reader, reader.uint32()); + break; + } + case 3: { + message.requestId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateFirewallEndpointRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.networksecurity.v1.UpdateFirewallEndpointRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.networksecurity.v1.UpdateFirewallEndpointRequest} UpdateFirewallEndpointRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateFirewallEndpointRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateFirewallEndpointRequest message. + * @function verify + * @memberof google.cloud.networksecurity.v1.UpdateFirewallEndpointRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateFirewallEndpointRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + if (message.firewallEndpoint != null && message.hasOwnProperty("firewallEndpoint")) { + var error = $root.google.cloud.networksecurity.v1.FirewallEndpoint.verify(message.firewallEndpoint); + if (error) + return "firewallEndpoint." + error; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + return null; + }; + + /** + * Creates an UpdateFirewallEndpointRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.networksecurity.v1.UpdateFirewallEndpointRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.networksecurity.v1.UpdateFirewallEndpointRequest} UpdateFirewallEndpointRequest + */ + UpdateFirewallEndpointRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networksecurity.v1.UpdateFirewallEndpointRequest) + return object; + var message = new $root.google.cloud.networksecurity.v1.UpdateFirewallEndpointRequest(); + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.networksecurity.v1.UpdateFirewallEndpointRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + if (object.firewallEndpoint != null) { + if (typeof object.firewallEndpoint !== "object") + throw TypeError(".google.cloud.networksecurity.v1.UpdateFirewallEndpointRequest.firewallEndpoint: object expected"); + message.firewallEndpoint = $root.google.cloud.networksecurity.v1.FirewallEndpoint.fromObject(object.firewallEndpoint); + } + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from an UpdateFirewallEndpointRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.networksecurity.v1.UpdateFirewallEndpointRequest + * @static + * @param {google.cloud.networksecurity.v1.UpdateFirewallEndpointRequest} message UpdateFirewallEndpointRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateFirewallEndpointRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.updateMask = null; + object.firewallEndpoint = null; + object.requestId = ""; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + if (message.firewallEndpoint != null && message.hasOwnProperty("firewallEndpoint")) + object.firewallEndpoint = $root.google.cloud.networksecurity.v1.FirewallEndpoint.toObject(message.firewallEndpoint, options); + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + return object; + }; + + /** + * Converts this UpdateFirewallEndpointRequest to JSON. + * @function toJSON + * @memberof google.cloud.networksecurity.v1.UpdateFirewallEndpointRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateFirewallEndpointRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateFirewallEndpointRequest + * @function getTypeUrl + * @memberof google.cloud.networksecurity.v1.UpdateFirewallEndpointRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateFirewallEndpointRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.networksecurity.v1.UpdateFirewallEndpointRequest"; + }; + + return UpdateFirewallEndpointRequest; + })(); + + v1.DeleteFirewallEndpointRequest = (function() { + + /** + * Properties of a DeleteFirewallEndpointRequest. + * @memberof google.cloud.networksecurity.v1 + * @interface IDeleteFirewallEndpointRequest + * @property {string|null} [name] DeleteFirewallEndpointRequest name + * @property {string|null} [requestId] DeleteFirewallEndpointRequest requestId + */ + + /** + * Constructs a new DeleteFirewallEndpointRequest. + * @memberof google.cloud.networksecurity.v1 + * @classdesc Represents a DeleteFirewallEndpointRequest. + * @implements IDeleteFirewallEndpointRequest + * @constructor + * @param {google.cloud.networksecurity.v1.IDeleteFirewallEndpointRequest=} [properties] Properties to set + */ + function DeleteFirewallEndpointRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteFirewallEndpointRequest name. + * @member {string} name + * @memberof google.cloud.networksecurity.v1.DeleteFirewallEndpointRequest + * @instance + */ + DeleteFirewallEndpointRequest.prototype.name = ""; + + /** + * DeleteFirewallEndpointRequest requestId. + * @member {string} requestId + * @memberof google.cloud.networksecurity.v1.DeleteFirewallEndpointRequest + * @instance + */ + DeleteFirewallEndpointRequest.prototype.requestId = ""; + + /** + * Creates a new DeleteFirewallEndpointRequest instance using the specified properties. + * @function create + * @memberof google.cloud.networksecurity.v1.DeleteFirewallEndpointRequest + * @static + * @param {google.cloud.networksecurity.v1.IDeleteFirewallEndpointRequest=} [properties] Properties to set + * @returns {google.cloud.networksecurity.v1.DeleteFirewallEndpointRequest} DeleteFirewallEndpointRequest instance + */ + DeleteFirewallEndpointRequest.create = function create(properties) { + return new DeleteFirewallEndpointRequest(properties); + }; + + /** + * Encodes the specified DeleteFirewallEndpointRequest message. Does not implicitly {@link google.cloud.networksecurity.v1.DeleteFirewallEndpointRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.networksecurity.v1.DeleteFirewallEndpointRequest + * @static + * @param {google.cloud.networksecurity.v1.IDeleteFirewallEndpointRequest} message DeleteFirewallEndpointRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteFirewallEndpointRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.requestId); + return writer; + }; + + /** + * Encodes the specified DeleteFirewallEndpointRequest message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.DeleteFirewallEndpointRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.networksecurity.v1.DeleteFirewallEndpointRequest + * @static + * @param {google.cloud.networksecurity.v1.IDeleteFirewallEndpointRequest} message DeleteFirewallEndpointRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteFirewallEndpointRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteFirewallEndpointRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.networksecurity.v1.DeleteFirewallEndpointRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.networksecurity.v1.DeleteFirewallEndpointRequest} DeleteFirewallEndpointRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteFirewallEndpointRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networksecurity.v1.DeleteFirewallEndpointRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.requestId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteFirewallEndpointRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.networksecurity.v1.DeleteFirewallEndpointRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.networksecurity.v1.DeleteFirewallEndpointRequest} DeleteFirewallEndpointRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteFirewallEndpointRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteFirewallEndpointRequest message. + * @function verify + * @memberof google.cloud.networksecurity.v1.DeleteFirewallEndpointRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteFirewallEndpointRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + return null; + }; + + /** + * Creates a DeleteFirewallEndpointRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.networksecurity.v1.DeleteFirewallEndpointRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.networksecurity.v1.DeleteFirewallEndpointRequest} DeleteFirewallEndpointRequest + */ + DeleteFirewallEndpointRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networksecurity.v1.DeleteFirewallEndpointRequest) + return object; + var message = new $root.google.cloud.networksecurity.v1.DeleteFirewallEndpointRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from a DeleteFirewallEndpointRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.networksecurity.v1.DeleteFirewallEndpointRequest + * @static + * @param {google.cloud.networksecurity.v1.DeleteFirewallEndpointRequest} message DeleteFirewallEndpointRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteFirewallEndpointRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.requestId = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + return object; + }; + + /** + * Converts this DeleteFirewallEndpointRequest to JSON. + * @function toJSON + * @memberof google.cloud.networksecurity.v1.DeleteFirewallEndpointRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteFirewallEndpointRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteFirewallEndpointRequest + * @function getTypeUrl + * @memberof google.cloud.networksecurity.v1.DeleteFirewallEndpointRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteFirewallEndpointRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.networksecurity.v1.DeleteFirewallEndpointRequest"; + }; + + return DeleteFirewallEndpointRequest; + })(); + + v1.FirewallEndpointAssociation = (function() { + + /** + * Properties of a FirewallEndpointAssociation. + * @memberof google.cloud.networksecurity.v1 + * @interface IFirewallEndpointAssociation + * @property {string|null} [name] FirewallEndpointAssociation name + * @property {google.protobuf.ITimestamp|null} [createTime] FirewallEndpointAssociation createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] FirewallEndpointAssociation updateTime + * @property {Object.|null} [labels] FirewallEndpointAssociation labels + * @property {google.cloud.networksecurity.v1.FirewallEndpointAssociation.State|null} [state] FirewallEndpointAssociation state + * @property {string|null} [network] FirewallEndpointAssociation network + * @property {string|null} [firewallEndpoint] FirewallEndpointAssociation firewallEndpoint + * @property {string|null} [tlsInspectionPolicy] FirewallEndpointAssociation tlsInspectionPolicy + * @property {boolean|null} [reconciling] FirewallEndpointAssociation reconciling + * @property {boolean|null} [disabled] FirewallEndpointAssociation disabled + */ + + /** + * Constructs a new FirewallEndpointAssociation. + * @memberof google.cloud.networksecurity.v1 + * @classdesc Represents a FirewallEndpointAssociation. + * @implements IFirewallEndpointAssociation + * @constructor + * @param {google.cloud.networksecurity.v1.IFirewallEndpointAssociation=} [properties] Properties to set + */ + function FirewallEndpointAssociation(properties) { + this.labels = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FirewallEndpointAssociation name. + * @member {string} name + * @memberof google.cloud.networksecurity.v1.FirewallEndpointAssociation + * @instance + */ + FirewallEndpointAssociation.prototype.name = ""; + + /** + * FirewallEndpointAssociation createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.networksecurity.v1.FirewallEndpointAssociation + * @instance + */ + FirewallEndpointAssociation.prototype.createTime = null; + + /** + * FirewallEndpointAssociation updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.networksecurity.v1.FirewallEndpointAssociation + * @instance + */ + FirewallEndpointAssociation.prototype.updateTime = null; + + /** + * FirewallEndpointAssociation labels. + * @member {Object.} labels + * @memberof google.cloud.networksecurity.v1.FirewallEndpointAssociation + * @instance + */ + FirewallEndpointAssociation.prototype.labels = $util.emptyObject; + + /** + * FirewallEndpointAssociation state. + * @member {google.cloud.networksecurity.v1.FirewallEndpointAssociation.State} state + * @memberof google.cloud.networksecurity.v1.FirewallEndpointAssociation + * @instance + */ + FirewallEndpointAssociation.prototype.state = 0; + + /** + * FirewallEndpointAssociation network. + * @member {string} network + * @memberof google.cloud.networksecurity.v1.FirewallEndpointAssociation + * @instance + */ + FirewallEndpointAssociation.prototype.network = ""; + + /** + * FirewallEndpointAssociation firewallEndpoint. + * @member {string} firewallEndpoint + * @memberof google.cloud.networksecurity.v1.FirewallEndpointAssociation + * @instance + */ + FirewallEndpointAssociation.prototype.firewallEndpoint = ""; + + /** + * FirewallEndpointAssociation tlsInspectionPolicy. + * @member {string} tlsInspectionPolicy + * @memberof google.cloud.networksecurity.v1.FirewallEndpointAssociation + * @instance + */ + FirewallEndpointAssociation.prototype.tlsInspectionPolicy = ""; + + /** + * FirewallEndpointAssociation reconciling. + * @member {boolean} reconciling + * @memberof google.cloud.networksecurity.v1.FirewallEndpointAssociation + * @instance + */ + FirewallEndpointAssociation.prototype.reconciling = false; + + /** + * FirewallEndpointAssociation disabled. + * @member {boolean} disabled + * @memberof google.cloud.networksecurity.v1.FirewallEndpointAssociation + * @instance + */ + FirewallEndpointAssociation.prototype.disabled = false; + + /** + * Creates a new FirewallEndpointAssociation instance using the specified properties. + * @function create + * @memberof google.cloud.networksecurity.v1.FirewallEndpointAssociation + * @static + * @param {google.cloud.networksecurity.v1.IFirewallEndpointAssociation=} [properties] Properties to set + * @returns {google.cloud.networksecurity.v1.FirewallEndpointAssociation} FirewallEndpointAssociation instance + */ + FirewallEndpointAssociation.create = function create(properties) { + return new FirewallEndpointAssociation(properties); + }; + + /** + * Encodes the specified FirewallEndpointAssociation message. Does not implicitly {@link google.cloud.networksecurity.v1.FirewallEndpointAssociation.verify|verify} messages. + * @function encode + * @memberof google.cloud.networksecurity.v1.FirewallEndpointAssociation + * @static + * @param {google.cloud.networksecurity.v1.IFirewallEndpointAssociation} message FirewallEndpointAssociation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FirewallEndpointAssociation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) + for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) + writer.uint32(/* id 4, wireType 2 =*/34).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.state); + if (message.network != null && Object.hasOwnProperty.call(message, "network")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.network); + if (message.firewallEndpoint != null && Object.hasOwnProperty.call(message, "firewallEndpoint")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.firewallEndpoint); + if (message.tlsInspectionPolicy != null && Object.hasOwnProperty.call(message, "tlsInspectionPolicy")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.tlsInspectionPolicy); + if (message.reconciling != null && Object.hasOwnProperty.call(message, "reconciling")) + writer.uint32(/* id 9, wireType 0 =*/72).bool(message.reconciling); + if (message.disabled != null && Object.hasOwnProperty.call(message, "disabled")) + writer.uint32(/* id 10, wireType 0 =*/80).bool(message.disabled); + return writer; + }; + + /** + * Encodes the specified FirewallEndpointAssociation message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.FirewallEndpointAssociation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.networksecurity.v1.FirewallEndpointAssociation + * @static + * @param {google.cloud.networksecurity.v1.IFirewallEndpointAssociation} message FirewallEndpointAssociation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FirewallEndpointAssociation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FirewallEndpointAssociation message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.networksecurity.v1.FirewallEndpointAssociation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.networksecurity.v1.FirewallEndpointAssociation} FirewallEndpointAssociation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FirewallEndpointAssociation.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networksecurity.v1.FirewallEndpointAssociation(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 3: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 4: { + if (message.labels === $util.emptyObject) + message.labels = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.labels[key] = value; + break; + } + case 5: { + message.state = reader.int32(); + break; + } + case 6: { + message.network = reader.string(); + break; + } + case 7: { + message.firewallEndpoint = reader.string(); + break; + } + case 8: { + message.tlsInspectionPolicy = reader.string(); + break; + } + case 9: { + message.reconciling = reader.bool(); + break; + } + case 10: { + message.disabled = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FirewallEndpointAssociation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.networksecurity.v1.FirewallEndpointAssociation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.networksecurity.v1.FirewallEndpointAssociation} FirewallEndpointAssociation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FirewallEndpointAssociation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FirewallEndpointAssociation message. + * @function verify + * @memberof google.cloud.networksecurity.v1.FirewallEndpointAssociation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FirewallEndpointAssociation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime); + if (error) + return "updateTime." + error; + } + if (message.labels != null && message.hasOwnProperty("labels")) { + if (!$util.isObject(message.labels)) + return "labels: object expected"; + var key = Object.keys(message.labels); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.labels[key[i]])) + return "labels: string{k:string} expected"; + } + if (message.state != null && message.hasOwnProperty("state")) + switch (message.state) { + default: + return "state: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + break; + } + if (message.network != null && message.hasOwnProperty("network")) + if (!$util.isString(message.network)) + return "network: string expected"; + if (message.firewallEndpoint != null && message.hasOwnProperty("firewallEndpoint")) + if (!$util.isString(message.firewallEndpoint)) + return "firewallEndpoint: string expected"; + if (message.tlsInspectionPolicy != null && message.hasOwnProperty("tlsInspectionPolicy")) + if (!$util.isString(message.tlsInspectionPolicy)) + return "tlsInspectionPolicy: string expected"; + if (message.reconciling != null && message.hasOwnProperty("reconciling")) + if (typeof message.reconciling !== "boolean") + return "reconciling: boolean expected"; + if (message.disabled != null && message.hasOwnProperty("disabled")) + if (typeof message.disabled !== "boolean") + return "disabled: boolean expected"; + return null; + }; + + /** + * Creates a FirewallEndpointAssociation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.networksecurity.v1.FirewallEndpointAssociation + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.networksecurity.v1.FirewallEndpointAssociation} FirewallEndpointAssociation + */ + FirewallEndpointAssociation.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networksecurity.v1.FirewallEndpointAssociation) + return object; + var message = new $root.google.cloud.networksecurity.v1.FirewallEndpointAssociation(); + if (object.name != null) + message.name = String(object.name); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.networksecurity.v1.FirewallEndpointAssociation.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.updateTime != null) { + if (typeof object.updateTime !== "object") + throw TypeError(".google.cloud.networksecurity.v1.FirewallEndpointAssociation.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.cloud.networksecurity.v1.FirewallEndpointAssociation.labels: object expected"); + message.labels = {}; + for (var keys = Object.keys(object.labels), i = 0; i < keys.length; ++i) + message.labels[keys[i]] = String(object.labels[keys[i]]); + } + switch (object.state) { + default: + if (typeof object.state === "number") { + message.state = object.state; + break; + } + break; + case "STATE_UNSPECIFIED": + case 0: + message.state = 0; + break; + case "CREATING": + case 1: + message.state = 1; + break; + case "ACTIVE": + case 2: + message.state = 2; + break; + case "DELETING": + case 3: + message.state = 3; + break; + case "INACTIVE": + case 4: + message.state = 4; + break; + case "ORPHAN": + case 5: + message.state = 5; + break; + } + if (object.network != null) + message.network = String(object.network); + if (object.firewallEndpoint != null) + message.firewallEndpoint = String(object.firewallEndpoint); + if (object.tlsInspectionPolicy != null) + message.tlsInspectionPolicy = String(object.tlsInspectionPolicy); + if (object.reconciling != null) + message.reconciling = Boolean(object.reconciling); + if (object.disabled != null) + message.disabled = Boolean(object.disabled); + return message; + }; + + /** + * Creates a plain object from a FirewallEndpointAssociation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.networksecurity.v1.FirewallEndpointAssociation + * @static + * @param {google.cloud.networksecurity.v1.FirewallEndpointAssociation} message FirewallEndpointAssociation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FirewallEndpointAssociation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.labels = {}; + if (options.defaults) { + object.name = ""; + object.createTime = null; + object.updateTime = null; + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + object.network = ""; + object.firewallEndpoint = ""; + object.tlsInspectionPolicy = ""; + object.reconciling = false; + object.disabled = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.updateTime != null && message.hasOwnProperty("updateTime")) + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); + var keys2; + if (message.labels && (keys2 = Object.keys(message.labels)).length) { + object.labels = {}; + for (var j = 0; j < keys2.length; ++j) + object.labels[keys2[j]] = message.labels[keys2[j]]; + } + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.networksecurity.v1.FirewallEndpointAssociation.State[message.state] === undefined ? message.state : $root.google.cloud.networksecurity.v1.FirewallEndpointAssociation.State[message.state] : message.state; + if (message.network != null && message.hasOwnProperty("network")) + object.network = message.network; + if (message.firewallEndpoint != null && message.hasOwnProperty("firewallEndpoint")) + object.firewallEndpoint = message.firewallEndpoint; + if (message.tlsInspectionPolicy != null && message.hasOwnProperty("tlsInspectionPolicy")) + object.tlsInspectionPolicy = message.tlsInspectionPolicy; + if (message.reconciling != null && message.hasOwnProperty("reconciling")) + object.reconciling = message.reconciling; + if (message.disabled != null && message.hasOwnProperty("disabled")) + object.disabled = message.disabled; + return object; + }; + + /** + * Converts this FirewallEndpointAssociation to JSON. + * @function toJSON + * @memberof google.cloud.networksecurity.v1.FirewallEndpointAssociation + * @instance + * @returns {Object.} JSON object + */ + FirewallEndpointAssociation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FirewallEndpointAssociation + * @function getTypeUrl + * @memberof google.cloud.networksecurity.v1.FirewallEndpointAssociation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FirewallEndpointAssociation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.networksecurity.v1.FirewallEndpointAssociation"; + }; + + /** + * State enum. + * @name google.cloud.networksecurity.v1.FirewallEndpointAssociation.State + * @enum {number} + * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value + * @property {number} CREATING=1 CREATING value + * @property {number} ACTIVE=2 ACTIVE value + * @property {number} DELETING=3 DELETING value + * @property {number} INACTIVE=4 INACTIVE value + * @property {number} ORPHAN=5 ORPHAN value + */ + FirewallEndpointAssociation.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "CREATING"] = 1; + values[valuesById[2] = "ACTIVE"] = 2; + values[valuesById[3] = "DELETING"] = 3; + values[valuesById[4] = "INACTIVE"] = 4; + values[valuesById[5] = "ORPHAN"] = 5; + return values; + })(); + + return FirewallEndpointAssociation; + })(); + + v1.ListFirewallEndpointAssociationsRequest = (function() { + + /** + * Properties of a ListFirewallEndpointAssociationsRequest. + * @memberof google.cloud.networksecurity.v1 + * @interface IListFirewallEndpointAssociationsRequest + * @property {string|null} [parent] ListFirewallEndpointAssociationsRequest parent + * @property {number|null} [pageSize] ListFirewallEndpointAssociationsRequest pageSize + * @property {string|null} [pageToken] ListFirewallEndpointAssociationsRequest pageToken + * @property {string|null} [filter] ListFirewallEndpointAssociationsRequest filter + * @property {string|null} [orderBy] ListFirewallEndpointAssociationsRequest orderBy + */ + + /** + * Constructs a new ListFirewallEndpointAssociationsRequest. + * @memberof google.cloud.networksecurity.v1 + * @classdesc Represents a ListFirewallEndpointAssociationsRequest. + * @implements IListFirewallEndpointAssociationsRequest + * @constructor + * @param {google.cloud.networksecurity.v1.IListFirewallEndpointAssociationsRequest=} [properties] Properties to set + */ + function ListFirewallEndpointAssociationsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListFirewallEndpointAssociationsRequest parent. + * @member {string} parent + * @memberof google.cloud.networksecurity.v1.ListFirewallEndpointAssociationsRequest + * @instance + */ + ListFirewallEndpointAssociationsRequest.prototype.parent = ""; + + /** + * ListFirewallEndpointAssociationsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.networksecurity.v1.ListFirewallEndpointAssociationsRequest + * @instance + */ + ListFirewallEndpointAssociationsRequest.prototype.pageSize = 0; + + /** + * ListFirewallEndpointAssociationsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.networksecurity.v1.ListFirewallEndpointAssociationsRequest + * @instance + */ + ListFirewallEndpointAssociationsRequest.prototype.pageToken = ""; + + /** + * ListFirewallEndpointAssociationsRequest filter. + * @member {string} filter + * @memberof google.cloud.networksecurity.v1.ListFirewallEndpointAssociationsRequest + * @instance + */ + ListFirewallEndpointAssociationsRequest.prototype.filter = ""; + + /** + * ListFirewallEndpointAssociationsRequest orderBy. + * @member {string} orderBy + * @memberof google.cloud.networksecurity.v1.ListFirewallEndpointAssociationsRequest + * @instance + */ + ListFirewallEndpointAssociationsRequest.prototype.orderBy = ""; + + /** + * Creates a new ListFirewallEndpointAssociationsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.networksecurity.v1.ListFirewallEndpointAssociationsRequest + * @static + * @param {google.cloud.networksecurity.v1.IListFirewallEndpointAssociationsRequest=} [properties] Properties to set + * @returns {google.cloud.networksecurity.v1.ListFirewallEndpointAssociationsRequest} ListFirewallEndpointAssociationsRequest instance + */ + ListFirewallEndpointAssociationsRequest.create = function create(properties) { + return new ListFirewallEndpointAssociationsRequest(properties); + }; + + /** + * Encodes the specified ListFirewallEndpointAssociationsRequest message. Does not implicitly {@link google.cloud.networksecurity.v1.ListFirewallEndpointAssociationsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.networksecurity.v1.ListFirewallEndpointAssociationsRequest + * @static + * @param {google.cloud.networksecurity.v1.IListFirewallEndpointAssociationsRequest} message ListFirewallEndpointAssociationsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListFirewallEndpointAssociationsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.filter); + if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.orderBy); + return writer; + }; + + /** + * Encodes the specified ListFirewallEndpointAssociationsRequest message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.ListFirewallEndpointAssociationsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.networksecurity.v1.ListFirewallEndpointAssociationsRequest + * @static + * @param {google.cloud.networksecurity.v1.IListFirewallEndpointAssociationsRequest} message ListFirewallEndpointAssociationsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListFirewallEndpointAssociationsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListFirewallEndpointAssociationsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.networksecurity.v1.ListFirewallEndpointAssociationsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.networksecurity.v1.ListFirewallEndpointAssociationsRequest} ListFirewallEndpointAssociationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListFirewallEndpointAssociationsRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networksecurity.v1.ListFirewallEndpointAssociationsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + case 4: { + message.filter = reader.string(); + break; + } + case 5: { + message.orderBy = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListFirewallEndpointAssociationsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.networksecurity.v1.ListFirewallEndpointAssociationsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.networksecurity.v1.ListFirewallEndpointAssociationsRequest} ListFirewallEndpointAssociationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListFirewallEndpointAssociationsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListFirewallEndpointAssociationsRequest message. + * @function verify + * @memberof google.cloud.networksecurity.v1.ListFirewallEndpointAssociationsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListFirewallEndpointAssociationsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + if (!$util.isString(message.orderBy)) + return "orderBy: string expected"; + return null; + }; + + /** + * Creates a ListFirewallEndpointAssociationsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.networksecurity.v1.ListFirewallEndpointAssociationsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.networksecurity.v1.ListFirewallEndpointAssociationsRequest} ListFirewallEndpointAssociationsRequest + */ + ListFirewallEndpointAssociationsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networksecurity.v1.ListFirewallEndpointAssociationsRequest) + return object; + var message = new $root.google.cloud.networksecurity.v1.ListFirewallEndpointAssociationsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.filter != null) + message.filter = String(object.filter); + if (object.orderBy != null) + message.orderBy = String(object.orderBy); + return message; + }; + + /** + * Creates a plain object from a ListFirewallEndpointAssociationsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.networksecurity.v1.ListFirewallEndpointAssociationsRequest + * @static + * @param {google.cloud.networksecurity.v1.ListFirewallEndpointAssociationsRequest} message ListFirewallEndpointAssociationsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListFirewallEndpointAssociationsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + object.filter = ""; + object.orderBy = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + object.orderBy = message.orderBy; + return object; + }; + + /** + * Converts this ListFirewallEndpointAssociationsRequest to JSON. + * @function toJSON + * @memberof google.cloud.networksecurity.v1.ListFirewallEndpointAssociationsRequest + * @instance + * @returns {Object.} JSON object + */ + ListFirewallEndpointAssociationsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListFirewallEndpointAssociationsRequest + * @function getTypeUrl + * @memberof google.cloud.networksecurity.v1.ListFirewallEndpointAssociationsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListFirewallEndpointAssociationsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.networksecurity.v1.ListFirewallEndpointAssociationsRequest"; + }; + + return ListFirewallEndpointAssociationsRequest; + })(); + + v1.ListFirewallEndpointAssociationsResponse = (function() { + + /** + * Properties of a ListFirewallEndpointAssociationsResponse. + * @memberof google.cloud.networksecurity.v1 + * @interface IListFirewallEndpointAssociationsResponse + * @property {Array.|null} [firewallEndpointAssociations] ListFirewallEndpointAssociationsResponse firewallEndpointAssociations + * @property {string|null} [nextPageToken] ListFirewallEndpointAssociationsResponse nextPageToken + * @property {Array.|null} [unreachable] ListFirewallEndpointAssociationsResponse unreachable + */ + + /** + * Constructs a new ListFirewallEndpointAssociationsResponse. + * @memberof google.cloud.networksecurity.v1 + * @classdesc Represents a ListFirewallEndpointAssociationsResponse. + * @implements IListFirewallEndpointAssociationsResponse + * @constructor + * @param {google.cloud.networksecurity.v1.IListFirewallEndpointAssociationsResponse=} [properties] Properties to set + */ + function ListFirewallEndpointAssociationsResponse(properties) { + this.firewallEndpointAssociations = []; + this.unreachable = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListFirewallEndpointAssociationsResponse firewallEndpointAssociations. + * @member {Array.} firewallEndpointAssociations + * @memberof google.cloud.networksecurity.v1.ListFirewallEndpointAssociationsResponse + * @instance + */ + ListFirewallEndpointAssociationsResponse.prototype.firewallEndpointAssociations = $util.emptyArray; + + /** + * ListFirewallEndpointAssociationsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.networksecurity.v1.ListFirewallEndpointAssociationsResponse + * @instance + */ + ListFirewallEndpointAssociationsResponse.prototype.nextPageToken = ""; + + /** + * ListFirewallEndpointAssociationsResponse unreachable. + * @member {Array.} unreachable + * @memberof google.cloud.networksecurity.v1.ListFirewallEndpointAssociationsResponse + * @instance + */ + ListFirewallEndpointAssociationsResponse.prototype.unreachable = $util.emptyArray; + + /** + * Creates a new ListFirewallEndpointAssociationsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.networksecurity.v1.ListFirewallEndpointAssociationsResponse + * @static + * @param {google.cloud.networksecurity.v1.IListFirewallEndpointAssociationsResponse=} [properties] Properties to set + * @returns {google.cloud.networksecurity.v1.ListFirewallEndpointAssociationsResponse} ListFirewallEndpointAssociationsResponse instance + */ + ListFirewallEndpointAssociationsResponse.create = function create(properties) { + return new ListFirewallEndpointAssociationsResponse(properties); + }; + + /** + * Encodes the specified ListFirewallEndpointAssociationsResponse message. Does not implicitly {@link google.cloud.networksecurity.v1.ListFirewallEndpointAssociationsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.networksecurity.v1.ListFirewallEndpointAssociationsResponse + * @static + * @param {google.cloud.networksecurity.v1.IListFirewallEndpointAssociationsResponse} message ListFirewallEndpointAssociationsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListFirewallEndpointAssociationsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.firewallEndpointAssociations != null && message.firewallEndpointAssociations.length) + for (var i = 0; i < message.firewallEndpointAssociations.length; ++i) + $root.google.cloud.networksecurity.v1.FirewallEndpointAssociation.encode(message.firewallEndpointAssociations[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + if (message.unreachable != null && message.unreachable.length) + for (var i = 0; i < message.unreachable.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.unreachable[i]); + return writer; + }; + + /** + * Encodes the specified ListFirewallEndpointAssociationsResponse message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.ListFirewallEndpointAssociationsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.networksecurity.v1.ListFirewallEndpointAssociationsResponse + * @static + * @param {google.cloud.networksecurity.v1.IListFirewallEndpointAssociationsResponse} message ListFirewallEndpointAssociationsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListFirewallEndpointAssociationsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListFirewallEndpointAssociationsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.networksecurity.v1.ListFirewallEndpointAssociationsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.networksecurity.v1.ListFirewallEndpointAssociationsResponse} ListFirewallEndpointAssociationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListFirewallEndpointAssociationsResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networksecurity.v1.ListFirewallEndpointAssociationsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.firewallEndpointAssociations && message.firewallEndpointAssociations.length)) + message.firewallEndpointAssociations = []; + message.firewallEndpointAssociations.push($root.google.cloud.networksecurity.v1.FirewallEndpointAssociation.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + case 3: { + if (!(message.unreachable && message.unreachable.length)) + message.unreachable = []; + message.unreachable.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListFirewallEndpointAssociationsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.networksecurity.v1.ListFirewallEndpointAssociationsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.networksecurity.v1.ListFirewallEndpointAssociationsResponse} ListFirewallEndpointAssociationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListFirewallEndpointAssociationsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListFirewallEndpointAssociationsResponse message. + * @function verify + * @memberof google.cloud.networksecurity.v1.ListFirewallEndpointAssociationsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListFirewallEndpointAssociationsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.firewallEndpointAssociations != null && message.hasOwnProperty("firewallEndpointAssociations")) { + if (!Array.isArray(message.firewallEndpointAssociations)) + return "firewallEndpointAssociations: array expected"; + for (var i = 0; i < message.firewallEndpointAssociations.length; ++i) { + var error = $root.google.cloud.networksecurity.v1.FirewallEndpointAssociation.verify(message.firewallEndpointAssociations[i]); + if (error) + return "firewallEndpointAssociations." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + if (message.unreachable != null && message.hasOwnProperty("unreachable")) { + if (!Array.isArray(message.unreachable)) + return "unreachable: array expected"; + for (var i = 0; i < message.unreachable.length; ++i) + if (!$util.isString(message.unreachable[i])) + return "unreachable: string[] expected"; + } + return null; + }; + + /** + * Creates a ListFirewallEndpointAssociationsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.networksecurity.v1.ListFirewallEndpointAssociationsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.networksecurity.v1.ListFirewallEndpointAssociationsResponse} ListFirewallEndpointAssociationsResponse + */ + ListFirewallEndpointAssociationsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networksecurity.v1.ListFirewallEndpointAssociationsResponse) + return object; + var message = new $root.google.cloud.networksecurity.v1.ListFirewallEndpointAssociationsResponse(); + if (object.firewallEndpointAssociations) { + if (!Array.isArray(object.firewallEndpointAssociations)) + throw TypeError(".google.cloud.networksecurity.v1.ListFirewallEndpointAssociationsResponse.firewallEndpointAssociations: array expected"); + message.firewallEndpointAssociations = []; + for (var i = 0; i < object.firewallEndpointAssociations.length; ++i) { + if (typeof object.firewallEndpointAssociations[i] !== "object") + throw TypeError(".google.cloud.networksecurity.v1.ListFirewallEndpointAssociationsResponse.firewallEndpointAssociations: object expected"); + message.firewallEndpointAssociations[i] = $root.google.cloud.networksecurity.v1.FirewallEndpointAssociation.fromObject(object.firewallEndpointAssociations[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.unreachable) { + if (!Array.isArray(object.unreachable)) + throw TypeError(".google.cloud.networksecurity.v1.ListFirewallEndpointAssociationsResponse.unreachable: array expected"); + message.unreachable = []; + for (var i = 0; i < object.unreachable.length; ++i) + message.unreachable[i] = String(object.unreachable[i]); + } + return message; + }; + + /** + * Creates a plain object from a ListFirewallEndpointAssociationsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.networksecurity.v1.ListFirewallEndpointAssociationsResponse + * @static + * @param {google.cloud.networksecurity.v1.ListFirewallEndpointAssociationsResponse} message ListFirewallEndpointAssociationsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListFirewallEndpointAssociationsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.firewallEndpointAssociations = []; + object.unreachable = []; + } + if (options.defaults) + object.nextPageToken = ""; + if (message.firewallEndpointAssociations && message.firewallEndpointAssociations.length) { + object.firewallEndpointAssociations = []; + for (var j = 0; j < message.firewallEndpointAssociations.length; ++j) + object.firewallEndpointAssociations[j] = $root.google.cloud.networksecurity.v1.FirewallEndpointAssociation.toObject(message.firewallEndpointAssociations[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + if (message.unreachable && message.unreachable.length) { + object.unreachable = []; + for (var j = 0; j < message.unreachable.length; ++j) + object.unreachable[j] = message.unreachable[j]; + } + return object; + }; + + /** + * Converts this ListFirewallEndpointAssociationsResponse to JSON. + * @function toJSON + * @memberof google.cloud.networksecurity.v1.ListFirewallEndpointAssociationsResponse + * @instance + * @returns {Object.} JSON object + */ + ListFirewallEndpointAssociationsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListFirewallEndpointAssociationsResponse + * @function getTypeUrl + * @memberof google.cloud.networksecurity.v1.ListFirewallEndpointAssociationsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListFirewallEndpointAssociationsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.networksecurity.v1.ListFirewallEndpointAssociationsResponse"; + }; + + return ListFirewallEndpointAssociationsResponse; + })(); + + v1.GetFirewallEndpointAssociationRequest = (function() { + + /** + * Properties of a GetFirewallEndpointAssociationRequest. + * @memberof google.cloud.networksecurity.v1 + * @interface IGetFirewallEndpointAssociationRequest + * @property {string|null} [name] GetFirewallEndpointAssociationRequest name + */ + + /** + * Constructs a new GetFirewallEndpointAssociationRequest. + * @memberof google.cloud.networksecurity.v1 + * @classdesc Represents a GetFirewallEndpointAssociationRequest. + * @implements IGetFirewallEndpointAssociationRequest + * @constructor + * @param {google.cloud.networksecurity.v1.IGetFirewallEndpointAssociationRequest=} [properties] Properties to set + */ + function GetFirewallEndpointAssociationRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetFirewallEndpointAssociationRequest name. + * @member {string} name + * @memberof google.cloud.networksecurity.v1.GetFirewallEndpointAssociationRequest + * @instance + */ + GetFirewallEndpointAssociationRequest.prototype.name = ""; + + /** + * Creates a new GetFirewallEndpointAssociationRequest instance using the specified properties. + * @function create + * @memberof google.cloud.networksecurity.v1.GetFirewallEndpointAssociationRequest + * @static + * @param {google.cloud.networksecurity.v1.IGetFirewallEndpointAssociationRequest=} [properties] Properties to set + * @returns {google.cloud.networksecurity.v1.GetFirewallEndpointAssociationRequest} GetFirewallEndpointAssociationRequest instance + */ + GetFirewallEndpointAssociationRequest.create = function create(properties) { + return new GetFirewallEndpointAssociationRequest(properties); + }; + + /** + * Encodes the specified GetFirewallEndpointAssociationRequest message. Does not implicitly {@link google.cloud.networksecurity.v1.GetFirewallEndpointAssociationRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.networksecurity.v1.GetFirewallEndpointAssociationRequest + * @static + * @param {google.cloud.networksecurity.v1.IGetFirewallEndpointAssociationRequest} message GetFirewallEndpointAssociationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetFirewallEndpointAssociationRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified GetFirewallEndpointAssociationRequest message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.GetFirewallEndpointAssociationRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.networksecurity.v1.GetFirewallEndpointAssociationRequest + * @static + * @param {google.cloud.networksecurity.v1.IGetFirewallEndpointAssociationRequest} message GetFirewallEndpointAssociationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetFirewallEndpointAssociationRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetFirewallEndpointAssociationRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.networksecurity.v1.GetFirewallEndpointAssociationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.networksecurity.v1.GetFirewallEndpointAssociationRequest} GetFirewallEndpointAssociationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetFirewallEndpointAssociationRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networksecurity.v1.GetFirewallEndpointAssociationRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetFirewallEndpointAssociationRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.networksecurity.v1.GetFirewallEndpointAssociationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.networksecurity.v1.GetFirewallEndpointAssociationRequest} GetFirewallEndpointAssociationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetFirewallEndpointAssociationRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetFirewallEndpointAssociationRequest message. + * @function verify + * @memberof google.cloud.networksecurity.v1.GetFirewallEndpointAssociationRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetFirewallEndpointAssociationRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a GetFirewallEndpointAssociationRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.networksecurity.v1.GetFirewallEndpointAssociationRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.networksecurity.v1.GetFirewallEndpointAssociationRequest} GetFirewallEndpointAssociationRequest + */ + GetFirewallEndpointAssociationRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networksecurity.v1.GetFirewallEndpointAssociationRequest) + return object; + var message = new $root.google.cloud.networksecurity.v1.GetFirewallEndpointAssociationRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetFirewallEndpointAssociationRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.networksecurity.v1.GetFirewallEndpointAssociationRequest + * @static + * @param {google.cloud.networksecurity.v1.GetFirewallEndpointAssociationRequest} message GetFirewallEndpointAssociationRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetFirewallEndpointAssociationRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this GetFirewallEndpointAssociationRequest to JSON. + * @function toJSON + * @memberof google.cloud.networksecurity.v1.GetFirewallEndpointAssociationRequest + * @instance + * @returns {Object.} JSON object + */ + GetFirewallEndpointAssociationRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetFirewallEndpointAssociationRequest + * @function getTypeUrl + * @memberof google.cloud.networksecurity.v1.GetFirewallEndpointAssociationRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetFirewallEndpointAssociationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.networksecurity.v1.GetFirewallEndpointAssociationRequest"; + }; + + return GetFirewallEndpointAssociationRequest; + })(); + + v1.CreateFirewallEndpointAssociationRequest = (function() { + + /** + * Properties of a CreateFirewallEndpointAssociationRequest. + * @memberof google.cloud.networksecurity.v1 + * @interface ICreateFirewallEndpointAssociationRequest + * @property {string|null} [parent] CreateFirewallEndpointAssociationRequest parent + * @property {string|null} [firewallEndpointAssociationId] CreateFirewallEndpointAssociationRequest firewallEndpointAssociationId + * @property {google.cloud.networksecurity.v1.IFirewallEndpointAssociation|null} [firewallEndpointAssociation] CreateFirewallEndpointAssociationRequest firewallEndpointAssociation + * @property {string|null} [requestId] CreateFirewallEndpointAssociationRequest requestId + */ + + /** + * Constructs a new CreateFirewallEndpointAssociationRequest. + * @memberof google.cloud.networksecurity.v1 + * @classdesc Represents a CreateFirewallEndpointAssociationRequest. + * @implements ICreateFirewallEndpointAssociationRequest + * @constructor + * @param {google.cloud.networksecurity.v1.ICreateFirewallEndpointAssociationRequest=} [properties] Properties to set + */ + function CreateFirewallEndpointAssociationRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateFirewallEndpointAssociationRequest parent. + * @member {string} parent + * @memberof google.cloud.networksecurity.v1.CreateFirewallEndpointAssociationRequest + * @instance + */ + CreateFirewallEndpointAssociationRequest.prototype.parent = ""; + + /** + * CreateFirewallEndpointAssociationRequest firewallEndpointAssociationId. + * @member {string} firewallEndpointAssociationId + * @memberof google.cloud.networksecurity.v1.CreateFirewallEndpointAssociationRequest + * @instance + */ + CreateFirewallEndpointAssociationRequest.prototype.firewallEndpointAssociationId = ""; + + /** + * CreateFirewallEndpointAssociationRequest firewallEndpointAssociation. + * @member {google.cloud.networksecurity.v1.IFirewallEndpointAssociation|null|undefined} firewallEndpointAssociation + * @memberof google.cloud.networksecurity.v1.CreateFirewallEndpointAssociationRequest + * @instance + */ + CreateFirewallEndpointAssociationRequest.prototype.firewallEndpointAssociation = null; + + /** + * CreateFirewallEndpointAssociationRequest requestId. + * @member {string} requestId + * @memberof google.cloud.networksecurity.v1.CreateFirewallEndpointAssociationRequest + * @instance + */ + CreateFirewallEndpointAssociationRequest.prototype.requestId = ""; + + /** + * Creates a new CreateFirewallEndpointAssociationRequest instance using the specified properties. + * @function create + * @memberof google.cloud.networksecurity.v1.CreateFirewallEndpointAssociationRequest + * @static + * @param {google.cloud.networksecurity.v1.ICreateFirewallEndpointAssociationRequest=} [properties] Properties to set + * @returns {google.cloud.networksecurity.v1.CreateFirewallEndpointAssociationRequest} CreateFirewallEndpointAssociationRequest instance + */ + CreateFirewallEndpointAssociationRequest.create = function create(properties) { + return new CreateFirewallEndpointAssociationRequest(properties); + }; + + /** + * Encodes the specified CreateFirewallEndpointAssociationRequest message. Does not implicitly {@link google.cloud.networksecurity.v1.CreateFirewallEndpointAssociationRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.networksecurity.v1.CreateFirewallEndpointAssociationRequest + * @static + * @param {google.cloud.networksecurity.v1.ICreateFirewallEndpointAssociationRequest} message CreateFirewallEndpointAssociationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateFirewallEndpointAssociationRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.firewallEndpointAssociationId != null && Object.hasOwnProperty.call(message, "firewallEndpointAssociationId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.firewallEndpointAssociationId); + if (message.firewallEndpointAssociation != null && Object.hasOwnProperty.call(message, "firewallEndpointAssociation")) + $root.google.cloud.networksecurity.v1.FirewallEndpointAssociation.encode(message.firewallEndpointAssociation, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.requestId); + return writer; + }; + + /** + * Encodes the specified CreateFirewallEndpointAssociationRequest message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.CreateFirewallEndpointAssociationRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.networksecurity.v1.CreateFirewallEndpointAssociationRequest + * @static + * @param {google.cloud.networksecurity.v1.ICreateFirewallEndpointAssociationRequest} message CreateFirewallEndpointAssociationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateFirewallEndpointAssociationRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateFirewallEndpointAssociationRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.networksecurity.v1.CreateFirewallEndpointAssociationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.networksecurity.v1.CreateFirewallEndpointAssociationRequest} CreateFirewallEndpointAssociationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateFirewallEndpointAssociationRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networksecurity.v1.CreateFirewallEndpointAssociationRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.firewallEndpointAssociationId = reader.string(); + break; + } + case 3: { + message.firewallEndpointAssociation = $root.google.cloud.networksecurity.v1.FirewallEndpointAssociation.decode(reader, reader.uint32()); + break; + } + case 4: { + message.requestId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateFirewallEndpointAssociationRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.networksecurity.v1.CreateFirewallEndpointAssociationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.networksecurity.v1.CreateFirewallEndpointAssociationRequest} CreateFirewallEndpointAssociationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateFirewallEndpointAssociationRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateFirewallEndpointAssociationRequest message. + * @function verify + * @memberof google.cloud.networksecurity.v1.CreateFirewallEndpointAssociationRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateFirewallEndpointAssociationRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.firewallEndpointAssociationId != null && message.hasOwnProperty("firewallEndpointAssociationId")) + if (!$util.isString(message.firewallEndpointAssociationId)) + return "firewallEndpointAssociationId: string expected"; + if (message.firewallEndpointAssociation != null && message.hasOwnProperty("firewallEndpointAssociation")) { + var error = $root.google.cloud.networksecurity.v1.FirewallEndpointAssociation.verify(message.firewallEndpointAssociation); + if (error) + return "firewallEndpointAssociation." + error; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + return null; + }; + + /** + * Creates a CreateFirewallEndpointAssociationRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.networksecurity.v1.CreateFirewallEndpointAssociationRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.networksecurity.v1.CreateFirewallEndpointAssociationRequest} CreateFirewallEndpointAssociationRequest + */ + CreateFirewallEndpointAssociationRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networksecurity.v1.CreateFirewallEndpointAssociationRequest) + return object; + var message = new $root.google.cloud.networksecurity.v1.CreateFirewallEndpointAssociationRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.firewallEndpointAssociationId != null) + message.firewallEndpointAssociationId = String(object.firewallEndpointAssociationId); + if (object.firewallEndpointAssociation != null) { + if (typeof object.firewallEndpointAssociation !== "object") + throw TypeError(".google.cloud.networksecurity.v1.CreateFirewallEndpointAssociationRequest.firewallEndpointAssociation: object expected"); + message.firewallEndpointAssociation = $root.google.cloud.networksecurity.v1.FirewallEndpointAssociation.fromObject(object.firewallEndpointAssociation); + } + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from a CreateFirewallEndpointAssociationRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.networksecurity.v1.CreateFirewallEndpointAssociationRequest + * @static + * @param {google.cloud.networksecurity.v1.CreateFirewallEndpointAssociationRequest} message CreateFirewallEndpointAssociationRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateFirewallEndpointAssociationRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.firewallEndpointAssociationId = ""; + object.firewallEndpointAssociation = null; + object.requestId = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.firewallEndpointAssociationId != null && message.hasOwnProperty("firewallEndpointAssociationId")) + object.firewallEndpointAssociationId = message.firewallEndpointAssociationId; + if (message.firewallEndpointAssociation != null && message.hasOwnProperty("firewallEndpointAssociation")) + object.firewallEndpointAssociation = $root.google.cloud.networksecurity.v1.FirewallEndpointAssociation.toObject(message.firewallEndpointAssociation, options); + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + return object; + }; + + /** + * Converts this CreateFirewallEndpointAssociationRequest to JSON. + * @function toJSON + * @memberof google.cloud.networksecurity.v1.CreateFirewallEndpointAssociationRequest + * @instance + * @returns {Object.} JSON object + */ + CreateFirewallEndpointAssociationRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateFirewallEndpointAssociationRequest + * @function getTypeUrl + * @memberof google.cloud.networksecurity.v1.CreateFirewallEndpointAssociationRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateFirewallEndpointAssociationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.networksecurity.v1.CreateFirewallEndpointAssociationRequest"; + }; + + return CreateFirewallEndpointAssociationRequest; + })(); + + v1.DeleteFirewallEndpointAssociationRequest = (function() { + + /** + * Properties of a DeleteFirewallEndpointAssociationRequest. + * @memberof google.cloud.networksecurity.v1 + * @interface IDeleteFirewallEndpointAssociationRequest + * @property {string|null} [name] DeleteFirewallEndpointAssociationRequest name + * @property {string|null} [requestId] DeleteFirewallEndpointAssociationRequest requestId + */ + + /** + * Constructs a new DeleteFirewallEndpointAssociationRequest. + * @memberof google.cloud.networksecurity.v1 + * @classdesc Represents a DeleteFirewallEndpointAssociationRequest. + * @implements IDeleteFirewallEndpointAssociationRequest + * @constructor + * @param {google.cloud.networksecurity.v1.IDeleteFirewallEndpointAssociationRequest=} [properties] Properties to set + */ + function DeleteFirewallEndpointAssociationRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteFirewallEndpointAssociationRequest name. + * @member {string} name + * @memberof google.cloud.networksecurity.v1.DeleteFirewallEndpointAssociationRequest + * @instance + */ + DeleteFirewallEndpointAssociationRequest.prototype.name = ""; + + /** + * DeleteFirewallEndpointAssociationRequest requestId. + * @member {string} requestId + * @memberof google.cloud.networksecurity.v1.DeleteFirewallEndpointAssociationRequest + * @instance + */ + DeleteFirewallEndpointAssociationRequest.prototype.requestId = ""; + + /** + * Creates a new DeleteFirewallEndpointAssociationRequest instance using the specified properties. + * @function create + * @memberof google.cloud.networksecurity.v1.DeleteFirewallEndpointAssociationRequest + * @static + * @param {google.cloud.networksecurity.v1.IDeleteFirewallEndpointAssociationRequest=} [properties] Properties to set + * @returns {google.cloud.networksecurity.v1.DeleteFirewallEndpointAssociationRequest} DeleteFirewallEndpointAssociationRequest instance + */ + DeleteFirewallEndpointAssociationRequest.create = function create(properties) { + return new DeleteFirewallEndpointAssociationRequest(properties); + }; + + /** + * Encodes the specified DeleteFirewallEndpointAssociationRequest message. Does not implicitly {@link google.cloud.networksecurity.v1.DeleteFirewallEndpointAssociationRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.networksecurity.v1.DeleteFirewallEndpointAssociationRequest + * @static + * @param {google.cloud.networksecurity.v1.IDeleteFirewallEndpointAssociationRequest} message DeleteFirewallEndpointAssociationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteFirewallEndpointAssociationRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.requestId); + return writer; + }; + + /** + * Encodes the specified DeleteFirewallEndpointAssociationRequest message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.DeleteFirewallEndpointAssociationRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.networksecurity.v1.DeleteFirewallEndpointAssociationRequest + * @static + * @param {google.cloud.networksecurity.v1.IDeleteFirewallEndpointAssociationRequest} message DeleteFirewallEndpointAssociationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteFirewallEndpointAssociationRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteFirewallEndpointAssociationRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.networksecurity.v1.DeleteFirewallEndpointAssociationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.networksecurity.v1.DeleteFirewallEndpointAssociationRequest} DeleteFirewallEndpointAssociationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteFirewallEndpointAssociationRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networksecurity.v1.DeleteFirewallEndpointAssociationRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.requestId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteFirewallEndpointAssociationRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.networksecurity.v1.DeleteFirewallEndpointAssociationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.networksecurity.v1.DeleteFirewallEndpointAssociationRequest} DeleteFirewallEndpointAssociationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteFirewallEndpointAssociationRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteFirewallEndpointAssociationRequest message. + * @function verify + * @memberof google.cloud.networksecurity.v1.DeleteFirewallEndpointAssociationRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteFirewallEndpointAssociationRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + return null; + }; + + /** + * Creates a DeleteFirewallEndpointAssociationRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.networksecurity.v1.DeleteFirewallEndpointAssociationRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.networksecurity.v1.DeleteFirewallEndpointAssociationRequest} DeleteFirewallEndpointAssociationRequest + */ + DeleteFirewallEndpointAssociationRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networksecurity.v1.DeleteFirewallEndpointAssociationRequest) + return object; + var message = new $root.google.cloud.networksecurity.v1.DeleteFirewallEndpointAssociationRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from a DeleteFirewallEndpointAssociationRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.networksecurity.v1.DeleteFirewallEndpointAssociationRequest + * @static + * @param {google.cloud.networksecurity.v1.DeleteFirewallEndpointAssociationRequest} message DeleteFirewallEndpointAssociationRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteFirewallEndpointAssociationRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.requestId = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + return object; + }; + + /** + * Converts this DeleteFirewallEndpointAssociationRequest to JSON. + * @function toJSON + * @memberof google.cloud.networksecurity.v1.DeleteFirewallEndpointAssociationRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteFirewallEndpointAssociationRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteFirewallEndpointAssociationRequest + * @function getTypeUrl + * @memberof google.cloud.networksecurity.v1.DeleteFirewallEndpointAssociationRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteFirewallEndpointAssociationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.networksecurity.v1.DeleteFirewallEndpointAssociationRequest"; + }; + + return DeleteFirewallEndpointAssociationRequest; + })(); + + v1.UpdateFirewallEndpointAssociationRequest = (function() { + + /** + * Properties of an UpdateFirewallEndpointAssociationRequest. + * @memberof google.cloud.networksecurity.v1 + * @interface IUpdateFirewallEndpointAssociationRequest + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateFirewallEndpointAssociationRequest updateMask + * @property {google.cloud.networksecurity.v1.IFirewallEndpointAssociation|null} [firewallEndpointAssociation] UpdateFirewallEndpointAssociationRequest firewallEndpointAssociation + * @property {string|null} [requestId] UpdateFirewallEndpointAssociationRequest requestId + */ + + /** + * Constructs a new UpdateFirewallEndpointAssociationRequest. + * @memberof google.cloud.networksecurity.v1 + * @classdesc Represents an UpdateFirewallEndpointAssociationRequest. + * @implements IUpdateFirewallEndpointAssociationRequest + * @constructor + * @param {google.cloud.networksecurity.v1.IUpdateFirewallEndpointAssociationRequest=} [properties] Properties to set + */ + function UpdateFirewallEndpointAssociationRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateFirewallEndpointAssociationRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.networksecurity.v1.UpdateFirewallEndpointAssociationRequest + * @instance + */ + UpdateFirewallEndpointAssociationRequest.prototype.updateMask = null; + + /** + * UpdateFirewallEndpointAssociationRequest firewallEndpointAssociation. + * @member {google.cloud.networksecurity.v1.IFirewallEndpointAssociation|null|undefined} firewallEndpointAssociation + * @memberof google.cloud.networksecurity.v1.UpdateFirewallEndpointAssociationRequest + * @instance + */ + UpdateFirewallEndpointAssociationRequest.prototype.firewallEndpointAssociation = null; + + /** + * UpdateFirewallEndpointAssociationRequest requestId. + * @member {string} requestId + * @memberof google.cloud.networksecurity.v1.UpdateFirewallEndpointAssociationRequest + * @instance + */ + UpdateFirewallEndpointAssociationRequest.prototype.requestId = ""; + + /** + * Creates a new UpdateFirewallEndpointAssociationRequest instance using the specified properties. + * @function create + * @memberof google.cloud.networksecurity.v1.UpdateFirewallEndpointAssociationRequest + * @static + * @param {google.cloud.networksecurity.v1.IUpdateFirewallEndpointAssociationRequest=} [properties] Properties to set + * @returns {google.cloud.networksecurity.v1.UpdateFirewallEndpointAssociationRequest} UpdateFirewallEndpointAssociationRequest instance + */ + UpdateFirewallEndpointAssociationRequest.create = function create(properties) { + return new UpdateFirewallEndpointAssociationRequest(properties); + }; + + /** + * Encodes the specified UpdateFirewallEndpointAssociationRequest message. Does not implicitly {@link google.cloud.networksecurity.v1.UpdateFirewallEndpointAssociationRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.networksecurity.v1.UpdateFirewallEndpointAssociationRequest + * @static + * @param {google.cloud.networksecurity.v1.IUpdateFirewallEndpointAssociationRequest} message UpdateFirewallEndpointAssociationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateFirewallEndpointAssociationRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.firewallEndpointAssociation != null && Object.hasOwnProperty.call(message, "firewallEndpointAssociation")) + $root.google.cloud.networksecurity.v1.FirewallEndpointAssociation.encode(message.firewallEndpointAssociation, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.requestId); + return writer; + }; + + /** + * Encodes the specified UpdateFirewallEndpointAssociationRequest message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.UpdateFirewallEndpointAssociationRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.networksecurity.v1.UpdateFirewallEndpointAssociationRequest + * @static + * @param {google.cloud.networksecurity.v1.IUpdateFirewallEndpointAssociationRequest} message UpdateFirewallEndpointAssociationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateFirewallEndpointAssociationRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateFirewallEndpointAssociationRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.networksecurity.v1.UpdateFirewallEndpointAssociationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.networksecurity.v1.UpdateFirewallEndpointAssociationRequest} UpdateFirewallEndpointAssociationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateFirewallEndpointAssociationRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networksecurity.v1.UpdateFirewallEndpointAssociationRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + case 2: { + message.firewallEndpointAssociation = $root.google.cloud.networksecurity.v1.FirewallEndpointAssociation.decode(reader, reader.uint32()); + break; + } + case 3: { + message.requestId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateFirewallEndpointAssociationRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.networksecurity.v1.UpdateFirewallEndpointAssociationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.networksecurity.v1.UpdateFirewallEndpointAssociationRequest} UpdateFirewallEndpointAssociationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateFirewallEndpointAssociationRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateFirewallEndpointAssociationRequest message. + * @function verify + * @memberof google.cloud.networksecurity.v1.UpdateFirewallEndpointAssociationRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateFirewallEndpointAssociationRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + if (message.firewallEndpointAssociation != null && message.hasOwnProperty("firewallEndpointAssociation")) { + var error = $root.google.cloud.networksecurity.v1.FirewallEndpointAssociation.verify(message.firewallEndpointAssociation); + if (error) + return "firewallEndpointAssociation." + error; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + return null; + }; + + /** + * Creates an UpdateFirewallEndpointAssociationRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.networksecurity.v1.UpdateFirewallEndpointAssociationRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.networksecurity.v1.UpdateFirewallEndpointAssociationRequest} UpdateFirewallEndpointAssociationRequest + */ + UpdateFirewallEndpointAssociationRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networksecurity.v1.UpdateFirewallEndpointAssociationRequest) + return object; + var message = new $root.google.cloud.networksecurity.v1.UpdateFirewallEndpointAssociationRequest(); + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.networksecurity.v1.UpdateFirewallEndpointAssociationRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + if (object.firewallEndpointAssociation != null) { + if (typeof object.firewallEndpointAssociation !== "object") + throw TypeError(".google.cloud.networksecurity.v1.UpdateFirewallEndpointAssociationRequest.firewallEndpointAssociation: object expected"); + message.firewallEndpointAssociation = $root.google.cloud.networksecurity.v1.FirewallEndpointAssociation.fromObject(object.firewallEndpointAssociation); + } + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from an UpdateFirewallEndpointAssociationRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.networksecurity.v1.UpdateFirewallEndpointAssociationRequest + * @static + * @param {google.cloud.networksecurity.v1.UpdateFirewallEndpointAssociationRequest} message UpdateFirewallEndpointAssociationRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateFirewallEndpointAssociationRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.updateMask = null; + object.firewallEndpointAssociation = null; + object.requestId = ""; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + if (message.firewallEndpointAssociation != null && message.hasOwnProperty("firewallEndpointAssociation")) + object.firewallEndpointAssociation = $root.google.cloud.networksecurity.v1.FirewallEndpointAssociation.toObject(message.firewallEndpointAssociation, options); + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + return object; + }; + + /** + * Converts this UpdateFirewallEndpointAssociationRequest to JSON. + * @function toJSON + * @memberof google.cloud.networksecurity.v1.UpdateFirewallEndpointAssociationRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateFirewallEndpointAssociationRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateFirewallEndpointAssociationRequest + * @function getTypeUrl + * @memberof google.cloud.networksecurity.v1.UpdateFirewallEndpointAssociationRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateFirewallEndpointAssociationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.networksecurity.v1.UpdateFirewallEndpointAssociationRequest"; + }; + + return UpdateFirewallEndpointAssociationRequest; + })(); + + v1.GatewaySecurityPolicy = (function() { + + /** + * Properties of a GatewaySecurityPolicy. + * @memberof google.cloud.networksecurity.v1 + * @interface IGatewaySecurityPolicy + * @property {string|null} [name] GatewaySecurityPolicy name + * @property {google.protobuf.ITimestamp|null} [createTime] GatewaySecurityPolicy createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] GatewaySecurityPolicy updateTime + * @property {string|null} [description] GatewaySecurityPolicy description + * @property {string|null} [tlsInspectionPolicy] GatewaySecurityPolicy tlsInspectionPolicy + */ + + /** + * Constructs a new GatewaySecurityPolicy. + * @memberof google.cloud.networksecurity.v1 + * @classdesc Represents a GatewaySecurityPolicy. + * @implements IGatewaySecurityPolicy + * @constructor + * @param {google.cloud.networksecurity.v1.IGatewaySecurityPolicy=} [properties] Properties to set + */ + function GatewaySecurityPolicy(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GatewaySecurityPolicy name. + * @member {string} name + * @memberof google.cloud.networksecurity.v1.GatewaySecurityPolicy + * @instance + */ + GatewaySecurityPolicy.prototype.name = ""; + + /** + * GatewaySecurityPolicy createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.networksecurity.v1.GatewaySecurityPolicy + * @instance + */ + GatewaySecurityPolicy.prototype.createTime = null; + + /** + * GatewaySecurityPolicy updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.networksecurity.v1.GatewaySecurityPolicy + * @instance + */ + GatewaySecurityPolicy.prototype.updateTime = null; + + /** + * GatewaySecurityPolicy description. + * @member {string} description + * @memberof google.cloud.networksecurity.v1.GatewaySecurityPolicy + * @instance + */ + GatewaySecurityPolicy.prototype.description = ""; + + /** + * GatewaySecurityPolicy tlsInspectionPolicy. + * @member {string} tlsInspectionPolicy + * @memberof google.cloud.networksecurity.v1.GatewaySecurityPolicy + * @instance + */ + GatewaySecurityPolicy.prototype.tlsInspectionPolicy = ""; + + /** + * Creates a new GatewaySecurityPolicy instance using the specified properties. + * @function create + * @memberof google.cloud.networksecurity.v1.GatewaySecurityPolicy + * @static + * @param {google.cloud.networksecurity.v1.IGatewaySecurityPolicy=} [properties] Properties to set + * @returns {google.cloud.networksecurity.v1.GatewaySecurityPolicy} GatewaySecurityPolicy instance + */ + GatewaySecurityPolicy.create = function create(properties) { + return new GatewaySecurityPolicy(properties); + }; + + /** + * Encodes the specified GatewaySecurityPolicy message. Does not implicitly {@link google.cloud.networksecurity.v1.GatewaySecurityPolicy.verify|verify} messages. + * @function encode + * @memberof google.cloud.networksecurity.v1.GatewaySecurityPolicy + * @static + * @param {google.cloud.networksecurity.v1.IGatewaySecurityPolicy} message GatewaySecurityPolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GatewaySecurityPolicy.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.description); + if (message.tlsInspectionPolicy != null && Object.hasOwnProperty.call(message, "tlsInspectionPolicy")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.tlsInspectionPolicy); + return writer; + }; + + /** + * Encodes the specified GatewaySecurityPolicy message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.GatewaySecurityPolicy.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.networksecurity.v1.GatewaySecurityPolicy + * @static + * @param {google.cloud.networksecurity.v1.IGatewaySecurityPolicy} message GatewaySecurityPolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GatewaySecurityPolicy.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GatewaySecurityPolicy message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.networksecurity.v1.GatewaySecurityPolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.networksecurity.v1.GatewaySecurityPolicy} GatewaySecurityPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GatewaySecurityPolicy.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networksecurity.v1.GatewaySecurityPolicy(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 3: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 4: { + message.description = reader.string(); + break; + } + case 5: { + message.tlsInspectionPolicy = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GatewaySecurityPolicy message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.networksecurity.v1.GatewaySecurityPolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.networksecurity.v1.GatewaySecurityPolicy} GatewaySecurityPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GatewaySecurityPolicy.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GatewaySecurityPolicy message. + * @function verify + * @memberof google.cloud.networksecurity.v1.GatewaySecurityPolicy + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GatewaySecurityPolicy.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime); + if (error) + return "updateTime." + error; + } + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.tlsInspectionPolicy != null && message.hasOwnProperty("tlsInspectionPolicy")) + if (!$util.isString(message.tlsInspectionPolicy)) + return "tlsInspectionPolicy: string expected"; + return null; + }; + + /** + * Creates a GatewaySecurityPolicy message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.networksecurity.v1.GatewaySecurityPolicy + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.networksecurity.v1.GatewaySecurityPolicy} GatewaySecurityPolicy + */ + GatewaySecurityPolicy.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networksecurity.v1.GatewaySecurityPolicy) + return object; + var message = new $root.google.cloud.networksecurity.v1.GatewaySecurityPolicy(); + if (object.name != null) + message.name = String(object.name); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.networksecurity.v1.GatewaySecurityPolicy.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.updateTime != null) { + if (typeof object.updateTime !== "object") + throw TypeError(".google.cloud.networksecurity.v1.GatewaySecurityPolicy.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + if (object.description != null) + message.description = String(object.description); + if (object.tlsInspectionPolicy != null) + message.tlsInspectionPolicy = String(object.tlsInspectionPolicy); + return message; + }; + + /** + * Creates a plain object from a GatewaySecurityPolicy message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.networksecurity.v1.GatewaySecurityPolicy + * @static + * @param {google.cloud.networksecurity.v1.GatewaySecurityPolicy} message GatewaySecurityPolicy + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GatewaySecurityPolicy.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.createTime = null; + object.updateTime = null; + object.description = ""; + object.tlsInspectionPolicy = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.updateTime != null && message.hasOwnProperty("updateTime")) + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.tlsInspectionPolicy != null && message.hasOwnProperty("tlsInspectionPolicy")) + object.tlsInspectionPolicy = message.tlsInspectionPolicy; + return object; + }; + + /** + * Converts this GatewaySecurityPolicy to JSON. + * @function toJSON + * @memberof google.cloud.networksecurity.v1.GatewaySecurityPolicy + * @instance + * @returns {Object.} JSON object + */ + GatewaySecurityPolicy.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GatewaySecurityPolicy + * @function getTypeUrl + * @memberof google.cloud.networksecurity.v1.GatewaySecurityPolicy + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GatewaySecurityPolicy.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.networksecurity.v1.GatewaySecurityPolicy"; + }; + + return GatewaySecurityPolicy; + })(); + + v1.CreateGatewaySecurityPolicyRequest = (function() { + + /** + * Properties of a CreateGatewaySecurityPolicyRequest. + * @memberof google.cloud.networksecurity.v1 + * @interface ICreateGatewaySecurityPolicyRequest + * @property {string|null} [parent] CreateGatewaySecurityPolicyRequest parent + * @property {string|null} [gatewaySecurityPolicyId] CreateGatewaySecurityPolicyRequest gatewaySecurityPolicyId + * @property {google.cloud.networksecurity.v1.IGatewaySecurityPolicy|null} [gatewaySecurityPolicy] CreateGatewaySecurityPolicyRequest gatewaySecurityPolicy + */ + + /** + * Constructs a new CreateGatewaySecurityPolicyRequest. + * @memberof google.cloud.networksecurity.v1 + * @classdesc Represents a CreateGatewaySecurityPolicyRequest. + * @implements ICreateGatewaySecurityPolicyRequest + * @constructor + * @param {google.cloud.networksecurity.v1.ICreateGatewaySecurityPolicyRequest=} [properties] Properties to set + */ + function CreateGatewaySecurityPolicyRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateGatewaySecurityPolicyRequest parent. + * @member {string} parent + * @memberof google.cloud.networksecurity.v1.CreateGatewaySecurityPolicyRequest + * @instance + */ + CreateGatewaySecurityPolicyRequest.prototype.parent = ""; + + /** + * CreateGatewaySecurityPolicyRequest gatewaySecurityPolicyId. + * @member {string} gatewaySecurityPolicyId + * @memberof google.cloud.networksecurity.v1.CreateGatewaySecurityPolicyRequest + * @instance + */ + CreateGatewaySecurityPolicyRequest.prototype.gatewaySecurityPolicyId = ""; + + /** + * CreateGatewaySecurityPolicyRequest gatewaySecurityPolicy. + * @member {google.cloud.networksecurity.v1.IGatewaySecurityPolicy|null|undefined} gatewaySecurityPolicy + * @memberof google.cloud.networksecurity.v1.CreateGatewaySecurityPolicyRequest + * @instance + */ + CreateGatewaySecurityPolicyRequest.prototype.gatewaySecurityPolicy = null; + + /** + * Creates a new CreateGatewaySecurityPolicyRequest instance using the specified properties. + * @function create + * @memberof google.cloud.networksecurity.v1.CreateGatewaySecurityPolicyRequest + * @static + * @param {google.cloud.networksecurity.v1.ICreateGatewaySecurityPolicyRequest=} [properties] Properties to set + * @returns {google.cloud.networksecurity.v1.CreateGatewaySecurityPolicyRequest} CreateGatewaySecurityPolicyRequest instance + */ + CreateGatewaySecurityPolicyRequest.create = function create(properties) { + return new CreateGatewaySecurityPolicyRequest(properties); + }; + + /** + * Encodes the specified CreateGatewaySecurityPolicyRequest message. Does not implicitly {@link google.cloud.networksecurity.v1.CreateGatewaySecurityPolicyRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.networksecurity.v1.CreateGatewaySecurityPolicyRequest + * @static + * @param {google.cloud.networksecurity.v1.ICreateGatewaySecurityPolicyRequest} message CreateGatewaySecurityPolicyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateGatewaySecurityPolicyRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.gatewaySecurityPolicyId != null && Object.hasOwnProperty.call(message, "gatewaySecurityPolicyId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.gatewaySecurityPolicyId); + if (message.gatewaySecurityPolicy != null && Object.hasOwnProperty.call(message, "gatewaySecurityPolicy")) + $root.google.cloud.networksecurity.v1.GatewaySecurityPolicy.encode(message.gatewaySecurityPolicy, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreateGatewaySecurityPolicyRequest message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.CreateGatewaySecurityPolicyRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.networksecurity.v1.CreateGatewaySecurityPolicyRequest + * @static + * @param {google.cloud.networksecurity.v1.ICreateGatewaySecurityPolicyRequest} message CreateGatewaySecurityPolicyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateGatewaySecurityPolicyRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateGatewaySecurityPolicyRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.networksecurity.v1.CreateGatewaySecurityPolicyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.networksecurity.v1.CreateGatewaySecurityPolicyRequest} CreateGatewaySecurityPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateGatewaySecurityPolicyRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networksecurity.v1.CreateGatewaySecurityPolicyRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.gatewaySecurityPolicyId = reader.string(); + break; + } + case 3: { + message.gatewaySecurityPolicy = $root.google.cloud.networksecurity.v1.GatewaySecurityPolicy.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateGatewaySecurityPolicyRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.networksecurity.v1.CreateGatewaySecurityPolicyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.networksecurity.v1.CreateGatewaySecurityPolicyRequest} CreateGatewaySecurityPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateGatewaySecurityPolicyRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateGatewaySecurityPolicyRequest message. + * @function verify + * @memberof google.cloud.networksecurity.v1.CreateGatewaySecurityPolicyRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateGatewaySecurityPolicyRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.gatewaySecurityPolicyId != null && message.hasOwnProperty("gatewaySecurityPolicyId")) + if (!$util.isString(message.gatewaySecurityPolicyId)) + return "gatewaySecurityPolicyId: string expected"; + if (message.gatewaySecurityPolicy != null && message.hasOwnProperty("gatewaySecurityPolicy")) { + var error = $root.google.cloud.networksecurity.v1.GatewaySecurityPolicy.verify(message.gatewaySecurityPolicy); + if (error) + return "gatewaySecurityPolicy." + error; + } + return null; + }; + + /** + * Creates a CreateGatewaySecurityPolicyRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.networksecurity.v1.CreateGatewaySecurityPolicyRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.networksecurity.v1.CreateGatewaySecurityPolicyRequest} CreateGatewaySecurityPolicyRequest + */ + CreateGatewaySecurityPolicyRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networksecurity.v1.CreateGatewaySecurityPolicyRequest) + return object; + var message = new $root.google.cloud.networksecurity.v1.CreateGatewaySecurityPolicyRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.gatewaySecurityPolicyId != null) + message.gatewaySecurityPolicyId = String(object.gatewaySecurityPolicyId); + if (object.gatewaySecurityPolicy != null) { + if (typeof object.gatewaySecurityPolicy !== "object") + throw TypeError(".google.cloud.networksecurity.v1.CreateGatewaySecurityPolicyRequest.gatewaySecurityPolicy: object expected"); + message.gatewaySecurityPolicy = $root.google.cloud.networksecurity.v1.GatewaySecurityPolicy.fromObject(object.gatewaySecurityPolicy); + } + return message; + }; + + /** + * Creates a plain object from a CreateGatewaySecurityPolicyRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.networksecurity.v1.CreateGatewaySecurityPolicyRequest + * @static + * @param {google.cloud.networksecurity.v1.CreateGatewaySecurityPolicyRequest} message CreateGatewaySecurityPolicyRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateGatewaySecurityPolicyRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.gatewaySecurityPolicyId = ""; + object.gatewaySecurityPolicy = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.gatewaySecurityPolicyId != null && message.hasOwnProperty("gatewaySecurityPolicyId")) + object.gatewaySecurityPolicyId = message.gatewaySecurityPolicyId; + if (message.gatewaySecurityPolicy != null && message.hasOwnProperty("gatewaySecurityPolicy")) + object.gatewaySecurityPolicy = $root.google.cloud.networksecurity.v1.GatewaySecurityPolicy.toObject(message.gatewaySecurityPolicy, options); + return object; + }; + + /** + * Converts this CreateGatewaySecurityPolicyRequest to JSON. + * @function toJSON + * @memberof google.cloud.networksecurity.v1.CreateGatewaySecurityPolicyRequest + * @instance + * @returns {Object.} JSON object + */ + CreateGatewaySecurityPolicyRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateGatewaySecurityPolicyRequest + * @function getTypeUrl + * @memberof google.cloud.networksecurity.v1.CreateGatewaySecurityPolicyRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateGatewaySecurityPolicyRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.networksecurity.v1.CreateGatewaySecurityPolicyRequest"; + }; + + return CreateGatewaySecurityPolicyRequest; + })(); + + v1.ListGatewaySecurityPoliciesRequest = (function() { + + /** + * Properties of a ListGatewaySecurityPoliciesRequest. + * @memberof google.cloud.networksecurity.v1 + * @interface IListGatewaySecurityPoliciesRequest + * @property {string|null} [parent] ListGatewaySecurityPoliciesRequest parent + * @property {number|null} [pageSize] ListGatewaySecurityPoliciesRequest pageSize + * @property {string|null} [pageToken] ListGatewaySecurityPoliciesRequest pageToken + */ + + /** + * Constructs a new ListGatewaySecurityPoliciesRequest. + * @memberof google.cloud.networksecurity.v1 + * @classdesc Represents a ListGatewaySecurityPoliciesRequest. + * @implements IListGatewaySecurityPoliciesRequest + * @constructor + * @param {google.cloud.networksecurity.v1.IListGatewaySecurityPoliciesRequest=} [properties] Properties to set + */ + function ListGatewaySecurityPoliciesRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListGatewaySecurityPoliciesRequest parent. + * @member {string} parent + * @memberof google.cloud.networksecurity.v1.ListGatewaySecurityPoliciesRequest + * @instance + */ + ListGatewaySecurityPoliciesRequest.prototype.parent = ""; + + /** + * ListGatewaySecurityPoliciesRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.networksecurity.v1.ListGatewaySecurityPoliciesRequest + * @instance + */ + ListGatewaySecurityPoliciesRequest.prototype.pageSize = 0; + + /** + * ListGatewaySecurityPoliciesRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.networksecurity.v1.ListGatewaySecurityPoliciesRequest + * @instance + */ + ListGatewaySecurityPoliciesRequest.prototype.pageToken = ""; + + /** + * Creates a new ListGatewaySecurityPoliciesRequest instance using the specified properties. + * @function create + * @memberof google.cloud.networksecurity.v1.ListGatewaySecurityPoliciesRequest + * @static + * @param {google.cloud.networksecurity.v1.IListGatewaySecurityPoliciesRequest=} [properties] Properties to set + * @returns {google.cloud.networksecurity.v1.ListGatewaySecurityPoliciesRequest} ListGatewaySecurityPoliciesRequest instance + */ + ListGatewaySecurityPoliciesRequest.create = function create(properties) { + return new ListGatewaySecurityPoliciesRequest(properties); + }; + + /** + * Encodes the specified ListGatewaySecurityPoliciesRequest message. Does not implicitly {@link google.cloud.networksecurity.v1.ListGatewaySecurityPoliciesRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.networksecurity.v1.ListGatewaySecurityPoliciesRequest + * @static + * @param {google.cloud.networksecurity.v1.IListGatewaySecurityPoliciesRequest} message ListGatewaySecurityPoliciesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListGatewaySecurityPoliciesRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + return writer; + }; + + /** + * Encodes the specified ListGatewaySecurityPoliciesRequest message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.ListGatewaySecurityPoliciesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.networksecurity.v1.ListGatewaySecurityPoliciesRequest + * @static + * @param {google.cloud.networksecurity.v1.IListGatewaySecurityPoliciesRequest} message ListGatewaySecurityPoliciesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListGatewaySecurityPoliciesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListGatewaySecurityPoliciesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.networksecurity.v1.ListGatewaySecurityPoliciesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.networksecurity.v1.ListGatewaySecurityPoliciesRequest} ListGatewaySecurityPoliciesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListGatewaySecurityPoliciesRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networksecurity.v1.ListGatewaySecurityPoliciesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListGatewaySecurityPoliciesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.networksecurity.v1.ListGatewaySecurityPoliciesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.networksecurity.v1.ListGatewaySecurityPoliciesRequest} ListGatewaySecurityPoliciesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListGatewaySecurityPoliciesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListGatewaySecurityPoliciesRequest message. + * @function verify + * @memberof google.cloud.networksecurity.v1.ListGatewaySecurityPoliciesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListGatewaySecurityPoliciesRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + return null; + }; + + /** + * Creates a ListGatewaySecurityPoliciesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.networksecurity.v1.ListGatewaySecurityPoliciesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.networksecurity.v1.ListGatewaySecurityPoliciesRequest} ListGatewaySecurityPoliciesRequest + */ + ListGatewaySecurityPoliciesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networksecurity.v1.ListGatewaySecurityPoliciesRequest) + return object; + var message = new $root.google.cloud.networksecurity.v1.ListGatewaySecurityPoliciesRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + return message; + }; + + /** + * Creates a plain object from a ListGatewaySecurityPoliciesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.networksecurity.v1.ListGatewaySecurityPoliciesRequest + * @static + * @param {google.cloud.networksecurity.v1.ListGatewaySecurityPoliciesRequest} message ListGatewaySecurityPoliciesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListGatewaySecurityPoliciesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + return object; + }; + + /** + * Converts this ListGatewaySecurityPoliciesRequest to JSON. + * @function toJSON + * @memberof google.cloud.networksecurity.v1.ListGatewaySecurityPoliciesRequest + * @instance + * @returns {Object.} JSON object + */ + ListGatewaySecurityPoliciesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListGatewaySecurityPoliciesRequest + * @function getTypeUrl + * @memberof google.cloud.networksecurity.v1.ListGatewaySecurityPoliciesRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListGatewaySecurityPoliciesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.networksecurity.v1.ListGatewaySecurityPoliciesRequest"; + }; + + return ListGatewaySecurityPoliciesRequest; + })(); + + v1.ListGatewaySecurityPoliciesResponse = (function() { + + /** + * Properties of a ListGatewaySecurityPoliciesResponse. + * @memberof google.cloud.networksecurity.v1 + * @interface IListGatewaySecurityPoliciesResponse + * @property {Array.|null} [gatewaySecurityPolicies] ListGatewaySecurityPoliciesResponse gatewaySecurityPolicies + * @property {string|null} [nextPageToken] ListGatewaySecurityPoliciesResponse nextPageToken + * @property {Array.|null} [unreachable] ListGatewaySecurityPoliciesResponse unreachable + */ + + /** + * Constructs a new ListGatewaySecurityPoliciesResponse. + * @memberof google.cloud.networksecurity.v1 + * @classdesc Represents a ListGatewaySecurityPoliciesResponse. + * @implements IListGatewaySecurityPoliciesResponse + * @constructor + * @param {google.cloud.networksecurity.v1.IListGatewaySecurityPoliciesResponse=} [properties] Properties to set + */ + function ListGatewaySecurityPoliciesResponse(properties) { + this.gatewaySecurityPolicies = []; + this.unreachable = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListGatewaySecurityPoliciesResponse gatewaySecurityPolicies. + * @member {Array.} gatewaySecurityPolicies + * @memberof google.cloud.networksecurity.v1.ListGatewaySecurityPoliciesResponse + * @instance + */ + ListGatewaySecurityPoliciesResponse.prototype.gatewaySecurityPolicies = $util.emptyArray; + + /** + * ListGatewaySecurityPoliciesResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.networksecurity.v1.ListGatewaySecurityPoliciesResponse + * @instance + */ + ListGatewaySecurityPoliciesResponse.prototype.nextPageToken = ""; + + /** + * ListGatewaySecurityPoliciesResponse unreachable. + * @member {Array.} unreachable + * @memberof google.cloud.networksecurity.v1.ListGatewaySecurityPoliciesResponse + * @instance + */ + ListGatewaySecurityPoliciesResponse.prototype.unreachable = $util.emptyArray; + + /** + * Creates a new ListGatewaySecurityPoliciesResponse instance using the specified properties. + * @function create + * @memberof google.cloud.networksecurity.v1.ListGatewaySecurityPoliciesResponse + * @static + * @param {google.cloud.networksecurity.v1.IListGatewaySecurityPoliciesResponse=} [properties] Properties to set + * @returns {google.cloud.networksecurity.v1.ListGatewaySecurityPoliciesResponse} ListGatewaySecurityPoliciesResponse instance + */ + ListGatewaySecurityPoliciesResponse.create = function create(properties) { + return new ListGatewaySecurityPoliciesResponse(properties); + }; + + /** + * Encodes the specified ListGatewaySecurityPoliciesResponse message. Does not implicitly {@link google.cloud.networksecurity.v1.ListGatewaySecurityPoliciesResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.networksecurity.v1.ListGatewaySecurityPoliciesResponse + * @static + * @param {google.cloud.networksecurity.v1.IListGatewaySecurityPoliciesResponse} message ListGatewaySecurityPoliciesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListGatewaySecurityPoliciesResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.gatewaySecurityPolicies != null && message.gatewaySecurityPolicies.length) + for (var i = 0; i < message.gatewaySecurityPolicies.length; ++i) + $root.google.cloud.networksecurity.v1.GatewaySecurityPolicy.encode(message.gatewaySecurityPolicies[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + if (message.unreachable != null && message.unreachable.length) + for (var i = 0; i < message.unreachable.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.unreachable[i]); + return writer; + }; + + /** + * Encodes the specified ListGatewaySecurityPoliciesResponse message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.ListGatewaySecurityPoliciesResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.networksecurity.v1.ListGatewaySecurityPoliciesResponse + * @static + * @param {google.cloud.networksecurity.v1.IListGatewaySecurityPoliciesResponse} message ListGatewaySecurityPoliciesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListGatewaySecurityPoliciesResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListGatewaySecurityPoliciesResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.networksecurity.v1.ListGatewaySecurityPoliciesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.networksecurity.v1.ListGatewaySecurityPoliciesResponse} ListGatewaySecurityPoliciesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListGatewaySecurityPoliciesResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networksecurity.v1.ListGatewaySecurityPoliciesResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.gatewaySecurityPolicies && message.gatewaySecurityPolicies.length)) + message.gatewaySecurityPolicies = []; + message.gatewaySecurityPolicies.push($root.google.cloud.networksecurity.v1.GatewaySecurityPolicy.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + case 3: { + if (!(message.unreachable && message.unreachable.length)) + message.unreachable = []; + message.unreachable.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListGatewaySecurityPoliciesResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.networksecurity.v1.ListGatewaySecurityPoliciesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.networksecurity.v1.ListGatewaySecurityPoliciesResponse} ListGatewaySecurityPoliciesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListGatewaySecurityPoliciesResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListGatewaySecurityPoliciesResponse message. + * @function verify + * @memberof google.cloud.networksecurity.v1.ListGatewaySecurityPoliciesResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListGatewaySecurityPoliciesResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.gatewaySecurityPolicies != null && message.hasOwnProperty("gatewaySecurityPolicies")) { + if (!Array.isArray(message.gatewaySecurityPolicies)) + return "gatewaySecurityPolicies: array expected"; + for (var i = 0; i < message.gatewaySecurityPolicies.length; ++i) { + var error = $root.google.cloud.networksecurity.v1.GatewaySecurityPolicy.verify(message.gatewaySecurityPolicies[i]); + if (error) + return "gatewaySecurityPolicies." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + if (message.unreachable != null && message.hasOwnProperty("unreachable")) { + if (!Array.isArray(message.unreachable)) + return "unreachable: array expected"; + for (var i = 0; i < message.unreachable.length; ++i) + if (!$util.isString(message.unreachable[i])) + return "unreachable: string[] expected"; + } + return null; + }; + + /** + * Creates a ListGatewaySecurityPoliciesResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.networksecurity.v1.ListGatewaySecurityPoliciesResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.networksecurity.v1.ListGatewaySecurityPoliciesResponse} ListGatewaySecurityPoliciesResponse + */ + ListGatewaySecurityPoliciesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networksecurity.v1.ListGatewaySecurityPoliciesResponse) + return object; + var message = new $root.google.cloud.networksecurity.v1.ListGatewaySecurityPoliciesResponse(); + if (object.gatewaySecurityPolicies) { + if (!Array.isArray(object.gatewaySecurityPolicies)) + throw TypeError(".google.cloud.networksecurity.v1.ListGatewaySecurityPoliciesResponse.gatewaySecurityPolicies: array expected"); + message.gatewaySecurityPolicies = []; + for (var i = 0; i < object.gatewaySecurityPolicies.length; ++i) { + if (typeof object.gatewaySecurityPolicies[i] !== "object") + throw TypeError(".google.cloud.networksecurity.v1.ListGatewaySecurityPoliciesResponse.gatewaySecurityPolicies: object expected"); + message.gatewaySecurityPolicies[i] = $root.google.cloud.networksecurity.v1.GatewaySecurityPolicy.fromObject(object.gatewaySecurityPolicies[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.unreachable) { + if (!Array.isArray(object.unreachable)) + throw TypeError(".google.cloud.networksecurity.v1.ListGatewaySecurityPoliciesResponse.unreachable: array expected"); + message.unreachable = []; + for (var i = 0; i < object.unreachable.length; ++i) + message.unreachable[i] = String(object.unreachable[i]); + } + return message; + }; + + /** + * Creates a plain object from a ListGatewaySecurityPoliciesResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.networksecurity.v1.ListGatewaySecurityPoliciesResponse + * @static + * @param {google.cloud.networksecurity.v1.ListGatewaySecurityPoliciesResponse} message ListGatewaySecurityPoliciesResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListGatewaySecurityPoliciesResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.gatewaySecurityPolicies = []; + object.unreachable = []; + } + if (options.defaults) + object.nextPageToken = ""; + if (message.gatewaySecurityPolicies && message.gatewaySecurityPolicies.length) { + object.gatewaySecurityPolicies = []; + for (var j = 0; j < message.gatewaySecurityPolicies.length; ++j) + object.gatewaySecurityPolicies[j] = $root.google.cloud.networksecurity.v1.GatewaySecurityPolicy.toObject(message.gatewaySecurityPolicies[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + if (message.unreachable && message.unreachable.length) { + object.unreachable = []; + for (var j = 0; j < message.unreachable.length; ++j) + object.unreachable[j] = message.unreachable[j]; + } + return object; + }; + + /** + * Converts this ListGatewaySecurityPoliciesResponse to JSON. + * @function toJSON + * @memberof google.cloud.networksecurity.v1.ListGatewaySecurityPoliciesResponse + * @instance + * @returns {Object.} JSON object + */ + ListGatewaySecurityPoliciesResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListGatewaySecurityPoliciesResponse + * @function getTypeUrl + * @memberof google.cloud.networksecurity.v1.ListGatewaySecurityPoliciesResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListGatewaySecurityPoliciesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.networksecurity.v1.ListGatewaySecurityPoliciesResponse"; + }; + + return ListGatewaySecurityPoliciesResponse; + })(); + + v1.GetGatewaySecurityPolicyRequest = (function() { + + /** + * Properties of a GetGatewaySecurityPolicyRequest. + * @memberof google.cloud.networksecurity.v1 + * @interface IGetGatewaySecurityPolicyRequest + * @property {string|null} [name] GetGatewaySecurityPolicyRequest name + */ + + /** + * Constructs a new GetGatewaySecurityPolicyRequest. + * @memberof google.cloud.networksecurity.v1 + * @classdesc Represents a GetGatewaySecurityPolicyRequest. + * @implements IGetGatewaySecurityPolicyRequest + * @constructor + * @param {google.cloud.networksecurity.v1.IGetGatewaySecurityPolicyRequest=} [properties] Properties to set + */ + function GetGatewaySecurityPolicyRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetGatewaySecurityPolicyRequest name. + * @member {string} name + * @memberof google.cloud.networksecurity.v1.GetGatewaySecurityPolicyRequest + * @instance + */ + GetGatewaySecurityPolicyRequest.prototype.name = ""; + + /** + * Creates a new GetGatewaySecurityPolicyRequest instance using the specified properties. + * @function create + * @memberof google.cloud.networksecurity.v1.GetGatewaySecurityPolicyRequest + * @static + * @param {google.cloud.networksecurity.v1.IGetGatewaySecurityPolicyRequest=} [properties] Properties to set + * @returns {google.cloud.networksecurity.v1.GetGatewaySecurityPolicyRequest} GetGatewaySecurityPolicyRequest instance + */ + GetGatewaySecurityPolicyRequest.create = function create(properties) { + return new GetGatewaySecurityPolicyRequest(properties); + }; + + /** + * Encodes the specified GetGatewaySecurityPolicyRequest message. Does not implicitly {@link google.cloud.networksecurity.v1.GetGatewaySecurityPolicyRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.networksecurity.v1.GetGatewaySecurityPolicyRequest + * @static + * @param {google.cloud.networksecurity.v1.IGetGatewaySecurityPolicyRequest} message GetGatewaySecurityPolicyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetGatewaySecurityPolicyRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified GetGatewaySecurityPolicyRequest message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.GetGatewaySecurityPolicyRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.networksecurity.v1.GetGatewaySecurityPolicyRequest + * @static + * @param {google.cloud.networksecurity.v1.IGetGatewaySecurityPolicyRequest} message GetGatewaySecurityPolicyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetGatewaySecurityPolicyRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetGatewaySecurityPolicyRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.networksecurity.v1.GetGatewaySecurityPolicyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.networksecurity.v1.GetGatewaySecurityPolicyRequest} GetGatewaySecurityPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetGatewaySecurityPolicyRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networksecurity.v1.GetGatewaySecurityPolicyRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetGatewaySecurityPolicyRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.networksecurity.v1.GetGatewaySecurityPolicyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.networksecurity.v1.GetGatewaySecurityPolicyRequest} GetGatewaySecurityPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetGatewaySecurityPolicyRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetGatewaySecurityPolicyRequest message. + * @function verify + * @memberof google.cloud.networksecurity.v1.GetGatewaySecurityPolicyRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetGatewaySecurityPolicyRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a GetGatewaySecurityPolicyRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.networksecurity.v1.GetGatewaySecurityPolicyRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.networksecurity.v1.GetGatewaySecurityPolicyRequest} GetGatewaySecurityPolicyRequest + */ + GetGatewaySecurityPolicyRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networksecurity.v1.GetGatewaySecurityPolicyRequest) + return object; + var message = new $root.google.cloud.networksecurity.v1.GetGatewaySecurityPolicyRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetGatewaySecurityPolicyRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.networksecurity.v1.GetGatewaySecurityPolicyRequest + * @static + * @param {google.cloud.networksecurity.v1.GetGatewaySecurityPolicyRequest} message GetGatewaySecurityPolicyRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetGatewaySecurityPolicyRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this GetGatewaySecurityPolicyRequest to JSON. + * @function toJSON + * @memberof google.cloud.networksecurity.v1.GetGatewaySecurityPolicyRequest + * @instance + * @returns {Object.} JSON object + */ + GetGatewaySecurityPolicyRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetGatewaySecurityPolicyRequest + * @function getTypeUrl + * @memberof google.cloud.networksecurity.v1.GetGatewaySecurityPolicyRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetGatewaySecurityPolicyRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.networksecurity.v1.GetGatewaySecurityPolicyRequest"; + }; + + return GetGatewaySecurityPolicyRequest; + })(); + + v1.DeleteGatewaySecurityPolicyRequest = (function() { + + /** + * Properties of a DeleteGatewaySecurityPolicyRequest. + * @memberof google.cloud.networksecurity.v1 + * @interface IDeleteGatewaySecurityPolicyRequest + * @property {string|null} [name] DeleteGatewaySecurityPolicyRequest name + */ + + /** + * Constructs a new DeleteGatewaySecurityPolicyRequest. + * @memberof google.cloud.networksecurity.v1 + * @classdesc Represents a DeleteGatewaySecurityPolicyRequest. + * @implements IDeleteGatewaySecurityPolicyRequest + * @constructor + * @param {google.cloud.networksecurity.v1.IDeleteGatewaySecurityPolicyRequest=} [properties] Properties to set + */ + function DeleteGatewaySecurityPolicyRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteGatewaySecurityPolicyRequest name. + * @member {string} name + * @memberof google.cloud.networksecurity.v1.DeleteGatewaySecurityPolicyRequest + * @instance + */ + DeleteGatewaySecurityPolicyRequest.prototype.name = ""; + + /** + * Creates a new DeleteGatewaySecurityPolicyRequest instance using the specified properties. + * @function create + * @memberof google.cloud.networksecurity.v1.DeleteGatewaySecurityPolicyRequest + * @static + * @param {google.cloud.networksecurity.v1.IDeleteGatewaySecurityPolicyRequest=} [properties] Properties to set + * @returns {google.cloud.networksecurity.v1.DeleteGatewaySecurityPolicyRequest} DeleteGatewaySecurityPolicyRequest instance + */ + DeleteGatewaySecurityPolicyRequest.create = function create(properties) { + return new DeleteGatewaySecurityPolicyRequest(properties); + }; + + /** + * Encodes the specified DeleteGatewaySecurityPolicyRequest message. Does not implicitly {@link google.cloud.networksecurity.v1.DeleteGatewaySecurityPolicyRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.networksecurity.v1.DeleteGatewaySecurityPolicyRequest + * @static + * @param {google.cloud.networksecurity.v1.IDeleteGatewaySecurityPolicyRequest} message DeleteGatewaySecurityPolicyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteGatewaySecurityPolicyRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified DeleteGatewaySecurityPolicyRequest message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.DeleteGatewaySecurityPolicyRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.networksecurity.v1.DeleteGatewaySecurityPolicyRequest + * @static + * @param {google.cloud.networksecurity.v1.IDeleteGatewaySecurityPolicyRequest} message DeleteGatewaySecurityPolicyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteGatewaySecurityPolicyRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteGatewaySecurityPolicyRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.networksecurity.v1.DeleteGatewaySecurityPolicyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.networksecurity.v1.DeleteGatewaySecurityPolicyRequest} DeleteGatewaySecurityPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteGatewaySecurityPolicyRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networksecurity.v1.DeleteGatewaySecurityPolicyRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteGatewaySecurityPolicyRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.networksecurity.v1.DeleteGatewaySecurityPolicyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.networksecurity.v1.DeleteGatewaySecurityPolicyRequest} DeleteGatewaySecurityPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteGatewaySecurityPolicyRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteGatewaySecurityPolicyRequest message. + * @function verify + * @memberof google.cloud.networksecurity.v1.DeleteGatewaySecurityPolicyRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteGatewaySecurityPolicyRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a DeleteGatewaySecurityPolicyRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.networksecurity.v1.DeleteGatewaySecurityPolicyRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.networksecurity.v1.DeleteGatewaySecurityPolicyRequest} DeleteGatewaySecurityPolicyRequest + */ + DeleteGatewaySecurityPolicyRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networksecurity.v1.DeleteGatewaySecurityPolicyRequest) + return object; + var message = new $root.google.cloud.networksecurity.v1.DeleteGatewaySecurityPolicyRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a DeleteGatewaySecurityPolicyRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.networksecurity.v1.DeleteGatewaySecurityPolicyRequest + * @static + * @param {google.cloud.networksecurity.v1.DeleteGatewaySecurityPolicyRequest} message DeleteGatewaySecurityPolicyRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteGatewaySecurityPolicyRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this DeleteGatewaySecurityPolicyRequest to JSON. + * @function toJSON + * @memberof google.cloud.networksecurity.v1.DeleteGatewaySecurityPolicyRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteGatewaySecurityPolicyRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteGatewaySecurityPolicyRequest + * @function getTypeUrl + * @memberof google.cloud.networksecurity.v1.DeleteGatewaySecurityPolicyRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteGatewaySecurityPolicyRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.networksecurity.v1.DeleteGatewaySecurityPolicyRequest"; + }; + + return DeleteGatewaySecurityPolicyRequest; + })(); + + v1.UpdateGatewaySecurityPolicyRequest = (function() { + + /** + * Properties of an UpdateGatewaySecurityPolicyRequest. + * @memberof google.cloud.networksecurity.v1 + * @interface IUpdateGatewaySecurityPolicyRequest + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateGatewaySecurityPolicyRequest updateMask + * @property {google.cloud.networksecurity.v1.IGatewaySecurityPolicy|null} [gatewaySecurityPolicy] UpdateGatewaySecurityPolicyRequest gatewaySecurityPolicy + */ + + /** + * Constructs a new UpdateGatewaySecurityPolicyRequest. + * @memberof google.cloud.networksecurity.v1 + * @classdesc Represents an UpdateGatewaySecurityPolicyRequest. + * @implements IUpdateGatewaySecurityPolicyRequest + * @constructor + * @param {google.cloud.networksecurity.v1.IUpdateGatewaySecurityPolicyRequest=} [properties] Properties to set + */ + function UpdateGatewaySecurityPolicyRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateGatewaySecurityPolicyRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.networksecurity.v1.UpdateGatewaySecurityPolicyRequest + * @instance + */ + UpdateGatewaySecurityPolicyRequest.prototype.updateMask = null; + + /** + * UpdateGatewaySecurityPolicyRequest gatewaySecurityPolicy. + * @member {google.cloud.networksecurity.v1.IGatewaySecurityPolicy|null|undefined} gatewaySecurityPolicy + * @memberof google.cloud.networksecurity.v1.UpdateGatewaySecurityPolicyRequest + * @instance + */ + UpdateGatewaySecurityPolicyRequest.prototype.gatewaySecurityPolicy = null; + + /** + * Creates a new UpdateGatewaySecurityPolicyRequest instance using the specified properties. + * @function create + * @memberof google.cloud.networksecurity.v1.UpdateGatewaySecurityPolicyRequest + * @static + * @param {google.cloud.networksecurity.v1.IUpdateGatewaySecurityPolicyRequest=} [properties] Properties to set + * @returns {google.cloud.networksecurity.v1.UpdateGatewaySecurityPolicyRequest} UpdateGatewaySecurityPolicyRequest instance + */ + UpdateGatewaySecurityPolicyRequest.create = function create(properties) { + return new UpdateGatewaySecurityPolicyRequest(properties); + }; + + /** + * Encodes the specified UpdateGatewaySecurityPolicyRequest message. Does not implicitly {@link google.cloud.networksecurity.v1.UpdateGatewaySecurityPolicyRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.networksecurity.v1.UpdateGatewaySecurityPolicyRequest + * @static + * @param {google.cloud.networksecurity.v1.IUpdateGatewaySecurityPolicyRequest} message UpdateGatewaySecurityPolicyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateGatewaySecurityPolicyRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.gatewaySecurityPolicy != null && Object.hasOwnProperty.call(message, "gatewaySecurityPolicy")) + $root.google.cloud.networksecurity.v1.GatewaySecurityPolicy.encode(message.gatewaySecurityPolicy, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified UpdateGatewaySecurityPolicyRequest message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.UpdateGatewaySecurityPolicyRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.networksecurity.v1.UpdateGatewaySecurityPolicyRequest + * @static + * @param {google.cloud.networksecurity.v1.IUpdateGatewaySecurityPolicyRequest} message UpdateGatewaySecurityPolicyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateGatewaySecurityPolicyRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateGatewaySecurityPolicyRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.networksecurity.v1.UpdateGatewaySecurityPolicyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.networksecurity.v1.UpdateGatewaySecurityPolicyRequest} UpdateGatewaySecurityPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateGatewaySecurityPolicyRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networksecurity.v1.UpdateGatewaySecurityPolicyRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + case 2: { + message.gatewaySecurityPolicy = $root.google.cloud.networksecurity.v1.GatewaySecurityPolicy.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateGatewaySecurityPolicyRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.networksecurity.v1.UpdateGatewaySecurityPolicyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.networksecurity.v1.UpdateGatewaySecurityPolicyRequest} UpdateGatewaySecurityPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateGatewaySecurityPolicyRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateGatewaySecurityPolicyRequest message. + * @function verify + * @memberof google.cloud.networksecurity.v1.UpdateGatewaySecurityPolicyRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateGatewaySecurityPolicyRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + if (message.gatewaySecurityPolicy != null && message.hasOwnProperty("gatewaySecurityPolicy")) { + var error = $root.google.cloud.networksecurity.v1.GatewaySecurityPolicy.verify(message.gatewaySecurityPolicy); + if (error) + return "gatewaySecurityPolicy." + error; + } + return null; + }; + + /** + * Creates an UpdateGatewaySecurityPolicyRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.networksecurity.v1.UpdateGatewaySecurityPolicyRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.networksecurity.v1.UpdateGatewaySecurityPolicyRequest} UpdateGatewaySecurityPolicyRequest + */ + UpdateGatewaySecurityPolicyRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networksecurity.v1.UpdateGatewaySecurityPolicyRequest) + return object; + var message = new $root.google.cloud.networksecurity.v1.UpdateGatewaySecurityPolicyRequest(); + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.networksecurity.v1.UpdateGatewaySecurityPolicyRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + if (object.gatewaySecurityPolicy != null) { + if (typeof object.gatewaySecurityPolicy !== "object") + throw TypeError(".google.cloud.networksecurity.v1.UpdateGatewaySecurityPolicyRequest.gatewaySecurityPolicy: object expected"); + message.gatewaySecurityPolicy = $root.google.cloud.networksecurity.v1.GatewaySecurityPolicy.fromObject(object.gatewaySecurityPolicy); + } + return message; + }; + + /** + * Creates a plain object from an UpdateGatewaySecurityPolicyRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.networksecurity.v1.UpdateGatewaySecurityPolicyRequest + * @static + * @param {google.cloud.networksecurity.v1.UpdateGatewaySecurityPolicyRequest} message UpdateGatewaySecurityPolicyRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateGatewaySecurityPolicyRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.updateMask = null; + object.gatewaySecurityPolicy = null; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + if (message.gatewaySecurityPolicy != null && message.hasOwnProperty("gatewaySecurityPolicy")) + object.gatewaySecurityPolicy = $root.google.cloud.networksecurity.v1.GatewaySecurityPolicy.toObject(message.gatewaySecurityPolicy, options); + return object; + }; + + /** + * Converts this UpdateGatewaySecurityPolicyRequest to JSON. + * @function toJSON + * @memberof google.cloud.networksecurity.v1.UpdateGatewaySecurityPolicyRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateGatewaySecurityPolicyRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateGatewaySecurityPolicyRequest + * @function getTypeUrl + * @memberof google.cloud.networksecurity.v1.UpdateGatewaySecurityPolicyRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateGatewaySecurityPolicyRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.networksecurity.v1.UpdateGatewaySecurityPolicyRequest"; + }; + + return UpdateGatewaySecurityPolicyRequest; + })(); + + v1.GatewaySecurityPolicyRule = (function() { + + /** + * Properties of a GatewaySecurityPolicyRule. + * @memberof google.cloud.networksecurity.v1 + * @interface IGatewaySecurityPolicyRule + * @property {google.cloud.networksecurity.v1.GatewaySecurityPolicyRule.BasicProfile|null} [basicProfile] GatewaySecurityPolicyRule basicProfile + * @property {string|null} [name] GatewaySecurityPolicyRule name + * @property {google.protobuf.ITimestamp|null} [createTime] GatewaySecurityPolicyRule createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] GatewaySecurityPolicyRule updateTime + * @property {boolean|null} [enabled] GatewaySecurityPolicyRule enabled + * @property {number|null} [priority] GatewaySecurityPolicyRule priority + * @property {string|null} [description] GatewaySecurityPolicyRule description + * @property {string|null} [sessionMatcher] GatewaySecurityPolicyRule sessionMatcher + * @property {string|null} [applicationMatcher] GatewaySecurityPolicyRule applicationMatcher + * @property {boolean|null} [tlsInspectionEnabled] GatewaySecurityPolicyRule tlsInspectionEnabled + */ + + /** + * Constructs a new GatewaySecurityPolicyRule. + * @memberof google.cloud.networksecurity.v1 + * @classdesc Represents a GatewaySecurityPolicyRule. + * @implements IGatewaySecurityPolicyRule + * @constructor + * @param {google.cloud.networksecurity.v1.IGatewaySecurityPolicyRule=} [properties] Properties to set + */ + function GatewaySecurityPolicyRule(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GatewaySecurityPolicyRule basicProfile. + * @member {google.cloud.networksecurity.v1.GatewaySecurityPolicyRule.BasicProfile|null|undefined} basicProfile + * @memberof google.cloud.networksecurity.v1.GatewaySecurityPolicyRule + * @instance + */ + GatewaySecurityPolicyRule.prototype.basicProfile = null; + + /** + * GatewaySecurityPolicyRule name. + * @member {string} name + * @memberof google.cloud.networksecurity.v1.GatewaySecurityPolicyRule + * @instance + */ + GatewaySecurityPolicyRule.prototype.name = ""; + + /** + * GatewaySecurityPolicyRule createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.networksecurity.v1.GatewaySecurityPolicyRule + * @instance + */ + GatewaySecurityPolicyRule.prototype.createTime = null; + + /** + * GatewaySecurityPolicyRule updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.networksecurity.v1.GatewaySecurityPolicyRule + * @instance + */ + GatewaySecurityPolicyRule.prototype.updateTime = null; + + /** + * GatewaySecurityPolicyRule enabled. + * @member {boolean} enabled + * @memberof google.cloud.networksecurity.v1.GatewaySecurityPolicyRule + * @instance + */ + GatewaySecurityPolicyRule.prototype.enabled = false; + + /** + * GatewaySecurityPolicyRule priority. + * @member {number} priority + * @memberof google.cloud.networksecurity.v1.GatewaySecurityPolicyRule + * @instance + */ + GatewaySecurityPolicyRule.prototype.priority = 0; + + /** + * GatewaySecurityPolicyRule description. + * @member {string} description + * @memberof google.cloud.networksecurity.v1.GatewaySecurityPolicyRule + * @instance + */ + GatewaySecurityPolicyRule.prototype.description = ""; + + /** + * GatewaySecurityPolicyRule sessionMatcher. + * @member {string} sessionMatcher + * @memberof google.cloud.networksecurity.v1.GatewaySecurityPolicyRule + * @instance + */ + GatewaySecurityPolicyRule.prototype.sessionMatcher = ""; + + /** + * GatewaySecurityPolicyRule applicationMatcher. + * @member {string} applicationMatcher + * @memberof google.cloud.networksecurity.v1.GatewaySecurityPolicyRule + * @instance + */ + GatewaySecurityPolicyRule.prototype.applicationMatcher = ""; + + /** + * GatewaySecurityPolicyRule tlsInspectionEnabled. + * @member {boolean} tlsInspectionEnabled + * @memberof google.cloud.networksecurity.v1.GatewaySecurityPolicyRule + * @instance + */ + GatewaySecurityPolicyRule.prototype.tlsInspectionEnabled = false; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GatewaySecurityPolicyRule profile. + * @member {"basicProfile"|undefined} profile + * @memberof google.cloud.networksecurity.v1.GatewaySecurityPolicyRule + * @instance + */ + Object.defineProperty(GatewaySecurityPolicyRule.prototype, "profile", { + get: $util.oneOfGetter($oneOfFields = ["basicProfile"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GatewaySecurityPolicyRule instance using the specified properties. + * @function create + * @memberof google.cloud.networksecurity.v1.GatewaySecurityPolicyRule + * @static + * @param {google.cloud.networksecurity.v1.IGatewaySecurityPolicyRule=} [properties] Properties to set + * @returns {google.cloud.networksecurity.v1.GatewaySecurityPolicyRule} GatewaySecurityPolicyRule instance + */ + GatewaySecurityPolicyRule.create = function create(properties) { + return new GatewaySecurityPolicyRule(properties); + }; + + /** + * Encodes the specified GatewaySecurityPolicyRule message. Does not implicitly {@link google.cloud.networksecurity.v1.GatewaySecurityPolicyRule.verify|verify} messages. + * @function encode + * @memberof google.cloud.networksecurity.v1.GatewaySecurityPolicyRule + * @static + * @param {google.cloud.networksecurity.v1.IGatewaySecurityPolicyRule} message GatewaySecurityPolicyRule message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GatewaySecurityPolicyRule.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.enabled != null && Object.hasOwnProperty.call(message, "enabled")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.enabled); + if (message.priority != null && Object.hasOwnProperty.call(message, "priority")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.priority); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.description); + if (message.sessionMatcher != null && Object.hasOwnProperty.call(message, "sessionMatcher")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.sessionMatcher); + if (message.applicationMatcher != null && Object.hasOwnProperty.call(message, "applicationMatcher")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.applicationMatcher); + if (message.basicProfile != null && Object.hasOwnProperty.call(message, "basicProfile")) + writer.uint32(/* id 9, wireType 0 =*/72).int32(message.basicProfile); + if (message.tlsInspectionEnabled != null && Object.hasOwnProperty.call(message, "tlsInspectionEnabled")) + writer.uint32(/* id 10, wireType 0 =*/80).bool(message.tlsInspectionEnabled); + return writer; + }; + + /** + * Encodes the specified GatewaySecurityPolicyRule message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.GatewaySecurityPolicyRule.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.networksecurity.v1.GatewaySecurityPolicyRule + * @static + * @param {google.cloud.networksecurity.v1.IGatewaySecurityPolicyRule} message GatewaySecurityPolicyRule message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GatewaySecurityPolicyRule.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GatewaySecurityPolicyRule message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.networksecurity.v1.GatewaySecurityPolicyRule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.networksecurity.v1.GatewaySecurityPolicyRule} GatewaySecurityPolicyRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GatewaySecurityPolicyRule.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networksecurity.v1.GatewaySecurityPolicyRule(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 9: { + message.basicProfile = reader.int32(); + break; + } + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 3: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 4: { + message.enabled = reader.bool(); + break; + } + case 5: { + message.priority = reader.int32(); + break; + } + case 6: { + message.description = reader.string(); + break; + } + case 7: { + message.sessionMatcher = reader.string(); + break; + } + case 8: { + message.applicationMatcher = reader.string(); + break; + } + case 10: { + message.tlsInspectionEnabled = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GatewaySecurityPolicyRule message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.networksecurity.v1.GatewaySecurityPolicyRule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.networksecurity.v1.GatewaySecurityPolicyRule} GatewaySecurityPolicyRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GatewaySecurityPolicyRule.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GatewaySecurityPolicyRule message. + * @function verify + * @memberof google.cloud.networksecurity.v1.GatewaySecurityPolicyRule + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GatewaySecurityPolicyRule.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.basicProfile != null && message.hasOwnProperty("basicProfile")) { + properties.profile = 1; + switch (message.basicProfile) { + default: + return "basicProfile: enum value expected"; + case 0: + case 1: + case 2: + break; + } + } + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime); + if (error) + return "updateTime." + error; + } + if (message.enabled != null && message.hasOwnProperty("enabled")) + if (typeof message.enabled !== "boolean") + return "enabled: boolean expected"; + if (message.priority != null && message.hasOwnProperty("priority")) + if (!$util.isInteger(message.priority)) + return "priority: integer expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.sessionMatcher != null && message.hasOwnProperty("sessionMatcher")) + if (!$util.isString(message.sessionMatcher)) + return "sessionMatcher: string expected"; + if (message.applicationMatcher != null && message.hasOwnProperty("applicationMatcher")) + if (!$util.isString(message.applicationMatcher)) + return "applicationMatcher: string expected"; + if (message.tlsInspectionEnabled != null && message.hasOwnProperty("tlsInspectionEnabled")) + if (typeof message.tlsInspectionEnabled !== "boolean") + return "tlsInspectionEnabled: boolean expected"; + return null; + }; + + /** + * Creates a GatewaySecurityPolicyRule message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.networksecurity.v1.GatewaySecurityPolicyRule + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.networksecurity.v1.GatewaySecurityPolicyRule} GatewaySecurityPolicyRule + */ + GatewaySecurityPolicyRule.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networksecurity.v1.GatewaySecurityPolicyRule) + return object; + var message = new $root.google.cloud.networksecurity.v1.GatewaySecurityPolicyRule(); + switch (object.basicProfile) { + default: + if (typeof object.basicProfile === "number") { + message.basicProfile = object.basicProfile; + break; + } + break; + case "BASIC_PROFILE_UNSPECIFIED": + case 0: + message.basicProfile = 0; + break; + case "ALLOW": + case 1: + message.basicProfile = 1; + break; + case "DENY": + case 2: + message.basicProfile = 2; + break; + } + if (object.name != null) + message.name = String(object.name); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.networksecurity.v1.GatewaySecurityPolicyRule.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.updateTime != null) { + if (typeof object.updateTime !== "object") + throw TypeError(".google.cloud.networksecurity.v1.GatewaySecurityPolicyRule.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + if (object.enabled != null) + message.enabled = Boolean(object.enabled); + if (object.priority != null) + message.priority = object.priority | 0; + if (object.description != null) + message.description = String(object.description); + if (object.sessionMatcher != null) + message.sessionMatcher = String(object.sessionMatcher); + if (object.applicationMatcher != null) + message.applicationMatcher = String(object.applicationMatcher); + if (object.tlsInspectionEnabled != null) + message.tlsInspectionEnabled = Boolean(object.tlsInspectionEnabled); + return message; + }; + + /** + * Creates a plain object from a GatewaySecurityPolicyRule message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.networksecurity.v1.GatewaySecurityPolicyRule + * @static + * @param {google.cloud.networksecurity.v1.GatewaySecurityPolicyRule} message GatewaySecurityPolicyRule + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GatewaySecurityPolicyRule.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.createTime = null; + object.updateTime = null; + object.enabled = false; + object.priority = 0; + object.description = ""; + object.sessionMatcher = ""; + object.applicationMatcher = ""; + object.tlsInspectionEnabled = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.updateTime != null && message.hasOwnProperty("updateTime")) + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); + if (message.enabled != null && message.hasOwnProperty("enabled")) + object.enabled = message.enabled; + if (message.priority != null && message.hasOwnProperty("priority")) + object.priority = message.priority; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.sessionMatcher != null && message.hasOwnProperty("sessionMatcher")) + object.sessionMatcher = message.sessionMatcher; + if (message.applicationMatcher != null && message.hasOwnProperty("applicationMatcher")) + object.applicationMatcher = message.applicationMatcher; + if (message.basicProfile != null && message.hasOwnProperty("basicProfile")) { + object.basicProfile = options.enums === String ? $root.google.cloud.networksecurity.v1.GatewaySecurityPolicyRule.BasicProfile[message.basicProfile] === undefined ? message.basicProfile : $root.google.cloud.networksecurity.v1.GatewaySecurityPolicyRule.BasicProfile[message.basicProfile] : message.basicProfile; + if (options.oneofs) + object.profile = "basicProfile"; + } + if (message.tlsInspectionEnabled != null && message.hasOwnProperty("tlsInspectionEnabled")) + object.tlsInspectionEnabled = message.tlsInspectionEnabled; + return object; + }; + + /** + * Converts this GatewaySecurityPolicyRule to JSON. + * @function toJSON + * @memberof google.cloud.networksecurity.v1.GatewaySecurityPolicyRule + * @instance + * @returns {Object.} JSON object + */ + GatewaySecurityPolicyRule.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GatewaySecurityPolicyRule + * @function getTypeUrl + * @memberof google.cloud.networksecurity.v1.GatewaySecurityPolicyRule + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GatewaySecurityPolicyRule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.networksecurity.v1.GatewaySecurityPolicyRule"; + }; + + /** + * BasicProfile enum. + * @name google.cloud.networksecurity.v1.GatewaySecurityPolicyRule.BasicProfile + * @enum {number} + * @property {number} BASIC_PROFILE_UNSPECIFIED=0 BASIC_PROFILE_UNSPECIFIED value + * @property {number} ALLOW=1 ALLOW value + * @property {number} DENY=2 DENY value + */ + GatewaySecurityPolicyRule.BasicProfile = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "BASIC_PROFILE_UNSPECIFIED"] = 0; + values[valuesById[1] = "ALLOW"] = 1; + values[valuesById[2] = "DENY"] = 2; + return values; + })(); + + return GatewaySecurityPolicyRule; + })(); + + v1.CreateGatewaySecurityPolicyRuleRequest = (function() { + + /** + * Properties of a CreateGatewaySecurityPolicyRuleRequest. + * @memberof google.cloud.networksecurity.v1 + * @interface ICreateGatewaySecurityPolicyRuleRequest + * @property {string|null} [parent] CreateGatewaySecurityPolicyRuleRequest parent + * @property {google.cloud.networksecurity.v1.IGatewaySecurityPolicyRule|null} [gatewaySecurityPolicyRule] CreateGatewaySecurityPolicyRuleRequest gatewaySecurityPolicyRule + * @property {string|null} [gatewaySecurityPolicyRuleId] CreateGatewaySecurityPolicyRuleRequest gatewaySecurityPolicyRuleId + */ + + /** + * Constructs a new CreateGatewaySecurityPolicyRuleRequest. + * @memberof google.cloud.networksecurity.v1 + * @classdesc Represents a CreateGatewaySecurityPolicyRuleRequest. + * @implements ICreateGatewaySecurityPolicyRuleRequest + * @constructor + * @param {google.cloud.networksecurity.v1.ICreateGatewaySecurityPolicyRuleRequest=} [properties] Properties to set + */ + function CreateGatewaySecurityPolicyRuleRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateGatewaySecurityPolicyRuleRequest parent. + * @member {string} parent + * @memberof google.cloud.networksecurity.v1.CreateGatewaySecurityPolicyRuleRequest + * @instance + */ + CreateGatewaySecurityPolicyRuleRequest.prototype.parent = ""; + + /** + * CreateGatewaySecurityPolicyRuleRequest gatewaySecurityPolicyRule. + * @member {google.cloud.networksecurity.v1.IGatewaySecurityPolicyRule|null|undefined} gatewaySecurityPolicyRule + * @memberof google.cloud.networksecurity.v1.CreateGatewaySecurityPolicyRuleRequest + * @instance + */ + CreateGatewaySecurityPolicyRuleRequest.prototype.gatewaySecurityPolicyRule = null; + + /** + * CreateGatewaySecurityPolicyRuleRequest gatewaySecurityPolicyRuleId. + * @member {string} gatewaySecurityPolicyRuleId + * @memberof google.cloud.networksecurity.v1.CreateGatewaySecurityPolicyRuleRequest + * @instance + */ + CreateGatewaySecurityPolicyRuleRequest.prototype.gatewaySecurityPolicyRuleId = ""; + + /** + * Creates a new CreateGatewaySecurityPolicyRuleRequest instance using the specified properties. + * @function create + * @memberof google.cloud.networksecurity.v1.CreateGatewaySecurityPolicyRuleRequest + * @static + * @param {google.cloud.networksecurity.v1.ICreateGatewaySecurityPolicyRuleRequest=} [properties] Properties to set + * @returns {google.cloud.networksecurity.v1.CreateGatewaySecurityPolicyRuleRequest} CreateGatewaySecurityPolicyRuleRequest instance + */ + CreateGatewaySecurityPolicyRuleRequest.create = function create(properties) { + return new CreateGatewaySecurityPolicyRuleRequest(properties); + }; + + /** + * Encodes the specified CreateGatewaySecurityPolicyRuleRequest message. Does not implicitly {@link google.cloud.networksecurity.v1.CreateGatewaySecurityPolicyRuleRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.networksecurity.v1.CreateGatewaySecurityPolicyRuleRequest + * @static + * @param {google.cloud.networksecurity.v1.ICreateGatewaySecurityPolicyRuleRequest} message CreateGatewaySecurityPolicyRuleRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateGatewaySecurityPolicyRuleRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.gatewaySecurityPolicyRule != null && Object.hasOwnProperty.call(message, "gatewaySecurityPolicyRule")) + $root.google.cloud.networksecurity.v1.GatewaySecurityPolicyRule.encode(message.gatewaySecurityPolicyRule, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.gatewaySecurityPolicyRuleId != null && Object.hasOwnProperty.call(message, "gatewaySecurityPolicyRuleId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.gatewaySecurityPolicyRuleId); + return writer; + }; + + /** + * Encodes the specified CreateGatewaySecurityPolicyRuleRequest message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.CreateGatewaySecurityPolicyRuleRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.networksecurity.v1.CreateGatewaySecurityPolicyRuleRequest + * @static + * @param {google.cloud.networksecurity.v1.ICreateGatewaySecurityPolicyRuleRequest} message CreateGatewaySecurityPolicyRuleRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateGatewaySecurityPolicyRuleRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateGatewaySecurityPolicyRuleRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.networksecurity.v1.CreateGatewaySecurityPolicyRuleRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.networksecurity.v1.CreateGatewaySecurityPolicyRuleRequest} CreateGatewaySecurityPolicyRuleRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateGatewaySecurityPolicyRuleRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networksecurity.v1.CreateGatewaySecurityPolicyRuleRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.gatewaySecurityPolicyRule = $root.google.cloud.networksecurity.v1.GatewaySecurityPolicyRule.decode(reader, reader.uint32()); + break; + } + case 3: { + message.gatewaySecurityPolicyRuleId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateGatewaySecurityPolicyRuleRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.networksecurity.v1.CreateGatewaySecurityPolicyRuleRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.networksecurity.v1.CreateGatewaySecurityPolicyRuleRequest} CreateGatewaySecurityPolicyRuleRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateGatewaySecurityPolicyRuleRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateGatewaySecurityPolicyRuleRequest message. + * @function verify + * @memberof google.cloud.networksecurity.v1.CreateGatewaySecurityPolicyRuleRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateGatewaySecurityPolicyRuleRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.gatewaySecurityPolicyRule != null && message.hasOwnProperty("gatewaySecurityPolicyRule")) { + var error = $root.google.cloud.networksecurity.v1.GatewaySecurityPolicyRule.verify(message.gatewaySecurityPolicyRule); + if (error) + return "gatewaySecurityPolicyRule." + error; + } + if (message.gatewaySecurityPolicyRuleId != null && message.hasOwnProperty("gatewaySecurityPolicyRuleId")) + if (!$util.isString(message.gatewaySecurityPolicyRuleId)) + return "gatewaySecurityPolicyRuleId: string expected"; + return null; + }; + + /** + * Creates a CreateGatewaySecurityPolicyRuleRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.networksecurity.v1.CreateGatewaySecurityPolicyRuleRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.networksecurity.v1.CreateGatewaySecurityPolicyRuleRequest} CreateGatewaySecurityPolicyRuleRequest + */ + CreateGatewaySecurityPolicyRuleRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networksecurity.v1.CreateGatewaySecurityPolicyRuleRequest) + return object; + var message = new $root.google.cloud.networksecurity.v1.CreateGatewaySecurityPolicyRuleRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.gatewaySecurityPolicyRule != null) { + if (typeof object.gatewaySecurityPolicyRule !== "object") + throw TypeError(".google.cloud.networksecurity.v1.CreateGatewaySecurityPolicyRuleRequest.gatewaySecurityPolicyRule: object expected"); + message.gatewaySecurityPolicyRule = $root.google.cloud.networksecurity.v1.GatewaySecurityPolicyRule.fromObject(object.gatewaySecurityPolicyRule); + } + if (object.gatewaySecurityPolicyRuleId != null) + message.gatewaySecurityPolicyRuleId = String(object.gatewaySecurityPolicyRuleId); + return message; + }; + + /** + * Creates a plain object from a CreateGatewaySecurityPolicyRuleRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.networksecurity.v1.CreateGatewaySecurityPolicyRuleRequest + * @static + * @param {google.cloud.networksecurity.v1.CreateGatewaySecurityPolicyRuleRequest} message CreateGatewaySecurityPolicyRuleRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateGatewaySecurityPolicyRuleRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.gatewaySecurityPolicyRule = null; + object.gatewaySecurityPolicyRuleId = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.gatewaySecurityPolicyRule != null && message.hasOwnProperty("gatewaySecurityPolicyRule")) + object.gatewaySecurityPolicyRule = $root.google.cloud.networksecurity.v1.GatewaySecurityPolicyRule.toObject(message.gatewaySecurityPolicyRule, options); + if (message.gatewaySecurityPolicyRuleId != null && message.hasOwnProperty("gatewaySecurityPolicyRuleId")) + object.gatewaySecurityPolicyRuleId = message.gatewaySecurityPolicyRuleId; + return object; + }; + + /** + * Converts this CreateGatewaySecurityPolicyRuleRequest to JSON. + * @function toJSON + * @memberof google.cloud.networksecurity.v1.CreateGatewaySecurityPolicyRuleRequest + * @instance + * @returns {Object.} JSON object + */ + CreateGatewaySecurityPolicyRuleRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateGatewaySecurityPolicyRuleRequest + * @function getTypeUrl + * @memberof google.cloud.networksecurity.v1.CreateGatewaySecurityPolicyRuleRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateGatewaySecurityPolicyRuleRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.networksecurity.v1.CreateGatewaySecurityPolicyRuleRequest"; + }; + + return CreateGatewaySecurityPolicyRuleRequest; + })(); + + v1.GetGatewaySecurityPolicyRuleRequest = (function() { + + /** + * Properties of a GetGatewaySecurityPolicyRuleRequest. + * @memberof google.cloud.networksecurity.v1 + * @interface IGetGatewaySecurityPolicyRuleRequest + * @property {string|null} [name] GetGatewaySecurityPolicyRuleRequest name + */ + + /** + * Constructs a new GetGatewaySecurityPolicyRuleRequest. + * @memberof google.cloud.networksecurity.v1 + * @classdesc Represents a GetGatewaySecurityPolicyRuleRequest. + * @implements IGetGatewaySecurityPolicyRuleRequest + * @constructor + * @param {google.cloud.networksecurity.v1.IGetGatewaySecurityPolicyRuleRequest=} [properties] Properties to set + */ + function GetGatewaySecurityPolicyRuleRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetGatewaySecurityPolicyRuleRequest name. + * @member {string} name + * @memberof google.cloud.networksecurity.v1.GetGatewaySecurityPolicyRuleRequest + * @instance + */ + GetGatewaySecurityPolicyRuleRequest.prototype.name = ""; + + /** + * Creates a new GetGatewaySecurityPolicyRuleRequest instance using the specified properties. + * @function create + * @memberof google.cloud.networksecurity.v1.GetGatewaySecurityPolicyRuleRequest + * @static + * @param {google.cloud.networksecurity.v1.IGetGatewaySecurityPolicyRuleRequest=} [properties] Properties to set + * @returns {google.cloud.networksecurity.v1.GetGatewaySecurityPolicyRuleRequest} GetGatewaySecurityPolicyRuleRequest instance + */ + GetGatewaySecurityPolicyRuleRequest.create = function create(properties) { + return new GetGatewaySecurityPolicyRuleRequest(properties); + }; + + /** + * Encodes the specified GetGatewaySecurityPolicyRuleRequest message. Does not implicitly {@link google.cloud.networksecurity.v1.GetGatewaySecurityPolicyRuleRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.networksecurity.v1.GetGatewaySecurityPolicyRuleRequest + * @static + * @param {google.cloud.networksecurity.v1.IGetGatewaySecurityPolicyRuleRequest} message GetGatewaySecurityPolicyRuleRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetGatewaySecurityPolicyRuleRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified GetGatewaySecurityPolicyRuleRequest message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.GetGatewaySecurityPolicyRuleRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.networksecurity.v1.GetGatewaySecurityPolicyRuleRequest + * @static + * @param {google.cloud.networksecurity.v1.IGetGatewaySecurityPolicyRuleRequest} message GetGatewaySecurityPolicyRuleRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetGatewaySecurityPolicyRuleRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetGatewaySecurityPolicyRuleRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.networksecurity.v1.GetGatewaySecurityPolicyRuleRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.networksecurity.v1.GetGatewaySecurityPolicyRuleRequest} GetGatewaySecurityPolicyRuleRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetGatewaySecurityPolicyRuleRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networksecurity.v1.GetGatewaySecurityPolicyRuleRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetGatewaySecurityPolicyRuleRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.networksecurity.v1.GetGatewaySecurityPolicyRuleRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.networksecurity.v1.GetGatewaySecurityPolicyRuleRequest} GetGatewaySecurityPolicyRuleRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetGatewaySecurityPolicyRuleRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetGatewaySecurityPolicyRuleRequest message. + * @function verify + * @memberof google.cloud.networksecurity.v1.GetGatewaySecurityPolicyRuleRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetGatewaySecurityPolicyRuleRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a GetGatewaySecurityPolicyRuleRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.networksecurity.v1.GetGatewaySecurityPolicyRuleRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.networksecurity.v1.GetGatewaySecurityPolicyRuleRequest} GetGatewaySecurityPolicyRuleRequest + */ + GetGatewaySecurityPolicyRuleRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networksecurity.v1.GetGatewaySecurityPolicyRuleRequest) + return object; + var message = new $root.google.cloud.networksecurity.v1.GetGatewaySecurityPolicyRuleRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetGatewaySecurityPolicyRuleRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.networksecurity.v1.GetGatewaySecurityPolicyRuleRequest + * @static + * @param {google.cloud.networksecurity.v1.GetGatewaySecurityPolicyRuleRequest} message GetGatewaySecurityPolicyRuleRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetGatewaySecurityPolicyRuleRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this GetGatewaySecurityPolicyRuleRequest to JSON. + * @function toJSON + * @memberof google.cloud.networksecurity.v1.GetGatewaySecurityPolicyRuleRequest + * @instance + * @returns {Object.} JSON object + */ + GetGatewaySecurityPolicyRuleRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetGatewaySecurityPolicyRuleRequest + * @function getTypeUrl + * @memberof google.cloud.networksecurity.v1.GetGatewaySecurityPolicyRuleRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetGatewaySecurityPolicyRuleRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.networksecurity.v1.GetGatewaySecurityPolicyRuleRequest"; + }; + + return GetGatewaySecurityPolicyRuleRequest; + })(); + + v1.UpdateGatewaySecurityPolicyRuleRequest = (function() { + + /** + * Properties of an UpdateGatewaySecurityPolicyRuleRequest. + * @memberof google.cloud.networksecurity.v1 + * @interface IUpdateGatewaySecurityPolicyRuleRequest + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateGatewaySecurityPolicyRuleRequest updateMask + * @property {google.cloud.networksecurity.v1.IGatewaySecurityPolicyRule|null} [gatewaySecurityPolicyRule] UpdateGatewaySecurityPolicyRuleRequest gatewaySecurityPolicyRule + */ + + /** + * Constructs a new UpdateGatewaySecurityPolicyRuleRequest. + * @memberof google.cloud.networksecurity.v1 + * @classdesc Represents an UpdateGatewaySecurityPolicyRuleRequest. + * @implements IUpdateGatewaySecurityPolicyRuleRequest + * @constructor + * @param {google.cloud.networksecurity.v1.IUpdateGatewaySecurityPolicyRuleRequest=} [properties] Properties to set + */ + function UpdateGatewaySecurityPolicyRuleRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateGatewaySecurityPolicyRuleRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.networksecurity.v1.UpdateGatewaySecurityPolicyRuleRequest + * @instance + */ + UpdateGatewaySecurityPolicyRuleRequest.prototype.updateMask = null; + + /** + * UpdateGatewaySecurityPolicyRuleRequest gatewaySecurityPolicyRule. + * @member {google.cloud.networksecurity.v1.IGatewaySecurityPolicyRule|null|undefined} gatewaySecurityPolicyRule + * @memberof google.cloud.networksecurity.v1.UpdateGatewaySecurityPolicyRuleRequest + * @instance + */ + UpdateGatewaySecurityPolicyRuleRequest.prototype.gatewaySecurityPolicyRule = null; + + /** + * Creates a new UpdateGatewaySecurityPolicyRuleRequest instance using the specified properties. + * @function create + * @memberof google.cloud.networksecurity.v1.UpdateGatewaySecurityPolicyRuleRequest + * @static + * @param {google.cloud.networksecurity.v1.IUpdateGatewaySecurityPolicyRuleRequest=} [properties] Properties to set + * @returns {google.cloud.networksecurity.v1.UpdateGatewaySecurityPolicyRuleRequest} UpdateGatewaySecurityPolicyRuleRequest instance + */ + UpdateGatewaySecurityPolicyRuleRequest.create = function create(properties) { + return new UpdateGatewaySecurityPolicyRuleRequest(properties); + }; + + /** + * Encodes the specified UpdateGatewaySecurityPolicyRuleRequest message. Does not implicitly {@link google.cloud.networksecurity.v1.UpdateGatewaySecurityPolicyRuleRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.networksecurity.v1.UpdateGatewaySecurityPolicyRuleRequest + * @static + * @param {google.cloud.networksecurity.v1.IUpdateGatewaySecurityPolicyRuleRequest} message UpdateGatewaySecurityPolicyRuleRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateGatewaySecurityPolicyRuleRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.gatewaySecurityPolicyRule != null && Object.hasOwnProperty.call(message, "gatewaySecurityPolicyRule")) + $root.google.cloud.networksecurity.v1.GatewaySecurityPolicyRule.encode(message.gatewaySecurityPolicyRule, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified UpdateGatewaySecurityPolicyRuleRequest message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.UpdateGatewaySecurityPolicyRuleRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.networksecurity.v1.UpdateGatewaySecurityPolicyRuleRequest + * @static + * @param {google.cloud.networksecurity.v1.IUpdateGatewaySecurityPolicyRuleRequest} message UpdateGatewaySecurityPolicyRuleRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateGatewaySecurityPolicyRuleRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateGatewaySecurityPolicyRuleRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.networksecurity.v1.UpdateGatewaySecurityPolicyRuleRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.networksecurity.v1.UpdateGatewaySecurityPolicyRuleRequest} UpdateGatewaySecurityPolicyRuleRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateGatewaySecurityPolicyRuleRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networksecurity.v1.UpdateGatewaySecurityPolicyRuleRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + case 2: { + message.gatewaySecurityPolicyRule = $root.google.cloud.networksecurity.v1.GatewaySecurityPolicyRule.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateGatewaySecurityPolicyRuleRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.networksecurity.v1.UpdateGatewaySecurityPolicyRuleRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.networksecurity.v1.UpdateGatewaySecurityPolicyRuleRequest} UpdateGatewaySecurityPolicyRuleRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateGatewaySecurityPolicyRuleRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateGatewaySecurityPolicyRuleRequest message. + * @function verify + * @memberof google.cloud.networksecurity.v1.UpdateGatewaySecurityPolicyRuleRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateGatewaySecurityPolicyRuleRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + if (message.gatewaySecurityPolicyRule != null && message.hasOwnProperty("gatewaySecurityPolicyRule")) { + var error = $root.google.cloud.networksecurity.v1.GatewaySecurityPolicyRule.verify(message.gatewaySecurityPolicyRule); + if (error) + return "gatewaySecurityPolicyRule." + error; + } + return null; + }; + + /** + * Creates an UpdateGatewaySecurityPolicyRuleRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.networksecurity.v1.UpdateGatewaySecurityPolicyRuleRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.networksecurity.v1.UpdateGatewaySecurityPolicyRuleRequest} UpdateGatewaySecurityPolicyRuleRequest + */ + UpdateGatewaySecurityPolicyRuleRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networksecurity.v1.UpdateGatewaySecurityPolicyRuleRequest) + return object; + var message = new $root.google.cloud.networksecurity.v1.UpdateGatewaySecurityPolicyRuleRequest(); + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.networksecurity.v1.UpdateGatewaySecurityPolicyRuleRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + if (object.gatewaySecurityPolicyRule != null) { + if (typeof object.gatewaySecurityPolicyRule !== "object") + throw TypeError(".google.cloud.networksecurity.v1.UpdateGatewaySecurityPolicyRuleRequest.gatewaySecurityPolicyRule: object expected"); + message.gatewaySecurityPolicyRule = $root.google.cloud.networksecurity.v1.GatewaySecurityPolicyRule.fromObject(object.gatewaySecurityPolicyRule); + } + return message; + }; + + /** + * Creates a plain object from an UpdateGatewaySecurityPolicyRuleRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.networksecurity.v1.UpdateGatewaySecurityPolicyRuleRequest + * @static + * @param {google.cloud.networksecurity.v1.UpdateGatewaySecurityPolicyRuleRequest} message UpdateGatewaySecurityPolicyRuleRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateGatewaySecurityPolicyRuleRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.updateMask = null; + object.gatewaySecurityPolicyRule = null; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + if (message.gatewaySecurityPolicyRule != null && message.hasOwnProperty("gatewaySecurityPolicyRule")) + object.gatewaySecurityPolicyRule = $root.google.cloud.networksecurity.v1.GatewaySecurityPolicyRule.toObject(message.gatewaySecurityPolicyRule, options); + return object; + }; + + /** + * Converts this UpdateGatewaySecurityPolicyRuleRequest to JSON. + * @function toJSON + * @memberof google.cloud.networksecurity.v1.UpdateGatewaySecurityPolicyRuleRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateGatewaySecurityPolicyRuleRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateGatewaySecurityPolicyRuleRequest + * @function getTypeUrl + * @memberof google.cloud.networksecurity.v1.UpdateGatewaySecurityPolicyRuleRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateGatewaySecurityPolicyRuleRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.networksecurity.v1.UpdateGatewaySecurityPolicyRuleRequest"; + }; + + return UpdateGatewaySecurityPolicyRuleRequest; + })(); + + v1.ListGatewaySecurityPolicyRulesRequest = (function() { + + /** + * Properties of a ListGatewaySecurityPolicyRulesRequest. + * @memberof google.cloud.networksecurity.v1 + * @interface IListGatewaySecurityPolicyRulesRequest + * @property {string|null} [parent] ListGatewaySecurityPolicyRulesRequest parent + * @property {number|null} [pageSize] ListGatewaySecurityPolicyRulesRequest pageSize + * @property {string|null} [pageToken] ListGatewaySecurityPolicyRulesRequest pageToken + */ + + /** + * Constructs a new ListGatewaySecurityPolicyRulesRequest. + * @memberof google.cloud.networksecurity.v1 + * @classdesc Represents a ListGatewaySecurityPolicyRulesRequest. + * @implements IListGatewaySecurityPolicyRulesRequest + * @constructor + * @param {google.cloud.networksecurity.v1.IListGatewaySecurityPolicyRulesRequest=} [properties] Properties to set + */ + function ListGatewaySecurityPolicyRulesRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListGatewaySecurityPolicyRulesRequest parent. + * @member {string} parent + * @memberof google.cloud.networksecurity.v1.ListGatewaySecurityPolicyRulesRequest + * @instance + */ + ListGatewaySecurityPolicyRulesRequest.prototype.parent = ""; + + /** + * ListGatewaySecurityPolicyRulesRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.networksecurity.v1.ListGatewaySecurityPolicyRulesRequest + * @instance + */ + ListGatewaySecurityPolicyRulesRequest.prototype.pageSize = 0; + + /** + * ListGatewaySecurityPolicyRulesRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.networksecurity.v1.ListGatewaySecurityPolicyRulesRequest + * @instance + */ + ListGatewaySecurityPolicyRulesRequest.prototype.pageToken = ""; + + /** + * Creates a new ListGatewaySecurityPolicyRulesRequest instance using the specified properties. + * @function create + * @memberof google.cloud.networksecurity.v1.ListGatewaySecurityPolicyRulesRequest + * @static + * @param {google.cloud.networksecurity.v1.IListGatewaySecurityPolicyRulesRequest=} [properties] Properties to set + * @returns {google.cloud.networksecurity.v1.ListGatewaySecurityPolicyRulesRequest} ListGatewaySecurityPolicyRulesRequest instance + */ + ListGatewaySecurityPolicyRulesRequest.create = function create(properties) { + return new ListGatewaySecurityPolicyRulesRequest(properties); + }; + + /** + * Encodes the specified ListGatewaySecurityPolicyRulesRequest message. Does not implicitly {@link google.cloud.networksecurity.v1.ListGatewaySecurityPolicyRulesRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.networksecurity.v1.ListGatewaySecurityPolicyRulesRequest + * @static + * @param {google.cloud.networksecurity.v1.IListGatewaySecurityPolicyRulesRequest} message ListGatewaySecurityPolicyRulesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListGatewaySecurityPolicyRulesRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + return writer; + }; + + /** + * Encodes the specified ListGatewaySecurityPolicyRulesRequest message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.ListGatewaySecurityPolicyRulesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.networksecurity.v1.ListGatewaySecurityPolicyRulesRequest + * @static + * @param {google.cloud.networksecurity.v1.IListGatewaySecurityPolicyRulesRequest} message ListGatewaySecurityPolicyRulesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListGatewaySecurityPolicyRulesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListGatewaySecurityPolicyRulesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.networksecurity.v1.ListGatewaySecurityPolicyRulesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.networksecurity.v1.ListGatewaySecurityPolicyRulesRequest} ListGatewaySecurityPolicyRulesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListGatewaySecurityPolicyRulesRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networksecurity.v1.ListGatewaySecurityPolicyRulesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListGatewaySecurityPolicyRulesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.networksecurity.v1.ListGatewaySecurityPolicyRulesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.networksecurity.v1.ListGatewaySecurityPolicyRulesRequest} ListGatewaySecurityPolicyRulesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListGatewaySecurityPolicyRulesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListGatewaySecurityPolicyRulesRequest message. + * @function verify + * @memberof google.cloud.networksecurity.v1.ListGatewaySecurityPolicyRulesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListGatewaySecurityPolicyRulesRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + return null; + }; + + /** + * Creates a ListGatewaySecurityPolicyRulesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.networksecurity.v1.ListGatewaySecurityPolicyRulesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.networksecurity.v1.ListGatewaySecurityPolicyRulesRequest} ListGatewaySecurityPolicyRulesRequest + */ + ListGatewaySecurityPolicyRulesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networksecurity.v1.ListGatewaySecurityPolicyRulesRequest) + return object; + var message = new $root.google.cloud.networksecurity.v1.ListGatewaySecurityPolicyRulesRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + return message; + }; + + /** + * Creates a plain object from a ListGatewaySecurityPolicyRulesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.networksecurity.v1.ListGatewaySecurityPolicyRulesRequest + * @static + * @param {google.cloud.networksecurity.v1.ListGatewaySecurityPolicyRulesRequest} message ListGatewaySecurityPolicyRulesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListGatewaySecurityPolicyRulesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + return object; + }; + + /** + * Converts this ListGatewaySecurityPolicyRulesRequest to JSON. + * @function toJSON + * @memberof google.cloud.networksecurity.v1.ListGatewaySecurityPolicyRulesRequest + * @instance + * @returns {Object.} JSON object + */ + ListGatewaySecurityPolicyRulesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListGatewaySecurityPolicyRulesRequest + * @function getTypeUrl + * @memberof google.cloud.networksecurity.v1.ListGatewaySecurityPolicyRulesRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListGatewaySecurityPolicyRulesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.networksecurity.v1.ListGatewaySecurityPolicyRulesRequest"; + }; + + return ListGatewaySecurityPolicyRulesRequest; + })(); + + v1.ListGatewaySecurityPolicyRulesResponse = (function() { + + /** + * Properties of a ListGatewaySecurityPolicyRulesResponse. + * @memberof google.cloud.networksecurity.v1 + * @interface IListGatewaySecurityPolicyRulesResponse + * @property {Array.|null} [gatewaySecurityPolicyRules] ListGatewaySecurityPolicyRulesResponse gatewaySecurityPolicyRules + * @property {string|null} [nextPageToken] ListGatewaySecurityPolicyRulesResponse nextPageToken + * @property {Array.|null} [unreachable] ListGatewaySecurityPolicyRulesResponse unreachable + */ + + /** + * Constructs a new ListGatewaySecurityPolicyRulesResponse. + * @memberof google.cloud.networksecurity.v1 + * @classdesc Represents a ListGatewaySecurityPolicyRulesResponse. + * @implements IListGatewaySecurityPolicyRulesResponse + * @constructor + * @param {google.cloud.networksecurity.v1.IListGatewaySecurityPolicyRulesResponse=} [properties] Properties to set + */ + function ListGatewaySecurityPolicyRulesResponse(properties) { + this.gatewaySecurityPolicyRules = []; + this.unreachable = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListGatewaySecurityPolicyRulesResponse gatewaySecurityPolicyRules. + * @member {Array.} gatewaySecurityPolicyRules + * @memberof google.cloud.networksecurity.v1.ListGatewaySecurityPolicyRulesResponse + * @instance + */ + ListGatewaySecurityPolicyRulesResponse.prototype.gatewaySecurityPolicyRules = $util.emptyArray; + + /** + * ListGatewaySecurityPolicyRulesResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.networksecurity.v1.ListGatewaySecurityPolicyRulesResponse + * @instance + */ + ListGatewaySecurityPolicyRulesResponse.prototype.nextPageToken = ""; + + /** + * ListGatewaySecurityPolicyRulesResponse unreachable. + * @member {Array.} unreachable + * @memberof google.cloud.networksecurity.v1.ListGatewaySecurityPolicyRulesResponse + * @instance + */ + ListGatewaySecurityPolicyRulesResponse.prototype.unreachable = $util.emptyArray; + + /** + * Creates a new ListGatewaySecurityPolicyRulesResponse instance using the specified properties. + * @function create + * @memberof google.cloud.networksecurity.v1.ListGatewaySecurityPolicyRulesResponse + * @static + * @param {google.cloud.networksecurity.v1.IListGatewaySecurityPolicyRulesResponse=} [properties] Properties to set + * @returns {google.cloud.networksecurity.v1.ListGatewaySecurityPolicyRulesResponse} ListGatewaySecurityPolicyRulesResponse instance + */ + ListGatewaySecurityPolicyRulesResponse.create = function create(properties) { + return new ListGatewaySecurityPolicyRulesResponse(properties); + }; + + /** + * Encodes the specified ListGatewaySecurityPolicyRulesResponse message. Does not implicitly {@link google.cloud.networksecurity.v1.ListGatewaySecurityPolicyRulesResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.networksecurity.v1.ListGatewaySecurityPolicyRulesResponse + * @static + * @param {google.cloud.networksecurity.v1.IListGatewaySecurityPolicyRulesResponse} message ListGatewaySecurityPolicyRulesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListGatewaySecurityPolicyRulesResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.gatewaySecurityPolicyRules != null && message.gatewaySecurityPolicyRules.length) + for (var i = 0; i < message.gatewaySecurityPolicyRules.length; ++i) + $root.google.cloud.networksecurity.v1.GatewaySecurityPolicyRule.encode(message.gatewaySecurityPolicyRules[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + if (message.unreachable != null && message.unreachable.length) + for (var i = 0; i < message.unreachable.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.unreachable[i]); + return writer; + }; + + /** + * Encodes the specified ListGatewaySecurityPolicyRulesResponse message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.ListGatewaySecurityPolicyRulesResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.networksecurity.v1.ListGatewaySecurityPolicyRulesResponse + * @static + * @param {google.cloud.networksecurity.v1.IListGatewaySecurityPolicyRulesResponse} message ListGatewaySecurityPolicyRulesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListGatewaySecurityPolicyRulesResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListGatewaySecurityPolicyRulesResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.networksecurity.v1.ListGatewaySecurityPolicyRulesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.networksecurity.v1.ListGatewaySecurityPolicyRulesResponse} ListGatewaySecurityPolicyRulesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListGatewaySecurityPolicyRulesResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networksecurity.v1.ListGatewaySecurityPolicyRulesResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.gatewaySecurityPolicyRules && message.gatewaySecurityPolicyRules.length)) + message.gatewaySecurityPolicyRules = []; + message.gatewaySecurityPolicyRules.push($root.google.cloud.networksecurity.v1.GatewaySecurityPolicyRule.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + case 3: { + if (!(message.unreachable && message.unreachable.length)) + message.unreachable = []; + message.unreachable.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListGatewaySecurityPolicyRulesResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.networksecurity.v1.ListGatewaySecurityPolicyRulesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.networksecurity.v1.ListGatewaySecurityPolicyRulesResponse} ListGatewaySecurityPolicyRulesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListGatewaySecurityPolicyRulesResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListGatewaySecurityPolicyRulesResponse message. + * @function verify + * @memberof google.cloud.networksecurity.v1.ListGatewaySecurityPolicyRulesResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListGatewaySecurityPolicyRulesResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.gatewaySecurityPolicyRules != null && message.hasOwnProperty("gatewaySecurityPolicyRules")) { + if (!Array.isArray(message.gatewaySecurityPolicyRules)) + return "gatewaySecurityPolicyRules: array expected"; + for (var i = 0; i < message.gatewaySecurityPolicyRules.length; ++i) { + var error = $root.google.cloud.networksecurity.v1.GatewaySecurityPolicyRule.verify(message.gatewaySecurityPolicyRules[i]); + if (error) + return "gatewaySecurityPolicyRules." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + if (message.unreachable != null && message.hasOwnProperty("unreachable")) { + if (!Array.isArray(message.unreachable)) + return "unreachable: array expected"; + for (var i = 0; i < message.unreachable.length; ++i) + if (!$util.isString(message.unreachable[i])) + return "unreachable: string[] expected"; + } + return null; + }; + + /** + * Creates a ListGatewaySecurityPolicyRulesResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.networksecurity.v1.ListGatewaySecurityPolicyRulesResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.networksecurity.v1.ListGatewaySecurityPolicyRulesResponse} ListGatewaySecurityPolicyRulesResponse + */ + ListGatewaySecurityPolicyRulesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networksecurity.v1.ListGatewaySecurityPolicyRulesResponse) + return object; + var message = new $root.google.cloud.networksecurity.v1.ListGatewaySecurityPolicyRulesResponse(); + if (object.gatewaySecurityPolicyRules) { + if (!Array.isArray(object.gatewaySecurityPolicyRules)) + throw TypeError(".google.cloud.networksecurity.v1.ListGatewaySecurityPolicyRulesResponse.gatewaySecurityPolicyRules: array expected"); + message.gatewaySecurityPolicyRules = []; + for (var i = 0; i < object.gatewaySecurityPolicyRules.length; ++i) { + if (typeof object.gatewaySecurityPolicyRules[i] !== "object") + throw TypeError(".google.cloud.networksecurity.v1.ListGatewaySecurityPolicyRulesResponse.gatewaySecurityPolicyRules: object expected"); + message.gatewaySecurityPolicyRules[i] = $root.google.cloud.networksecurity.v1.GatewaySecurityPolicyRule.fromObject(object.gatewaySecurityPolicyRules[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.unreachable) { + if (!Array.isArray(object.unreachable)) + throw TypeError(".google.cloud.networksecurity.v1.ListGatewaySecurityPolicyRulesResponse.unreachable: array expected"); + message.unreachable = []; + for (var i = 0; i < object.unreachable.length; ++i) + message.unreachable[i] = String(object.unreachable[i]); + } + return message; + }; + + /** + * Creates a plain object from a ListGatewaySecurityPolicyRulesResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.networksecurity.v1.ListGatewaySecurityPolicyRulesResponse + * @static + * @param {google.cloud.networksecurity.v1.ListGatewaySecurityPolicyRulesResponse} message ListGatewaySecurityPolicyRulesResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListGatewaySecurityPolicyRulesResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.gatewaySecurityPolicyRules = []; + object.unreachable = []; + } + if (options.defaults) + object.nextPageToken = ""; + if (message.gatewaySecurityPolicyRules && message.gatewaySecurityPolicyRules.length) { + object.gatewaySecurityPolicyRules = []; + for (var j = 0; j < message.gatewaySecurityPolicyRules.length; ++j) + object.gatewaySecurityPolicyRules[j] = $root.google.cloud.networksecurity.v1.GatewaySecurityPolicyRule.toObject(message.gatewaySecurityPolicyRules[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + if (message.unreachable && message.unreachable.length) { + object.unreachable = []; + for (var j = 0; j < message.unreachable.length; ++j) + object.unreachable[j] = message.unreachable[j]; + } + return object; + }; + + /** + * Converts this ListGatewaySecurityPolicyRulesResponse to JSON. + * @function toJSON + * @memberof google.cloud.networksecurity.v1.ListGatewaySecurityPolicyRulesResponse + * @instance + * @returns {Object.} JSON object + */ + ListGatewaySecurityPolicyRulesResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListGatewaySecurityPolicyRulesResponse + * @function getTypeUrl + * @memberof google.cloud.networksecurity.v1.ListGatewaySecurityPolicyRulesResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListGatewaySecurityPolicyRulesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.networksecurity.v1.ListGatewaySecurityPolicyRulesResponse"; + }; + + return ListGatewaySecurityPolicyRulesResponse; + })(); + + v1.DeleteGatewaySecurityPolicyRuleRequest = (function() { + + /** + * Properties of a DeleteGatewaySecurityPolicyRuleRequest. + * @memberof google.cloud.networksecurity.v1 + * @interface IDeleteGatewaySecurityPolicyRuleRequest + * @property {string|null} [name] DeleteGatewaySecurityPolicyRuleRequest name + */ + + /** + * Constructs a new DeleteGatewaySecurityPolicyRuleRequest. + * @memberof google.cloud.networksecurity.v1 + * @classdesc Represents a DeleteGatewaySecurityPolicyRuleRequest. + * @implements IDeleteGatewaySecurityPolicyRuleRequest + * @constructor + * @param {google.cloud.networksecurity.v1.IDeleteGatewaySecurityPolicyRuleRequest=} [properties] Properties to set + */ + function DeleteGatewaySecurityPolicyRuleRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteGatewaySecurityPolicyRuleRequest name. + * @member {string} name + * @memberof google.cloud.networksecurity.v1.DeleteGatewaySecurityPolicyRuleRequest + * @instance + */ + DeleteGatewaySecurityPolicyRuleRequest.prototype.name = ""; + + /** + * Creates a new DeleteGatewaySecurityPolicyRuleRequest instance using the specified properties. + * @function create + * @memberof google.cloud.networksecurity.v1.DeleteGatewaySecurityPolicyRuleRequest + * @static + * @param {google.cloud.networksecurity.v1.IDeleteGatewaySecurityPolicyRuleRequest=} [properties] Properties to set + * @returns {google.cloud.networksecurity.v1.DeleteGatewaySecurityPolicyRuleRequest} DeleteGatewaySecurityPolicyRuleRequest instance + */ + DeleteGatewaySecurityPolicyRuleRequest.create = function create(properties) { + return new DeleteGatewaySecurityPolicyRuleRequest(properties); + }; + + /** + * Encodes the specified DeleteGatewaySecurityPolicyRuleRequest message. Does not implicitly {@link google.cloud.networksecurity.v1.DeleteGatewaySecurityPolicyRuleRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.networksecurity.v1.DeleteGatewaySecurityPolicyRuleRequest + * @static + * @param {google.cloud.networksecurity.v1.IDeleteGatewaySecurityPolicyRuleRequest} message DeleteGatewaySecurityPolicyRuleRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteGatewaySecurityPolicyRuleRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified DeleteGatewaySecurityPolicyRuleRequest message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.DeleteGatewaySecurityPolicyRuleRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.networksecurity.v1.DeleteGatewaySecurityPolicyRuleRequest + * @static + * @param {google.cloud.networksecurity.v1.IDeleteGatewaySecurityPolicyRuleRequest} message DeleteGatewaySecurityPolicyRuleRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteGatewaySecurityPolicyRuleRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteGatewaySecurityPolicyRuleRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.networksecurity.v1.DeleteGatewaySecurityPolicyRuleRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.networksecurity.v1.DeleteGatewaySecurityPolicyRuleRequest} DeleteGatewaySecurityPolicyRuleRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteGatewaySecurityPolicyRuleRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networksecurity.v1.DeleteGatewaySecurityPolicyRuleRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteGatewaySecurityPolicyRuleRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.networksecurity.v1.DeleteGatewaySecurityPolicyRuleRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.networksecurity.v1.DeleteGatewaySecurityPolicyRuleRequest} DeleteGatewaySecurityPolicyRuleRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteGatewaySecurityPolicyRuleRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteGatewaySecurityPolicyRuleRequest message. + * @function verify + * @memberof google.cloud.networksecurity.v1.DeleteGatewaySecurityPolicyRuleRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteGatewaySecurityPolicyRuleRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a DeleteGatewaySecurityPolicyRuleRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.networksecurity.v1.DeleteGatewaySecurityPolicyRuleRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.networksecurity.v1.DeleteGatewaySecurityPolicyRuleRequest} DeleteGatewaySecurityPolicyRuleRequest + */ + DeleteGatewaySecurityPolicyRuleRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networksecurity.v1.DeleteGatewaySecurityPolicyRuleRequest) + return object; + var message = new $root.google.cloud.networksecurity.v1.DeleteGatewaySecurityPolicyRuleRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a DeleteGatewaySecurityPolicyRuleRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.networksecurity.v1.DeleteGatewaySecurityPolicyRuleRequest + * @static + * @param {google.cloud.networksecurity.v1.DeleteGatewaySecurityPolicyRuleRequest} message DeleteGatewaySecurityPolicyRuleRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteGatewaySecurityPolicyRuleRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this DeleteGatewaySecurityPolicyRuleRequest to JSON. + * @function toJSON + * @memberof google.cloud.networksecurity.v1.DeleteGatewaySecurityPolicyRuleRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteGatewaySecurityPolicyRuleRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteGatewaySecurityPolicyRuleRequest + * @function getTypeUrl + * @memberof google.cloud.networksecurity.v1.DeleteGatewaySecurityPolicyRuleRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteGatewaySecurityPolicyRuleRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.networksecurity.v1.DeleteGatewaySecurityPolicyRuleRequest"; + }; + + return DeleteGatewaySecurityPolicyRuleRequest; + })(); + + v1.Intercept = (function() { + + /** + * Constructs a new Intercept service. + * @memberof google.cloud.networksecurity.v1 + * @classdesc Represents an Intercept + * @extends $protobuf.rpc.Service + * @constructor + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + */ + function Intercept(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (Intercept.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Intercept; + + /** + * Creates new Intercept service using the specified rpc implementation. + * @function create + * @memberof google.cloud.networksecurity.v1.Intercept + * @static + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + * @returns {Intercept} RPC service. Useful where requests and/or responses are streamed. + */ + Intercept.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.networksecurity.v1.Intercept|listInterceptEndpointGroups}. + * @memberof google.cloud.networksecurity.v1.Intercept + * @typedef ListInterceptEndpointGroupsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.networksecurity.v1.ListInterceptEndpointGroupsResponse} [response] ListInterceptEndpointGroupsResponse + */ + + /** + * Calls ListInterceptEndpointGroups. + * @function listInterceptEndpointGroups + * @memberof google.cloud.networksecurity.v1.Intercept + * @instance + * @param {google.cloud.networksecurity.v1.IListInterceptEndpointGroupsRequest} request ListInterceptEndpointGroupsRequest message or plain object + * @param {google.cloud.networksecurity.v1.Intercept.ListInterceptEndpointGroupsCallback} callback Node-style callback called with the error, if any, and ListInterceptEndpointGroupsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Intercept.prototype.listInterceptEndpointGroups = function listInterceptEndpointGroups(request, callback) { + return this.rpcCall(listInterceptEndpointGroups, $root.google.cloud.networksecurity.v1.ListInterceptEndpointGroupsRequest, $root.google.cloud.networksecurity.v1.ListInterceptEndpointGroupsResponse, request, callback); + }, "name", { value: "ListInterceptEndpointGroups" }); + + /** + * Calls ListInterceptEndpointGroups. + * @function listInterceptEndpointGroups + * @memberof google.cloud.networksecurity.v1.Intercept + * @instance + * @param {google.cloud.networksecurity.v1.IListInterceptEndpointGroupsRequest} request ListInterceptEndpointGroupsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.networksecurity.v1.Intercept|getInterceptEndpointGroup}. + * @memberof google.cloud.networksecurity.v1.Intercept + * @typedef GetInterceptEndpointGroupCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.networksecurity.v1.InterceptEndpointGroup} [response] InterceptEndpointGroup + */ + + /** + * Calls GetInterceptEndpointGroup. + * @function getInterceptEndpointGroup + * @memberof google.cloud.networksecurity.v1.Intercept + * @instance + * @param {google.cloud.networksecurity.v1.IGetInterceptEndpointGroupRequest} request GetInterceptEndpointGroupRequest message or plain object + * @param {google.cloud.networksecurity.v1.Intercept.GetInterceptEndpointGroupCallback} callback Node-style callback called with the error, if any, and InterceptEndpointGroup + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Intercept.prototype.getInterceptEndpointGroup = function getInterceptEndpointGroup(request, callback) { + return this.rpcCall(getInterceptEndpointGroup, $root.google.cloud.networksecurity.v1.GetInterceptEndpointGroupRequest, $root.google.cloud.networksecurity.v1.InterceptEndpointGroup, request, callback); + }, "name", { value: "GetInterceptEndpointGroup" }); + + /** + * Calls GetInterceptEndpointGroup. + * @function getInterceptEndpointGroup + * @memberof google.cloud.networksecurity.v1.Intercept + * @instance + * @param {google.cloud.networksecurity.v1.IGetInterceptEndpointGroupRequest} request GetInterceptEndpointGroupRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.networksecurity.v1.Intercept|createInterceptEndpointGroup}. + * @memberof google.cloud.networksecurity.v1.Intercept + * @typedef CreateInterceptEndpointGroupCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls CreateInterceptEndpointGroup. + * @function createInterceptEndpointGroup + * @memberof google.cloud.networksecurity.v1.Intercept + * @instance + * @param {google.cloud.networksecurity.v1.ICreateInterceptEndpointGroupRequest} request CreateInterceptEndpointGroupRequest message or plain object + * @param {google.cloud.networksecurity.v1.Intercept.CreateInterceptEndpointGroupCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Intercept.prototype.createInterceptEndpointGroup = function createInterceptEndpointGroup(request, callback) { + return this.rpcCall(createInterceptEndpointGroup, $root.google.cloud.networksecurity.v1.CreateInterceptEndpointGroupRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "CreateInterceptEndpointGroup" }); + + /** + * Calls CreateInterceptEndpointGroup. + * @function createInterceptEndpointGroup + * @memberof google.cloud.networksecurity.v1.Intercept + * @instance + * @param {google.cloud.networksecurity.v1.ICreateInterceptEndpointGroupRequest} request CreateInterceptEndpointGroupRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.networksecurity.v1.Intercept|updateInterceptEndpointGroup}. + * @memberof google.cloud.networksecurity.v1.Intercept + * @typedef UpdateInterceptEndpointGroupCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls UpdateInterceptEndpointGroup. + * @function updateInterceptEndpointGroup + * @memberof google.cloud.networksecurity.v1.Intercept + * @instance + * @param {google.cloud.networksecurity.v1.IUpdateInterceptEndpointGroupRequest} request UpdateInterceptEndpointGroupRequest message or plain object + * @param {google.cloud.networksecurity.v1.Intercept.UpdateInterceptEndpointGroupCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Intercept.prototype.updateInterceptEndpointGroup = function updateInterceptEndpointGroup(request, callback) { + return this.rpcCall(updateInterceptEndpointGroup, $root.google.cloud.networksecurity.v1.UpdateInterceptEndpointGroupRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "UpdateInterceptEndpointGroup" }); + + /** + * Calls UpdateInterceptEndpointGroup. + * @function updateInterceptEndpointGroup + * @memberof google.cloud.networksecurity.v1.Intercept + * @instance + * @param {google.cloud.networksecurity.v1.IUpdateInterceptEndpointGroupRequest} request UpdateInterceptEndpointGroupRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.networksecurity.v1.Intercept|deleteInterceptEndpointGroup}. + * @memberof google.cloud.networksecurity.v1.Intercept + * @typedef DeleteInterceptEndpointGroupCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls DeleteInterceptEndpointGroup. + * @function deleteInterceptEndpointGroup + * @memberof google.cloud.networksecurity.v1.Intercept + * @instance + * @param {google.cloud.networksecurity.v1.IDeleteInterceptEndpointGroupRequest} request DeleteInterceptEndpointGroupRequest message or plain object + * @param {google.cloud.networksecurity.v1.Intercept.DeleteInterceptEndpointGroupCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Intercept.prototype.deleteInterceptEndpointGroup = function deleteInterceptEndpointGroup(request, callback) { + return this.rpcCall(deleteInterceptEndpointGroup, $root.google.cloud.networksecurity.v1.DeleteInterceptEndpointGroupRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "DeleteInterceptEndpointGroup" }); + + /** + * Calls DeleteInterceptEndpointGroup. + * @function deleteInterceptEndpointGroup + * @memberof google.cloud.networksecurity.v1.Intercept + * @instance + * @param {google.cloud.networksecurity.v1.IDeleteInterceptEndpointGroupRequest} request DeleteInterceptEndpointGroupRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.networksecurity.v1.Intercept|listInterceptEndpointGroupAssociations}. + * @memberof google.cloud.networksecurity.v1.Intercept + * @typedef ListInterceptEndpointGroupAssociationsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.networksecurity.v1.ListInterceptEndpointGroupAssociationsResponse} [response] ListInterceptEndpointGroupAssociationsResponse + */ + + /** + * Calls ListInterceptEndpointGroupAssociations. + * @function listInterceptEndpointGroupAssociations + * @memberof google.cloud.networksecurity.v1.Intercept + * @instance + * @param {google.cloud.networksecurity.v1.IListInterceptEndpointGroupAssociationsRequest} request ListInterceptEndpointGroupAssociationsRequest message or plain object + * @param {google.cloud.networksecurity.v1.Intercept.ListInterceptEndpointGroupAssociationsCallback} callback Node-style callback called with the error, if any, and ListInterceptEndpointGroupAssociationsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Intercept.prototype.listInterceptEndpointGroupAssociations = function listInterceptEndpointGroupAssociations(request, callback) { + return this.rpcCall(listInterceptEndpointGroupAssociations, $root.google.cloud.networksecurity.v1.ListInterceptEndpointGroupAssociationsRequest, $root.google.cloud.networksecurity.v1.ListInterceptEndpointGroupAssociationsResponse, request, callback); + }, "name", { value: "ListInterceptEndpointGroupAssociations" }); + + /** + * Calls ListInterceptEndpointGroupAssociations. + * @function listInterceptEndpointGroupAssociations + * @memberof google.cloud.networksecurity.v1.Intercept + * @instance + * @param {google.cloud.networksecurity.v1.IListInterceptEndpointGroupAssociationsRequest} request ListInterceptEndpointGroupAssociationsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.networksecurity.v1.Intercept|getInterceptEndpointGroupAssociation}. + * @memberof google.cloud.networksecurity.v1.Intercept + * @typedef GetInterceptEndpointGroupAssociationCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.networksecurity.v1.InterceptEndpointGroupAssociation} [response] InterceptEndpointGroupAssociation + */ + + /** + * Calls GetInterceptEndpointGroupAssociation. + * @function getInterceptEndpointGroupAssociation + * @memberof google.cloud.networksecurity.v1.Intercept + * @instance + * @param {google.cloud.networksecurity.v1.IGetInterceptEndpointGroupAssociationRequest} request GetInterceptEndpointGroupAssociationRequest message or plain object + * @param {google.cloud.networksecurity.v1.Intercept.GetInterceptEndpointGroupAssociationCallback} callback Node-style callback called with the error, if any, and InterceptEndpointGroupAssociation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Intercept.prototype.getInterceptEndpointGroupAssociation = function getInterceptEndpointGroupAssociation(request, callback) { + return this.rpcCall(getInterceptEndpointGroupAssociation, $root.google.cloud.networksecurity.v1.GetInterceptEndpointGroupAssociationRequest, $root.google.cloud.networksecurity.v1.InterceptEndpointGroupAssociation, request, callback); + }, "name", { value: "GetInterceptEndpointGroupAssociation" }); + + /** + * Calls GetInterceptEndpointGroupAssociation. + * @function getInterceptEndpointGroupAssociation + * @memberof google.cloud.networksecurity.v1.Intercept + * @instance + * @param {google.cloud.networksecurity.v1.IGetInterceptEndpointGroupAssociationRequest} request GetInterceptEndpointGroupAssociationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.networksecurity.v1.Intercept|createInterceptEndpointGroupAssociation}. + * @memberof google.cloud.networksecurity.v1.Intercept + * @typedef CreateInterceptEndpointGroupAssociationCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls CreateInterceptEndpointGroupAssociation. + * @function createInterceptEndpointGroupAssociation + * @memberof google.cloud.networksecurity.v1.Intercept + * @instance + * @param {google.cloud.networksecurity.v1.ICreateInterceptEndpointGroupAssociationRequest} request CreateInterceptEndpointGroupAssociationRequest message or plain object + * @param {google.cloud.networksecurity.v1.Intercept.CreateInterceptEndpointGroupAssociationCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Intercept.prototype.createInterceptEndpointGroupAssociation = function createInterceptEndpointGroupAssociation(request, callback) { + return this.rpcCall(createInterceptEndpointGroupAssociation, $root.google.cloud.networksecurity.v1.CreateInterceptEndpointGroupAssociationRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "CreateInterceptEndpointGroupAssociation" }); + + /** + * Calls CreateInterceptEndpointGroupAssociation. + * @function createInterceptEndpointGroupAssociation + * @memberof google.cloud.networksecurity.v1.Intercept + * @instance + * @param {google.cloud.networksecurity.v1.ICreateInterceptEndpointGroupAssociationRequest} request CreateInterceptEndpointGroupAssociationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.networksecurity.v1.Intercept|updateInterceptEndpointGroupAssociation}. + * @memberof google.cloud.networksecurity.v1.Intercept + * @typedef UpdateInterceptEndpointGroupAssociationCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls UpdateInterceptEndpointGroupAssociation. + * @function updateInterceptEndpointGroupAssociation + * @memberof google.cloud.networksecurity.v1.Intercept + * @instance + * @param {google.cloud.networksecurity.v1.IUpdateInterceptEndpointGroupAssociationRequest} request UpdateInterceptEndpointGroupAssociationRequest message or plain object + * @param {google.cloud.networksecurity.v1.Intercept.UpdateInterceptEndpointGroupAssociationCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Intercept.prototype.updateInterceptEndpointGroupAssociation = function updateInterceptEndpointGroupAssociation(request, callback) { + return this.rpcCall(updateInterceptEndpointGroupAssociation, $root.google.cloud.networksecurity.v1.UpdateInterceptEndpointGroupAssociationRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "UpdateInterceptEndpointGroupAssociation" }); + + /** + * Calls UpdateInterceptEndpointGroupAssociation. + * @function updateInterceptEndpointGroupAssociation + * @memberof google.cloud.networksecurity.v1.Intercept + * @instance + * @param {google.cloud.networksecurity.v1.IUpdateInterceptEndpointGroupAssociationRequest} request UpdateInterceptEndpointGroupAssociationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.networksecurity.v1.Intercept|deleteInterceptEndpointGroupAssociation}. + * @memberof google.cloud.networksecurity.v1.Intercept + * @typedef DeleteInterceptEndpointGroupAssociationCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls DeleteInterceptEndpointGroupAssociation. + * @function deleteInterceptEndpointGroupAssociation + * @memberof google.cloud.networksecurity.v1.Intercept + * @instance + * @param {google.cloud.networksecurity.v1.IDeleteInterceptEndpointGroupAssociationRequest} request DeleteInterceptEndpointGroupAssociationRequest message or plain object + * @param {google.cloud.networksecurity.v1.Intercept.DeleteInterceptEndpointGroupAssociationCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Intercept.prototype.deleteInterceptEndpointGroupAssociation = function deleteInterceptEndpointGroupAssociation(request, callback) { + return this.rpcCall(deleteInterceptEndpointGroupAssociation, $root.google.cloud.networksecurity.v1.DeleteInterceptEndpointGroupAssociationRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "DeleteInterceptEndpointGroupAssociation" }); + + /** + * Calls DeleteInterceptEndpointGroupAssociation. + * @function deleteInterceptEndpointGroupAssociation + * @memberof google.cloud.networksecurity.v1.Intercept + * @instance + * @param {google.cloud.networksecurity.v1.IDeleteInterceptEndpointGroupAssociationRequest} request DeleteInterceptEndpointGroupAssociationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.networksecurity.v1.Intercept|listInterceptDeploymentGroups}. + * @memberof google.cloud.networksecurity.v1.Intercept + * @typedef ListInterceptDeploymentGroupsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.networksecurity.v1.ListInterceptDeploymentGroupsResponse} [response] ListInterceptDeploymentGroupsResponse + */ + + /** + * Calls ListInterceptDeploymentGroups. + * @function listInterceptDeploymentGroups + * @memberof google.cloud.networksecurity.v1.Intercept + * @instance + * @param {google.cloud.networksecurity.v1.IListInterceptDeploymentGroupsRequest} request ListInterceptDeploymentGroupsRequest message or plain object + * @param {google.cloud.networksecurity.v1.Intercept.ListInterceptDeploymentGroupsCallback} callback Node-style callback called with the error, if any, and ListInterceptDeploymentGroupsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Intercept.prototype.listInterceptDeploymentGroups = function listInterceptDeploymentGroups(request, callback) { + return this.rpcCall(listInterceptDeploymentGroups, $root.google.cloud.networksecurity.v1.ListInterceptDeploymentGroupsRequest, $root.google.cloud.networksecurity.v1.ListInterceptDeploymentGroupsResponse, request, callback); + }, "name", { value: "ListInterceptDeploymentGroups" }); + + /** + * Calls ListInterceptDeploymentGroups. + * @function listInterceptDeploymentGroups + * @memberof google.cloud.networksecurity.v1.Intercept + * @instance + * @param {google.cloud.networksecurity.v1.IListInterceptDeploymentGroupsRequest} request ListInterceptDeploymentGroupsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.networksecurity.v1.Intercept|getInterceptDeploymentGroup}. + * @memberof google.cloud.networksecurity.v1.Intercept + * @typedef GetInterceptDeploymentGroupCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.networksecurity.v1.InterceptDeploymentGroup} [response] InterceptDeploymentGroup + */ + + /** + * Calls GetInterceptDeploymentGroup. + * @function getInterceptDeploymentGroup + * @memberof google.cloud.networksecurity.v1.Intercept + * @instance + * @param {google.cloud.networksecurity.v1.IGetInterceptDeploymentGroupRequest} request GetInterceptDeploymentGroupRequest message or plain object + * @param {google.cloud.networksecurity.v1.Intercept.GetInterceptDeploymentGroupCallback} callback Node-style callback called with the error, if any, and InterceptDeploymentGroup + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Intercept.prototype.getInterceptDeploymentGroup = function getInterceptDeploymentGroup(request, callback) { + return this.rpcCall(getInterceptDeploymentGroup, $root.google.cloud.networksecurity.v1.GetInterceptDeploymentGroupRequest, $root.google.cloud.networksecurity.v1.InterceptDeploymentGroup, request, callback); + }, "name", { value: "GetInterceptDeploymentGroup" }); + + /** + * Calls GetInterceptDeploymentGroup. + * @function getInterceptDeploymentGroup + * @memberof google.cloud.networksecurity.v1.Intercept + * @instance + * @param {google.cloud.networksecurity.v1.IGetInterceptDeploymentGroupRequest} request GetInterceptDeploymentGroupRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.networksecurity.v1.Intercept|createInterceptDeploymentGroup}. + * @memberof google.cloud.networksecurity.v1.Intercept + * @typedef CreateInterceptDeploymentGroupCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls CreateInterceptDeploymentGroup. + * @function createInterceptDeploymentGroup + * @memberof google.cloud.networksecurity.v1.Intercept + * @instance + * @param {google.cloud.networksecurity.v1.ICreateInterceptDeploymentGroupRequest} request CreateInterceptDeploymentGroupRequest message or plain object + * @param {google.cloud.networksecurity.v1.Intercept.CreateInterceptDeploymentGroupCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Intercept.prototype.createInterceptDeploymentGroup = function createInterceptDeploymentGroup(request, callback) { + return this.rpcCall(createInterceptDeploymentGroup, $root.google.cloud.networksecurity.v1.CreateInterceptDeploymentGroupRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "CreateInterceptDeploymentGroup" }); + + /** + * Calls CreateInterceptDeploymentGroup. + * @function createInterceptDeploymentGroup + * @memberof google.cloud.networksecurity.v1.Intercept + * @instance + * @param {google.cloud.networksecurity.v1.ICreateInterceptDeploymentGroupRequest} request CreateInterceptDeploymentGroupRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.networksecurity.v1.Intercept|updateInterceptDeploymentGroup}. + * @memberof google.cloud.networksecurity.v1.Intercept + * @typedef UpdateInterceptDeploymentGroupCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls UpdateInterceptDeploymentGroup. + * @function updateInterceptDeploymentGroup + * @memberof google.cloud.networksecurity.v1.Intercept + * @instance + * @param {google.cloud.networksecurity.v1.IUpdateInterceptDeploymentGroupRequest} request UpdateInterceptDeploymentGroupRequest message or plain object + * @param {google.cloud.networksecurity.v1.Intercept.UpdateInterceptDeploymentGroupCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Intercept.prototype.updateInterceptDeploymentGroup = function updateInterceptDeploymentGroup(request, callback) { + return this.rpcCall(updateInterceptDeploymentGroup, $root.google.cloud.networksecurity.v1.UpdateInterceptDeploymentGroupRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "UpdateInterceptDeploymentGroup" }); + + /** + * Calls UpdateInterceptDeploymentGroup. + * @function updateInterceptDeploymentGroup + * @memberof google.cloud.networksecurity.v1.Intercept + * @instance + * @param {google.cloud.networksecurity.v1.IUpdateInterceptDeploymentGroupRequest} request UpdateInterceptDeploymentGroupRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.networksecurity.v1.Intercept|deleteInterceptDeploymentGroup}. + * @memberof google.cloud.networksecurity.v1.Intercept + * @typedef DeleteInterceptDeploymentGroupCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls DeleteInterceptDeploymentGroup. + * @function deleteInterceptDeploymentGroup + * @memberof google.cloud.networksecurity.v1.Intercept + * @instance + * @param {google.cloud.networksecurity.v1.IDeleteInterceptDeploymentGroupRequest} request DeleteInterceptDeploymentGroupRequest message or plain object + * @param {google.cloud.networksecurity.v1.Intercept.DeleteInterceptDeploymentGroupCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Intercept.prototype.deleteInterceptDeploymentGroup = function deleteInterceptDeploymentGroup(request, callback) { + return this.rpcCall(deleteInterceptDeploymentGroup, $root.google.cloud.networksecurity.v1.DeleteInterceptDeploymentGroupRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "DeleteInterceptDeploymentGroup" }); + + /** + * Calls DeleteInterceptDeploymentGroup. + * @function deleteInterceptDeploymentGroup + * @memberof google.cloud.networksecurity.v1.Intercept + * @instance + * @param {google.cloud.networksecurity.v1.IDeleteInterceptDeploymentGroupRequest} request DeleteInterceptDeploymentGroupRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.networksecurity.v1.Intercept|listInterceptDeployments}. + * @memberof google.cloud.networksecurity.v1.Intercept + * @typedef ListInterceptDeploymentsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.networksecurity.v1.ListInterceptDeploymentsResponse} [response] ListInterceptDeploymentsResponse + */ + + /** + * Calls ListInterceptDeployments. + * @function listInterceptDeployments + * @memberof google.cloud.networksecurity.v1.Intercept + * @instance + * @param {google.cloud.networksecurity.v1.IListInterceptDeploymentsRequest} request ListInterceptDeploymentsRequest message or plain object + * @param {google.cloud.networksecurity.v1.Intercept.ListInterceptDeploymentsCallback} callback Node-style callback called with the error, if any, and ListInterceptDeploymentsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Intercept.prototype.listInterceptDeployments = function listInterceptDeployments(request, callback) { + return this.rpcCall(listInterceptDeployments, $root.google.cloud.networksecurity.v1.ListInterceptDeploymentsRequest, $root.google.cloud.networksecurity.v1.ListInterceptDeploymentsResponse, request, callback); + }, "name", { value: "ListInterceptDeployments" }); + + /** + * Calls ListInterceptDeployments. + * @function listInterceptDeployments + * @memberof google.cloud.networksecurity.v1.Intercept + * @instance + * @param {google.cloud.networksecurity.v1.IListInterceptDeploymentsRequest} request ListInterceptDeploymentsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.networksecurity.v1.Intercept|getInterceptDeployment}. + * @memberof google.cloud.networksecurity.v1.Intercept + * @typedef GetInterceptDeploymentCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.networksecurity.v1.InterceptDeployment} [response] InterceptDeployment + */ + + /** + * Calls GetInterceptDeployment. + * @function getInterceptDeployment + * @memberof google.cloud.networksecurity.v1.Intercept + * @instance + * @param {google.cloud.networksecurity.v1.IGetInterceptDeploymentRequest} request GetInterceptDeploymentRequest message or plain object + * @param {google.cloud.networksecurity.v1.Intercept.GetInterceptDeploymentCallback} callback Node-style callback called with the error, if any, and InterceptDeployment + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Intercept.prototype.getInterceptDeployment = function getInterceptDeployment(request, callback) { + return this.rpcCall(getInterceptDeployment, $root.google.cloud.networksecurity.v1.GetInterceptDeploymentRequest, $root.google.cloud.networksecurity.v1.InterceptDeployment, request, callback); + }, "name", { value: "GetInterceptDeployment" }); + + /** + * Calls GetInterceptDeployment. + * @function getInterceptDeployment + * @memberof google.cloud.networksecurity.v1.Intercept + * @instance + * @param {google.cloud.networksecurity.v1.IGetInterceptDeploymentRequest} request GetInterceptDeploymentRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.networksecurity.v1.Intercept|createInterceptDeployment}. + * @memberof google.cloud.networksecurity.v1.Intercept + * @typedef CreateInterceptDeploymentCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls CreateInterceptDeployment. + * @function createInterceptDeployment + * @memberof google.cloud.networksecurity.v1.Intercept + * @instance + * @param {google.cloud.networksecurity.v1.ICreateInterceptDeploymentRequest} request CreateInterceptDeploymentRequest message or plain object + * @param {google.cloud.networksecurity.v1.Intercept.CreateInterceptDeploymentCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Intercept.prototype.createInterceptDeployment = function createInterceptDeployment(request, callback) { + return this.rpcCall(createInterceptDeployment, $root.google.cloud.networksecurity.v1.CreateInterceptDeploymentRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "CreateInterceptDeployment" }); + + /** + * Calls CreateInterceptDeployment. + * @function createInterceptDeployment + * @memberof google.cloud.networksecurity.v1.Intercept + * @instance + * @param {google.cloud.networksecurity.v1.ICreateInterceptDeploymentRequest} request CreateInterceptDeploymentRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.networksecurity.v1.Intercept|updateInterceptDeployment}. + * @memberof google.cloud.networksecurity.v1.Intercept + * @typedef UpdateInterceptDeploymentCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls UpdateInterceptDeployment. + * @function updateInterceptDeployment + * @memberof google.cloud.networksecurity.v1.Intercept + * @instance + * @param {google.cloud.networksecurity.v1.IUpdateInterceptDeploymentRequest} request UpdateInterceptDeploymentRequest message or plain object + * @param {google.cloud.networksecurity.v1.Intercept.UpdateInterceptDeploymentCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Intercept.prototype.updateInterceptDeployment = function updateInterceptDeployment(request, callback) { + return this.rpcCall(updateInterceptDeployment, $root.google.cloud.networksecurity.v1.UpdateInterceptDeploymentRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "UpdateInterceptDeployment" }); + + /** + * Calls UpdateInterceptDeployment. + * @function updateInterceptDeployment + * @memberof google.cloud.networksecurity.v1.Intercept + * @instance + * @param {google.cloud.networksecurity.v1.IUpdateInterceptDeploymentRequest} request UpdateInterceptDeploymentRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.networksecurity.v1.Intercept|deleteInterceptDeployment}. + * @memberof google.cloud.networksecurity.v1.Intercept + * @typedef DeleteInterceptDeploymentCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls DeleteInterceptDeployment. + * @function deleteInterceptDeployment + * @memberof google.cloud.networksecurity.v1.Intercept + * @instance + * @param {google.cloud.networksecurity.v1.IDeleteInterceptDeploymentRequest} request DeleteInterceptDeploymentRequest message or plain object + * @param {google.cloud.networksecurity.v1.Intercept.DeleteInterceptDeploymentCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Intercept.prototype.deleteInterceptDeployment = function deleteInterceptDeployment(request, callback) { + return this.rpcCall(deleteInterceptDeployment, $root.google.cloud.networksecurity.v1.DeleteInterceptDeploymentRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "DeleteInterceptDeployment" }); + + /** + * Calls DeleteInterceptDeployment. + * @function deleteInterceptDeployment + * @memberof google.cloud.networksecurity.v1.Intercept + * @instance + * @param {google.cloud.networksecurity.v1.IDeleteInterceptDeploymentRequest} request DeleteInterceptDeploymentRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return Intercept; + })(); + + v1.InterceptEndpointGroup = (function() { + + /** + * Properties of an InterceptEndpointGroup. + * @memberof google.cloud.networksecurity.v1 + * @interface IInterceptEndpointGroup + * @property {string|null} [name] InterceptEndpointGroup name + * @property {google.protobuf.ITimestamp|null} [createTime] InterceptEndpointGroup createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] InterceptEndpointGroup updateTime + * @property {Object.|null} [labels] InterceptEndpointGroup labels + * @property {string|null} [interceptDeploymentGroup] InterceptEndpointGroup interceptDeploymentGroup + * @property {google.cloud.networksecurity.v1.InterceptEndpointGroup.IConnectedDeploymentGroup|null} [connectedDeploymentGroup] InterceptEndpointGroup connectedDeploymentGroup + * @property {google.cloud.networksecurity.v1.InterceptEndpointGroup.State|null} [state] InterceptEndpointGroup state + * @property {boolean|null} [reconciling] InterceptEndpointGroup reconciling + * @property {Array.|null} [associations] InterceptEndpointGroup associations + * @property {string|null} [description] InterceptEndpointGroup description + */ + + /** + * Constructs a new InterceptEndpointGroup. + * @memberof google.cloud.networksecurity.v1 + * @classdesc Represents an InterceptEndpointGroup. + * @implements IInterceptEndpointGroup + * @constructor + * @param {google.cloud.networksecurity.v1.IInterceptEndpointGroup=} [properties] Properties to set + */ + function InterceptEndpointGroup(properties) { + this.labels = {}; + this.associations = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * InterceptEndpointGroup name. + * @member {string} name + * @memberof google.cloud.networksecurity.v1.InterceptEndpointGroup + * @instance + */ + InterceptEndpointGroup.prototype.name = ""; + + /** + * InterceptEndpointGroup createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.networksecurity.v1.InterceptEndpointGroup + * @instance + */ + InterceptEndpointGroup.prototype.createTime = null; + + /** + * InterceptEndpointGroup updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.networksecurity.v1.InterceptEndpointGroup + * @instance + */ + InterceptEndpointGroup.prototype.updateTime = null; + + /** + * InterceptEndpointGroup labels. + * @member {Object.} labels + * @memberof google.cloud.networksecurity.v1.InterceptEndpointGroup + * @instance + */ + InterceptEndpointGroup.prototype.labels = $util.emptyObject; + + /** + * InterceptEndpointGroup interceptDeploymentGroup. + * @member {string} interceptDeploymentGroup + * @memberof google.cloud.networksecurity.v1.InterceptEndpointGroup + * @instance + */ + InterceptEndpointGroup.prototype.interceptDeploymentGroup = ""; + + /** + * InterceptEndpointGroup connectedDeploymentGroup. + * @member {google.cloud.networksecurity.v1.InterceptEndpointGroup.IConnectedDeploymentGroup|null|undefined} connectedDeploymentGroup + * @memberof google.cloud.networksecurity.v1.InterceptEndpointGroup + * @instance + */ + InterceptEndpointGroup.prototype.connectedDeploymentGroup = null; + + /** + * InterceptEndpointGroup state. + * @member {google.cloud.networksecurity.v1.InterceptEndpointGroup.State} state + * @memberof google.cloud.networksecurity.v1.InterceptEndpointGroup + * @instance + */ + InterceptEndpointGroup.prototype.state = 0; + + /** + * InterceptEndpointGroup reconciling. + * @member {boolean} reconciling + * @memberof google.cloud.networksecurity.v1.InterceptEndpointGroup + * @instance + */ + InterceptEndpointGroup.prototype.reconciling = false; + + /** + * InterceptEndpointGroup associations. + * @member {Array.} associations + * @memberof google.cloud.networksecurity.v1.InterceptEndpointGroup + * @instance + */ + InterceptEndpointGroup.prototype.associations = $util.emptyArray; + + /** + * InterceptEndpointGroup description. + * @member {string} description + * @memberof google.cloud.networksecurity.v1.InterceptEndpointGroup + * @instance + */ + InterceptEndpointGroup.prototype.description = ""; + + /** + * Creates a new InterceptEndpointGroup instance using the specified properties. + * @function create + * @memberof google.cloud.networksecurity.v1.InterceptEndpointGroup + * @static + * @param {google.cloud.networksecurity.v1.IInterceptEndpointGroup=} [properties] Properties to set + * @returns {google.cloud.networksecurity.v1.InterceptEndpointGroup} InterceptEndpointGroup instance + */ + InterceptEndpointGroup.create = function create(properties) { + return new InterceptEndpointGroup(properties); + }; + + /** + * Encodes the specified InterceptEndpointGroup message. Does not implicitly {@link google.cloud.networksecurity.v1.InterceptEndpointGroup.verify|verify} messages. + * @function encode + * @memberof google.cloud.networksecurity.v1.InterceptEndpointGroup + * @static + * @param {google.cloud.networksecurity.v1.IInterceptEndpointGroup} message InterceptEndpointGroup message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InterceptEndpointGroup.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) + for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) + writer.uint32(/* id 4, wireType 2 =*/34).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); + if (message.interceptDeploymentGroup != null && Object.hasOwnProperty.call(message, "interceptDeploymentGroup")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.interceptDeploymentGroup); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 7, wireType 0 =*/56).int32(message.state); + if (message.reconciling != null && Object.hasOwnProperty.call(message, "reconciling")) + writer.uint32(/* id 8, wireType 0 =*/64).bool(message.reconciling); + if (message.associations != null && message.associations.length) + for (var i = 0; i < message.associations.length; ++i) + $root.google.cloud.networksecurity.v1.InterceptEndpointGroup.AssociationDetails.encode(message.associations[i], writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.description); + if (message.connectedDeploymentGroup != null && Object.hasOwnProperty.call(message, "connectedDeploymentGroup")) + $root.google.cloud.networksecurity.v1.InterceptEndpointGroup.ConnectedDeploymentGroup.encode(message.connectedDeploymentGroup, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified InterceptEndpointGroup message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.InterceptEndpointGroup.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.networksecurity.v1.InterceptEndpointGroup + * @static + * @param {google.cloud.networksecurity.v1.IInterceptEndpointGroup} message InterceptEndpointGroup message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InterceptEndpointGroup.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an InterceptEndpointGroup message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.networksecurity.v1.InterceptEndpointGroup + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.networksecurity.v1.InterceptEndpointGroup} InterceptEndpointGroup + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InterceptEndpointGroup.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networksecurity.v1.InterceptEndpointGroup(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 3: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 4: { + if (message.labels === $util.emptyObject) + message.labels = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.labels[key] = value; + break; + } + case 5: { + message.interceptDeploymentGroup = reader.string(); + break; + } + case 11: { + message.connectedDeploymentGroup = $root.google.cloud.networksecurity.v1.InterceptEndpointGroup.ConnectedDeploymentGroup.decode(reader, reader.uint32()); + break; + } + case 7: { + message.state = reader.int32(); + break; + } + case 8: { + message.reconciling = reader.bool(); + break; + } + case 9: { + if (!(message.associations && message.associations.length)) + message.associations = []; + message.associations.push($root.google.cloud.networksecurity.v1.InterceptEndpointGroup.AssociationDetails.decode(reader, reader.uint32())); + break; + } + case 10: { + message.description = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an InterceptEndpointGroup message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.networksecurity.v1.InterceptEndpointGroup + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.networksecurity.v1.InterceptEndpointGroup} InterceptEndpointGroup + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InterceptEndpointGroup.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an InterceptEndpointGroup message. + * @function verify + * @memberof google.cloud.networksecurity.v1.InterceptEndpointGroup + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + InterceptEndpointGroup.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime); + if (error) + return "updateTime." + error; + } + if (message.labels != null && message.hasOwnProperty("labels")) { + if (!$util.isObject(message.labels)) + return "labels: object expected"; + var key = Object.keys(message.labels); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.labels[key[i]])) + return "labels: string{k:string} expected"; + } + if (message.interceptDeploymentGroup != null && message.hasOwnProperty("interceptDeploymentGroup")) + if (!$util.isString(message.interceptDeploymentGroup)) + return "interceptDeploymentGroup: string expected"; + if (message.connectedDeploymentGroup != null && message.hasOwnProperty("connectedDeploymentGroup")) { + var error = $root.google.cloud.networksecurity.v1.InterceptEndpointGroup.ConnectedDeploymentGroup.verify(message.connectedDeploymentGroup); + if (error) + return "connectedDeploymentGroup." + error; + } + if (message.state != null && message.hasOwnProperty("state")) + switch (message.state) { + default: + return "state: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + break; + } + if (message.reconciling != null && message.hasOwnProperty("reconciling")) + if (typeof message.reconciling !== "boolean") + return "reconciling: boolean expected"; + if (message.associations != null && message.hasOwnProperty("associations")) { + if (!Array.isArray(message.associations)) + return "associations: array expected"; + for (var i = 0; i < message.associations.length; ++i) { + var error = $root.google.cloud.networksecurity.v1.InterceptEndpointGroup.AssociationDetails.verify(message.associations[i]); + if (error) + return "associations." + error; + } + } + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + return null; + }; + + /** + * Creates an InterceptEndpointGroup message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.networksecurity.v1.InterceptEndpointGroup + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.networksecurity.v1.InterceptEndpointGroup} InterceptEndpointGroup + */ + InterceptEndpointGroup.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networksecurity.v1.InterceptEndpointGroup) + return object; + var message = new $root.google.cloud.networksecurity.v1.InterceptEndpointGroup(); + if (object.name != null) + message.name = String(object.name); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.networksecurity.v1.InterceptEndpointGroup.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.updateTime != null) { + if (typeof object.updateTime !== "object") + throw TypeError(".google.cloud.networksecurity.v1.InterceptEndpointGroup.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.cloud.networksecurity.v1.InterceptEndpointGroup.labels: object expected"); + message.labels = {}; + for (var keys = Object.keys(object.labels), i = 0; i < keys.length; ++i) + message.labels[keys[i]] = String(object.labels[keys[i]]); + } + if (object.interceptDeploymentGroup != null) + message.interceptDeploymentGroup = String(object.interceptDeploymentGroup); + if (object.connectedDeploymentGroup != null) { + if (typeof object.connectedDeploymentGroup !== "object") + throw TypeError(".google.cloud.networksecurity.v1.InterceptEndpointGroup.connectedDeploymentGroup: object expected"); + message.connectedDeploymentGroup = $root.google.cloud.networksecurity.v1.InterceptEndpointGroup.ConnectedDeploymentGroup.fromObject(object.connectedDeploymentGroup); + } + switch (object.state) { + default: + if (typeof object.state === "number") { + message.state = object.state; + break; + } + break; + case "STATE_UNSPECIFIED": + case 0: + message.state = 0; + break; + case "ACTIVE": + case 1: + message.state = 1; + break; + case "CLOSED": + case 2: + message.state = 2; + break; + case "CREATING": + case 3: + message.state = 3; + break; + case "DELETING": + case 4: + message.state = 4; + break; + case "OUT_OF_SYNC": + case 5: + message.state = 5; + break; + case "DELETE_FAILED": + case 6: + message.state = 6; + break; + } + if (object.reconciling != null) + message.reconciling = Boolean(object.reconciling); + if (object.associations) { + if (!Array.isArray(object.associations)) + throw TypeError(".google.cloud.networksecurity.v1.InterceptEndpointGroup.associations: array expected"); + message.associations = []; + for (var i = 0; i < object.associations.length; ++i) { + if (typeof object.associations[i] !== "object") + throw TypeError(".google.cloud.networksecurity.v1.InterceptEndpointGroup.associations: object expected"); + message.associations[i] = $root.google.cloud.networksecurity.v1.InterceptEndpointGroup.AssociationDetails.fromObject(object.associations[i]); + } + } + if (object.description != null) + message.description = String(object.description); + return message; + }; + + /** + * Creates a plain object from an InterceptEndpointGroup message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.networksecurity.v1.InterceptEndpointGroup + * @static + * @param {google.cloud.networksecurity.v1.InterceptEndpointGroup} message InterceptEndpointGroup + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + InterceptEndpointGroup.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.associations = []; + if (options.objects || options.defaults) + object.labels = {}; + if (options.defaults) { + object.name = ""; + object.createTime = null; + object.updateTime = null; + object.interceptDeploymentGroup = ""; + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + object.reconciling = false; + object.description = ""; + object.connectedDeploymentGroup = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.updateTime != null && message.hasOwnProperty("updateTime")) + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); + var keys2; + if (message.labels && (keys2 = Object.keys(message.labels)).length) { + object.labels = {}; + for (var j = 0; j < keys2.length; ++j) + object.labels[keys2[j]] = message.labels[keys2[j]]; + } + if (message.interceptDeploymentGroup != null && message.hasOwnProperty("interceptDeploymentGroup")) + object.interceptDeploymentGroup = message.interceptDeploymentGroup; + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.networksecurity.v1.InterceptEndpointGroup.State[message.state] === undefined ? message.state : $root.google.cloud.networksecurity.v1.InterceptEndpointGroup.State[message.state] : message.state; + if (message.reconciling != null && message.hasOwnProperty("reconciling")) + object.reconciling = message.reconciling; + if (message.associations && message.associations.length) { + object.associations = []; + for (var j = 0; j < message.associations.length; ++j) + object.associations[j] = $root.google.cloud.networksecurity.v1.InterceptEndpointGroup.AssociationDetails.toObject(message.associations[j], options); + } + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.connectedDeploymentGroup != null && message.hasOwnProperty("connectedDeploymentGroup")) + object.connectedDeploymentGroup = $root.google.cloud.networksecurity.v1.InterceptEndpointGroup.ConnectedDeploymentGroup.toObject(message.connectedDeploymentGroup, options); + return object; + }; + + /** + * Converts this InterceptEndpointGroup to JSON. + * @function toJSON + * @memberof google.cloud.networksecurity.v1.InterceptEndpointGroup + * @instance + * @returns {Object.} JSON object + */ + InterceptEndpointGroup.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for InterceptEndpointGroup + * @function getTypeUrl + * @memberof google.cloud.networksecurity.v1.InterceptEndpointGroup + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + InterceptEndpointGroup.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.networksecurity.v1.InterceptEndpointGroup"; + }; + + InterceptEndpointGroup.ConnectedDeploymentGroup = (function() { + + /** + * Properties of a ConnectedDeploymentGroup. + * @memberof google.cloud.networksecurity.v1.InterceptEndpointGroup + * @interface IConnectedDeploymentGroup + * @property {string|null} [name] ConnectedDeploymentGroup name + * @property {Array.|null} [locations] ConnectedDeploymentGroup locations + */ + + /** + * Constructs a new ConnectedDeploymentGroup. + * @memberof google.cloud.networksecurity.v1.InterceptEndpointGroup + * @classdesc Represents a ConnectedDeploymentGroup. + * @implements IConnectedDeploymentGroup + * @constructor + * @param {google.cloud.networksecurity.v1.InterceptEndpointGroup.IConnectedDeploymentGroup=} [properties] Properties to set + */ + function ConnectedDeploymentGroup(properties) { + this.locations = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ConnectedDeploymentGroup name. + * @member {string} name + * @memberof google.cloud.networksecurity.v1.InterceptEndpointGroup.ConnectedDeploymentGroup + * @instance + */ + ConnectedDeploymentGroup.prototype.name = ""; + + /** + * ConnectedDeploymentGroup locations. + * @member {Array.} locations + * @memberof google.cloud.networksecurity.v1.InterceptEndpointGroup.ConnectedDeploymentGroup + * @instance + */ + ConnectedDeploymentGroup.prototype.locations = $util.emptyArray; + + /** + * Creates a new ConnectedDeploymentGroup instance using the specified properties. + * @function create + * @memberof google.cloud.networksecurity.v1.InterceptEndpointGroup.ConnectedDeploymentGroup + * @static + * @param {google.cloud.networksecurity.v1.InterceptEndpointGroup.IConnectedDeploymentGroup=} [properties] Properties to set + * @returns {google.cloud.networksecurity.v1.InterceptEndpointGroup.ConnectedDeploymentGroup} ConnectedDeploymentGroup instance + */ + ConnectedDeploymentGroup.create = function create(properties) { + return new ConnectedDeploymentGroup(properties); + }; + + /** + * Encodes the specified ConnectedDeploymentGroup message. Does not implicitly {@link google.cloud.networksecurity.v1.InterceptEndpointGroup.ConnectedDeploymentGroup.verify|verify} messages. + * @function encode + * @memberof google.cloud.networksecurity.v1.InterceptEndpointGroup.ConnectedDeploymentGroup + * @static + * @param {google.cloud.networksecurity.v1.InterceptEndpointGroup.IConnectedDeploymentGroup} message ConnectedDeploymentGroup message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ConnectedDeploymentGroup.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.locations != null && message.locations.length) + for (var i = 0; i < message.locations.length; ++i) + $root.google.cloud.networksecurity.v1.InterceptLocation.encode(message.locations[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ConnectedDeploymentGroup message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.InterceptEndpointGroup.ConnectedDeploymentGroup.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.networksecurity.v1.InterceptEndpointGroup.ConnectedDeploymentGroup + * @static + * @param {google.cloud.networksecurity.v1.InterceptEndpointGroup.IConnectedDeploymentGroup} message ConnectedDeploymentGroup message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ConnectedDeploymentGroup.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ConnectedDeploymentGroup message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.networksecurity.v1.InterceptEndpointGroup.ConnectedDeploymentGroup + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.networksecurity.v1.InterceptEndpointGroup.ConnectedDeploymentGroup} ConnectedDeploymentGroup + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ConnectedDeploymentGroup.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networksecurity.v1.InterceptEndpointGroup.ConnectedDeploymentGroup(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + if (!(message.locations && message.locations.length)) + message.locations = []; + message.locations.push($root.google.cloud.networksecurity.v1.InterceptLocation.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ConnectedDeploymentGroup message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.networksecurity.v1.InterceptEndpointGroup.ConnectedDeploymentGroup + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.networksecurity.v1.InterceptEndpointGroup.ConnectedDeploymentGroup} ConnectedDeploymentGroup + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ConnectedDeploymentGroup.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ConnectedDeploymentGroup message. + * @function verify + * @memberof google.cloud.networksecurity.v1.InterceptEndpointGroup.ConnectedDeploymentGroup + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ConnectedDeploymentGroup.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.locations != null && message.hasOwnProperty("locations")) { + if (!Array.isArray(message.locations)) + return "locations: array expected"; + for (var i = 0; i < message.locations.length; ++i) { + var error = $root.google.cloud.networksecurity.v1.InterceptLocation.verify(message.locations[i]); + if (error) + return "locations." + error; + } + } + return null; + }; + + /** + * Creates a ConnectedDeploymentGroup message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.networksecurity.v1.InterceptEndpointGroup.ConnectedDeploymentGroup + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.networksecurity.v1.InterceptEndpointGroup.ConnectedDeploymentGroup} ConnectedDeploymentGroup + */ + ConnectedDeploymentGroup.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networksecurity.v1.InterceptEndpointGroup.ConnectedDeploymentGroup) + return object; + var message = new $root.google.cloud.networksecurity.v1.InterceptEndpointGroup.ConnectedDeploymentGroup(); + if (object.name != null) + message.name = String(object.name); + if (object.locations) { + if (!Array.isArray(object.locations)) + throw TypeError(".google.cloud.networksecurity.v1.InterceptEndpointGroup.ConnectedDeploymentGroup.locations: array expected"); + message.locations = []; + for (var i = 0; i < object.locations.length; ++i) { + if (typeof object.locations[i] !== "object") + throw TypeError(".google.cloud.networksecurity.v1.InterceptEndpointGroup.ConnectedDeploymentGroup.locations: object expected"); + message.locations[i] = $root.google.cloud.networksecurity.v1.InterceptLocation.fromObject(object.locations[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a ConnectedDeploymentGroup message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.networksecurity.v1.InterceptEndpointGroup.ConnectedDeploymentGroup + * @static + * @param {google.cloud.networksecurity.v1.InterceptEndpointGroup.ConnectedDeploymentGroup} message ConnectedDeploymentGroup + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ConnectedDeploymentGroup.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.locations = []; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.locations && message.locations.length) { + object.locations = []; + for (var j = 0; j < message.locations.length; ++j) + object.locations[j] = $root.google.cloud.networksecurity.v1.InterceptLocation.toObject(message.locations[j], options); + } + return object; + }; + + /** + * Converts this ConnectedDeploymentGroup to JSON. + * @function toJSON + * @memberof google.cloud.networksecurity.v1.InterceptEndpointGroup.ConnectedDeploymentGroup + * @instance + * @returns {Object.} JSON object + */ + ConnectedDeploymentGroup.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ConnectedDeploymentGroup + * @function getTypeUrl + * @memberof google.cloud.networksecurity.v1.InterceptEndpointGroup.ConnectedDeploymentGroup + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ConnectedDeploymentGroup.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.networksecurity.v1.InterceptEndpointGroup.ConnectedDeploymentGroup"; + }; + + return ConnectedDeploymentGroup; + })(); + + InterceptEndpointGroup.AssociationDetails = (function() { + + /** + * Properties of an AssociationDetails. + * @memberof google.cloud.networksecurity.v1.InterceptEndpointGroup + * @interface IAssociationDetails + * @property {string|null} [name] AssociationDetails name + * @property {string|null} [network] AssociationDetails network + * @property {google.cloud.networksecurity.v1.InterceptEndpointGroupAssociation.State|null} [state] AssociationDetails state + */ + + /** + * Constructs a new AssociationDetails. + * @memberof google.cloud.networksecurity.v1.InterceptEndpointGroup + * @classdesc Represents an AssociationDetails. + * @implements IAssociationDetails + * @constructor + * @param {google.cloud.networksecurity.v1.InterceptEndpointGroup.IAssociationDetails=} [properties] Properties to set + */ + function AssociationDetails(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AssociationDetails name. + * @member {string} name + * @memberof google.cloud.networksecurity.v1.InterceptEndpointGroup.AssociationDetails + * @instance + */ + AssociationDetails.prototype.name = ""; + + /** + * AssociationDetails network. + * @member {string} network + * @memberof google.cloud.networksecurity.v1.InterceptEndpointGroup.AssociationDetails + * @instance + */ + AssociationDetails.prototype.network = ""; + + /** + * AssociationDetails state. + * @member {google.cloud.networksecurity.v1.InterceptEndpointGroupAssociation.State} state + * @memberof google.cloud.networksecurity.v1.InterceptEndpointGroup.AssociationDetails + * @instance + */ + AssociationDetails.prototype.state = 0; + + /** + * Creates a new AssociationDetails instance using the specified properties. + * @function create + * @memberof google.cloud.networksecurity.v1.InterceptEndpointGroup.AssociationDetails + * @static + * @param {google.cloud.networksecurity.v1.InterceptEndpointGroup.IAssociationDetails=} [properties] Properties to set + * @returns {google.cloud.networksecurity.v1.InterceptEndpointGroup.AssociationDetails} AssociationDetails instance + */ + AssociationDetails.create = function create(properties) { + return new AssociationDetails(properties); + }; + + /** + * Encodes the specified AssociationDetails message. Does not implicitly {@link google.cloud.networksecurity.v1.InterceptEndpointGroup.AssociationDetails.verify|verify} messages. + * @function encode + * @memberof google.cloud.networksecurity.v1.InterceptEndpointGroup.AssociationDetails + * @static + * @param {google.cloud.networksecurity.v1.InterceptEndpointGroup.IAssociationDetails} message AssociationDetails message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AssociationDetails.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.network != null && Object.hasOwnProperty.call(message, "network")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.network); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.state); + return writer; + }; + + /** + * Encodes the specified AssociationDetails message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.InterceptEndpointGroup.AssociationDetails.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.networksecurity.v1.InterceptEndpointGroup.AssociationDetails + * @static + * @param {google.cloud.networksecurity.v1.InterceptEndpointGroup.IAssociationDetails} message AssociationDetails message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AssociationDetails.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AssociationDetails message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.networksecurity.v1.InterceptEndpointGroup.AssociationDetails + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.networksecurity.v1.InterceptEndpointGroup.AssociationDetails} AssociationDetails + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AssociationDetails.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networksecurity.v1.InterceptEndpointGroup.AssociationDetails(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.network = reader.string(); + break; + } + case 3: { + message.state = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AssociationDetails message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.networksecurity.v1.InterceptEndpointGroup.AssociationDetails + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.networksecurity.v1.InterceptEndpointGroup.AssociationDetails} AssociationDetails + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AssociationDetails.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AssociationDetails message. + * @function verify + * @memberof google.cloud.networksecurity.v1.InterceptEndpointGroup.AssociationDetails + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AssociationDetails.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.network != null && message.hasOwnProperty("network")) + if (!$util.isString(message.network)) + return "network: string expected"; + if (message.state != null && message.hasOwnProperty("state")) + switch (message.state) { + default: + return "state: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + break; + } + return null; + }; + + /** + * Creates an AssociationDetails message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.networksecurity.v1.InterceptEndpointGroup.AssociationDetails + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.networksecurity.v1.InterceptEndpointGroup.AssociationDetails} AssociationDetails + */ + AssociationDetails.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networksecurity.v1.InterceptEndpointGroup.AssociationDetails) + return object; + var message = new $root.google.cloud.networksecurity.v1.InterceptEndpointGroup.AssociationDetails(); + if (object.name != null) + message.name = String(object.name); + if (object.network != null) + message.network = String(object.network); + switch (object.state) { + default: + if (typeof object.state === "number") { + message.state = object.state; + break; + } + break; + case "STATE_UNSPECIFIED": + case 0: + message.state = 0; + break; + case "ACTIVE": + case 1: + message.state = 1; + break; + case "CREATING": + case 2: + message.state = 2; + break; + case "DELETING": + case 3: + message.state = 3; + break; + case "CLOSED": + case 4: + message.state = 4; + break; + case "OUT_OF_SYNC": + case 5: + message.state = 5; + break; + case "DELETE_FAILED": + case 6: + message.state = 6; + break; + } + return message; + }; + + /** + * Creates a plain object from an AssociationDetails message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.networksecurity.v1.InterceptEndpointGroup.AssociationDetails + * @static + * @param {google.cloud.networksecurity.v1.InterceptEndpointGroup.AssociationDetails} message AssociationDetails + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AssociationDetails.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.network = ""; + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.network != null && message.hasOwnProperty("network")) + object.network = message.network; + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.networksecurity.v1.InterceptEndpointGroupAssociation.State[message.state] === undefined ? message.state : $root.google.cloud.networksecurity.v1.InterceptEndpointGroupAssociation.State[message.state] : message.state; + return object; + }; + + /** + * Converts this AssociationDetails to JSON. + * @function toJSON + * @memberof google.cloud.networksecurity.v1.InterceptEndpointGroup.AssociationDetails + * @instance + * @returns {Object.} JSON object + */ + AssociationDetails.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AssociationDetails + * @function getTypeUrl + * @memberof google.cloud.networksecurity.v1.InterceptEndpointGroup.AssociationDetails + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AssociationDetails.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.networksecurity.v1.InterceptEndpointGroup.AssociationDetails"; + }; + + return AssociationDetails; + })(); + + /** + * State enum. + * @name google.cloud.networksecurity.v1.InterceptEndpointGroup.State + * @enum {number} + * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value + * @property {number} ACTIVE=1 ACTIVE value + * @property {number} CLOSED=2 CLOSED value + * @property {number} CREATING=3 CREATING value + * @property {number} DELETING=4 DELETING value + * @property {number} OUT_OF_SYNC=5 OUT_OF_SYNC value + * @property {number} DELETE_FAILED=6 DELETE_FAILED value + */ + InterceptEndpointGroup.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "ACTIVE"] = 1; + values[valuesById[2] = "CLOSED"] = 2; + values[valuesById[3] = "CREATING"] = 3; + values[valuesById[4] = "DELETING"] = 4; + values[valuesById[5] = "OUT_OF_SYNC"] = 5; + values[valuesById[6] = "DELETE_FAILED"] = 6; + return values; + })(); + + return InterceptEndpointGroup; + })(); + + v1.ListInterceptEndpointGroupsRequest = (function() { + + /** + * Properties of a ListInterceptEndpointGroupsRequest. + * @memberof google.cloud.networksecurity.v1 + * @interface IListInterceptEndpointGroupsRequest + * @property {string|null} [parent] ListInterceptEndpointGroupsRequest parent + * @property {number|null} [pageSize] ListInterceptEndpointGroupsRequest pageSize + * @property {string|null} [pageToken] ListInterceptEndpointGroupsRequest pageToken + * @property {string|null} [filter] ListInterceptEndpointGroupsRequest filter + * @property {string|null} [orderBy] ListInterceptEndpointGroupsRequest orderBy + */ + + /** + * Constructs a new ListInterceptEndpointGroupsRequest. + * @memberof google.cloud.networksecurity.v1 + * @classdesc Represents a ListInterceptEndpointGroupsRequest. + * @implements IListInterceptEndpointGroupsRequest + * @constructor + * @param {google.cloud.networksecurity.v1.IListInterceptEndpointGroupsRequest=} [properties] Properties to set + */ + function ListInterceptEndpointGroupsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListInterceptEndpointGroupsRequest parent. + * @member {string} parent + * @memberof google.cloud.networksecurity.v1.ListInterceptEndpointGroupsRequest + * @instance + */ + ListInterceptEndpointGroupsRequest.prototype.parent = ""; + + /** + * ListInterceptEndpointGroupsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.networksecurity.v1.ListInterceptEndpointGroupsRequest + * @instance + */ + ListInterceptEndpointGroupsRequest.prototype.pageSize = 0; + + /** + * ListInterceptEndpointGroupsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.networksecurity.v1.ListInterceptEndpointGroupsRequest + * @instance + */ + ListInterceptEndpointGroupsRequest.prototype.pageToken = ""; + + /** + * ListInterceptEndpointGroupsRequest filter. + * @member {string} filter + * @memberof google.cloud.networksecurity.v1.ListInterceptEndpointGroupsRequest + * @instance + */ + ListInterceptEndpointGroupsRequest.prototype.filter = ""; + + /** + * ListInterceptEndpointGroupsRequest orderBy. + * @member {string} orderBy + * @memberof google.cloud.networksecurity.v1.ListInterceptEndpointGroupsRequest + * @instance + */ + ListInterceptEndpointGroupsRequest.prototype.orderBy = ""; + + /** + * Creates a new ListInterceptEndpointGroupsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.networksecurity.v1.ListInterceptEndpointGroupsRequest + * @static + * @param {google.cloud.networksecurity.v1.IListInterceptEndpointGroupsRequest=} [properties] Properties to set + * @returns {google.cloud.networksecurity.v1.ListInterceptEndpointGroupsRequest} ListInterceptEndpointGroupsRequest instance + */ + ListInterceptEndpointGroupsRequest.create = function create(properties) { + return new ListInterceptEndpointGroupsRequest(properties); + }; + + /** + * Encodes the specified ListInterceptEndpointGroupsRequest message. Does not implicitly {@link google.cloud.networksecurity.v1.ListInterceptEndpointGroupsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.networksecurity.v1.ListInterceptEndpointGroupsRequest + * @static + * @param {google.cloud.networksecurity.v1.IListInterceptEndpointGroupsRequest} message ListInterceptEndpointGroupsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListInterceptEndpointGroupsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.filter); + if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.orderBy); + return writer; + }; + + /** + * Encodes the specified ListInterceptEndpointGroupsRequest message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.ListInterceptEndpointGroupsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.networksecurity.v1.ListInterceptEndpointGroupsRequest + * @static + * @param {google.cloud.networksecurity.v1.IListInterceptEndpointGroupsRequest} message ListInterceptEndpointGroupsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListInterceptEndpointGroupsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListInterceptEndpointGroupsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.networksecurity.v1.ListInterceptEndpointGroupsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.networksecurity.v1.ListInterceptEndpointGroupsRequest} ListInterceptEndpointGroupsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListInterceptEndpointGroupsRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networksecurity.v1.ListInterceptEndpointGroupsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + case 4: { + message.filter = reader.string(); + break; + } + case 5: { + message.orderBy = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListInterceptEndpointGroupsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.networksecurity.v1.ListInterceptEndpointGroupsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.networksecurity.v1.ListInterceptEndpointGroupsRequest} ListInterceptEndpointGroupsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListInterceptEndpointGroupsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListInterceptEndpointGroupsRequest message. + * @function verify + * @memberof google.cloud.networksecurity.v1.ListInterceptEndpointGroupsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListInterceptEndpointGroupsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + if (!$util.isString(message.orderBy)) + return "orderBy: string expected"; + return null; + }; + + /** + * Creates a ListInterceptEndpointGroupsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.networksecurity.v1.ListInterceptEndpointGroupsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.networksecurity.v1.ListInterceptEndpointGroupsRequest} ListInterceptEndpointGroupsRequest + */ + ListInterceptEndpointGroupsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networksecurity.v1.ListInterceptEndpointGroupsRequest) + return object; + var message = new $root.google.cloud.networksecurity.v1.ListInterceptEndpointGroupsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.filter != null) + message.filter = String(object.filter); + if (object.orderBy != null) + message.orderBy = String(object.orderBy); + return message; + }; + + /** + * Creates a plain object from a ListInterceptEndpointGroupsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.networksecurity.v1.ListInterceptEndpointGroupsRequest + * @static + * @param {google.cloud.networksecurity.v1.ListInterceptEndpointGroupsRequest} message ListInterceptEndpointGroupsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListInterceptEndpointGroupsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + object.filter = ""; + object.orderBy = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + object.orderBy = message.orderBy; + return object; + }; + + /** + * Converts this ListInterceptEndpointGroupsRequest to JSON. + * @function toJSON + * @memberof google.cloud.networksecurity.v1.ListInterceptEndpointGroupsRequest + * @instance + * @returns {Object.} JSON object + */ + ListInterceptEndpointGroupsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListInterceptEndpointGroupsRequest + * @function getTypeUrl + * @memberof google.cloud.networksecurity.v1.ListInterceptEndpointGroupsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListInterceptEndpointGroupsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.networksecurity.v1.ListInterceptEndpointGroupsRequest"; + }; + + return ListInterceptEndpointGroupsRequest; + })(); + + v1.ListInterceptEndpointGroupsResponse = (function() { + + /** + * Properties of a ListInterceptEndpointGroupsResponse. + * @memberof google.cloud.networksecurity.v1 + * @interface IListInterceptEndpointGroupsResponse + * @property {Array.|null} [interceptEndpointGroups] ListInterceptEndpointGroupsResponse interceptEndpointGroups + * @property {string|null} [nextPageToken] ListInterceptEndpointGroupsResponse nextPageToken + */ + + /** + * Constructs a new ListInterceptEndpointGroupsResponse. + * @memberof google.cloud.networksecurity.v1 + * @classdesc Represents a ListInterceptEndpointGroupsResponse. + * @implements IListInterceptEndpointGroupsResponse + * @constructor + * @param {google.cloud.networksecurity.v1.IListInterceptEndpointGroupsResponse=} [properties] Properties to set + */ + function ListInterceptEndpointGroupsResponse(properties) { + this.interceptEndpointGroups = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListInterceptEndpointGroupsResponse interceptEndpointGroups. + * @member {Array.} interceptEndpointGroups + * @memberof google.cloud.networksecurity.v1.ListInterceptEndpointGroupsResponse + * @instance + */ + ListInterceptEndpointGroupsResponse.prototype.interceptEndpointGroups = $util.emptyArray; + + /** + * ListInterceptEndpointGroupsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.networksecurity.v1.ListInterceptEndpointGroupsResponse + * @instance + */ + ListInterceptEndpointGroupsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListInterceptEndpointGroupsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.networksecurity.v1.ListInterceptEndpointGroupsResponse + * @static + * @param {google.cloud.networksecurity.v1.IListInterceptEndpointGroupsResponse=} [properties] Properties to set + * @returns {google.cloud.networksecurity.v1.ListInterceptEndpointGroupsResponse} ListInterceptEndpointGroupsResponse instance + */ + ListInterceptEndpointGroupsResponse.create = function create(properties) { + return new ListInterceptEndpointGroupsResponse(properties); + }; + + /** + * Encodes the specified ListInterceptEndpointGroupsResponse message. Does not implicitly {@link google.cloud.networksecurity.v1.ListInterceptEndpointGroupsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.networksecurity.v1.ListInterceptEndpointGroupsResponse + * @static + * @param {google.cloud.networksecurity.v1.IListInterceptEndpointGroupsResponse} message ListInterceptEndpointGroupsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListInterceptEndpointGroupsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.interceptEndpointGroups != null && message.interceptEndpointGroups.length) + for (var i = 0; i < message.interceptEndpointGroups.length; ++i) + $root.google.cloud.networksecurity.v1.InterceptEndpointGroup.encode(message.interceptEndpointGroups[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + return writer; + }; + + /** + * Encodes the specified ListInterceptEndpointGroupsResponse message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.ListInterceptEndpointGroupsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.networksecurity.v1.ListInterceptEndpointGroupsResponse + * @static + * @param {google.cloud.networksecurity.v1.IListInterceptEndpointGroupsResponse} message ListInterceptEndpointGroupsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListInterceptEndpointGroupsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListInterceptEndpointGroupsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.networksecurity.v1.ListInterceptEndpointGroupsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.networksecurity.v1.ListInterceptEndpointGroupsResponse} ListInterceptEndpointGroupsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListInterceptEndpointGroupsResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networksecurity.v1.ListInterceptEndpointGroupsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.interceptEndpointGroups && message.interceptEndpointGroups.length)) + message.interceptEndpointGroups = []; + message.interceptEndpointGroups.push($root.google.cloud.networksecurity.v1.InterceptEndpointGroup.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListInterceptEndpointGroupsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.networksecurity.v1.ListInterceptEndpointGroupsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.networksecurity.v1.ListInterceptEndpointGroupsResponse} ListInterceptEndpointGroupsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListInterceptEndpointGroupsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListInterceptEndpointGroupsResponse message. + * @function verify + * @memberof google.cloud.networksecurity.v1.ListInterceptEndpointGroupsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListInterceptEndpointGroupsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.interceptEndpointGroups != null && message.hasOwnProperty("interceptEndpointGroups")) { + if (!Array.isArray(message.interceptEndpointGroups)) + return "interceptEndpointGroups: array expected"; + for (var i = 0; i < message.interceptEndpointGroups.length; ++i) { + var error = $root.google.cloud.networksecurity.v1.InterceptEndpointGroup.verify(message.interceptEndpointGroups[i]); + if (error) + return "interceptEndpointGroups." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListInterceptEndpointGroupsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.networksecurity.v1.ListInterceptEndpointGroupsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.networksecurity.v1.ListInterceptEndpointGroupsResponse} ListInterceptEndpointGroupsResponse + */ + ListInterceptEndpointGroupsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networksecurity.v1.ListInterceptEndpointGroupsResponse) + return object; + var message = new $root.google.cloud.networksecurity.v1.ListInterceptEndpointGroupsResponse(); + if (object.interceptEndpointGroups) { + if (!Array.isArray(object.interceptEndpointGroups)) + throw TypeError(".google.cloud.networksecurity.v1.ListInterceptEndpointGroupsResponse.interceptEndpointGroups: array expected"); + message.interceptEndpointGroups = []; + for (var i = 0; i < object.interceptEndpointGroups.length; ++i) { + if (typeof object.interceptEndpointGroups[i] !== "object") + throw TypeError(".google.cloud.networksecurity.v1.ListInterceptEndpointGroupsResponse.interceptEndpointGroups: object expected"); + message.interceptEndpointGroups[i] = $root.google.cloud.networksecurity.v1.InterceptEndpointGroup.fromObject(object.interceptEndpointGroups[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListInterceptEndpointGroupsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.networksecurity.v1.ListInterceptEndpointGroupsResponse + * @static + * @param {google.cloud.networksecurity.v1.ListInterceptEndpointGroupsResponse} message ListInterceptEndpointGroupsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListInterceptEndpointGroupsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.interceptEndpointGroups = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.interceptEndpointGroups && message.interceptEndpointGroups.length) { + object.interceptEndpointGroups = []; + for (var j = 0; j < message.interceptEndpointGroups.length; ++j) + object.interceptEndpointGroups[j] = $root.google.cloud.networksecurity.v1.InterceptEndpointGroup.toObject(message.interceptEndpointGroups[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListInterceptEndpointGroupsResponse to JSON. + * @function toJSON + * @memberof google.cloud.networksecurity.v1.ListInterceptEndpointGroupsResponse + * @instance + * @returns {Object.} JSON object + */ + ListInterceptEndpointGroupsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListInterceptEndpointGroupsResponse + * @function getTypeUrl + * @memberof google.cloud.networksecurity.v1.ListInterceptEndpointGroupsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListInterceptEndpointGroupsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.networksecurity.v1.ListInterceptEndpointGroupsResponse"; + }; + + return ListInterceptEndpointGroupsResponse; + })(); + + v1.GetInterceptEndpointGroupRequest = (function() { + + /** + * Properties of a GetInterceptEndpointGroupRequest. + * @memberof google.cloud.networksecurity.v1 + * @interface IGetInterceptEndpointGroupRequest + * @property {string|null} [name] GetInterceptEndpointGroupRequest name + */ + + /** + * Constructs a new GetInterceptEndpointGroupRequest. + * @memberof google.cloud.networksecurity.v1 + * @classdesc Represents a GetInterceptEndpointGroupRequest. + * @implements IGetInterceptEndpointGroupRequest + * @constructor + * @param {google.cloud.networksecurity.v1.IGetInterceptEndpointGroupRequest=} [properties] Properties to set + */ + function GetInterceptEndpointGroupRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetInterceptEndpointGroupRequest name. + * @member {string} name + * @memberof google.cloud.networksecurity.v1.GetInterceptEndpointGroupRequest + * @instance + */ + GetInterceptEndpointGroupRequest.prototype.name = ""; + + /** + * Creates a new GetInterceptEndpointGroupRequest instance using the specified properties. + * @function create + * @memberof google.cloud.networksecurity.v1.GetInterceptEndpointGroupRequest + * @static + * @param {google.cloud.networksecurity.v1.IGetInterceptEndpointGroupRequest=} [properties] Properties to set + * @returns {google.cloud.networksecurity.v1.GetInterceptEndpointGroupRequest} GetInterceptEndpointGroupRequest instance + */ + GetInterceptEndpointGroupRequest.create = function create(properties) { + return new GetInterceptEndpointGroupRequest(properties); + }; + + /** + * Encodes the specified GetInterceptEndpointGroupRequest message. Does not implicitly {@link google.cloud.networksecurity.v1.GetInterceptEndpointGroupRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.networksecurity.v1.GetInterceptEndpointGroupRequest + * @static + * @param {google.cloud.networksecurity.v1.IGetInterceptEndpointGroupRequest} message GetInterceptEndpointGroupRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetInterceptEndpointGroupRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified GetInterceptEndpointGroupRequest message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.GetInterceptEndpointGroupRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.networksecurity.v1.GetInterceptEndpointGroupRequest + * @static + * @param {google.cloud.networksecurity.v1.IGetInterceptEndpointGroupRequest} message GetInterceptEndpointGroupRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetInterceptEndpointGroupRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetInterceptEndpointGroupRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.networksecurity.v1.GetInterceptEndpointGroupRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.networksecurity.v1.GetInterceptEndpointGroupRequest} GetInterceptEndpointGroupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetInterceptEndpointGroupRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networksecurity.v1.GetInterceptEndpointGroupRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetInterceptEndpointGroupRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.networksecurity.v1.GetInterceptEndpointGroupRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.networksecurity.v1.GetInterceptEndpointGroupRequest} GetInterceptEndpointGroupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetInterceptEndpointGroupRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetInterceptEndpointGroupRequest message. + * @function verify + * @memberof google.cloud.networksecurity.v1.GetInterceptEndpointGroupRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetInterceptEndpointGroupRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a GetInterceptEndpointGroupRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.networksecurity.v1.GetInterceptEndpointGroupRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.networksecurity.v1.GetInterceptEndpointGroupRequest} GetInterceptEndpointGroupRequest + */ + GetInterceptEndpointGroupRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networksecurity.v1.GetInterceptEndpointGroupRequest) + return object; + var message = new $root.google.cloud.networksecurity.v1.GetInterceptEndpointGroupRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetInterceptEndpointGroupRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.networksecurity.v1.GetInterceptEndpointGroupRequest + * @static + * @param {google.cloud.networksecurity.v1.GetInterceptEndpointGroupRequest} message GetInterceptEndpointGroupRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetInterceptEndpointGroupRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this GetInterceptEndpointGroupRequest to JSON. + * @function toJSON + * @memberof google.cloud.networksecurity.v1.GetInterceptEndpointGroupRequest + * @instance + * @returns {Object.} JSON object + */ + GetInterceptEndpointGroupRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetInterceptEndpointGroupRequest + * @function getTypeUrl + * @memberof google.cloud.networksecurity.v1.GetInterceptEndpointGroupRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetInterceptEndpointGroupRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.networksecurity.v1.GetInterceptEndpointGroupRequest"; + }; + + return GetInterceptEndpointGroupRequest; + })(); + + v1.CreateInterceptEndpointGroupRequest = (function() { + + /** + * Properties of a CreateInterceptEndpointGroupRequest. + * @memberof google.cloud.networksecurity.v1 + * @interface ICreateInterceptEndpointGroupRequest + * @property {string|null} [parent] CreateInterceptEndpointGroupRequest parent + * @property {string|null} [interceptEndpointGroupId] CreateInterceptEndpointGroupRequest interceptEndpointGroupId + * @property {google.cloud.networksecurity.v1.IInterceptEndpointGroup|null} [interceptEndpointGroup] CreateInterceptEndpointGroupRequest interceptEndpointGroup + * @property {string|null} [requestId] CreateInterceptEndpointGroupRequest requestId + */ + + /** + * Constructs a new CreateInterceptEndpointGroupRequest. + * @memberof google.cloud.networksecurity.v1 + * @classdesc Represents a CreateInterceptEndpointGroupRequest. + * @implements ICreateInterceptEndpointGroupRequest + * @constructor + * @param {google.cloud.networksecurity.v1.ICreateInterceptEndpointGroupRequest=} [properties] Properties to set + */ + function CreateInterceptEndpointGroupRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateInterceptEndpointGroupRequest parent. + * @member {string} parent + * @memberof google.cloud.networksecurity.v1.CreateInterceptEndpointGroupRequest + * @instance + */ + CreateInterceptEndpointGroupRequest.prototype.parent = ""; + + /** + * CreateInterceptEndpointGroupRequest interceptEndpointGroupId. + * @member {string} interceptEndpointGroupId + * @memberof google.cloud.networksecurity.v1.CreateInterceptEndpointGroupRequest + * @instance + */ + CreateInterceptEndpointGroupRequest.prototype.interceptEndpointGroupId = ""; + + /** + * CreateInterceptEndpointGroupRequest interceptEndpointGroup. + * @member {google.cloud.networksecurity.v1.IInterceptEndpointGroup|null|undefined} interceptEndpointGroup + * @memberof google.cloud.networksecurity.v1.CreateInterceptEndpointGroupRequest + * @instance + */ + CreateInterceptEndpointGroupRequest.prototype.interceptEndpointGroup = null; + + /** + * CreateInterceptEndpointGroupRequest requestId. + * @member {string} requestId + * @memberof google.cloud.networksecurity.v1.CreateInterceptEndpointGroupRequest + * @instance + */ + CreateInterceptEndpointGroupRequest.prototype.requestId = ""; + + /** + * Creates a new CreateInterceptEndpointGroupRequest instance using the specified properties. + * @function create + * @memberof google.cloud.networksecurity.v1.CreateInterceptEndpointGroupRequest + * @static + * @param {google.cloud.networksecurity.v1.ICreateInterceptEndpointGroupRequest=} [properties] Properties to set + * @returns {google.cloud.networksecurity.v1.CreateInterceptEndpointGroupRequest} CreateInterceptEndpointGroupRequest instance + */ + CreateInterceptEndpointGroupRequest.create = function create(properties) { + return new CreateInterceptEndpointGroupRequest(properties); + }; + + /** + * Encodes the specified CreateInterceptEndpointGroupRequest message. Does not implicitly {@link google.cloud.networksecurity.v1.CreateInterceptEndpointGroupRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.networksecurity.v1.CreateInterceptEndpointGroupRequest + * @static + * @param {google.cloud.networksecurity.v1.ICreateInterceptEndpointGroupRequest} message CreateInterceptEndpointGroupRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateInterceptEndpointGroupRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.interceptEndpointGroupId != null && Object.hasOwnProperty.call(message, "interceptEndpointGroupId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.interceptEndpointGroupId); + if (message.interceptEndpointGroup != null && Object.hasOwnProperty.call(message, "interceptEndpointGroup")) + $root.google.cloud.networksecurity.v1.InterceptEndpointGroup.encode(message.interceptEndpointGroup, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.requestId); + return writer; + }; + + /** + * Encodes the specified CreateInterceptEndpointGroupRequest message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.CreateInterceptEndpointGroupRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.networksecurity.v1.CreateInterceptEndpointGroupRequest + * @static + * @param {google.cloud.networksecurity.v1.ICreateInterceptEndpointGroupRequest} message CreateInterceptEndpointGroupRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateInterceptEndpointGroupRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateInterceptEndpointGroupRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.networksecurity.v1.CreateInterceptEndpointGroupRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.networksecurity.v1.CreateInterceptEndpointGroupRequest} CreateInterceptEndpointGroupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateInterceptEndpointGroupRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networksecurity.v1.CreateInterceptEndpointGroupRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.interceptEndpointGroupId = reader.string(); + break; + } + case 3: { + message.interceptEndpointGroup = $root.google.cloud.networksecurity.v1.InterceptEndpointGroup.decode(reader, reader.uint32()); + break; + } + case 4: { + message.requestId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateInterceptEndpointGroupRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.networksecurity.v1.CreateInterceptEndpointGroupRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.networksecurity.v1.CreateInterceptEndpointGroupRequest} CreateInterceptEndpointGroupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateInterceptEndpointGroupRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateInterceptEndpointGroupRequest message. + * @function verify + * @memberof google.cloud.networksecurity.v1.CreateInterceptEndpointGroupRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateInterceptEndpointGroupRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.interceptEndpointGroupId != null && message.hasOwnProperty("interceptEndpointGroupId")) + if (!$util.isString(message.interceptEndpointGroupId)) + return "interceptEndpointGroupId: string expected"; + if (message.interceptEndpointGroup != null && message.hasOwnProperty("interceptEndpointGroup")) { + var error = $root.google.cloud.networksecurity.v1.InterceptEndpointGroup.verify(message.interceptEndpointGroup); + if (error) + return "interceptEndpointGroup." + error; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + return null; + }; + + /** + * Creates a CreateInterceptEndpointGroupRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.networksecurity.v1.CreateInterceptEndpointGroupRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.networksecurity.v1.CreateInterceptEndpointGroupRequest} CreateInterceptEndpointGroupRequest + */ + CreateInterceptEndpointGroupRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networksecurity.v1.CreateInterceptEndpointGroupRequest) + return object; + var message = new $root.google.cloud.networksecurity.v1.CreateInterceptEndpointGroupRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.interceptEndpointGroupId != null) + message.interceptEndpointGroupId = String(object.interceptEndpointGroupId); + if (object.interceptEndpointGroup != null) { + if (typeof object.interceptEndpointGroup !== "object") + throw TypeError(".google.cloud.networksecurity.v1.CreateInterceptEndpointGroupRequest.interceptEndpointGroup: object expected"); + message.interceptEndpointGroup = $root.google.cloud.networksecurity.v1.InterceptEndpointGroup.fromObject(object.interceptEndpointGroup); + } + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from a CreateInterceptEndpointGroupRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.networksecurity.v1.CreateInterceptEndpointGroupRequest + * @static + * @param {google.cloud.networksecurity.v1.CreateInterceptEndpointGroupRequest} message CreateInterceptEndpointGroupRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateInterceptEndpointGroupRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.interceptEndpointGroupId = ""; + object.interceptEndpointGroup = null; + object.requestId = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.interceptEndpointGroupId != null && message.hasOwnProperty("interceptEndpointGroupId")) + object.interceptEndpointGroupId = message.interceptEndpointGroupId; + if (message.interceptEndpointGroup != null && message.hasOwnProperty("interceptEndpointGroup")) + object.interceptEndpointGroup = $root.google.cloud.networksecurity.v1.InterceptEndpointGroup.toObject(message.interceptEndpointGroup, options); + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + return object; + }; + + /** + * Converts this CreateInterceptEndpointGroupRequest to JSON. + * @function toJSON + * @memberof google.cloud.networksecurity.v1.CreateInterceptEndpointGroupRequest + * @instance + * @returns {Object.} JSON object + */ + CreateInterceptEndpointGroupRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateInterceptEndpointGroupRequest + * @function getTypeUrl + * @memberof google.cloud.networksecurity.v1.CreateInterceptEndpointGroupRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateInterceptEndpointGroupRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.networksecurity.v1.CreateInterceptEndpointGroupRequest"; + }; + + return CreateInterceptEndpointGroupRequest; + })(); + + v1.UpdateInterceptEndpointGroupRequest = (function() { + + /** + * Properties of an UpdateInterceptEndpointGroupRequest. + * @memberof google.cloud.networksecurity.v1 + * @interface IUpdateInterceptEndpointGroupRequest + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateInterceptEndpointGroupRequest updateMask + * @property {google.cloud.networksecurity.v1.IInterceptEndpointGroup|null} [interceptEndpointGroup] UpdateInterceptEndpointGroupRequest interceptEndpointGroup + * @property {string|null} [requestId] UpdateInterceptEndpointGroupRequest requestId + */ + + /** + * Constructs a new UpdateInterceptEndpointGroupRequest. + * @memberof google.cloud.networksecurity.v1 + * @classdesc Represents an UpdateInterceptEndpointGroupRequest. + * @implements IUpdateInterceptEndpointGroupRequest + * @constructor + * @param {google.cloud.networksecurity.v1.IUpdateInterceptEndpointGroupRequest=} [properties] Properties to set + */ + function UpdateInterceptEndpointGroupRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateInterceptEndpointGroupRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.networksecurity.v1.UpdateInterceptEndpointGroupRequest + * @instance + */ + UpdateInterceptEndpointGroupRequest.prototype.updateMask = null; + + /** + * UpdateInterceptEndpointGroupRequest interceptEndpointGroup. + * @member {google.cloud.networksecurity.v1.IInterceptEndpointGroup|null|undefined} interceptEndpointGroup + * @memberof google.cloud.networksecurity.v1.UpdateInterceptEndpointGroupRequest + * @instance + */ + UpdateInterceptEndpointGroupRequest.prototype.interceptEndpointGroup = null; + + /** + * UpdateInterceptEndpointGroupRequest requestId. + * @member {string} requestId + * @memberof google.cloud.networksecurity.v1.UpdateInterceptEndpointGroupRequest + * @instance + */ + UpdateInterceptEndpointGroupRequest.prototype.requestId = ""; + + /** + * Creates a new UpdateInterceptEndpointGroupRequest instance using the specified properties. + * @function create + * @memberof google.cloud.networksecurity.v1.UpdateInterceptEndpointGroupRequest + * @static + * @param {google.cloud.networksecurity.v1.IUpdateInterceptEndpointGroupRequest=} [properties] Properties to set + * @returns {google.cloud.networksecurity.v1.UpdateInterceptEndpointGroupRequest} UpdateInterceptEndpointGroupRequest instance + */ + UpdateInterceptEndpointGroupRequest.create = function create(properties) { + return new UpdateInterceptEndpointGroupRequest(properties); + }; + + /** + * Encodes the specified UpdateInterceptEndpointGroupRequest message. Does not implicitly {@link google.cloud.networksecurity.v1.UpdateInterceptEndpointGroupRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.networksecurity.v1.UpdateInterceptEndpointGroupRequest + * @static + * @param {google.cloud.networksecurity.v1.IUpdateInterceptEndpointGroupRequest} message UpdateInterceptEndpointGroupRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateInterceptEndpointGroupRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.interceptEndpointGroup != null && Object.hasOwnProperty.call(message, "interceptEndpointGroup")) + $root.google.cloud.networksecurity.v1.InterceptEndpointGroup.encode(message.interceptEndpointGroup, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.requestId); + return writer; + }; + + /** + * Encodes the specified UpdateInterceptEndpointGroupRequest message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.UpdateInterceptEndpointGroupRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.networksecurity.v1.UpdateInterceptEndpointGroupRequest + * @static + * @param {google.cloud.networksecurity.v1.IUpdateInterceptEndpointGroupRequest} message UpdateInterceptEndpointGroupRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateInterceptEndpointGroupRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateInterceptEndpointGroupRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.networksecurity.v1.UpdateInterceptEndpointGroupRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.networksecurity.v1.UpdateInterceptEndpointGroupRequest} UpdateInterceptEndpointGroupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateInterceptEndpointGroupRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networksecurity.v1.UpdateInterceptEndpointGroupRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + case 2: { + message.interceptEndpointGroup = $root.google.cloud.networksecurity.v1.InterceptEndpointGroup.decode(reader, reader.uint32()); + break; + } + case 3: { + message.requestId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateInterceptEndpointGroupRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.networksecurity.v1.UpdateInterceptEndpointGroupRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.networksecurity.v1.UpdateInterceptEndpointGroupRequest} UpdateInterceptEndpointGroupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateInterceptEndpointGroupRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateInterceptEndpointGroupRequest message. + * @function verify + * @memberof google.cloud.networksecurity.v1.UpdateInterceptEndpointGroupRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateInterceptEndpointGroupRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + if (message.interceptEndpointGroup != null && message.hasOwnProperty("interceptEndpointGroup")) { + var error = $root.google.cloud.networksecurity.v1.InterceptEndpointGroup.verify(message.interceptEndpointGroup); + if (error) + return "interceptEndpointGroup." + error; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + return null; + }; + + /** + * Creates an UpdateInterceptEndpointGroupRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.networksecurity.v1.UpdateInterceptEndpointGroupRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.networksecurity.v1.UpdateInterceptEndpointGroupRequest} UpdateInterceptEndpointGroupRequest + */ + UpdateInterceptEndpointGroupRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networksecurity.v1.UpdateInterceptEndpointGroupRequest) + return object; + var message = new $root.google.cloud.networksecurity.v1.UpdateInterceptEndpointGroupRequest(); + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.networksecurity.v1.UpdateInterceptEndpointGroupRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + if (object.interceptEndpointGroup != null) { + if (typeof object.interceptEndpointGroup !== "object") + throw TypeError(".google.cloud.networksecurity.v1.UpdateInterceptEndpointGroupRequest.interceptEndpointGroup: object expected"); + message.interceptEndpointGroup = $root.google.cloud.networksecurity.v1.InterceptEndpointGroup.fromObject(object.interceptEndpointGroup); + } + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from an UpdateInterceptEndpointGroupRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.networksecurity.v1.UpdateInterceptEndpointGroupRequest + * @static + * @param {google.cloud.networksecurity.v1.UpdateInterceptEndpointGroupRequest} message UpdateInterceptEndpointGroupRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateInterceptEndpointGroupRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.updateMask = null; + object.interceptEndpointGroup = null; + object.requestId = ""; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + if (message.interceptEndpointGroup != null && message.hasOwnProperty("interceptEndpointGroup")) + object.interceptEndpointGroup = $root.google.cloud.networksecurity.v1.InterceptEndpointGroup.toObject(message.interceptEndpointGroup, options); + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + return object; + }; + + /** + * Converts this UpdateInterceptEndpointGroupRequest to JSON. + * @function toJSON + * @memberof google.cloud.networksecurity.v1.UpdateInterceptEndpointGroupRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateInterceptEndpointGroupRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateInterceptEndpointGroupRequest + * @function getTypeUrl + * @memberof google.cloud.networksecurity.v1.UpdateInterceptEndpointGroupRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateInterceptEndpointGroupRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.networksecurity.v1.UpdateInterceptEndpointGroupRequest"; + }; + + return UpdateInterceptEndpointGroupRequest; + })(); + + v1.DeleteInterceptEndpointGroupRequest = (function() { + + /** + * Properties of a DeleteInterceptEndpointGroupRequest. + * @memberof google.cloud.networksecurity.v1 + * @interface IDeleteInterceptEndpointGroupRequest + * @property {string|null} [name] DeleteInterceptEndpointGroupRequest name + * @property {string|null} [requestId] DeleteInterceptEndpointGroupRequest requestId + */ + + /** + * Constructs a new DeleteInterceptEndpointGroupRequest. + * @memberof google.cloud.networksecurity.v1 + * @classdesc Represents a DeleteInterceptEndpointGroupRequest. + * @implements IDeleteInterceptEndpointGroupRequest + * @constructor + * @param {google.cloud.networksecurity.v1.IDeleteInterceptEndpointGroupRequest=} [properties] Properties to set + */ + function DeleteInterceptEndpointGroupRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteInterceptEndpointGroupRequest name. + * @member {string} name + * @memberof google.cloud.networksecurity.v1.DeleteInterceptEndpointGroupRequest + * @instance + */ + DeleteInterceptEndpointGroupRequest.prototype.name = ""; + + /** + * DeleteInterceptEndpointGroupRequest requestId. + * @member {string} requestId + * @memberof google.cloud.networksecurity.v1.DeleteInterceptEndpointGroupRequest + * @instance + */ + DeleteInterceptEndpointGroupRequest.prototype.requestId = ""; + + /** + * Creates a new DeleteInterceptEndpointGroupRequest instance using the specified properties. + * @function create + * @memberof google.cloud.networksecurity.v1.DeleteInterceptEndpointGroupRequest + * @static + * @param {google.cloud.networksecurity.v1.IDeleteInterceptEndpointGroupRequest=} [properties] Properties to set + * @returns {google.cloud.networksecurity.v1.DeleteInterceptEndpointGroupRequest} DeleteInterceptEndpointGroupRequest instance + */ + DeleteInterceptEndpointGroupRequest.create = function create(properties) { + return new DeleteInterceptEndpointGroupRequest(properties); + }; + + /** + * Encodes the specified DeleteInterceptEndpointGroupRequest message. Does not implicitly {@link google.cloud.networksecurity.v1.DeleteInterceptEndpointGroupRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.networksecurity.v1.DeleteInterceptEndpointGroupRequest + * @static + * @param {google.cloud.networksecurity.v1.IDeleteInterceptEndpointGroupRequest} message DeleteInterceptEndpointGroupRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteInterceptEndpointGroupRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.requestId); + return writer; + }; + + /** + * Encodes the specified DeleteInterceptEndpointGroupRequest message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.DeleteInterceptEndpointGroupRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.networksecurity.v1.DeleteInterceptEndpointGroupRequest + * @static + * @param {google.cloud.networksecurity.v1.IDeleteInterceptEndpointGroupRequest} message DeleteInterceptEndpointGroupRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteInterceptEndpointGroupRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteInterceptEndpointGroupRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.networksecurity.v1.DeleteInterceptEndpointGroupRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.networksecurity.v1.DeleteInterceptEndpointGroupRequest} DeleteInterceptEndpointGroupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteInterceptEndpointGroupRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networksecurity.v1.DeleteInterceptEndpointGroupRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.requestId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteInterceptEndpointGroupRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.networksecurity.v1.DeleteInterceptEndpointGroupRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.networksecurity.v1.DeleteInterceptEndpointGroupRequest} DeleteInterceptEndpointGroupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteInterceptEndpointGroupRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteInterceptEndpointGroupRequest message. + * @function verify + * @memberof google.cloud.networksecurity.v1.DeleteInterceptEndpointGroupRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteInterceptEndpointGroupRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + return null; + }; + + /** + * Creates a DeleteInterceptEndpointGroupRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.networksecurity.v1.DeleteInterceptEndpointGroupRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.networksecurity.v1.DeleteInterceptEndpointGroupRequest} DeleteInterceptEndpointGroupRequest + */ + DeleteInterceptEndpointGroupRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networksecurity.v1.DeleteInterceptEndpointGroupRequest) + return object; + var message = new $root.google.cloud.networksecurity.v1.DeleteInterceptEndpointGroupRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from a DeleteInterceptEndpointGroupRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.networksecurity.v1.DeleteInterceptEndpointGroupRequest + * @static + * @param {google.cloud.networksecurity.v1.DeleteInterceptEndpointGroupRequest} message DeleteInterceptEndpointGroupRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteInterceptEndpointGroupRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.requestId = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + return object; + }; + + /** + * Converts this DeleteInterceptEndpointGroupRequest to JSON. + * @function toJSON + * @memberof google.cloud.networksecurity.v1.DeleteInterceptEndpointGroupRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteInterceptEndpointGroupRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteInterceptEndpointGroupRequest + * @function getTypeUrl + * @memberof google.cloud.networksecurity.v1.DeleteInterceptEndpointGroupRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteInterceptEndpointGroupRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.networksecurity.v1.DeleteInterceptEndpointGroupRequest"; + }; + + return DeleteInterceptEndpointGroupRequest; + })(); + + v1.InterceptEndpointGroupAssociation = (function() { + + /** + * Properties of an InterceptEndpointGroupAssociation. + * @memberof google.cloud.networksecurity.v1 + * @interface IInterceptEndpointGroupAssociation + * @property {string|null} [name] InterceptEndpointGroupAssociation name + * @property {google.protobuf.ITimestamp|null} [createTime] InterceptEndpointGroupAssociation createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] InterceptEndpointGroupAssociation updateTime + * @property {Object.|null} [labels] InterceptEndpointGroupAssociation labels + * @property {string|null} [interceptEndpointGroup] InterceptEndpointGroupAssociation interceptEndpointGroup + * @property {string|null} [network] InterceptEndpointGroupAssociation network + * @property {Array.|null} [locationsDetails] InterceptEndpointGroupAssociation locationsDetails + * @property {google.cloud.networksecurity.v1.InterceptEndpointGroupAssociation.State|null} [state] InterceptEndpointGroupAssociation state + * @property {boolean|null} [reconciling] InterceptEndpointGroupAssociation reconciling + * @property {Array.|null} [locations] InterceptEndpointGroupAssociation locations + * @property {number|null} [networkCookie] InterceptEndpointGroupAssociation networkCookie + */ + + /** + * Constructs a new InterceptEndpointGroupAssociation. + * @memberof google.cloud.networksecurity.v1 + * @classdesc Represents an InterceptEndpointGroupAssociation. + * @implements IInterceptEndpointGroupAssociation + * @constructor + * @param {google.cloud.networksecurity.v1.IInterceptEndpointGroupAssociation=} [properties] Properties to set + */ + function InterceptEndpointGroupAssociation(properties) { + this.labels = {}; + this.locationsDetails = []; + this.locations = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * InterceptEndpointGroupAssociation name. + * @member {string} name + * @memberof google.cloud.networksecurity.v1.InterceptEndpointGroupAssociation + * @instance + */ + InterceptEndpointGroupAssociation.prototype.name = ""; + + /** + * InterceptEndpointGroupAssociation createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.networksecurity.v1.InterceptEndpointGroupAssociation + * @instance + */ + InterceptEndpointGroupAssociation.prototype.createTime = null; + + /** + * InterceptEndpointGroupAssociation updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.networksecurity.v1.InterceptEndpointGroupAssociation + * @instance + */ + InterceptEndpointGroupAssociation.prototype.updateTime = null; + + /** + * InterceptEndpointGroupAssociation labels. + * @member {Object.} labels + * @memberof google.cloud.networksecurity.v1.InterceptEndpointGroupAssociation + * @instance + */ + InterceptEndpointGroupAssociation.prototype.labels = $util.emptyObject; + + /** + * InterceptEndpointGroupAssociation interceptEndpointGroup. + * @member {string} interceptEndpointGroup + * @memberof google.cloud.networksecurity.v1.InterceptEndpointGroupAssociation + * @instance + */ + InterceptEndpointGroupAssociation.prototype.interceptEndpointGroup = ""; + + /** + * InterceptEndpointGroupAssociation network. + * @member {string} network + * @memberof google.cloud.networksecurity.v1.InterceptEndpointGroupAssociation + * @instance + */ + InterceptEndpointGroupAssociation.prototype.network = ""; + + /** + * InterceptEndpointGroupAssociation locationsDetails. + * @member {Array.} locationsDetails + * @memberof google.cloud.networksecurity.v1.InterceptEndpointGroupAssociation + * @instance + */ + InterceptEndpointGroupAssociation.prototype.locationsDetails = $util.emptyArray; + + /** + * InterceptEndpointGroupAssociation state. + * @member {google.cloud.networksecurity.v1.InterceptEndpointGroupAssociation.State} state + * @memberof google.cloud.networksecurity.v1.InterceptEndpointGroupAssociation + * @instance + */ + InterceptEndpointGroupAssociation.prototype.state = 0; + + /** + * InterceptEndpointGroupAssociation reconciling. + * @member {boolean} reconciling + * @memberof google.cloud.networksecurity.v1.InterceptEndpointGroupAssociation + * @instance + */ + InterceptEndpointGroupAssociation.prototype.reconciling = false; + + /** + * InterceptEndpointGroupAssociation locations. + * @member {Array.} locations + * @memberof google.cloud.networksecurity.v1.InterceptEndpointGroupAssociation + * @instance + */ + InterceptEndpointGroupAssociation.prototype.locations = $util.emptyArray; + + /** + * InterceptEndpointGroupAssociation networkCookie. + * @member {number} networkCookie + * @memberof google.cloud.networksecurity.v1.InterceptEndpointGroupAssociation + * @instance + */ + InterceptEndpointGroupAssociation.prototype.networkCookie = 0; + + /** + * Creates a new InterceptEndpointGroupAssociation instance using the specified properties. + * @function create + * @memberof google.cloud.networksecurity.v1.InterceptEndpointGroupAssociation + * @static + * @param {google.cloud.networksecurity.v1.IInterceptEndpointGroupAssociation=} [properties] Properties to set + * @returns {google.cloud.networksecurity.v1.InterceptEndpointGroupAssociation} InterceptEndpointGroupAssociation instance + */ + InterceptEndpointGroupAssociation.create = function create(properties) { + return new InterceptEndpointGroupAssociation(properties); + }; + + /** + * Encodes the specified InterceptEndpointGroupAssociation message. Does not implicitly {@link google.cloud.networksecurity.v1.InterceptEndpointGroupAssociation.verify|verify} messages. + * @function encode + * @memberof google.cloud.networksecurity.v1.InterceptEndpointGroupAssociation + * @static + * @param {google.cloud.networksecurity.v1.IInterceptEndpointGroupAssociation} message InterceptEndpointGroupAssociation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InterceptEndpointGroupAssociation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) + for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) + writer.uint32(/* id 4, wireType 2 =*/34).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); + if (message.interceptEndpointGroup != null && Object.hasOwnProperty.call(message, "interceptEndpointGroup")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.interceptEndpointGroup); + if (message.network != null && Object.hasOwnProperty.call(message, "network")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.network); + if (message.locationsDetails != null && message.locationsDetails.length) + for (var i = 0; i < message.locationsDetails.length; ++i) + $root.google.cloud.networksecurity.v1.InterceptEndpointGroupAssociation.LocationDetails.encode(message.locationsDetails[i], writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 8, wireType 0 =*/64).int32(message.state); + if (message.reconciling != null && Object.hasOwnProperty.call(message, "reconciling")) + writer.uint32(/* id 9, wireType 0 =*/72).bool(message.reconciling); + if (message.locations != null && message.locations.length) + for (var i = 0; i < message.locations.length; ++i) + $root.google.cloud.networksecurity.v1.InterceptLocation.encode(message.locations[i], writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + if (message.networkCookie != null && Object.hasOwnProperty.call(message, "networkCookie")) + writer.uint32(/* id 12, wireType 0 =*/96).uint32(message.networkCookie); + return writer; + }; + + /** + * Encodes the specified InterceptEndpointGroupAssociation message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.InterceptEndpointGroupAssociation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.networksecurity.v1.InterceptEndpointGroupAssociation + * @static + * @param {google.cloud.networksecurity.v1.IInterceptEndpointGroupAssociation} message InterceptEndpointGroupAssociation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InterceptEndpointGroupAssociation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an InterceptEndpointGroupAssociation message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.networksecurity.v1.InterceptEndpointGroupAssociation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.networksecurity.v1.InterceptEndpointGroupAssociation} InterceptEndpointGroupAssociation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InterceptEndpointGroupAssociation.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networksecurity.v1.InterceptEndpointGroupAssociation(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 3: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 4: { + if (message.labels === $util.emptyObject) + message.labels = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.labels[key] = value; + break; + } + case 5: { + message.interceptEndpointGroup = reader.string(); + break; + } + case 6: { + message.network = reader.string(); + break; + } + case 7: { + if (!(message.locationsDetails && message.locationsDetails.length)) + message.locationsDetails = []; + message.locationsDetails.push($root.google.cloud.networksecurity.v1.InterceptEndpointGroupAssociation.LocationDetails.decode(reader, reader.uint32())); + break; + } + case 8: { + message.state = reader.int32(); + break; + } + case 9: { + message.reconciling = reader.bool(); + break; + } + case 10: { + if (!(message.locations && message.locations.length)) + message.locations = []; + message.locations.push($root.google.cloud.networksecurity.v1.InterceptLocation.decode(reader, reader.uint32())); + break; + } + case 12: { + message.networkCookie = reader.uint32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an InterceptEndpointGroupAssociation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.networksecurity.v1.InterceptEndpointGroupAssociation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.networksecurity.v1.InterceptEndpointGroupAssociation} InterceptEndpointGroupAssociation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InterceptEndpointGroupAssociation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an InterceptEndpointGroupAssociation message. + * @function verify + * @memberof google.cloud.networksecurity.v1.InterceptEndpointGroupAssociation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + InterceptEndpointGroupAssociation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime); + if (error) + return "updateTime." + error; + } + if (message.labels != null && message.hasOwnProperty("labels")) { + if (!$util.isObject(message.labels)) + return "labels: object expected"; + var key = Object.keys(message.labels); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.labels[key[i]])) + return "labels: string{k:string} expected"; + } + if (message.interceptEndpointGroup != null && message.hasOwnProperty("interceptEndpointGroup")) + if (!$util.isString(message.interceptEndpointGroup)) + return "interceptEndpointGroup: string expected"; + if (message.network != null && message.hasOwnProperty("network")) + if (!$util.isString(message.network)) + return "network: string expected"; + if (message.locationsDetails != null && message.hasOwnProperty("locationsDetails")) { + if (!Array.isArray(message.locationsDetails)) + return "locationsDetails: array expected"; + for (var i = 0; i < message.locationsDetails.length; ++i) { + var error = $root.google.cloud.networksecurity.v1.InterceptEndpointGroupAssociation.LocationDetails.verify(message.locationsDetails[i]); + if (error) + return "locationsDetails." + error; + } + } + if (message.state != null && message.hasOwnProperty("state")) + switch (message.state) { + default: + return "state: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + break; + } + if (message.reconciling != null && message.hasOwnProperty("reconciling")) + if (typeof message.reconciling !== "boolean") + return "reconciling: boolean expected"; + if (message.locations != null && message.hasOwnProperty("locations")) { + if (!Array.isArray(message.locations)) + return "locations: array expected"; + for (var i = 0; i < message.locations.length; ++i) { + var error = $root.google.cloud.networksecurity.v1.InterceptLocation.verify(message.locations[i]); + if (error) + return "locations." + error; + } + } + if (message.networkCookie != null && message.hasOwnProperty("networkCookie")) + if (!$util.isInteger(message.networkCookie)) + return "networkCookie: integer expected"; + return null; + }; + + /** + * Creates an InterceptEndpointGroupAssociation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.networksecurity.v1.InterceptEndpointGroupAssociation + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.networksecurity.v1.InterceptEndpointGroupAssociation} InterceptEndpointGroupAssociation + */ + InterceptEndpointGroupAssociation.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networksecurity.v1.InterceptEndpointGroupAssociation) + return object; + var message = new $root.google.cloud.networksecurity.v1.InterceptEndpointGroupAssociation(); + if (object.name != null) + message.name = String(object.name); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.networksecurity.v1.InterceptEndpointGroupAssociation.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.updateTime != null) { + if (typeof object.updateTime !== "object") + throw TypeError(".google.cloud.networksecurity.v1.InterceptEndpointGroupAssociation.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.cloud.networksecurity.v1.InterceptEndpointGroupAssociation.labels: object expected"); + message.labels = {}; + for (var keys = Object.keys(object.labels), i = 0; i < keys.length; ++i) + message.labels[keys[i]] = String(object.labels[keys[i]]); + } + if (object.interceptEndpointGroup != null) + message.interceptEndpointGroup = String(object.interceptEndpointGroup); + if (object.network != null) + message.network = String(object.network); + if (object.locationsDetails) { + if (!Array.isArray(object.locationsDetails)) + throw TypeError(".google.cloud.networksecurity.v1.InterceptEndpointGroupAssociation.locationsDetails: array expected"); + message.locationsDetails = []; + for (var i = 0; i < object.locationsDetails.length; ++i) { + if (typeof object.locationsDetails[i] !== "object") + throw TypeError(".google.cloud.networksecurity.v1.InterceptEndpointGroupAssociation.locationsDetails: object expected"); + message.locationsDetails[i] = $root.google.cloud.networksecurity.v1.InterceptEndpointGroupAssociation.LocationDetails.fromObject(object.locationsDetails[i]); + } + } + switch (object.state) { + default: + if (typeof object.state === "number") { + message.state = object.state; + break; + } + break; + case "STATE_UNSPECIFIED": + case 0: + message.state = 0; + break; + case "ACTIVE": + case 1: + message.state = 1; + break; + case "CREATING": + case 2: + message.state = 2; + break; + case "DELETING": + case 3: + message.state = 3; + break; + case "CLOSED": + case 4: + message.state = 4; + break; + case "OUT_OF_SYNC": + case 5: + message.state = 5; + break; + case "DELETE_FAILED": + case 6: + message.state = 6; + break; + } + if (object.reconciling != null) + message.reconciling = Boolean(object.reconciling); + if (object.locations) { + if (!Array.isArray(object.locations)) + throw TypeError(".google.cloud.networksecurity.v1.InterceptEndpointGroupAssociation.locations: array expected"); + message.locations = []; + for (var i = 0; i < object.locations.length; ++i) { + if (typeof object.locations[i] !== "object") + throw TypeError(".google.cloud.networksecurity.v1.InterceptEndpointGroupAssociation.locations: object expected"); + message.locations[i] = $root.google.cloud.networksecurity.v1.InterceptLocation.fromObject(object.locations[i]); + } + } + if (object.networkCookie != null) + message.networkCookie = object.networkCookie >>> 0; + return message; + }; + + /** + * Creates a plain object from an InterceptEndpointGroupAssociation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.networksecurity.v1.InterceptEndpointGroupAssociation + * @static + * @param {google.cloud.networksecurity.v1.InterceptEndpointGroupAssociation} message InterceptEndpointGroupAssociation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + InterceptEndpointGroupAssociation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.locationsDetails = []; + object.locations = []; + } + if (options.objects || options.defaults) + object.labels = {}; + if (options.defaults) { + object.name = ""; + object.createTime = null; + object.updateTime = null; + object.interceptEndpointGroup = ""; + object.network = ""; + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + object.reconciling = false; + object.networkCookie = 0; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.updateTime != null && message.hasOwnProperty("updateTime")) + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); + var keys2; + if (message.labels && (keys2 = Object.keys(message.labels)).length) { + object.labels = {}; + for (var j = 0; j < keys2.length; ++j) + object.labels[keys2[j]] = message.labels[keys2[j]]; + } + if (message.interceptEndpointGroup != null && message.hasOwnProperty("interceptEndpointGroup")) + object.interceptEndpointGroup = message.interceptEndpointGroup; + if (message.network != null && message.hasOwnProperty("network")) + object.network = message.network; + if (message.locationsDetails && message.locationsDetails.length) { + object.locationsDetails = []; + for (var j = 0; j < message.locationsDetails.length; ++j) + object.locationsDetails[j] = $root.google.cloud.networksecurity.v1.InterceptEndpointGroupAssociation.LocationDetails.toObject(message.locationsDetails[j], options); + } + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.networksecurity.v1.InterceptEndpointGroupAssociation.State[message.state] === undefined ? message.state : $root.google.cloud.networksecurity.v1.InterceptEndpointGroupAssociation.State[message.state] : message.state; + if (message.reconciling != null && message.hasOwnProperty("reconciling")) + object.reconciling = message.reconciling; + if (message.locations && message.locations.length) { + object.locations = []; + for (var j = 0; j < message.locations.length; ++j) + object.locations[j] = $root.google.cloud.networksecurity.v1.InterceptLocation.toObject(message.locations[j], options); + } + if (message.networkCookie != null && message.hasOwnProperty("networkCookie")) + object.networkCookie = message.networkCookie; + return object; + }; + + /** + * Converts this InterceptEndpointGroupAssociation to JSON. + * @function toJSON + * @memberof google.cloud.networksecurity.v1.InterceptEndpointGroupAssociation + * @instance + * @returns {Object.} JSON object + */ + InterceptEndpointGroupAssociation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for InterceptEndpointGroupAssociation + * @function getTypeUrl + * @memberof google.cloud.networksecurity.v1.InterceptEndpointGroupAssociation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + InterceptEndpointGroupAssociation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.networksecurity.v1.InterceptEndpointGroupAssociation"; + }; + + InterceptEndpointGroupAssociation.LocationDetails = (function() { + + /** + * Properties of a LocationDetails. + * @memberof google.cloud.networksecurity.v1.InterceptEndpointGroupAssociation + * @interface ILocationDetails + * @property {string|null} [location] LocationDetails location + * @property {google.cloud.networksecurity.v1.InterceptEndpointGroupAssociation.LocationDetails.State|null} [state] LocationDetails state + */ + + /** + * Constructs a new LocationDetails. + * @memberof google.cloud.networksecurity.v1.InterceptEndpointGroupAssociation + * @classdesc Represents a LocationDetails. + * @implements ILocationDetails + * @constructor + * @param {google.cloud.networksecurity.v1.InterceptEndpointGroupAssociation.ILocationDetails=} [properties] Properties to set + */ + function LocationDetails(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * LocationDetails location. + * @member {string} location + * @memberof google.cloud.networksecurity.v1.InterceptEndpointGroupAssociation.LocationDetails + * @instance + */ + LocationDetails.prototype.location = ""; + + /** + * LocationDetails state. + * @member {google.cloud.networksecurity.v1.InterceptEndpointGroupAssociation.LocationDetails.State} state + * @memberof google.cloud.networksecurity.v1.InterceptEndpointGroupAssociation.LocationDetails + * @instance + */ + LocationDetails.prototype.state = 0; + + /** + * Creates a new LocationDetails instance using the specified properties. + * @function create + * @memberof google.cloud.networksecurity.v1.InterceptEndpointGroupAssociation.LocationDetails + * @static + * @param {google.cloud.networksecurity.v1.InterceptEndpointGroupAssociation.ILocationDetails=} [properties] Properties to set + * @returns {google.cloud.networksecurity.v1.InterceptEndpointGroupAssociation.LocationDetails} LocationDetails instance + */ + LocationDetails.create = function create(properties) { + return new LocationDetails(properties); + }; + + /** + * Encodes the specified LocationDetails message. Does not implicitly {@link google.cloud.networksecurity.v1.InterceptEndpointGroupAssociation.LocationDetails.verify|verify} messages. + * @function encode + * @memberof google.cloud.networksecurity.v1.InterceptEndpointGroupAssociation.LocationDetails + * @static + * @param {google.cloud.networksecurity.v1.InterceptEndpointGroupAssociation.ILocationDetails} message LocationDetails message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LocationDetails.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.location != null && Object.hasOwnProperty.call(message, "location")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.location); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.state); + return writer; + }; + + /** + * Encodes the specified LocationDetails message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.InterceptEndpointGroupAssociation.LocationDetails.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.networksecurity.v1.InterceptEndpointGroupAssociation.LocationDetails + * @static + * @param {google.cloud.networksecurity.v1.InterceptEndpointGroupAssociation.ILocationDetails} message LocationDetails message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LocationDetails.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a LocationDetails message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.networksecurity.v1.InterceptEndpointGroupAssociation.LocationDetails + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.networksecurity.v1.InterceptEndpointGroupAssociation.LocationDetails} LocationDetails + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LocationDetails.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networksecurity.v1.InterceptEndpointGroupAssociation.LocationDetails(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.location = reader.string(); + break; + } + case 2: { + message.state = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a LocationDetails message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.networksecurity.v1.InterceptEndpointGroupAssociation.LocationDetails + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.networksecurity.v1.InterceptEndpointGroupAssociation.LocationDetails} LocationDetails + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LocationDetails.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a LocationDetails message. + * @function verify + * @memberof google.cloud.networksecurity.v1.InterceptEndpointGroupAssociation.LocationDetails + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LocationDetails.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.location != null && message.hasOwnProperty("location")) + if (!$util.isString(message.location)) + return "location: string expected"; + if (message.state != null && message.hasOwnProperty("state")) + switch (message.state) { + default: + return "state: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates a LocationDetails message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.networksecurity.v1.InterceptEndpointGroupAssociation.LocationDetails + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.networksecurity.v1.InterceptEndpointGroupAssociation.LocationDetails} LocationDetails + */ + LocationDetails.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networksecurity.v1.InterceptEndpointGroupAssociation.LocationDetails) + return object; + var message = new $root.google.cloud.networksecurity.v1.InterceptEndpointGroupAssociation.LocationDetails(); + if (object.location != null) + message.location = String(object.location); + switch (object.state) { + default: + if (typeof object.state === "number") { + message.state = object.state; + break; + } + break; + case "STATE_UNSPECIFIED": + case 0: + message.state = 0; + break; + case "ACTIVE": + case 1: + message.state = 1; + break; + case "OUT_OF_SYNC": + case 2: + message.state = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from a LocationDetails message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.networksecurity.v1.InterceptEndpointGroupAssociation.LocationDetails + * @static + * @param {google.cloud.networksecurity.v1.InterceptEndpointGroupAssociation.LocationDetails} message LocationDetails + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LocationDetails.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.location = ""; + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + } + if (message.location != null && message.hasOwnProperty("location")) + object.location = message.location; + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.networksecurity.v1.InterceptEndpointGroupAssociation.LocationDetails.State[message.state] === undefined ? message.state : $root.google.cloud.networksecurity.v1.InterceptEndpointGroupAssociation.LocationDetails.State[message.state] : message.state; + return object; + }; + + /** + * Converts this LocationDetails to JSON. + * @function toJSON + * @memberof google.cloud.networksecurity.v1.InterceptEndpointGroupAssociation.LocationDetails + * @instance + * @returns {Object.} JSON object + */ + LocationDetails.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for LocationDetails + * @function getTypeUrl + * @memberof google.cloud.networksecurity.v1.InterceptEndpointGroupAssociation.LocationDetails + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + LocationDetails.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.networksecurity.v1.InterceptEndpointGroupAssociation.LocationDetails"; + }; + + /** + * State enum. + * @name google.cloud.networksecurity.v1.InterceptEndpointGroupAssociation.LocationDetails.State + * @enum {number} + * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value + * @property {number} ACTIVE=1 ACTIVE value + * @property {number} OUT_OF_SYNC=2 OUT_OF_SYNC value + */ + LocationDetails.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "ACTIVE"] = 1; + values[valuesById[2] = "OUT_OF_SYNC"] = 2; + return values; + })(); + + return LocationDetails; + })(); + + /** + * State enum. + * @name google.cloud.networksecurity.v1.InterceptEndpointGroupAssociation.State + * @enum {number} + * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value + * @property {number} ACTIVE=1 ACTIVE value + * @property {number} CREATING=2 CREATING value + * @property {number} DELETING=3 DELETING value + * @property {number} CLOSED=4 CLOSED value + * @property {number} OUT_OF_SYNC=5 OUT_OF_SYNC value + * @property {number} DELETE_FAILED=6 DELETE_FAILED value + */ + InterceptEndpointGroupAssociation.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "ACTIVE"] = 1; + values[valuesById[2] = "CREATING"] = 2; + values[valuesById[3] = "DELETING"] = 3; + values[valuesById[4] = "CLOSED"] = 4; + values[valuesById[5] = "OUT_OF_SYNC"] = 5; + values[valuesById[6] = "DELETE_FAILED"] = 6; + return values; + })(); + + return InterceptEndpointGroupAssociation; + })(); + + v1.ListInterceptEndpointGroupAssociationsRequest = (function() { + + /** + * Properties of a ListInterceptEndpointGroupAssociationsRequest. + * @memberof google.cloud.networksecurity.v1 + * @interface IListInterceptEndpointGroupAssociationsRequest + * @property {string|null} [parent] ListInterceptEndpointGroupAssociationsRequest parent + * @property {number|null} [pageSize] ListInterceptEndpointGroupAssociationsRequest pageSize + * @property {string|null} [pageToken] ListInterceptEndpointGroupAssociationsRequest pageToken + * @property {string|null} [filter] ListInterceptEndpointGroupAssociationsRequest filter + * @property {string|null} [orderBy] ListInterceptEndpointGroupAssociationsRequest orderBy + */ + + /** + * Constructs a new ListInterceptEndpointGroupAssociationsRequest. + * @memberof google.cloud.networksecurity.v1 + * @classdesc Represents a ListInterceptEndpointGroupAssociationsRequest. + * @implements IListInterceptEndpointGroupAssociationsRequest + * @constructor + * @param {google.cloud.networksecurity.v1.IListInterceptEndpointGroupAssociationsRequest=} [properties] Properties to set + */ + function ListInterceptEndpointGroupAssociationsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListInterceptEndpointGroupAssociationsRequest parent. + * @member {string} parent + * @memberof google.cloud.networksecurity.v1.ListInterceptEndpointGroupAssociationsRequest + * @instance + */ + ListInterceptEndpointGroupAssociationsRequest.prototype.parent = ""; + + /** + * ListInterceptEndpointGroupAssociationsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.networksecurity.v1.ListInterceptEndpointGroupAssociationsRequest + * @instance + */ + ListInterceptEndpointGroupAssociationsRequest.prototype.pageSize = 0; + + /** + * ListInterceptEndpointGroupAssociationsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.networksecurity.v1.ListInterceptEndpointGroupAssociationsRequest + * @instance + */ + ListInterceptEndpointGroupAssociationsRequest.prototype.pageToken = ""; + + /** + * ListInterceptEndpointGroupAssociationsRequest filter. + * @member {string} filter + * @memberof google.cloud.networksecurity.v1.ListInterceptEndpointGroupAssociationsRequest + * @instance + */ + ListInterceptEndpointGroupAssociationsRequest.prototype.filter = ""; + + /** + * ListInterceptEndpointGroupAssociationsRequest orderBy. + * @member {string} orderBy + * @memberof google.cloud.networksecurity.v1.ListInterceptEndpointGroupAssociationsRequest + * @instance + */ + ListInterceptEndpointGroupAssociationsRequest.prototype.orderBy = ""; + + /** + * Creates a new ListInterceptEndpointGroupAssociationsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.networksecurity.v1.ListInterceptEndpointGroupAssociationsRequest + * @static + * @param {google.cloud.networksecurity.v1.IListInterceptEndpointGroupAssociationsRequest=} [properties] Properties to set + * @returns {google.cloud.networksecurity.v1.ListInterceptEndpointGroupAssociationsRequest} ListInterceptEndpointGroupAssociationsRequest instance + */ + ListInterceptEndpointGroupAssociationsRequest.create = function create(properties) { + return new ListInterceptEndpointGroupAssociationsRequest(properties); + }; + + /** + * Encodes the specified ListInterceptEndpointGroupAssociationsRequest message. Does not implicitly {@link google.cloud.networksecurity.v1.ListInterceptEndpointGroupAssociationsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.networksecurity.v1.ListInterceptEndpointGroupAssociationsRequest + * @static + * @param {google.cloud.networksecurity.v1.IListInterceptEndpointGroupAssociationsRequest} message ListInterceptEndpointGroupAssociationsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListInterceptEndpointGroupAssociationsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.filter); + if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.orderBy); + return writer; + }; + + /** + * Encodes the specified ListInterceptEndpointGroupAssociationsRequest message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.ListInterceptEndpointGroupAssociationsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.networksecurity.v1.ListInterceptEndpointGroupAssociationsRequest + * @static + * @param {google.cloud.networksecurity.v1.IListInterceptEndpointGroupAssociationsRequest} message ListInterceptEndpointGroupAssociationsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListInterceptEndpointGroupAssociationsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListInterceptEndpointGroupAssociationsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.networksecurity.v1.ListInterceptEndpointGroupAssociationsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.networksecurity.v1.ListInterceptEndpointGroupAssociationsRequest} ListInterceptEndpointGroupAssociationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListInterceptEndpointGroupAssociationsRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networksecurity.v1.ListInterceptEndpointGroupAssociationsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + case 4: { + message.filter = reader.string(); + break; + } + case 5: { + message.orderBy = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListInterceptEndpointGroupAssociationsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.networksecurity.v1.ListInterceptEndpointGroupAssociationsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.networksecurity.v1.ListInterceptEndpointGroupAssociationsRequest} ListInterceptEndpointGroupAssociationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListInterceptEndpointGroupAssociationsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListInterceptEndpointGroupAssociationsRequest message. + * @function verify + * @memberof google.cloud.networksecurity.v1.ListInterceptEndpointGroupAssociationsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListInterceptEndpointGroupAssociationsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + if (!$util.isString(message.orderBy)) + return "orderBy: string expected"; + return null; + }; + + /** + * Creates a ListInterceptEndpointGroupAssociationsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.networksecurity.v1.ListInterceptEndpointGroupAssociationsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.networksecurity.v1.ListInterceptEndpointGroupAssociationsRequest} ListInterceptEndpointGroupAssociationsRequest + */ + ListInterceptEndpointGroupAssociationsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networksecurity.v1.ListInterceptEndpointGroupAssociationsRequest) + return object; + var message = new $root.google.cloud.networksecurity.v1.ListInterceptEndpointGroupAssociationsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.filter != null) + message.filter = String(object.filter); + if (object.orderBy != null) + message.orderBy = String(object.orderBy); + return message; + }; + + /** + * Creates a plain object from a ListInterceptEndpointGroupAssociationsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.networksecurity.v1.ListInterceptEndpointGroupAssociationsRequest + * @static + * @param {google.cloud.networksecurity.v1.ListInterceptEndpointGroupAssociationsRequest} message ListInterceptEndpointGroupAssociationsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListInterceptEndpointGroupAssociationsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + object.filter = ""; + object.orderBy = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + object.orderBy = message.orderBy; + return object; + }; + + /** + * Converts this ListInterceptEndpointGroupAssociationsRequest to JSON. + * @function toJSON + * @memberof google.cloud.networksecurity.v1.ListInterceptEndpointGroupAssociationsRequest + * @instance + * @returns {Object.} JSON object + */ + ListInterceptEndpointGroupAssociationsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListInterceptEndpointGroupAssociationsRequest + * @function getTypeUrl + * @memberof google.cloud.networksecurity.v1.ListInterceptEndpointGroupAssociationsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListInterceptEndpointGroupAssociationsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.networksecurity.v1.ListInterceptEndpointGroupAssociationsRequest"; + }; + + return ListInterceptEndpointGroupAssociationsRequest; + })(); + + v1.ListInterceptEndpointGroupAssociationsResponse = (function() { + + /** + * Properties of a ListInterceptEndpointGroupAssociationsResponse. + * @memberof google.cloud.networksecurity.v1 + * @interface IListInterceptEndpointGroupAssociationsResponse + * @property {Array.|null} [interceptEndpointGroupAssociations] ListInterceptEndpointGroupAssociationsResponse interceptEndpointGroupAssociations + * @property {string|null} [nextPageToken] ListInterceptEndpointGroupAssociationsResponse nextPageToken + */ + + /** + * Constructs a new ListInterceptEndpointGroupAssociationsResponse. + * @memberof google.cloud.networksecurity.v1 + * @classdesc Represents a ListInterceptEndpointGroupAssociationsResponse. + * @implements IListInterceptEndpointGroupAssociationsResponse + * @constructor + * @param {google.cloud.networksecurity.v1.IListInterceptEndpointGroupAssociationsResponse=} [properties] Properties to set + */ + function ListInterceptEndpointGroupAssociationsResponse(properties) { + this.interceptEndpointGroupAssociations = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListInterceptEndpointGroupAssociationsResponse interceptEndpointGroupAssociations. + * @member {Array.} interceptEndpointGroupAssociations + * @memberof google.cloud.networksecurity.v1.ListInterceptEndpointGroupAssociationsResponse + * @instance + */ + ListInterceptEndpointGroupAssociationsResponse.prototype.interceptEndpointGroupAssociations = $util.emptyArray; + + /** + * ListInterceptEndpointGroupAssociationsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.networksecurity.v1.ListInterceptEndpointGroupAssociationsResponse + * @instance + */ + ListInterceptEndpointGroupAssociationsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListInterceptEndpointGroupAssociationsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.networksecurity.v1.ListInterceptEndpointGroupAssociationsResponse + * @static + * @param {google.cloud.networksecurity.v1.IListInterceptEndpointGroupAssociationsResponse=} [properties] Properties to set + * @returns {google.cloud.networksecurity.v1.ListInterceptEndpointGroupAssociationsResponse} ListInterceptEndpointGroupAssociationsResponse instance + */ + ListInterceptEndpointGroupAssociationsResponse.create = function create(properties) { + return new ListInterceptEndpointGroupAssociationsResponse(properties); + }; + + /** + * Encodes the specified ListInterceptEndpointGroupAssociationsResponse message. Does not implicitly {@link google.cloud.networksecurity.v1.ListInterceptEndpointGroupAssociationsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.networksecurity.v1.ListInterceptEndpointGroupAssociationsResponse + * @static + * @param {google.cloud.networksecurity.v1.IListInterceptEndpointGroupAssociationsResponse} message ListInterceptEndpointGroupAssociationsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListInterceptEndpointGroupAssociationsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.interceptEndpointGroupAssociations != null && message.interceptEndpointGroupAssociations.length) + for (var i = 0; i < message.interceptEndpointGroupAssociations.length; ++i) + $root.google.cloud.networksecurity.v1.InterceptEndpointGroupAssociation.encode(message.interceptEndpointGroupAssociations[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + return writer; + }; + + /** + * Encodes the specified ListInterceptEndpointGroupAssociationsResponse message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.ListInterceptEndpointGroupAssociationsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.networksecurity.v1.ListInterceptEndpointGroupAssociationsResponse + * @static + * @param {google.cloud.networksecurity.v1.IListInterceptEndpointGroupAssociationsResponse} message ListInterceptEndpointGroupAssociationsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListInterceptEndpointGroupAssociationsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListInterceptEndpointGroupAssociationsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.networksecurity.v1.ListInterceptEndpointGroupAssociationsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.networksecurity.v1.ListInterceptEndpointGroupAssociationsResponse} ListInterceptEndpointGroupAssociationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListInterceptEndpointGroupAssociationsResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networksecurity.v1.ListInterceptEndpointGroupAssociationsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.interceptEndpointGroupAssociations && message.interceptEndpointGroupAssociations.length)) + message.interceptEndpointGroupAssociations = []; + message.interceptEndpointGroupAssociations.push($root.google.cloud.networksecurity.v1.InterceptEndpointGroupAssociation.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListInterceptEndpointGroupAssociationsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.networksecurity.v1.ListInterceptEndpointGroupAssociationsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.networksecurity.v1.ListInterceptEndpointGroupAssociationsResponse} ListInterceptEndpointGroupAssociationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListInterceptEndpointGroupAssociationsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListInterceptEndpointGroupAssociationsResponse message. + * @function verify + * @memberof google.cloud.networksecurity.v1.ListInterceptEndpointGroupAssociationsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListInterceptEndpointGroupAssociationsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.interceptEndpointGroupAssociations != null && message.hasOwnProperty("interceptEndpointGroupAssociations")) { + if (!Array.isArray(message.interceptEndpointGroupAssociations)) + return "interceptEndpointGroupAssociations: array expected"; + for (var i = 0; i < message.interceptEndpointGroupAssociations.length; ++i) { + var error = $root.google.cloud.networksecurity.v1.InterceptEndpointGroupAssociation.verify(message.interceptEndpointGroupAssociations[i]); + if (error) + return "interceptEndpointGroupAssociations." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListInterceptEndpointGroupAssociationsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.networksecurity.v1.ListInterceptEndpointGroupAssociationsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.networksecurity.v1.ListInterceptEndpointGroupAssociationsResponse} ListInterceptEndpointGroupAssociationsResponse + */ + ListInterceptEndpointGroupAssociationsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networksecurity.v1.ListInterceptEndpointGroupAssociationsResponse) + return object; + var message = new $root.google.cloud.networksecurity.v1.ListInterceptEndpointGroupAssociationsResponse(); + if (object.interceptEndpointGroupAssociations) { + if (!Array.isArray(object.interceptEndpointGroupAssociations)) + throw TypeError(".google.cloud.networksecurity.v1.ListInterceptEndpointGroupAssociationsResponse.interceptEndpointGroupAssociations: array expected"); + message.interceptEndpointGroupAssociations = []; + for (var i = 0; i < object.interceptEndpointGroupAssociations.length; ++i) { + if (typeof object.interceptEndpointGroupAssociations[i] !== "object") + throw TypeError(".google.cloud.networksecurity.v1.ListInterceptEndpointGroupAssociationsResponse.interceptEndpointGroupAssociations: object expected"); + message.interceptEndpointGroupAssociations[i] = $root.google.cloud.networksecurity.v1.InterceptEndpointGroupAssociation.fromObject(object.interceptEndpointGroupAssociations[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListInterceptEndpointGroupAssociationsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.networksecurity.v1.ListInterceptEndpointGroupAssociationsResponse + * @static + * @param {google.cloud.networksecurity.v1.ListInterceptEndpointGroupAssociationsResponse} message ListInterceptEndpointGroupAssociationsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListInterceptEndpointGroupAssociationsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.interceptEndpointGroupAssociations = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.interceptEndpointGroupAssociations && message.interceptEndpointGroupAssociations.length) { + object.interceptEndpointGroupAssociations = []; + for (var j = 0; j < message.interceptEndpointGroupAssociations.length; ++j) + object.interceptEndpointGroupAssociations[j] = $root.google.cloud.networksecurity.v1.InterceptEndpointGroupAssociation.toObject(message.interceptEndpointGroupAssociations[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListInterceptEndpointGroupAssociationsResponse to JSON. + * @function toJSON + * @memberof google.cloud.networksecurity.v1.ListInterceptEndpointGroupAssociationsResponse + * @instance + * @returns {Object.} JSON object + */ + ListInterceptEndpointGroupAssociationsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListInterceptEndpointGroupAssociationsResponse + * @function getTypeUrl + * @memberof google.cloud.networksecurity.v1.ListInterceptEndpointGroupAssociationsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListInterceptEndpointGroupAssociationsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.networksecurity.v1.ListInterceptEndpointGroupAssociationsResponse"; + }; + + return ListInterceptEndpointGroupAssociationsResponse; + })(); + + v1.GetInterceptEndpointGroupAssociationRequest = (function() { + + /** + * Properties of a GetInterceptEndpointGroupAssociationRequest. + * @memberof google.cloud.networksecurity.v1 + * @interface IGetInterceptEndpointGroupAssociationRequest + * @property {string|null} [name] GetInterceptEndpointGroupAssociationRequest name + */ + + /** + * Constructs a new GetInterceptEndpointGroupAssociationRequest. + * @memberof google.cloud.networksecurity.v1 + * @classdesc Represents a GetInterceptEndpointGroupAssociationRequest. + * @implements IGetInterceptEndpointGroupAssociationRequest + * @constructor + * @param {google.cloud.networksecurity.v1.IGetInterceptEndpointGroupAssociationRequest=} [properties] Properties to set + */ + function GetInterceptEndpointGroupAssociationRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetInterceptEndpointGroupAssociationRequest name. + * @member {string} name + * @memberof google.cloud.networksecurity.v1.GetInterceptEndpointGroupAssociationRequest + * @instance + */ + GetInterceptEndpointGroupAssociationRequest.prototype.name = ""; + + /** + * Creates a new GetInterceptEndpointGroupAssociationRequest instance using the specified properties. + * @function create + * @memberof google.cloud.networksecurity.v1.GetInterceptEndpointGroupAssociationRequest + * @static + * @param {google.cloud.networksecurity.v1.IGetInterceptEndpointGroupAssociationRequest=} [properties] Properties to set + * @returns {google.cloud.networksecurity.v1.GetInterceptEndpointGroupAssociationRequest} GetInterceptEndpointGroupAssociationRequest instance + */ + GetInterceptEndpointGroupAssociationRequest.create = function create(properties) { + return new GetInterceptEndpointGroupAssociationRequest(properties); + }; + + /** + * Encodes the specified GetInterceptEndpointGroupAssociationRequest message. Does not implicitly {@link google.cloud.networksecurity.v1.GetInterceptEndpointGroupAssociationRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.networksecurity.v1.GetInterceptEndpointGroupAssociationRequest + * @static + * @param {google.cloud.networksecurity.v1.IGetInterceptEndpointGroupAssociationRequest} message GetInterceptEndpointGroupAssociationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetInterceptEndpointGroupAssociationRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified GetInterceptEndpointGroupAssociationRequest message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.GetInterceptEndpointGroupAssociationRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.networksecurity.v1.GetInterceptEndpointGroupAssociationRequest + * @static + * @param {google.cloud.networksecurity.v1.IGetInterceptEndpointGroupAssociationRequest} message GetInterceptEndpointGroupAssociationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetInterceptEndpointGroupAssociationRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetInterceptEndpointGroupAssociationRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.networksecurity.v1.GetInterceptEndpointGroupAssociationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.networksecurity.v1.GetInterceptEndpointGroupAssociationRequest} GetInterceptEndpointGroupAssociationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetInterceptEndpointGroupAssociationRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networksecurity.v1.GetInterceptEndpointGroupAssociationRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetInterceptEndpointGroupAssociationRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.networksecurity.v1.GetInterceptEndpointGroupAssociationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.networksecurity.v1.GetInterceptEndpointGroupAssociationRequest} GetInterceptEndpointGroupAssociationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetInterceptEndpointGroupAssociationRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetInterceptEndpointGroupAssociationRequest message. + * @function verify + * @memberof google.cloud.networksecurity.v1.GetInterceptEndpointGroupAssociationRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetInterceptEndpointGroupAssociationRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a GetInterceptEndpointGroupAssociationRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.networksecurity.v1.GetInterceptEndpointGroupAssociationRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.networksecurity.v1.GetInterceptEndpointGroupAssociationRequest} GetInterceptEndpointGroupAssociationRequest + */ + GetInterceptEndpointGroupAssociationRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networksecurity.v1.GetInterceptEndpointGroupAssociationRequest) + return object; + var message = new $root.google.cloud.networksecurity.v1.GetInterceptEndpointGroupAssociationRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetInterceptEndpointGroupAssociationRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.networksecurity.v1.GetInterceptEndpointGroupAssociationRequest + * @static + * @param {google.cloud.networksecurity.v1.GetInterceptEndpointGroupAssociationRequest} message GetInterceptEndpointGroupAssociationRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetInterceptEndpointGroupAssociationRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this GetInterceptEndpointGroupAssociationRequest to JSON. + * @function toJSON + * @memberof google.cloud.networksecurity.v1.GetInterceptEndpointGroupAssociationRequest + * @instance + * @returns {Object.} JSON object + */ + GetInterceptEndpointGroupAssociationRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetInterceptEndpointGroupAssociationRequest + * @function getTypeUrl + * @memberof google.cloud.networksecurity.v1.GetInterceptEndpointGroupAssociationRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetInterceptEndpointGroupAssociationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.networksecurity.v1.GetInterceptEndpointGroupAssociationRequest"; + }; + + return GetInterceptEndpointGroupAssociationRequest; + })(); + + v1.CreateInterceptEndpointGroupAssociationRequest = (function() { + + /** + * Properties of a CreateInterceptEndpointGroupAssociationRequest. + * @memberof google.cloud.networksecurity.v1 + * @interface ICreateInterceptEndpointGroupAssociationRequest + * @property {string|null} [parent] CreateInterceptEndpointGroupAssociationRequest parent + * @property {string|null} [interceptEndpointGroupAssociationId] CreateInterceptEndpointGroupAssociationRequest interceptEndpointGroupAssociationId + * @property {google.cloud.networksecurity.v1.IInterceptEndpointGroupAssociation|null} [interceptEndpointGroupAssociation] CreateInterceptEndpointGroupAssociationRequest interceptEndpointGroupAssociation + * @property {string|null} [requestId] CreateInterceptEndpointGroupAssociationRequest requestId + */ + + /** + * Constructs a new CreateInterceptEndpointGroupAssociationRequest. + * @memberof google.cloud.networksecurity.v1 + * @classdesc Represents a CreateInterceptEndpointGroupAssociationRequest. + * @implements ICreateInterceptEndpointGroupAssociationRequest + * @constructor + * @param {google.cloud.networksecurity.v1.ICreateInterceptEndpointGroupAssociationRequest=} [properties] Properties to set + */ + function CreateInterceptEndpointGroupAssociationRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateInterceptEndpointGroupAssociationRequest parent. + * @member {string} parent + * @memberof google.cloud.networksecurity.v1.CreateInterceptEndpointGroupAssociationRequest + * @instance + */ + CreateInterceptEndpointGroupAssociationRequest.prototype.parent = ""; + + /** + * CreateInterceptEndpointGroupAssociationRequest interceptEndpointGroupAssociationId. + * @member {string} interceptEndpointGroupAssociationId + * @memberof google.cloud.networksecurity.v1.CreateInterceptEndpointGroupAssociationRequest + * @instance + */ + CreateInterceptEndpointGroupAssociationRequest.prototype.interceptEndpointGroupAssociationId = ""; + + /** + * CreateInterceptEndpointGroupAssociationRequest interceptEndpointGroupAssociation. + * @member {google.cloud.networksecurity.v1.IInterceptEndpointGroupAssociation|null|undefined} interceptEndpointGroupAssociation + * @memberof google.cloud.networksecurity.v1.CreateInterceptEndpointGroupAssociationRequest + * @instance + */ + CreateInterceptEndpointGroupAssociationRequest.prototype.interceptEndpointGroupAssociation = null; + + /** + * CreateInterceptEndpointGroupAssociationRequest requestId. + * @member {string} requestId + * @memberof google.cloud.networksecurity.v1.CreateInterceptEndpointGroupAssociationRequest + * @instance + */ + CreateInterceptEndpointGroupAssociationRequest.prototype.requestId = ""; + + /** + * Creates a new CreateInterceptEndpointGroupAssociationRequest instance using the specified properties. + * @function create + * @memberof google.cloud.networksecurity.v1.CreateInterceptEndpointGroupAssociationRequest + * @static + * @param {google.cloud.networksecurity.v1.ICreateInterceptEndpointGroupAssociationRequest=} [properties] Properties to set + * @returns {google.cloud.networksecurity.v1.CreateInterceptEndpointGroupAssociationRequest} CreateInterceptEndpointGroupAssociationRequest instance + */ + CreateInterceptEndpointGroupAssociationRequest.create = function create(properties) { + return new CreateInterceptEndpointGroupAssociationRequest(properties); + }; + + /** + * Encodes the specified CreateInterceptEndpointGroupAssociationRequest message. Does not implicitly {@link google.cloud.networksecurity.v1.CreateInterceptEndpointGroupAssociationRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.networksecurity.v1.CreateInterceptEndpointGroupAssociationRequest + * @static + * @param {google.cloud.networksecurity.v1.ICreateInterceptEndpointGroupAssociationRequest} message CreateInterceptEndpointGroupAssociationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateInterceptEndpointGroupAssociationRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.interceptEndpointGroupAssociationId != null && Object.hasOwnProperty.call(message, "interceptEndpointGroupAssociationId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.interceptEndpointGroupAssociationId); + if (message.interceptEndpointGroupAssociation != null && Object.hasOwnProperty.call(message, "interceptEndpointGroupAssociation")) + $root.google.cloud.networksecurity.v1.InterceptEndpointGroupAssociation.encode(message.interceptEndpointGroupAssociation, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.requestId); + return writer; + }; + + /** + * Encodes the specified CreateInterceptEndpointGroupAssociationRequest message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.CreateInterceptEndpointGroupAssociationRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.networksecurity.v1.CreateInterceptEndpointGroupAssociationRequest + * @static + * @param {google.cloud.networksecurity.v1.ICreateInterceptEndpointGroupAssociationRequest} message CreateInterceptEndpointGroupAssociationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateInterceptEndpointGroupAssociationRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateInterceptEndpointGroupAssociationRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.networksecurity.v1.CreateInterceptEndpointGroupAssociationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.networksecurity.v1.CreateInterceptEndpointGroupAssociationRequest} CreateInterceptEndpointGroupAssociationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateInterceptEndpointGroupAssociationRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networksecurity.v1.CreateInterceptEndpointGroupAssociationRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.interceptEndpointGroupAssociationId = reader.string(); + break; + } + case 3: { + message.interceptEndpointGroupAssociation = $root.google.cloud.networksecurity.v1.InterceptEndpointGroupAssociation.decode(reader, reader.uint32()); + break; + } + case 4: { + message.requestId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateInterceptEndpointGroupAssociationRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.networksecurity.v1.CreateInterceptEndpointGroupAssociationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.networksecurity.v1.CreateInterceptEndpointGroupAssociationRequest} CreateInterceptEndpointGroupAssociationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateInterceptEndpointGroupAssociationRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateInterceptEndpointGroupAssociationRequest message. + * @function verify + * @memberof google.cloud.networksecurity.v1.CreateInterceptEndpointGroupAssociationRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateInterceptEndpointGroupAssociationRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.interceptEndpointGroupAssociationId != null && message.hasOwnProperty("interceptEndpointGroupAssociationId")) + if (!$util.isString(message.interceptEndpointGroupAssociationId)) + return "interceptEndpointGroupAssociationId: string expected"; + if (message.interceptEndpointGroupAssociation != null && message.hasOwnProperty("interceptEndpointGroupAssociation")) { + var error = $root.google.cloud.networksecurity.v1.InterceptEndpointGroupAssociation.verify(message.interceptEndpointGroupAssociation); + if (error) + return "interceptEndpointGroupAssociation." + error; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + return null; + }; + + /** + * Creates a CreateInterceptEndpointGroupAssociationRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.networksecurity.v1.CreateInterceptEndpointGroupAssociationRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.networksecurity.v1.CreateInterceptEndpointGroupAssociationRequest} CreateInterceptEndpointGroupAssociationRequest + */ + CreateInterceptEndpointGroupAssociationRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networksecurity.v1.CreateInterceptEndpointGroupAssociationRequest) + return object; + var message = new $root.google.cloud.networksecurity.v1.CreateInterceptEndpointGroupAssociationRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.interceptEndpointGroupAssociationId != null) + message.interceptEndpointGroupAssociationId = String(object.interceptEndpointGroupAssociationId); + if (object.interceptEndpointGroupAssociation != null) { + if (typeof object.interceptEndpointGroupAssociation !== "object") + throw TypeError(".google.cloud.networksecurity.v1.CreateInterceptEndpointGroupAssociationRequest.interceptEndpointGroupAssociation: object expected"); + message.interceptEndpointGroupAssociation = $root.google.cloud.networksecurity.v1.InterceptEndpointGroupAssociation.fromObject(object.interceptEndpointGroupAssociation); + } + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from a CreateInterceptEndpointGroupAssociationRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.networksecurity.v1.CreateInterceptEndpointGroupAssociationRequest + * @static + * @param {google.cloud.networksecurity.v1.CreateInterceptEndpointGroupAssociationRequest} message CreateInterceptEndpointGroupAssociationRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateInterceptEndpointGroupAssociationRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.interceptEndpointGroupAssociationId = ""; + object.interceptEndpointGroupAssociation = null; + object.requestId = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.interceptEndpointGroupAssociationId != null && message.hasOwnProperty("interceptEndpointGroupAssociationId")) + object.interceptEndpointGroupAssociationId = message.interceptEndpointGroupAssociationId; + if (message.interceptEndpointGroupAssociation != null && message.hasOwnProperty("interceptEndpointGroupAssociation")) + object.interceptEndpointGroupAssociation = $root.google.cloud.networksecurity.v1.InterceptEndpointGroupAssociation.toObject(message.interceptEndpointGroupAssociation, options); + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + return object; + }; + + /** + * Converts this CreateInterceptEndpointGroupAssociationRequest to JSON. + * @function toJSON + * @memberof google.cloud.networksecurity.v1.CreateInterceptEndpointGroupAssociationRequest + * @instance + * @returns {Object.} JSON object + */ + CreateInterceptEndpointGroupAssociationRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateInterceptEndpointGroupAssociationRequest + * @function getTypeUrl + * @memberof google.cloud.networksecurity.v1.CreateInterceptEndpointGroupAssociationRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateInterceptEndpointGroupAssociationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.networksecurity.v1.CreateInterceptEndpointGroupAssociationRequest"; + }; + + return CreateInterceptEndpointGroupAssociationRequest; + })(); + + v1.UpdateInterceptEndpointGroupAssociationRequest = (function() { + + /** + * Properties of an UpdateInterceptEndpointGroupAssociationRequest. + * @memberof google.cloud.networksecurity.v1 + * @interface IUpdateInterceptEndpointGroupAssociationRequest + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateInterceptEndpointGroupAssociationRequest updateMask + * @property {google.cloud.networksecurity.v1.IInterceptEndpointGroupAssociation|null} [interceptEndpointGroupAssociation] UpdateInterceptEndpointGroupAssociationRequest interceptEndpointGroupAssociation + * @property {string|null} [requestId] UpdateInterceptEndpointGroupAssociationRequest requestId + */ + + /** + * Constructs a new UpdateInterceptEndpointGroupAssociationRequest. + * @memberof google.cloud.networksecurity.v1 + * @classdesc Represents an UpdateInterceptEndpointGroupAssociationRequest. + * @implements IUpdateInterceptEndpointGroupAssociationRequest + * @constructor + * @param {google.cloud.networksecurity.v1.IUpdateInterceptEndpointGroupAssociationRequest=} [properties] Properties to set + */ + function UpdateInterceptEndpointGroupAssociationRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateInterceptEndpointGroupAssociationRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.networksecurity.v1.UpdateInterceptEndpointGroupAssociationRequest + * @instance + */ + UpdateInterceptEndpointGroupAssociationRequest.prototype.updateMask = null; + + /** + * UpdateInterceptEndpointGroupAssociationRequest interceptEndpointGroupAssociation. + * @member {google.cloud.networksecurity.v1.IInterceptEndpointGroupAssociation|null|undefined} interceptEndpointGroupAssociation + * @memberof google.cloud.networksecurity.v1.UpdateInterceptEndpointGroupAssociationRequest + * @instance + */ + UpdateInterceptEndpointGroupAssociationRequest.prototype.interceptEndpointGroupAssociation = null; + + /** + * UpdateInterceptEndpointGroupAssociationRequest requestId. + * @member {string} requestId + * @memberof google.cloud.networksecurity.v1.UpdateInterceptEndpointGroupAssociationRequest + * @instance + */ + UpdateInterceptEndpointGroupAssociationRequest.prototype.requestId = ""; + + /** + * Creates a new UpdateInterceptEndpointGroupAssociationRequest instance using the specified properties. + * @function create + * @memberof google.cloud.networksecurity.v1.UpdateInterceptEndpointGroupAssociationRequest + * @static + * @param {google.cloud.networksecurity.v1.IUpdateInterceptEndpointGroupAssociationRequest=} [properties] Properties to set + * @returns {google.cloud.networksecurity.v1.UpdateInterceptEndpointGroupAssociationRequest} UpdateInterceptEndpointGroupAssociationRequest instance + */ + UpdateInterceptEndpointGroupAssociationRequest.create = function create(properties) { + return new UpdateInterceptEndpointGroupAssociationRequest(properties); + }; + + /** + * Encodes the specified UpdateInterceptEndpointGroupAssociationRequest message. Does not implicitly {@link google.cloud.networksecurity.v1.UpdateInterceptEndpointGroupAssociationRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.networksecurity.v1.UpdateInterceptEndpointGroupAssociationRequest + * @static + * @param {google.cloud.networksecurity.v1.IUpdateInterceptEndpointGroupAssociationRequest} message UpdateInterceptEndpointGroupAssociationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateInterceptEndpointGroupAssociationRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.interceptEndpointGroupAssociation != null && Object.hasOwnProperty.call(message, "interceptEndpointGroupAssociation")) + $root.google.cloud.networksecurity.v1.InterceptEndpointGroupAssociation.encode(message.interceptEndpointGroupAssociation, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.requestId); + return writer; + }; + + /** + * Encodes the specified UpdateInterceptEndpointGroupAssociationRequest message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.UpdateInterceptEndpointGroupAssociationRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.networksecurity.v1.UpdateInterceptEndpointGroupAssociationRequest + * @static + * @param {google.cloud.networksecurity.v1.IUpdateInterceptEndpointGroupAssociationRequest} message UpdateInterceptEndpointGroupAssociationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateInterceptEndpointGroupAssociationRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateInterceptEndpointGroupAssociationRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.networksecurity.v1.UpdateInterceptEndpointGroupAssociationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.networksecurity.v1.UpdateInterceptEndpointGroupAssociationRequest} UpdateInterceptEndpointGroupAssociationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateInterceptEndpointGroupAssociationRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networksecurity.v1.UpdateInterceptEndpointGroupAssociationRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + case 2: { + message.interceptEndpointGroupAssociation = $root.google.cloud.networksecurity.v1.InterceptEndpointGroupAssociation.decode(reader, reader.uint32()); + break; + } + case 3: { + message.requestId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateInterceptEndpointGroupAssociationRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.networksecurity.v1.UpdateInterceptEndpointGroupAssociationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.networksecurity.v1.UpdateInterceptEndpointGroupAssociationRequest} UpdateInterceptEndpointGroupAssociationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateInterceptEndpointGroupAssociationRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateInterceptEndpointGroupAssociationRequest message. + * @function verify + * @memberof google.cloud.networksecurity.v1.UpdateInterceptEndpointGroupAssociationRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateInterceptEndpointGroupAssociationRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + if (message.interceptEndpointGroupAssociation != null && message.hasOwnProperty("interceptEndpointGroupAssociation")) { + var error = $root.google.cloud.networksecurity.v1.InterceptEndpointGroupAssociation.verify(message.interceptEndpointGroupAssociation); + if (error) + return "interceptEndpointGroupAssociation." + error; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + return null; + }; + + /** + * Creates an UpdateInterceptEndpointGroupAssociationRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.networksecurity.v1.UpdateInterceptEndpointGroupAssociationRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.networksecurity.v1.UpdateInterceptEndpointGroupAssociationRequest} UpdateInterceptEndpointGroupAssociationRequest + */ + UpdateInterceptEndpointGroupAssociationRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networksecurity.v1.UpdateInterceptEndpointGroupAssociationRequest) + return object; + var message = new $root.google.cloud.networksecurity.v1.UpdateInterceptEndpointGroupAssociationRequest(); + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.networksecurity.v1.UpdateInterceptEndpointGroupAssociationRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + if (object.interceptEndpointGroupAssociation != null) { + if (typeof object.interceptEndpointGroupAssociation !== "object") + throw TypeError(".google.cloud.networksecurity.v1.UpdateInterceptEndpointGroupAssociationRequest.interceptEndpointGroupAssociation: object expected"); + message.interceptEndpointGroupAssociation = $root.google.cloud.networksecurity.v1.InterceptEndpointGroupAssociation.fromObject(object.interceptEndpointGroupAssociation); + } + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from an UpdateInterceptEndpointGroupAssociationRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.networksecurity.v1.UpdateInterceptEndpointGroupAssociationRequest + * @static + * @param {google.cloud.networksecurity.v1.UpdateInterceptEndpointGroupAssociationRequest} message UpdateInterceptEndpointGroupAssociationRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateInterceptEndpointGroupAssociationRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.updateMask = null; + object.interceptEndpointGroupAssociation = null; + object.requestId = ""; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + if (message.interceptEndpointGroupAssociation != null && message.hasOwnProperty("interceptEndpointGroupAssociation")) + object.interceptEndpointGroupAssociation = $root.google.cloud.networksecurity.v1.InterceptEndpointGroupAssociation.toObject(message.interceptEndpointGroupAssociation, options); + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + return object; + }; + + /** + * Converts this UpdateInterceptEndpointGroupAssociationRequest to JSON. + * @function toJSON + * @memberof google.cloud.networksecurity.v1.UpdateInterceptEndpointGroupAssociationRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateInterceptEndpointGroupAssociationRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateInterceptEndpointGroupAssociationRequest + * @function getTypeUrl + * @memberof google.cloud.networksecurity.v1.UpdateInterceptEndpointGroupAssociationRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateInterceptEndpointGroupAssociationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.networksecurity.v1.UpdateInterceptEndpointGroupAssociationRequest"; + }; + + return UpdateInterceptEndpointGroupAssociationRequest; + })(); + + v1.DeleteInterceptEndpointGroupAssociationRequest = (function() { + + /** + * Properties of a DeleteInterceptEndpointGroupAssociationRequest. + * @memberof google.cloud.networksecurity.v1 + * @interface IDeleteInterceptEndpointGroupAssociationRequest + * @property {string|null} [name] DeleteInterceptEndpointGroupAssociationRequest name + * @property {string|null} [requestId] DeleteInterceptEndpointGroupAssociationRequest requestId + */ + + /** + * Constructs a new DeleteInterceptEndpointGroupAssociationRequest. + * @memberof google.cloud.networksecurity.v1 + * @classdesc Represents a DeleteInterceptEndpointGroupAssociationRequest. + * @implements IDeleteInterceptEndpointGroupAssociationRequest + * @constructor + * @param {google.cloud.networksecurity.v1.IDeleteInterceptEndpointGroupAssociationRequest=} [properties] Properties to set + */ + function DeleteInterceptEndpointGroupAssociationRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteInterceptEndpointGroupAssociationRequest name. + * @member {string} name + * @memberof google.cloud.networksecurity.v1.DeleteInterceptEndpointGroupAssociationRequest + * @instance + */ + DeleteInterceptEndpointGroupAssociationRequest.prototype.name = ""; + + /** + * DeleteInterceptEndpointGroupAssociationRequest requestId. + * @member {string} requestId + * @memberof google.cloud.networksecurity.v1.DeleteInterceptEndpointGroupAssociationRequest + * @instance + */ + DeleteInterceptEndpointGroupAssociationRequest.prototype.requestId = ""; + + /** + * Creates a new DeleteInterceptEndpointGroupAssociationRequest instance using the specified properties. + * @function create + * @memberof google.cloud.networksecurity.v1.DeleteInterceptEndpointGroupAssociationRequest + * @static + * @param {google.cloud.networksecurity.v1.IDeleteInterceptEndpointGroupAssociationRequest=} [properties] Properties to set + * @returns {google.cloud.networksecurity.v1.DeleteInterceptEndpointGroupAssociationRequest} DeleteInterceptEndpointGroupAssociationRequest instance + */ + DeleteInterceptEndpointGroupAssociationRequest.create = function create(properties) { + return new DeleteInterceptEndpointGroupAssociationRequest(properties); + }; + + /** + * Encodes the specified DeleteInterceptEndpointGroupAssociationRequest message. Does not implicitly {@link google.cloud.networksecurity.v1.DeleteInterceptEndpointGroupAssociationRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.networksecurity.v1.DeleteInterceptEndpointGroupAssociationRequest + * @static + * @param {google.cloud.networksecurity.v1.IDeleteInterceptEndpointGroupAssociationRequest} message DeleteInterceptEndpointGroupAssociationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteInterceptEndpointGroupAssociationRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.requestId); + return writer; + }; + + /** + * Encodes the specified DeleteInterceptEndpointGroupAssociationRequest message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.DeleteInterceptEndpointGroupAssociationRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.networksecurity.v1.DeleteInterceptEndpointGroupAssociationRequest + * @static + * @param {google.cloud.networksecurity.v1.IDeleteInterceptEndpointGroupAssociationRequest} message DeleteInterceptEndpointGroupAssociationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteInterceptEndpointGroupAssociationRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteInterceptEndpointGroupAssociationRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.networksecurity.v1.DeleteInterceptEndpointGroupAssociationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.networksecurity.v1.DeleteInterceptEndpointGroupAssociationRequest} DeleteInterceptEndpointGroupAssociationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteInterceptEndpointGroupAssociationRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networksecurity.v1.DeleteInterceptEndpointGroupAssociationRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.requestId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteInterceptEndpointGroupAssociationRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.networksecurity.v1.DeleteInterceptEndpointGroupAssociationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.networksecurity.v1.DeleteInterceptEndpointGroupAssociationRequest} DeleteInterceptEndpointGroupAssociationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteInterceptEndpointGroupAssociationRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteInterceptEndpointGroupAssociationRequest message. + * @function verify + * @memberof google.cloud.networksecurity.v1.DeleteInterceptEndpointGroupAssociationRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteInterceptEndpointGroupAssociationRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + return null; + }; + + /** + * Creates a DeleteInterceptEndpointGroupAssociationRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.networksecurity.v1.DeleteInterceptEndpointGroupAssociationRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.networksecurity.v1.DeleteInterceptEndpointGroupAssociationRequest} DeleteInterceptEndpointGroupAssociationRequest + */ + DeleteInterceptEndpointGroupAssociationRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networksecurity.v1.DeleteInterceptEndpointGroupAssociationRequest) + return object; + var message = new $root.google.cloud.networksecurity.v1.DeleteInterceptEndpointGroupAssociationRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from a DeleteInterceptEndpointGroupAssociationRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.networksecurity.v1.DeleteInterceptEndpointGroupAssociationRequest + * @static + * @param {google.cloud.networksecurity.v1.DeleteInterceptEndpointGroupAssociationRequest} message DeleteInterceptEndpointGroupAssociationRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteInterceptEndpointGroupAssociationRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.requestId = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + return object; + }; + + /** + * Converts this DeleteInterceptEndpointGroupAssociationRequest to JSON. + * @function toJSON + * @memberof google.cloud.networksecurity.v1.DeleteInterceptEndpointGroupAssociationRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteInterceptEndpointGroupAssociationRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteInterceptEndpointGroupAssociationRequest + * @function getTypeUrl + * @memberof google.cloud.networksecurity.v1.DeleteInterceptEndpointGroupAssociationRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteInterceptEndpointGroupAssociationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.networksecurity.v1.DeleteInterceptEndpointGroupAssociationRequest"; + }; + + return DeleteInterceptEndpointGroupAssociationRequest; + })(); + + v1.InterceptDeploymentGroup = (function() { + + /** + * Properties of an InterceptDeploymentGroup. + * @memberof google.cloud.networksecurity.v1 + * @interface IInterceptDeploymentGroup + * @property {string|null} [name] InterceptDeploymentGroup name + * @property {google.protobuf.ITimestamp|null} [createTime] InterceptDeploymentGroup createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] InterceptDeploymentGroup updateTime + * @property {Object.|null} [labels] InterceptDeploymentGroup labels + * @property {string|null} [network] InterceptDeploymentGroup network + * @property {Array.|null} [connectedEndpointGroups] InterceptDeploymentGroup connectedEndpointGroups + * @property {Array.|null} [nestedDeployments] InterceptDeploymentGroup nestedDeployments + * @property {google.cloud.networksecurity.v1.InterceptDeploymentGroup.State|null} [state] InterceptDeploymentGroup state + * @property {boolean|null} [reconciling] InterceptDeploymentGroup reconciling + * @property {string|null} [description] InterceptDeploymentGroup description + * @property {Array.|null} [locations] InterceptDeploymentGroup locations + */ + + /** + * Constructs a new InterceptDeploymentGroup. + * @memberof google.cloud.networksecurity.v1 + * @classdesc Represents an InterceptDeploymentGroup. + * @implements IInterceptDeploymentGroup + * @constructor + * @param {google.cloud.networksecurity.v1.IInterceptDeploymentGroup=} [properties] Properties to set + */ + function InterceptDeploymentGroup(properties) { + this.labels = {}; + this.connectedEndpointGroups = []; + this.nestedDeployments = []; + this.locations = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * InterceptDeploymentGroup name. + * @member {string} name + * @memberof google.cloud.networksecurity.v1.InterceptDeploymentGroup + * @instance + */ + InterceptDeploymentGroup.prototype.name = ""; + + /** + * InterceptDeploymentGroup createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.networksecurity.v1.InterceptDeploymentGroup + * @instance + */ + InterceptDeploymentGroup.prototype.createTime = null; + + /** + * InterceptDeploymentGroup updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.networksecurity.v1.InterceptDeploymentGroup + * @instance + */ + InterceptDeploymentGroup.prototype.updateTime = null; + + /** + * InterceptDeploymentGroup labels. + * @member {Object.} labels + * @memberof google.cloud.networksecurity.v1.InterceptDeploymentGroup + * @instance + */ + InterceptDeploymentGroup.prototype.labels = $util.emptyObject; + + /** + * InterceptDeploymentGroup network. + * @member {string} network + * @memberof google.cloud.networksecurity.v1.InterceptDeploymentGroup + * @instance + */ + InterceptDeploymentGroup.prototype.network = ""; + + /** + * InterceptDeploymentGroup connectedEndpointGroups. + * @member {Array.} connectedEndpointGroups + * @memberof google.cloud.networksecurity.v1.InterceptDeploymentGroup + * @instance + */ + InterceptDeploymentGroup.prototype.connectedEndpointGroups = $util.emptyArray; + + /** + * InterceptDeploymentGroup nestedDeployments. + * @member {Array.} nestedDeployments + * @memberof google.cloud.networksecurity.v1.InterceptDeploymentGroup + * @instance + */ + InterceptDeploymentGroup.prototype.nestedDeployments = $util.emptyArray; + + /** + * InterceptDeploymentGroup state. + * @member {google.cloud.networksecurity.v1.InterceptDeploymentGroup.State} state + * @memberof google.cloud.networksecurity.v1.InterceptDeploymentGroup + * @instance + */ + InterceptDeploymentGroup.prototype.state = 0; + + /** + * InterceptDeploymentGroup reconciling. + * @member {boolean} reconciling + * @memberof google.cloud.networksecurity.v1.InterceptDeploymentGroup + * @instance + */ + InterceptDeploymentGroup.prototype.reconciling = false; + + /** + * InterceptDeploymentGroup description. + * @member {string} description + * @memberof google.cloud.networksecurity.v1.InterceptDeploymentGroup + * @instance + */ + InterceptDeploymentGroup.prototype.description = ""; + + /** + * InterceptDeploymentGroup locations. + * @member {Array.} locations + * @memberof google.cloud.networksecurity.v1.InterceptDeploymentGroup + * @instance + */ + InterceptDeploymentGroup.prototype.locations = $util.emptyArray; + + /** + * Creates a new InterceptDeploymentGroup instance using the specified properties. + * @function create + * @memberof google.cloud.networksecurity.v1.InterceptDeploymentGroup + * @static + * @param {google.cloud.networksecurity.v1.IInterceptDeploymentGroup=} [properties] Properties to set + * @returns {google.cloud.networksecurity.v1.InterceptDeploymentGroup} InterceptDeploymentGroup instance + */ + InterceptDeploymentGroup.create = function create(properties) { + return new InterceptDeploymentGroup(properties); + }; + + /** + * Encodes the specified InterceptDeploymentGroup message. Does not implicitly {@link google.cloud.networksecurity.v1.InterceptDeploymentGroup.verify|verify} messages. + * @function encode + * @memberof google.cloud.networksecurity.v1.InterceptDeploymentGroup + * @static + * @param {google.cloud.networksecurity.v1.IInterceptDeploymentGroup} message InterceptDeploymentGroup message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InterceptDeploymentGroup.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) + for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) + writer.uint32(/* id 4, wireType 2 =*/34).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); + if (message.network != null && Object.hasOwnProperty.call(message, "network")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.network); + if (message.connectedEndpointGroups != null && message.connectedEndpointGroups.length) + for (var i = 0; i < message.connectedEndpointGroups.length; ++i) + $root.google.cloud.networksecurity.v1.InterceptDeploymentGroup.ConnectedEndpointGroup.encode(message.connectedEndpointGroups[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 7, wireType 0 =*/56).int32(message.state); + if (message.reconciling != null && Object.hasOwnProperty.call(message, "reconciling")) + writer.uint32(/* id 8, wireType 0 =*/64).bool(message.reconciling); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 9, wireType 2 =*/74).string(message.description); + if (message.nestedDeployments != null && message.nestedDeployments.length) + for (var i = 0; i < message.nestedDeployments.length; ++i) + $root.google.cloud.networksecurity.v1.InterceptDeploymentGroup.Deployment.encode(message.nestedDeployments[i], writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + if (message.locations != null && message.locations.length) + for (var i = 0; i < message.locations.length; ++i) + $root.google.cloud.networksecurity.v1.InterceptLocation.encode(message.locations[i], writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified InterceptDeploymentGroup message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.InterceptDeploymentGroup.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.networksecurity.v1.InterceptDeploymentGroup + * @static + * @param {google.cloud.networksecurity.v1.IInterceptDeploymentGroup} message InterceptDeploymentGroup message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InterceptDeploymentGroup.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an InterceptDeploymentGroup message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.networksecurity.v1.InterceptDeploymentGroup + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.networksecurity.v1.InterceptDeploymentGroup} InterceptDeploymentGroup + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InterceptDeploymentGroup.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networksecurity.v1.InterceptDeploymentGroup(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 3: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 4: { + if (message.labels === $util.emptyObject) + message.labels = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.labels[key] = value; + break; + } + case 5: { + message.network = reader.string(); + break; + } + case 6: { + if (!(message.connectedEndpointGroups && message.connectedEndpointGroups.length)) + message.connectedEndpointGroups = []; + message.connectedEndpointGroups.push($root.google.cloud.networksecurity.v1.InterceptDeploymentGroup.ConnectedEndpointGroup.decode(reader, reader.uint32())); + break; + } + case 10: { + if (!(message.nestedDeployments && message.nestedDeployments.length)) + message.nestedDeployments = []; + message.nestedDeployments.push($root.google.cloud.networksecurity.v1.InterceptDeploymentGroup.Deployment.decode(reader, reader.uint32())); + break; + } + case 7: { + message.state = reader.int32(); + break; + } + case 8: { + message.reconciling = reader.bool(); + break; + } + case 9: { + message.description = reader.string(); + break; + } + case 11: { + if (!(message.locations && message.locations.length)) + message.locations = []; + message.locations.push($root.google.cloud.networksecurity.v1.InterceptLocation.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an InterceptDeploymentGroup message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.networksecurity.v1.InterceptDeploymentGroup + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.networksecurity.v1.InterceptDeploymentGroup} InterceptDeploymentGroup + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InterceptDeploymentGroup.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an InterceptDeploymentGroup message. + * @function verify + * @memberof google.cloud.networksecurity.v1.InterceptDeploymentGroup + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + InterceptDeploymentGroup.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime); + if (error) + return "updateTime." + error; + } + if (message.labels != null && message.hasOwnProperty("labels")) { + if (!$util.isObject(message.labels)) + return "labels: object expected"; + var key = Object.keys(message.labels); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.labels[key[i]])) + return "labels: string{k:string} expected"; + } + if (message.network != null && message.hasOwnProperty("network")) + if (!$util.isString(message.network)) + return "network: string expected"; + if (message.connectedEndpointGroups != null && message.hasOwnProperty("connectedEndpointGroups")) { + if (!Array.isArray(message.connectedEndpointGroups)) + return "connectedEndpointGroups: array expected"; + for (var i = 0; i < message.connectedEndpointGroups.length; ++i) { + var error = $root.google.cloud.networksecurity.v1.InterceptDeploymentGroup.ConnectedEndpointGroup.verify(message.connectedEndpointGroups[i]); + if (error) + return "connectedEndpointGroups." + error; + } + } + if (message.nestedDeployments != null && message.hasOwnProperty("nestedDeployments")) { + if (!Array.isArray(message.nestedDeployments)) + return "nestedDeployments: array expected"; + for (var i = 0; i < message.nestedDeployments.length; ++i) { + var error = $root.google.cloud.networksecurity.v1.InterceptDeploymentGroup.Deployment.verify(message.nestedDeployments[i]); + if (error) + return "nestedDeployments." + error; + } + } + if (message.state != null && message.hasOwnProperty("state")) + switch (message.state) { + default: + return "state: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.reconciling != null && message.hasOwnProperty("reconciling")) + if (typeof message.reconciling !== "boolean") + return "reconciling: boolean expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.locations != null && message.hasOwnProperty("locations")) { + if (!Array.isArray(message.locations)) + return "locations: array expected"; + for (var i = 0; i < message.locations.length; ++i) { + var error = $root.google.cloud.networksecurity.v1.InterceptLocation.verify(message.locations[i]); + if (error) + return "locations." + error; + } + } + return null; + }; + + /** + * Creates an InterceptDeploymentGroup message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.networksecurity.v1.InterceptDeploymentGroup + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.networksecurity.v1.InterceptDeploymentGroup} InterceptDeploymentGroup + */ + InterceptDeploymentGroup.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networksecurity.v1.InterceptDeploymentGroup) + return object; + var message = new $root.google.cloud.networksecurity.v1.InterceptDeploymentGroup(); + if (object.name != null) + message.name = String(object.name); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.networksecurity.v1.InterceptDeploymentGroup.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.updateTime != null) { + if (typeof object.updateTime !== "object") + throw TypeError(".google.cloud.networksecurity.v1.InterceptDeploymentGroup.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.cloud.networksecurity.v1.InterceptDeploymentGroup.labels: object expected"); + message.labels = {}; + for (var keys = Object.keys(object.labels), i = 0; i < keys.length; ++i) + message.labels[keys[i]] = String(object.labels[keys[i]]); + } + if (object.network != null) + message.network = String(object.network); + if (object.connectedEndpointGroups) { + if (!Array.isArray(object.connectedEndpointGroups)) + throw TypeError(".google.cloud.networksecurity.v1.InterceptDeploymentGroup.connectedEndpointGroups: array expected"); + message.connectedEndpointGroups = []; + for (var i = 0; i < object.connectedEndpointGroups.length; ++i) { + if (typeof object.connectedEndpointGroups[i] !== "object") + throw TypeError(".google.cloud.networksecurity.v1.InterceptDeploymentGroup.connectedEndpointGroups: object expected"); + message.connectedEndpointGroups[i] = $root.google.cloud.networksecurity.v1.InterceptDeploymentGroup.ConnectedEndpointGroup.fromObject(object.connectedEndpointGroups[i]); + } + } + if (object.nestedDeployments) { + if (!Array.isArray(object.nestedDeployments)) + throw TypeError(".google.cloud.networksecurity.v1.InterceptDeploymentGroup.nestedDeployments: array expected"); + message.nestedDeployments = []; + for (var i = 0; i < object.nestedDeployments.length; ++i) { + if (typeof object.nestedDeployments[i] !== "object") + throw TypeError(".google.cloud.networksecurity.v1.InterceptDeploymentGroup.nestedDeployments: object expected"); + message.nestedDeployments[i] = $root.google.cloud.networksecurity.v1.InterceptDeploymentGroup.Deployment.fromObject(object.nestedDeployments[i]); + } + } + switch (object.state) { + default: + if (typeof object.state === "number") { + message.state = object.state; + break; + } + break; + case "STATE_UNSPECIFIED": + case 0: + message.state = 0; + break; + case "ACTIVE": + case 1: + message.state = 1; + break; + case "CREATING": + case 2: + message.state = 2; + break; + case "DELETING": + case 3: + message.state = 3; + break; + } + if (object.reconciling != null) + message.reconciling = Boolean(object.reconciling); + if (object.description != null) + message.description = String(object.description); + if (object.locations) { + if (!Array.isArray(object.locations)) + throw TypeError(".google.cloud.networksecurity.v1.InterceptDeploymentGroup.locations: array expected"); + message.locations = []; + for (var i = 0; i < object.locations.length; ++i) { + if (typeof object.locations[i] !== "object") + throw TypeError(".google.cloud.networksecurity.v1.InterceptDeploymentGroup.locations: object expected"); + message.locations[i] = $root.google.cloud.networksecurity.v1.InterceptLocation.fromObject(object.locations[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an InterceptDeploymentGroup message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.networksecurity.v1.InterceptDeploymentGroup + * @static + * @param {google.cloud.networksecurity.v1.InterceptDeploymentGroup} message InterceptDeploymentGroup + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + InterceptDeploymentGroup.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.connectedEndpointGroups = []; + object.nestedDeployments = []; + object.locations = []; + } + if (options.objects || options.defaults) + object.labels = {}; + if (options.defaults) { + object.name = ""; + object.createTime = null; + object.updateTime = null; + object.network = ""; + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + object.reconciling = false; + object.description = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.updateTime != null && message.hasOwnProperty("updateTime")) + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); + var keys2; + if (message.labels && (keys2 = Object.keys(message.labels)).length) { + object.labels = {}; + for (var j = 0; j < keys2.length; ++j) + object.labels[keys2[j]] = message.labels[keys2[j]]; + } + if (message.network != null && message.hasOwnProperty("network")) + object.network = message.network; + if (message.connectedEndpointGroups && message.connectedEndpointGroups.length) { + object.connectedEndpointGroups = []; + for (var j = 0; j < message.connectedEndpointGroups.length; ++j) + object.connectedEndpointGroups[j] = $root.google.cloud.networksecurity.v1.InterceptDeploymentGroup.ConnectedEndpointGroup.toObject(message.connectedEndpointGroups[j], options); + } + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.networksecurity.v1.InterceptDeploymentGroup.State[message.state] === undefined ? message.state : $root.google.cloud.networksecurity.v1.InterceptDeploymentGroup.State[message.state] : message.state; + if (message.reconciling != null && message.hasOwnProperty("reconciling")) + object.reconciling = message.reconciling; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.nestedDeployments && message.nestedDeployments.length) { + object.nestedDeployments = []; + for (var j = 0; j < message.nestedDeployments.length; ++j) + object.nestedDeployments[j] = $root.google.cloud.networksecurity.v1.InterceptDeploymentGroup.Deployment.toObject(message.nestedDeployments[j], options); + } + if (message.locations && message.locations.length) { + object.locations = []; + for (var j = 0; j < message.locations.length; ++j) + object.locations[j] = $root.google.cloud.networksecurity.v1.InterceptLocation.toObject(message.locations[j], options); + } + return object; + }; + + /** + * Converts this InterceptDeploymentGroup to JSON. + * @function toJSON + * @memberof google.cloud.networksecurity.v1.InterceptDeploymentGroup + * @instance + * @returns {Object.} JSON object + */ + InterceptDeploymentGroup.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for InterceptDeploymentGroup + * @function getTypeUrl + * @memberof google.cloud.networksecurity.v1.InterceptDeploymentGroup + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + InterceptDeploymentGroup.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.networksecurity.v1.InterceptDeploymentGroup"; + }; + + InterceptDeploymentGroup.ConnectedEndpointGroup = (function() { + + /** + * Properties of a ConnectedEndpointGroup. + * @memberof google.cloud.networksecurity.v1.InterceptDeploymentGroup + * @interface IConnectedEndpointGroup + * @property {string|null} [name] ConnectedEndpointGroup name + */ + + /** + * Constructs a new ConnectedEndpointGroup. + * @memberof google.cloud.networksecurity.v1.InterceptDeploymentGroup + * @classdesc Represents a ConnectedEndpointGroup. + * @implements IConnectedEndpointGroup + * @constructor + * @param {google.cloud.networksecurity.v1.InterceptDeploymentGroup.IConnectedEndpointGroup=} [properties] Properties to set + */ + function ConnectedEndpointGroup(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ConnectedEndpointGroup name. + * @member {string} name + * @memberof google.cloud.networksecurity.v1.InterceptDeploymentGroup.ConnectedEndpointGroup + * @instance + */ + ConnectedEndpointGroup.prototype.name = ""; + + /** + * Creates a new ConnectedEndpointGroup instance using the specified properties. + * @function create + * @memberof google.cloud.networksecurity.v1.InterceptDeploymentGroup.ConnectedEndpointGroup + * @static + * @param {google.cloud.networksecurity.v1.InterceptDeploymentGroup.IConnectedEndpointGroup=} [properties] Properties to set + * @returns {google.cloud.networksecurity.v1.InterceptDeploymentGroup.ConnectedEndpointGroup} ConnectedEndpointGroup instance + */ + ConnectedEndpointGroup.create = function create(properties) { + return new ConnectedEndpointGroup(properties); + }; + + /** + * Encodes the specified ConnectedEndpointGroup message. Does not implicitly {@link google.cloud.networksecurity.v1.InterceptDeploymentGroup.ConnectedEndpointGroup.verify|verify} messages. + * @function encode + * @memberof google.cloud.networksecurity.v1.InterceptDeploymentGroup.ConnectedEndpointGroup + * @static + * @param {google.cloud.networksecurity.v1.InterceptDeploymentGroup.IConnectedEndpointGroup} message ConnectedEndpointGroup message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ConnectedEndpointGroup.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified ConnectedEndpointGroup message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.InterceptDeploymentGroup.ConnectedEndpointGroup.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.networksecurity.v1.InterceptDeploymentGroup.ConnectedEndpointGroup + * @static + * @param {google.cloud.networksecurity.v1.InterceptDeploymentGroup.IConnectedEndpointGroup} message ConnectedEndpointGroup message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ConnectedEndpointGroup.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ConnectedEndpointGroup message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.networksecurity.v1.InterceptDeploymentGroup.ConnectedEndpointGroup + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.networksecurity.v1.InterceptDeploymentGroup.ConnectedEndpointGroup} ConnectedEndpointGroup + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ConnectedEndpointGroup.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networksecurity.v1.InterceptDeploymentGroup.ConnectedEndpointGroup(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ConnectedEndpointGroup message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.networksecurity.v1.InterceptDeploymentGroup.ConnectedEndpointGroup + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.networksecurity.v1.InterceptDeploymentGroup.ConnectedEndpointGroup} ConnectedEndpointGroup + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ConnectedEndpointGroup.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ConnectedEndpointGroup message. + * @function verify + * @memberof google.cloud.networksecurity.v1.InterceptDeploymentGroup.ConnectedEndpointGroup + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ConnectedEndpointGroup.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a ConnectedEndpointGroup message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.networksecurity.v1.InterceptDeploymentGroup.ConnectedEndpointGroup + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.networksecurity.v1.InterceptDeploymentGroup.ConnectedEndpointGroup} ConnectedEndpointGroup + */ + ConnectedEndpointGroup.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networksecurity.v1.InterceptDeploymentGroup.ConnectedEndpointGroup) + return object; + var message = new $root.google.cloud.networksecurity.v1.InterceptDeploymentGroup.ConnectedEndpointGroup(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a ConnectedEndpointGroup message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.networksecurity.v1.InterceptDeploymentGroup.ConnectedEndpointGroup + * @static + * @param {google.cloud.networksecurity.v1.InterceptDeploymentGroup.ConnectedEndpointGroup} message ConnectedEndpointGroup + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ConnectedEndpointGroup.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this ConnectedEndpointGroup to JSON. + * @function toJSON + * @memberof google.cloud.networksecurity.v1.InterceptDeploymentGroup.ConnectedEndpointGroup + * @instance + * @returns {Object.} JSON object + */ + ConnectedEndpointGroup.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ConnectedEndpointGroup + * @function getTypeUrl + * @memberof google.cloud.networksecurity.v1.InterceptDeploymentGroup.ConnectedEndpointGroup + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ConnectedEndpointGroup.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.networksecurity.v1.InterceptDeploymentGroup.ConnectedEndpointGroup"; + }; + + return ConnectedEndpointGroup; + })(); + + InterceptDeploymentGroup.Deployment = (function() { + + /** + * Properties of a Deployment. + * @memberof google.cloud.networksecurity.v1.InterceptDeploymentGroup + * @interface IDeployment + * @property {string|null} [name] Deployment name + * @property {google.cloud.networksecurity.v1.InterceptDeployment.State|null} [state] Deployment state + */ + + /** + * Constructs a new Deployment. + * @memberof google.cloud.networksecurity.v1.InterceptDeploymentGroup + * @classdesc Represents a Deployment. + * @implements IDeployment + * @constructor + * @param {google.cloud.networksecurity.v1.InterceptDeploymentGroup.IDeployment=} [properties] Properties to set + */ + function Deployment(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Deployment name. + * @member {string} name + * @memberof google.cloud.networksecurity.v1.InterceptDeploymentGroup.Deployment + * @instance + */ + Deployment.prototype.name = ""; + + /** + * Deployment state. + * @member {google.cloud.networksecurity.v1.InterceptDeployment.State} state + * @memberof google.cloud.networksecurity.v1.InterceptDeploymentGroup.Deployment + * @instance + */ + Deployment.prototype.state = 0; + + /** + * Creates a new Deployment instance using the specified properties. + * @function create + * @memberof google.cloud.networksecurity.v1.InterceptDeploymentGroup.Deployment + * @static + * @param {google.cloud.networksecurity.v1.InterceptDeploymentGroup.IDeployment=} [properties] Properties to set + * @returns {google.cloud.networksecurity.v1.InterceptDeploymentGroup.Deployment} Deployment instance + */ + Deployment.create = function create(properties) { + return new Deployment(properties); + }; + + /** + * Encodes the specified Deployment message. Does not implicitly {@link google.cloud.networksecurity.v1.InterceptDeploymentGroup.Deployment.verify|verify} messages. + * @function encode + * @memberof google.cloud.networksecurity.v1.InterceptDeploymentGroup.Deployment + * @static + * @param {google.cloud.networksecurity.v1.InterceptDeploymentGroup.IDeployment} message Deployment message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Deployment.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.state); + return writer; + }; + + /** + * Encodes the specified Deployment message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.InterceptDeploymentGroup.Deployment.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.networksecurity.v1.InterceptDeploymentGroup.Deployment + * @static + * @param {google.cloud.networksecurity.v1.InterceptDeploymentGroup.IDeployment} message Deployment message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Deployment.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Deployment message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.networksecurity.v1.InterceptDeploymentGroup.Deployment + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.networksecurity.v1.InterceptDeploymentGroup.Deployment} Deployment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Deployment.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networksecurity.v1.InterceptDeploymentGroup.Deployment(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.state = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Deployment message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.networksecurity.v1.InterceptDeploymentGroup.Deployment + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.networksecurity.v1.InterceptDeploymentGroup.Deployment} Deployment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Deployment.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Deployment message. + * @function verify + * @memberof google.cloud.networksecurity.v1.InterceptDeploymentGroup.Deployment + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Deployment.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.state != null && message.hasOwnProperty("state")) + switch (message.state) { + default: + return "state: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + break; + } + return null; + }; + + /** + * Creates a Deployment message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.networksecurity.v1.InterceptDeploymentGroup.Deployment + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.networksecurity.v1.InterceptDeploymentGroup.Deployment} Deployment + */ + Deployment.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networksecurity.v1.InterceptDeploymentGroup.Deployment) + return object; + var message = new $root.google.cloud.networksecurity.v1.InterceptDeploymentGroup.Deployment(); + if (object.name != null) + message.name = String(object.name); + switch (object.state) { + default: + if (typeof object.state === "number") { + message.state = object.state; + break; + } + break; + case "STATE_UNSPECIFIED": + case 0: + message.state = 0; + break; + case "ACTIVE": + case 1: + message.state = 1; + break; + case "CREATING": + case 2: + message.state = 2; + break; + case "DELETING": + case 3: + message.state = 3; + break; + case "OUT_OF_SYNC": + case 4: + message.state = 4; + break; + case "DELETE_FAILED": + case 5: + message.state = 5; + break; + } + return message; + }; + + /** + * Creates a plain object from a Deployment message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.networksecurity.v1.InterceptDeploymentGroup.Deployment + * @static + * @param {google.cloud.networksecurity.v1.InterceptDeploymentGroup.Deployment} message Deployment + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Deployment.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.networksecurity.v1.InterceptDeployment.State[message.state] === undefined ? message.state : $root.google.cloud.networksecurity.v1.InterceptDeployment.State[message.state] : message.state; + return object; + }; + + /** + * Converts this Deployment to JSON. + * @function toJSON + * @memberof google.cloud.networksecurity.v1.InterceptDeploymentGroup.Deployment + * @instance + * @returns {Object.} JSON object + */ + Deployment.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Deployment + * @function getTypeUrl + * @memberof google.cloud.networksecurity.v1.InterceptDeploymentGroup.Deployment + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Deployment.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.networksecurity.v1.InterceptDeploymentGroup.Deployment"; + }; + + return Deployment; + })(); + + /** + * State enum. + * @name google.cloud.networksecurity.v1.InterceptDeploymentGroup.State + * @enum {number} + * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value + * @property {number} ACTIVE=1 ACTIVE value + * @property {number} CREATING=2 CREATING value + * @property {number} DELETING=3 DELETING value + */ + InterceptDeploymentGroup.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "ACTIVE"] = 1; + values[valuesById[2] = "CREATING"] = 2; + values[valuesById[3] = "DELETING"] = 3; + return values; + })(); + + return InterceptDeploymentGroup; + })(); + + v1.ListInterceptDeploymentGroupsRequest = (function() { + + /** + * Properties of a ListInterceptDeploymentGroupsRequest. + * @memberof google.cloud.networksecurity.v1 + * @interface IListInterceptDeploymentGroupsRequest + * @property {string|null} [parent] ListInterceptDeploymentGroupsRequest parent + * @property {number|null} [pageSize] ListInterceptDeploymentGroupsRequest pageSize + * @property {string|null} [pageToken] ListInterceptDeploymentGroupsRequest pageToken + * @property {string|null} [filter] ListInterceptDeploymentGroupsRequest filter + * @property {string|null} [orderBy] ListInterceptDeploymentGroupsRequest orderBy + */ + + /** + * Constructs a new ListInterceptDeploymentGroupsRequest. + * @memberof google.cloud.networksecurity.v1 + * @classdesc Represents a ListInterceptDeploymentGroupsRequest. + * @implements IListInterceptDeploymentGroupsRequest + * @constructor + * @param {google.cloud.networksecurity.v1.IListInterceptDeploymentGroupsRequest=} [properties] Properties to set + */ + function ListInterceptDeploymentGroupsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListInterceptDeploymentGroupsRequest parent. + * @member {string} parent + * @memberof google.cloud.networksecurity.v1.ListInterceptDeploymentGroupsRequest + * @instance + */ + ListInterceptDeploymentGroupsRequest.prototype.parent = ""; + + /** + * ListInterceptDeploymentGroupsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.networksecurity.v1.ListInterceptDeploymentGroupsRequest + * @instance + */ + ListInterceptDeploymentGroupsRequest.prototype.pageSize = 0; + + /** + * ListInterceptDeploymentGroupsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.networksecurity.v1.ListInterceptDeploymentGroupsRequest + * @instance + */ + ListInterceptDeploymentGroupsRequest.prototype.pageToken = ""; + + /** + * ListInterceptDeploymentGroupsRequest filter. + * @member {string} filter + * @memberof google.cloud.networksecurity.v1.ListInterceptDeploymentGroupsRequest + * @instance + */ + ListInterceptDeploymentGroupsRequest.prototype.filter = ""; + + /** + * ListInterceptDeploymentGroupsRequest orderBy. + * @member {string} orderBy + * @memberof google.cloud.networksecurity.v1.ListInterceptDeploymentGroupsRequest + * @instance + */ + ListInterceptDeploymentGroupsRequest.prototype.orderBy = ""; + + /** + * Creates a new ListInterceptDeploymentGroupsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.networksecurity.v1.ListInterceptDeploymentGroupsRequest + * @static + * @param {google.cloud.networksecurity.v1.IListInterceptDeploymentGroupsRequest=} [properties] Properties to set + * @returns {google.cloud.networksecurity.v1.ListInterceptDeploymentGroupsRequest} ListInterceptDeploymentGroupsRequest instance + */ + ListInterceptDeploymentGroupsRequest.create = function create(properties) { + return new ListInterceptDeploymentGroupsRequest(properties); + }; + + /** + * Encodes the specified ListInterceptDeploymentGroupsRequest message. Does not implicitly {@link google.cloud.networksecurity.v1.ListInterceptDeploymentGroupsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.networksecurity.v1.ListInterceptDeploymentGroupsRequest + * @static + * @param {google.cloud.networksecurity.v1.IListInterceptDeploymentGroupsRequest} message ListInterceptDeploymentGroupsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListInterceptDeploymentGroupsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.filter); + if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.orderBy); + return writer; + }; + + /** + * Encodes the specified ListInterceptDeploymentGroupsRequest message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.ListInterceptDeploymentGroupsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.networksecurity.v1.ListInterceptDeploymentGroupsRequest + * @static + * @param {google.cloud.networksecurity.v1.IListInterceptDeploymentGroupsRequest} message ListInterceptDeploymentGroupsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListInterceptDeploymentGroupsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListInterceptDeploymentGroupsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.networksecurity.v1.ListInterceptDeploymentGroupsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.networksecurity.v1.ListInterceptDeploymentGroupsRequest} ListInterceptDeploymentGroupsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListInterceptDeploymentGroupsRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networksecurity.v1.ListInterceptDeploymentGroupsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + case 4: { + message.filter = reader.string(); + break; + } + case 5: { + message.orderBy = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListInterceptDeploymentGroupsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.networksecurity.v1.ListInterceptDeploymentGroupsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.networksecurity.v1.ListInterceptDeploymentGroupsRequest} ListInterceptDeploymentGroupsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListInterceptDeploymentGroupsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListInterceptDeploymentGroupsRequest message. + * @function verify + * @memberof google.cloud.networksecurity.v1.ListInterceptDeploymentGroupsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListInterceptDeploymentGroupsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + if (!$util.isString(message.orderBy)) + return "orderBy: string expected"; + return null; + }; + + /** + * Creates a ListInterceptDeploymentGroupsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.networksecurity.v1.ListInterceptDeploymentGroupsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.networksecurity.v1.ListInterceptDeploymentGroupsRequest} ListInterceptDeploymentGroupsRequest + */ + ListInterceptDeploymentGroupsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networksecurity.v1.ListInterceptDeploymentGroupsRequest) + return object; + var message = new $root.google.cloud.networksecurity.v1.ListInterceptDeploymentGroupsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.filter != null) + message.filter = String(object.filter); + if (object.orderBy != null) + message.orderBy = String(object.orderBy); + return message; + }; + + /** + * Creates a plain object from a ListInterceptDeploymentGroupsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.networksecurity.v1.ListInterceptDeploymentGroupsRequest + * @static + * @param {google.cloud.networksecurity.v1.ListInterceptDeploymentGroupsRequest} message ListInterceptDeploymentGroupsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListInterceptDeploymentGroupsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + object.filter = ""; + object.orderBy = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + object.orderBy = message.orderBy; + return object; + }; + + /** + * Converts this ListInterceptDeploymentGroupsRequest to JSON. + * @function toJSON + * @memberof google.cloud.networksecurity.v1.ListInterceptDeploymentGroupsRequest + * @instance + * @returns {Object.} JSON object + */ + ListInterceptDeploymentGroupsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListInterceptDeploymentGroupsRequest + * @function getTypeUrl + * @memberof google.cloud.networksecurity.v1.ListInterceptDeploymentGroupsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListInterceptDeploymentGroupsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.networksecurity.v1.ListInterceptDeploymentGroupsRequest"; + }; + + return ListInterceptDeploymentGroupsRequest; + })(); + + v1.ListInterceptDeploymentGroupsResponse = (function() { + + /** + * Properties of a ListInterceptDeploymentGroupsResponse. + * @memberof google.cloud.networksecurity.v1 + * @interface IListInterceptDeploymentGroupsResponse + * @property {Array.|null} [interceptDeploymentGroups] ListInterceptDeploymentGroupsResponse interceptDeploymentGroups + * @property {string|null} [nextPageToken] ListInterceptDeploymentGroupsResponse nextPageToken + */ + + /** + * Constructs a new ListInterceptDeploymentGroupsResponse. + * @memberof google.cloud.networksecurity.v1 + * @classdesc Represents a ListInterceptDeploymentGroupsResponse. + * @implements IListInterceptDeploymentGroupsResponse + * @constructor + * @param {google.cloud.networksecurity.v1.IListInterceptDeploymentGroupsResponse=} [properties] Properties to set + */ + function ListInterceptDeploymentGroupsResponse(properties) { + this.interceptDeploymentGroups = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListInterceptDeploymentGroupsResponse interceptDeploymentGroups. + * @member {Array.} interceptDeploymentGroups + * @memberof google.cloud.networksecurity.v1.ListInterceptDeploymentGroupsResponse + * @instance + */ + ListInterceptDeploymentGroupsResponse.prototype.interceptDeploymentGroups = $util.emptyArray; + + /** + * ListInterceptDeploymentGroupsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.networksecurity.v1.ListInterceptDeploymentGroupsResponse + * @instance + */ + ListInterceptDeploymentGroupsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListInterceptDeploymentGroupsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.networksecurity.v1.ListInterceptDeploymentGroupsResponse + * @static + * @param {google.cloud.networksecurity.v1.IListInterceptDeploymentGroupsResponse=} [properties] Properties to set + * @returns {google.cloud.networksecurity.v1.ListInterceptDeploymentGroupsResponse} ListInterceptDeploymentGroupsResponse instance + */ + ListInterceptDeploymentGroupsResponse.create = function create(properties) { + return new ListInterceptDeploymentGroupsResponse(properties); + }; + + /** + * Encodes the specified ListInterceptDeploymentGroupsResponse message. Does not implicitly {@link google.cloud.networksecurity.v1.ListInterceptDeploymentGroupsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.networksecurity.v1.ListInterceptDeploymentGroupsResponse + * @static + * @param {google.cloud.networksecurity.v1.IListInterceptDeploymentGroupsResponse} message ListInterceptDeploymentGroupsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListInterceptDeploymentGroupsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.interceptDeploymentGroups != null && message.interceptDeploymentGroups.length) + for (var i = 0; i < message.interceptDeploymentGroups.length; ++i) + $root.google.cloud.networksecurity.v1.InterceptDeploymentGroup.encode(message.interceptDeploymentGroups[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + return writer; + }; + + /** + * Encodes the specified ListInterceptDeploymentGroupsResponse message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.ListInterceptDeploymentGroupsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.networksecurity.v1.ListInterceptDeploymentGroupsResponse + * @static + * @param {google.cloud.networksecurity.v1.IListInterceptDeploymentGroupsResponse} message ListInterceptDeploymentGroupsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListInterceptDeploymentGroupsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListInterceptDeploymentGroupsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.networksecurity.v1.ListInterceptDeploymentGroupsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.networksecurity.v1.ListInterceptDeploymentGroupsResponse} ListInterceptDeploymentGroupsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListInterceptDeploymentGroupsResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networksecurity.v1.ListInterceptDeploymentGroupsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.interceptDeploymentGroups && message.interceptDeploymentGroups.length)) + message.interceptDeploymentGroups = []; + message.interceptDeploymentGroups.push($root.google.cloud.networksecurity.v1.InterceptDeploymentGroup.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListInterceptDeploymentGroupsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.networksecurity.v1.ListInterceptDeploymentGroupsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.networksecurity.v1.ListInterceptDeploymentGroupsResponse} ListInterceptDeploymentGroupsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListInterceptDeploymentGroupsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListInterceptDeploymentGroupsResponse message. + * @function verify + * @memberof google.cloud.networksecurity.v1.ListInterceptDeploymentGroupsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListInterceptDeploymentGroupsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.interceptDeploymentGroups != null && message.hasOwnProperty("interceptDeploymentGroups")) { + if (!Array.isArray(message.interceptDeploymentGroups)) + return "interceptDeploymentGroups: array expected"; + for (var i = 0; i < message.interceptDeploymentGroups.length; ++i) { + var error = $root.google.cloud.networksecurity.v1.InterceptDeploymentGroup.verify(message.interceptDeploymentGroups[i]); + if (error) + return "interceptDeploymentGroups." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListInterceptDeploymentGroupsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.networksecurity.v1.ListInterceptDeploymentGroupsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.networksecurity.v1.ListInterceptDeploymentGroupsResponse} ListInterceptDeploymentGroupsResponse + */ + ListInterceptDeploymentGroupsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networksecurity.v1.ListInterceptDeploymentGroupsResponse) + return object; + var message = new $root.google.cloud.networksecurity.v1.ListInterceptDeploymentGroupsResponse(); + if (object.interceptDeploymentGroups) { + if (!Array.isArray(object.interceptDeploymentGroups)) + throw TypeError(".google.cloud.networksecurity.v1.ListInterceptDeploymentGroupsResponse.interceptDeploymentGroups: array expected"); + message.interceptDeploymentGroups = []; + for (var i = 0; i < object.interceptDeploymentGroups.length; ++i) { + if (typeof object.interceptDeploymentGroups[i] !== "object") + throw TypeError(".google.cloud.networksecurity.v1.ListInterceptDeploymentGroupsResponse.interceptDeploymentGroups: object expected"); + message.interceptDeploymentGroups[i] = $root.google.cloud.networksecurity.v1.InterceptDeploymentGroup.fromObject(object.interceptDeploymentGroups[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListInterceptDeploymentGroupsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.networksecurity.v1.ListInterceptDeploymentGroupsResponse + * @static + * @param {google.cloud.networksecurity.v1.ListInterceptDeploymentGroupsResponse} message ListInterceptDeploymentGroupsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListInterceptDeploymentGroupsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.interceptDeploymentGroups = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.interceptDeploymentGroups && message.interceptDeploymentGroups.length) { + object.interceptDeploymentGroups = []; + for (var j = 0; j < message.interceptDeploymentGroups.length; ++j) + object.interceptDeploymentGroups[j] = $root.google.cloud.networksecurity.v1.InterceptDeploymentGroup.toObject(message.interceptDeploymentGroups[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListInterceptDeploymentGroupsResponse to JSON. + * @function toJSON + * @memberof google.cloud.networksecurity.v1.ListInterceptDeploymentGroupsResponse + * @instance + * @returns {Object.} JSON object + */ + ListInterceptDeploymentGroupsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListInterceptDeploymentGroupsResponse + * @function getTypeUrl + * @memberof google.cloud.networksecurity.v1.ListInterceptDeploymentGroupsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListInterceptDeploymentGroupsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.networksecurity.v1.ListInterceptDeploymentGroupsResponse"; + }; + + return ListInterceptDeploymentGroupsResponse; + })(); + + v1.GetInterceptDeploymentGroupRequest = (function() { + + /** + * Properties of a GetInterceptDeploymentGroupRequest. + * @memberof google.cloud.networksecurity.v1 + * @interface IGetInterceptDeploymentGroupRequest + * @property {string|null} [name] GetInterceptDeploymentGroupRequest name + */ + + /** + * Constructs a new GetInterceptDeploymentGroupRequest. + * @memberof google.cloud.networksecurity.v1 + * @classdesc Represents a GetInterceptDeploymentGroupRequest. + * @implements IGetInterceptDeploymentGroupRequest + * @constructor + * @param {google.cloud.networksecurity.v1.IGetInterceptDeploymentGroupRequest=} [properties] Properties to set + */ + function GetInterceptDeploymentGroupRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetInterceptDeploymentGroupRequest name. + * @member {string} name + * @memberof google.cloud.networksecurity.v1.GetInterceptDeploymentGroupRequest + * @instance + */ + GetInterceptDeploymentGroupRequest.prototype.name = ""; + + /** + * Creates a new GetInterceptDeploymentGroupRequest instance using the specified properties. + * @function create + * @memberof google.cloud.networksecurity.v1.GetInterceptDeploymentGroupRequest + * @static + * @param {google.cloud.networksecurity.v1.IGetInterceptDeploymentGroupRequest=} [properties] Properties to set + * @returns {google.cloud.networksecurity.v1.GetInterceptDeploymentGroupRequest} GetInterceptDeploymentGroupRequest instance + */ + GetInterceptDeploymentGroupRequest.create = function create(properties) { + return new GetInterceptDeploymentGroupRequest(properties); + }; + + /** + * Encodes the specified GetInterceptDeploymentGroupRequest message. Does not implicitly {@link google.cloud.networksecurity.v1.GetInterceptDeploymentGroupRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.networksecurity.v1.GetInterceptDeploymentGroupRequest + * @static + * @param {google.cloud.networksecurity.v1.IGetInterceptDeploymentGroupRequest} message GetInterceptDeploymentGroupRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetInterceptDeploymentGroupRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified GetInterceptDeploymentGroupRequest message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.GetInterceptDeploymentGroupRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.networksecurity.v1.GetInterceptDeploymentGroupRequest + * @static + * @param {google.cloud.networksecurity.v1.IGetInterceptDeploymentGroupRequest} message GetInterceptDeploymentGroupRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetInterceptDeploymentGroupRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetInterceptDeploymentGroupRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.networksecurity.v1.GetInterceptDeploymentGroupRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.networksecurity.v1.GetInterceptDeploymentGroupRequest} GetInterceptDeploymentGroupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetInterceptDeploymentGroupRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networksecurity.v1.GetInterceptDeploymentGroupRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetInterceptDeploymentGroupRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.networksecurity.v1.GetInterceptDeploymentGroupRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.networksecurity.v1.GetInterceptDeploymentGroupRequest} GetInterceptDeploymentGroupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetInterceptDeploymentGroupRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetInterceptDeploymentGroupRequest message. + * @function verify + * @memberof google.cloud.networksecurity.v1.GetInterceptDeploymentGroupRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetInterceptDeploymentGroupRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a GetInterceptDeploymentGroupRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.networksecurity.v1.GetInterceptDeploymentGroupRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.networksecurity.v1.GetInterceptDeploymentGroupRequest} GetInterceptDeploymentGroupRequest + */ + GetInterceptDeploymentGroupRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networksecurity.v1.GetInterceptDeploymentGroupRequest) + return object; + var message = new $root.google.cloud.networksecurity.v1.GetInterceptDeploymentGroupRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetInterceptDeploymentGroupRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.networksecurity.v1.GetInterceptDeploymentGroupRequest + * @static + * @param {google.cloud.networksecurity.v1.GetInterceptDeploymentGroupRequest} message GetInterceptDeploymentGroupRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetInterceptDeploymentGroupRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this GetInterceptDeploymentGroupRequest to JSON. + * @function toJSON + * @memberof google.cloud.networksecurity.v1.GetInterceptDeploymentGroupRequest + * @instance + * @returns {Object.} JSON object + */ + GetInterceptDeploymentGroupRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetInterceptDeploymentGroupRequest + * @function getTypeUrl + * @memberof google.cloud.networksecurity.v1.GetInterceptDeploymentGroupRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetInterceptDeploymentGroupRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.networksecurity.v1.GetInterceptDeploymentGroupRequest"; + }; + + return GetInterceptDeploymentGroupRequest; + })(); + + v1.CreateInterceptDeploymentGroupRequest = (function() { + + /** + * Properties of a CreateInterceptDeploymentGroupRequest. + * @memberof google.cloud.networksecurity.v1 + * @interface ICreateInterceptDeploymentGroupRequest + * @property {string|null} [parent] CreateInterceptDeploymentGroupRequest parent + * @property {string|null} [interceptDeploymentGroupId] CreateInterceptDeploymentGroupRequest interceptDeploymentGroupId + * @property {google.cloud.networksecurity.v1.IInterceptDeploymentGroup|null} [interceptDeploymentGroup] CreateInterceptDeploymentGroupRequest interceptDeploymentGroup + * @property {string|null} [requestId] CreateInterceptDeploymentGroupRequest requestId + */ + + /** + * Constructs a new CreateInterceptDeploymentGroupRequest. + * @memberof google.cloud.networksecurity.v1 + * @classdesc Represents a CreateInterceptDeploymentGroupRequest. + * @implements ICreateInterceptDeploymentGroupRequest + * @constructor + * @param {google.cloud.networksecurity.v1.ICreateInterceptDeploymentGroupRequest=} [properties] Properties to set + */ + function CreateInterceptDeploymentGroupRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateInterceptDeploymentGroupRequest parent. + * @member {string} parent + * @memberof google.cloud.networksecurity.v1.CreateInterceptDeploymentGroupRequest + * @instance + */ + CreateInterceptDeploymentGroupRequest.prototype.parent = ""; + + /** + * CreateInterceptDeploymentGroupRequest interceptDeploymentGroupId. + * @member {string} interceptDeploymentGroupId + * @memberof google.cloud.networksecurity.v1.CreateInterceptDeploymentGroupRequest + * @instance + */ + CreateInterceptDeploymentGroupRequest.prototype.interceptDeploymentGroupId = ""; + + /** + * CreateInterceptDeploymentGroupRequest interceptDeploymentGroup. + * @member {google.cloud.networksecurity.v1.IInterceptDeploymentGroup|null|undefined} interceptDeploymentGroup + * @memberof google.cloud.networksecurity.v1.CreateInterceptDeploymentGroupRequest + * @instance + */ + CreateInterceptDeploymentGroupRequest.prototype.interceptDeploymentGroup = null; + + /** + * CreateInterceptDeploymentGroupRequest requestId. + * @member {string} requestId + * @memberof google.cloud.networksecurity.v1.CreateInterceptDeploymentGroupRequest + * @instance + */ + CreateInterceptDeploymentGroupRequest.prototype.requestId = ""; + + /** + * Creates a new CreateInterceptDeploymentGroupRequest instance using the specified properties. + * @function create + * @memberof google.cloud.networksecurity.v1.CreateInterceptDeploymentGroupRequest + * @static + * @param {google.cloud.networksecurity.v1.ICreateInterceptDeploymentGroupRequest=} [properties] Properties to set + * @returns {google.cloud.networksecurity.v1.CreateInterceptDeploymentGroupRequest} CreateInterceptDeploymentGroupRequest instance + */ + CreateInterceptDeploymentGroupRequest.create = function create(properties) { + return new CreateInterceptDeploymentGroupRequest(properties); + }; + + /** + * Encodes the specified CreateInterceptDeploymentGroupRequest message. Does not implicitly {@link google.cloud.networksecurity.v1.CreateInterceptDeploymentGroupRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.networksecurity.v1.CreateInterceptDeploymentGroupRequest + * @static + * @param {google.cloud.networksecurity.v1.ICreateInterceptDeploymentGroupRequest} message CreateInterceptDeploymentGroupRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateInterceptDeploymentGroupRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.interceptDeploymentGroupId != null && Object.hasOwnProperty.call(message, "interceptDeploymentGroupId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.interceptDeploymentGroupId); + if (message.interceptDeploymentGroup != null && Object.hasOwnProperty.call(message, "interceptDeploymentGroup")) + $root.google.cloud.networksecurity.v1.InterceptDeploymentGroup.encode(message.interceptDeploymentGroup, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.requestId); + return writer; + }; + + /** + * Encodes the specified CreateInterceptDeploymentGroupRequest message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.CreateInterceptDeploymentGroupRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.networksecurity.v1.CreateInterceptDeploymentGroupRequest + * @static + * @param {google.cloud.networksecurity.v1.ICreateInterceptDeploymentGroupRequest} message CreateInterceptDeploymentGroupRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateInterceptDeploymentGroupRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateInterceptDeploymentGroupRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.networksecurity.v1.CreateInterceptDeploymentGroupRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.networksecurity.v1.CreateInterceptDeploymentGroupRequest} CreateInterceptDeploymentGroupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateInterceptDeploymentGroupRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networksecurity.v1.CreateInterceptDeploymentGroupRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.interceptDeploymentGroupId = reader.string(); + break; + } + case 3: { + message.interceptDeploymentGroup = $root.google.cloud.networksecurity.v1.InterceptDeploymentGroup.decode(reader, reader.uint32()); + break; + } + case 4: { + message.requestId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateInterceptDeploymentGroupRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.networksecurity.v1.CreateInterceptDeploymentGroupRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.networksecurity.v1.CreateInterceptDeploymentGroupRequest} CreateInterceptDeploymentGroupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateInterceptDeploymentGroupRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateInterceptDeploymentGroupRequest message. + * @function verify + * @memberof google.cloud.networksecurity.v1.CreateInterceptDeploymentGroupRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateInterceptDeploymentGroupRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.interceptDeploymentGroupId != null && message.hasOwnProperty("interceptDeploymentGroupId")) + if (!$util.isString(message.interceptDeploymentGroupId)) + return "interceptDeploymentGroupId: string expected"; + if (message.interceptDeploymentGroup != null && message.hasOwnProperty("interceptDeploymentGroup")) { + var error = $root.google.cloud.networksecurity.v1.InterceptDeploymentGroup.verify(message.interceptDeploymentGroup); + if (error) + return "interceptDeploymentGroup." + error; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + return null; + }; + + /** + * Creates a CreateInterceptDeploymentGroupRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.networksecurity.v1.CreateInterceptDeploymentGroupRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.networksecurity.v1.CreateInterceptDeploymentGroupRequest} CreateInterceptDeploymentGroupRequest + */ + CreateInterceptDeploymentGroupRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networksecurity.v1.CreateInterceptDeploymentGroupRequest) + return object; + var message = new $root.google.cloud.networksecurity.v1.CreateInterceptDeploymentGroupRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.interceptDeploymentGroupId != null) + message.interceptDeploymentGroupId = String(object.interceptDeploymentGroupId); + if (object.interceptDeploymentGroup != null) { + if (typeof object.interceptDeploymentGroup !== "object") + throw TypeError(".google.cloud.networksecurity.v1.CreateInterceptDeploymentGroupRequest.interceptDeploymentGroup: object expected"); + message.interceptDeploymentGroup = $root.google.cloud.networksecurity.v1.InterceptDeploymentGroup.fromObject(object.interceptDeploymentGroup); + } + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from a CreateInterceptDeploymentGroupRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.networksecurity.v1.CreateInterceptDeploymentGroupRequest + * @static + * @param {google.cloud.networksecurity.v1.CreateInterceptDeploymentGroupRequest} message CreateInterceptDeploymentGroupRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateInterceptDeploymentGroupRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.interceptDeploymentGroupId = ""; + object.interceptDeploymentGroup = null; + object.requestId = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.interceptDeploymentGroupId != null && message.hasOwnProperty("interceptDeploymentGroupId")) + object.interceptDeploymentGroupId = message.interceptDeploymentGroupId; + if (message.interceptDeploymentGroup != null && message.hasOwnProperty("interceptDeploymentGroup")) + object.interceptDeploymentGroup = $root.google.cloud.networksecurity.v1.InterceptDeploymentGroup.toObject(message.interceptDeploymentGroup, options); + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + return object; + }; + + /** + * Converts this CreateInterceptDeploymentGroupRequest to JSON. + * @function toJSON + * @memberof google.cloud.networksecurity.v1.CreateInterceptDeploymentGroupRequest + * @instance + * @returns {Object.} JSON object + */ + CreateInterceptDeploymentGroupRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateInterceptDeploymentGroupRequest + * @function getTypeUrl + * @memberof google.cloud.networksecurity.v1.CreateInterceptDeploymentGroupRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateInterceptDeploymentGroupRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.networksecurity.v1.CreateInterceptDeploymentGroupRequest"; + }; + + return CreateInterceptDeploymentGroupRequest; + })(); + + v1.UpdateInterceptDeploymentGroupRequest = (function() { + + /** + * Properties of an UpdateInterceptDeploymentGroupRequest. + * @memberof google.cloud.networksecurity.v1 + * @interface IUpdateInterceptDeploymentGroupRequest + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateInterceptDeploymentGroupRequest updateMask + * @property {google.cloud.networksecurity.v1.IInterceptDeploymentGroup|null} [interceptDeploymentGroup] UpdateInterceptDeploymentGroupRequest interceptDeploymentGroup + * @property {string|null} [requestId] UpdateInterceptDeploymentGroupRequest requestId + */ + + /** + * Constructs a new UpdateInterceptDeploymentGroupRequest. + * @memberof google.cloud.networksecurity.v1 + * @classdesc Represents an UpdateInterceptDeploymentGroupRequest. + * @implements IUpdateInterceptDeploymentGroupRequest + * @constructor + * @param {google.cloud.networksecurity.v1.IUpdateInterceptDeploymentGroupRequest=} [properties] Properties to set + */ + function UpdateInterceptDeploymentGroupRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateInterceptDeploymentGroupRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.networksecurity.v1.UpdateInterceptDeploymentGroupRequest + * @instance + */ + UpdateInterceptDeploymentGroupRequest.prototype.updateMask = null; + + /** + * UpdateInterceptDeploymentGroupRequest interceptDeploymentGroup. + * @member {google.cloud.networksecurity.v1.IInterceptDeploymentGroup|null|undefined} interceptDeploymentGroup + * @memberof google.cloud.networksecurity.v1.UpdateInterceptDeploymentGroupRequest + * @instance + */ + UpdateInterceptDeploymentGroupRequest.prototype.interceptDeploymentGroup = null; + + /** + * UpdateInterceptDeploymentGroupRequest requestId. + * @member {string} requestId + * @memberof google.cloud.networksecurity.v1.UpdateInterceptDeploymentGroupRequest + * @instance + */ + UpdateInterceptDeploymentGroupRequest.prototype.requestId = ""; + + /** + * Creates a new UpdateInterceptDeploymentGroupRequest instance using the specified properties. + * @function create + * @memberof google.cloud.networksecurity.v1.UpdateInterceptDeploymentGroupRequest + * @static + * @param {google.cloud.networksecurity.v1.IUpdateInterceptDeploymentGroupRequest=} [properties] Properties to set + * @returns {google.cloud.networksecurity.v1.UpdateInterceptDeploymentGroupRequest} UpdateInterceptDeploymentGroupRequest instance + */ + UpdateInterceptDeploymentGroupRequest.create = function create(properties) { + return new UpdateInterceptDeploymentGroupRequest(properties); + }; + + /** + * Encodes the specified UpdateInterceptDeploymentGroupRequest message. Does not implicitly {@link google.cloud.networksecurity.v1.UpdateInterceptDeploymentGroupRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.networksecurity.v1.UpdateInterceptDeploymentGroupRequest + * @static + * @param {google.cloud.networksecurity.v1.IUpdateInterceptDeploymentGroupRequest} message UpdateInterceptDeploymentGroupRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateInterceptDeploymentGroupRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.interceptDeploymentGroup != null && Object.hasOwnProperty.call(message, "interceptDeploymentGroup")) + $root.google.cloud.networksecurity.v1.InterceptDeploymentGroup.encode(message.interceptDeploymentGroup, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.requestId); + return writer; + }; + + /** + * Encodes the specified UpdateInterceptDeploymentGroupRequest message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.UpdateInterceptDeploymentGroupRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.networksecurity.v1.UpdateInterceptDeploymentGroupRequest + * @static + * @param {google.cloud.networksecurity.v1.IUpdateInterceptDeploymentGroupRequest} message UpdateInterceptDeploymentGroupRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateInterceptDeploymentGroupRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateInterceptDeploymentGroupRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.networksecurity.v1.UpdateInterceptDeploymentGroupRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.networksecurity.v1.UpdateInterceptDeploymentGroupRequest} UpdateInterceptDeploymentGroupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateInterceptDeploymentGroupRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networksecurity.v1.UpdateInterceptDeploymentGroupRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + case 2: { + message.interceptDeploymentGroup = $root.google.cloud.networksecurity.v1.InterceptDeploymentGroup.decode(reader, reader.uint32()); + break; + } + case 3: { + message.requestId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateInterceptDeploymentGroupRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.networksecurity.v1.UpdateInterceptDeploymentGroupRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.networksecurity.v1.UpdateInterceptDeploymentGroupRequest} UpdateInterceptDeploymentGroupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateInterceptDeploymentGroupRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateInterceptDeploymentGroupRequest message. + * @function verify + * @memberof google.cloud.networksecurity.v1.UpdateInterceptDeploymentGroupRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateInterceptDeploymentGroupRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + if (message.interceptDeploymentGroup != null && message.hasOwnProperty("interceptDeploymentGroup")) { + var error = $root.google.cloud.networksecurity.v1.InterceptDeploymentGroup.verify(message.interceptDeploymentGroup); + if (error) + return "interceptDeploymentGroup." + error; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + return null; + }; + + /** + * Creates an UpdateInterceptDeploymentGroupRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.networksecurity.v1.UpdateInterceptDeploymentGroupRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.networksecurity.v1.UpdateInterceptDeploymentGroupRequest} UpdateInterceptDeploymentGroupRequest + */ + UpdateInterceptDeploymentGroupRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networksecurity.v1.UpdateInterceptDeploymentGroupRequest) + return object; + var message = new $root.google.cloud.networksecurity.v1.UpdateInterceptDeploymentGroupRequest(); + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.networksecurity.v1.UpdateInterceptDeploymentGroupRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + if (object.interceptDeploymentGroup != null) { + if (typeof object.interceptDeploymentGroup !== "object") + throw TypeError(".google.cloud.networksecurity.v1.UpdateInterceptDeploymentGroupRequest.interceptDeploymentGroup: object expected"); + message.interceptDeploymentGroup = $root.google.cloud.networksecurity.v1.InterceptDeploymentGroup.fromObject(object.interceptDeploymentGroup); + } + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from an UpdateInterceptDeploymentGroupRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.networksecurity.v1.UpdateInterceptDeploymentGroupRequest + * @static + * @param {google.cloud.networksecurity.v1.UpdateInterceptDeploymentGroupRequest} message UpdateInterceptDeploymentGroupRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateInterceptDeploymentGroupRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.updateMask = null; + object.interceptDeploymentGroup = null; + object.requestId = ""; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + if (message.interceptDeploymentGroup != null && message.hasOwnProperty("interceptDeploymentGroup")) + object.interceptDeploymentGroup = $root.google.cloud.networksecurity.v1.InterceptDeploymentGroup.toObject(message.interceptDeploymentGroup, options); + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + return object; + }; + + /** + * Converts this UpdateInterceptDeploymentGroupRequest to JSON. + * @function toJSON + * @memberof google.cloud.networksecurity.v1.UpdateInterceptDeploymentGroupRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateInterceptDeploymentGroupRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateInterceptDeploymentGroupRequest + * @function getTypeUrl + * @memberof google.cloud.networksecurity.v1.UpdateInterceptDeploymentGroupRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateInterceptDeploymentGroupRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.networksecurity.v1.UpdateInterceptDeploymentGroupRequest"; + }; + + return UpdateInterceptDeploymentGroupRequest; + })(); + + v1.DeleteInterceptDeploymentGroupRequest = (function() { + + /** + * Properties of a DeleteInterceptDeploymentGroupRequest. + * @memberof google.cloud.networksecurity.v1 + * @interface IDeleteInterceptDeploymentGroupRequest + * @property {string|null} [name] DeleteInterceptDeploymentGroupRequest name + * @property {string|null} [requestId] DeleteInterceptDeploymentGroupRequest requestId + */ + + /** + * Constructs a new DeleteInterceptDeploymentGroupRequest. + * @memberof google.cloud.networksecurity.v1 + * @classdesc Represents a DeleteInterceptDeploymentGroupRequest. + * @implements IDeleteInterceptDeploymentGroupRequest + * @constructor + * @param {google.cloud.networksecurity.v1.IDeleteInterceptDeploymentGroupRequest=} [properties] Properties to set + */ + function DeleteInterceptDeploymentGroupRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteInterceptDeploymentGroupRequest name. + * @member {string} name + * @memberof google.cloud.networksecurity.v1.DeleteInterceptDeploymentGroupRequest + * @instance + */ + DeleteInterceptDeploymentGroupRequest.prototype.name = ""; + + /** + * DeleteInterceptDeploymentGroupRequest requestId. + * @member {string} requestId + * @memberof google.cloud.networksecurity.v1.DeleteInterceptDeploymentGroupRequest + * @instance + */ + DeleteInterceptDeploymentGroupRequest.prototype.requestId = ""; + + /** + * Creates a new DeleteInterceptDeploymentGroupRequest instance using the specified properties. + * @function create + * @memberof google.cloud.networksecurity.v1.DeleteInterceptDeploymentGroupRequest + * @static + * @param {google.cloud.networksecurity.v1.IDeleteInterceptDeploymentGroupRequest=} [properties] Properties to set + * @returns {google.cloud.networksecurity.v1.DeleteInterceptDeploymentGroupRequest} DeleteInterceptDeploymentGroupRequest instance + */ + DeleteInterceptDeploymentGroupRequest.create = function create(properties) { + return new DeleteInterceptDeploymentGroupRequest(properties); + }; + + /** + * Encodes the specified DeleteInterceptDeploymentGroupRequest message. Does not implicitly {@link google.cloud.networksecurity.v1.DeleteInterceptDeploymentGroupRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.networksecurity.v1.DeleteInterceptDeploymentGroupRequest + * @static + * @param {google.cloud.networksecurity.v1.IDeleteInterceptDeploymentGroupRequest} message DeleteInterceptDeploymentGroupRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteInterceptDeploymentGroupRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.requestId); + return writer; + }; + + /** + * Encodes the specified DeleteInterceptDeploymentGroupRequest message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.DeleteInterceptDeploymentGroupRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.networksecurity.v1.DeleteInterceptDeploymentGroupRequest + * @static + * @param {google.cloud.networksecurity.v1.IDeleteInterceptDeploymentGroupRequest} message DeleteInterceptDeploymentGroupRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteInterceptDeploymentGroupRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteInterceptDeploymentGroupRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.networksecurity.v1.DeleteInterceptDeploymentGroupRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.networksecurity.v1.DeleteInterceptDeploymentGroupRequest} DeleteInterceptDeploymentGroupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteInterceptDeploymentGroupRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networksecurity.v1.DeleteInterceptDeploymentGroupRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.requestId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteInterceptDeploymentGroupRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.networksecurity.v1.DeleteInterceptDeploymentGroupRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.networksecurity.v1.DeleteInterceptDeploymentGroupRequest} DeleteInterceptDeploymentGroupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteInterceptDeploymentGroupRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteInterceptDeploymentGroupRequest message. + * @function verify + * @memberof google.cloud.networksecurity.v1.DeleteInterceptDeploymentGroupRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteInterceptDeploymentGroupRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + return null; + }; + + /** + * Creates a DeleteInterceptDeploymentGroupRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.networksecurity.v1.DeleteInterceptDeploymentGroupRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.networksecurity.v1.DeleteInterceptDeploymentGroupRequest} DeleteInterceptDeploymentGroupRequest + */ + DeleteInterceptDeploymentGroupRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networksecurity.v1.DeleteInterceptDeploymentGroupRequest) + return object; + var message = new $root.google.cloud.networksecurity.v1.DeleteInterceptDeploymentGroupRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from a DeleteInterceptDeploymentGroupRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.networksecurity.v1.DeleteInterceptDeploymentGroupRequest + * @static + * @param {google.cloud.networksecurity.v1.DeleteInterceptDeploymentGroupRequest} message DeleteInterceptDeploymentGroupRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteInterceptDeploymentGroupRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.requestId = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + return object; + }; + + /** + * Converts this DeleteInterceptDeploymentGroupRequest to JSON. + * @function toJSON + * @memberof google.cloud.networksecurity.v1.DeleteInterceptDeploymentGroupRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteInterceptDeploymentGroupRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteInterceptDeploymentGroupRequest + * @function getTypeUrl + * @memberof google.cloud.networksecurity.v1.DeleteInterceptDeploymentGroupRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteInterceptDeploymentGroupRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.networksecurity.v1.DeleteInterceptDeploymentGroupRequest"; + }; + + return DeleteInterceptDeploymentGroupRequest; + })(); + + v1.InterceptDeployment = (function() { + + /** + * Properties of an InterceptDeployment. + * @memberof google.cloud.networksecurity.v1 + * @interface IInterceptDeployment + * @property {string|null} [name] InterceptDeployment name + * @property {google.protobuf.ITimestamp|null} [createTime] InterceptDeployment createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] InterceptDeployment updateTime + * @property {Object.|null} [labels] InterceptDeployment labels + * @property {string|null} [forwardingRule] InterceptDeployment forwardingRule + * @property {string|null} [interceptDeploymentGroup] InterceptDeployment interceptDeploymentGroup + * @property {google.cloud.networksecurity.v1.InterceptDeployment.State|null} [state] InterceptDeployment state + * @property {boolean|null} [reconciling] InterceptDeployment reconciling + * @property {string|null} [description] InterceptDeployment description + */ + + /** + * Constructs a new InterceptDeployment. + * @memberof google.cloud.networksecurity.v1 + * @classdesc Represents an InterceptDeployment. + * @implements IInterceptDeployment + * @constructor + * @param {google.cloud.networksecurity.v1.IInterceptDeployment=} [properties] Properties to set + */ + function InterceptDeployment(properties) { + this.labels = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * InterceptDeployment name. + * @member {string} name + * @memberof google.cloud.networksecurity.v1.InterceptDeployment + * @instance + */ + InterceptDeployment.prototype.name = ""; + + /** + * InterceptDeployment createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.networksecurity.v1.InterceptDeployment + * @instance + */ + InterceptDeployment.prototype.createTime = null; + + /** + * InterceptDeployment updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.networksecurity.v1.InterceptDeployment + * @instance + */ + InterceptDeployment.prototype.updateTime = null; + + /** + * InterceptDeployment labels. + * @member {Object.} labels + * @memberof google.cloud.networksecurity.v1.InterceptDeployment + * @instance + */ + InterceptDeployment.prototype.labels = $util.emptyObject; + + /** + * InterceptDeployment forwardingRule. + * @member {string} forwardingRule + * @memberof google.cloud.networksecurity.v1.InterceptDeployment + * @instance + */ + InterceptDeployment.prototype.forwardingRule = ""; + + /** + * InterceptDeployment interceptDeploymentGroup. + * @member {string} interceptDeploymentGroup + * @memberof google.cloud.networksecurity.v1.InterceptDeployment + * @instance + */ + InterceptDeployment.prototype.interceptDeploymentGroup = ""; + + /** + * InterceptDeployment state. + * @member {google.cloud.networksecurity.v1.InterceptDeployment.State} state + * @memberof google.cloud.networksecurity.v1.InterceptDeployment + * @instance + */ + InterceptDeployment.prototype.state = 0; + + /** + * InterceptDeployment reconciling. + * @member {boolean} reconciling + * @memberof google.cloud.networksecurity.v1.InterceptDeployment + * @instance + */ + InterceptDeployment.prototype.reconciling = false; + + /** + * InterceptDeployment description. + * @member {string} description + * @memberof google.cloud.networksecurity.v1.InterceptDeployment + * @instance + */ + InterceptDeployment.prototype.description = ""; + + /** + * Creates a new InterceptDeployment instance using the specified properties. + * @function create + * @memberof google.cloud.networksecurity.v1.InterceptDeployment + * @static + * @param {google.cloud.networksecurity.v1.IInterceptDeployment=} [properties] Properties to set + * @returns {google.cloud.networksecurity.v1.InterceptDeployment} InterceptDeployment instance + */ + InterceptDeployment.create = function create(properties) { + return new InterceptDeployment(properties); + }; + + /** + * Encodes the specified InterceptDeployment message. Does not implicitly {@link google.cloud.networksecurity.v1.InterceptDeployment.verify|verify} messages. + * @function encode + * @memberof google.cloud.networksecurity.v1.InterceptDeployment + * @static + * @param {google.cloud.networksecurity.v1.IInterceptDeployment} message InterceptDeployment message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InterceptDeployment.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) + for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) + writer.uint32(/* id 4, wireType 2 =*/34).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); + if (message.forwardingRule != null && Object.hasOwnProperty.call(message, "forwardingRule")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.forwardingRule); + if (message.interceptDeploymentGroup != null && Object.hasOwnProperty.call(message, "interceptDeploymentGroup")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.interceptDeploymentGroup); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 7, wireType 0 =*/56).int32(message.state); + if (message.reconciling != null && Object.hasOwnProperty.call(message, "reconciling")) + writer.uint32(/* id 8, wireType 0 =*/64).bool(message.reconciling); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 9, wireType 2 =*/74).string(message.description); + return writer; + }; + + /** + * Encodes the specified InterceptDeployment message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.InterceptDeployment.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.networksecurity.v1.InterceptDeployment + * @static + * @param {google.cloud.networksecurity.v1.IInterceptDeployment} message InterceptDeployment message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InterceptDeployment.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an InterceptDeployment message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.networksecurity.v1.InterceptDeployment + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.networksecurity.v1.InterceptDeployment} InterceptDeployment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InterceptDeployment.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networksecurity.v1.InterceptDeployment(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 3: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 4: { + if (message.labels === $util.emptyObject) + message.labels = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.labels[key] = value; + break; + } + case 5: { + message.forwardingRule = reader.string(); + break; + } + case 6: { + message.interceptDeploymentGroup = reader.string(); + break; + } + case 7: { + message.state = reader.int32(); + break; + } + case 8: { + message.reconciling = reader.bool(); + break; + } + case 9: { + message.description = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an InterceptDeployment message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.networksecurity.v1.InterceptDeployment + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.networksecurity.v1.InterceptDeployment} InterceptDeployment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InterceptDeployment.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an InterceptDeployment message. + * @function verify + * @memberof google.cloud.networksecurity.v1.InterceptDeployment + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + InterceptDeployment.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime); + if (error) + return "updateTime." + error; + } + if (message.labels != null && message.hasOwnProperty("labels")) { + if (!$util.isObject(message.labels)) + return "labels: object expected"; + var key = Object.keys(message.labels); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.labels[key[i]])) + return "labels: string{k:string} expected"; + } + if (message.forwardingRule != null && message.hasOwnProperty("forwardingRule")) + if (!$util.isString(message.forwardingRule)) + return "forwardingRule: string expected"; + if (message.interceptDeploymentGroup != null && message.hasOwnProperty("interceptDeploymentGroup")) + if (!$util.isString(message.interceptDeploymentGroup)) + return "interceptDeploymentGroup: string expected"; + if (message.state != null && message.hasOwnProperty("state")) + switch (message.state) { + default: + return "state: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + break; + } + if (message.reconciling != null && message.hasOwnProperty("reconciling")) + if (typeof message.reconciling !== "boolean") + return "reconciling: boolean expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + return null; + }; + + /** + * Creates an InterceptDeployment message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.networksecurity.v1.InterceptDeployment + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.networksecurity.v1.InterceptDeployment} InterceptDeployment + */ + InterceptDeployment.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networksecurity.v1.InterceptDeployment) + return object; + var message = new $root.google.cloud.networksecurity.v1.InterceptDeployment(); + if (object.name != null) + message.name = String(object.name); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.networksecurity.v1.InterceptDeployment.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.updateTime != null) { + if (typeof object.updateTime !== "object") + throw TypeError(".google.cloud.networksecurity.v1.InterceptDeployment.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.cloud.networksecurity.v1.InterceptDeployment.labels: object expected"); + message.labels = {}; + for (var keys = Object.keys(object.labels), i = 0; i < keys.length; ++i) + message.labels[keys[i]] = String(object.labels[keys[i]]); + } + if (object.forwardingRule != null) + message.forwardingRule = String(object.forwardingRule); + if (object.interceptDeploymentGroup != null) + message.interceptDeploymentGroup = String(object.interceptDeploymentGroup); + switch (object.state) { + default: + if (typeof object.state === "number") { + message.state = object.state; + break; + } + break; + case "STATE_UNSPECIFIED": + case 0: + message.state = 0; + break; + case "ACTIVE": + case 1: + message.state = 1; + break; + case "CREATING": + case 2: + message.state = 2; + break; + case "DELETING": + case 3: + message.state = 3; + break; + case "OUT_OF_SYNC": + case 4: + message.state = 4; + break; + case "DELETE_FAILED": + case 5: + message.state = 5; + break; + } + if (object.reconciling != null) + message.reconciling = Boolean(object.reconciling); + if (object.description != null) + message.description = String(object.description); + return message; + }; + + /** + * Creates a plain object from an InterceptDeployment message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.networksecurity.v1.InterceptDeployment + * @static + * @param {google.cloud.networksecurity.v1.InterceptDeployment} message InterceptDeployment + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + InterceptDeployment.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.labels = {}; + if (options.defaults) { + object.name = ""; + object.createTime = null; + object.updateTime = null; + object.forwardingRule = ""; + object.interceptDeploymentGroup = ""; + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + object.reconciling = false; + object.description = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.updateTime != null && message.hasOwnProperty("updateTime")) + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); + var keys2; + if (message.labels && (keys2 = Object.keys(message.labels)).length) { + object.labels = {}; + for (var j = 0; j < keys2.length; ++j) + object.labels[keys2[j]] = message.labels[keys2[j]]; + } + if (message.forwardingRule != null && message.hasOwnProperty("forwardingRule")) + object.forwardingRule = message.forwardingRule; + if (message.interceptDeploymentGroup != null && message.hasOwnProperty("interceptDeploymentGroup")) + object.interceptDeploymentGroup = message.interceptDeploymentGroup; + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.networksecurity.v1.InterceptDeployment.State[message.state] === undefined ? message.state : $root.google.cloud.networksecurity.v1.InterceptDeployment.State[message.state] : message.state; + if (message.reconciling != null && message.hasOwnProperty("reconciling")) + object.reconciling = message.reconciling; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + return object; + }; + + /** + * Converts this InterceptDeployment to JSON. + * @function toJSON + * @memberof google.cloud.networksecurity.v1.InterceptDeployment + * @instance + * @returns {Object.} JSON object + */ + InterceptDeployment.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for InterceptDeployment + * @function getTypeUrl + * @memberof google.cloud.networksecurity.v1.InterceptDeployment + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + InterceptDeployment.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.networksecurity.v1.InterceptDeployment"; + }; + + /** + * State enum. + * @name google.cloud.networksecurity.v1.InterceptDeployment.State + * @enum {number} + * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value + * @property {number} ACTIVE=1 ACTIVE value + * @property {number} CREATING=2 CREATING value + * @property {number} DELETING=3 DELETING value + * @property {number} OUT_OF_SYNC=4 OUT_OF_SYNC value + * @property {number} DELETE_FAILED=5 DELETE_FAILED value + */ + InterceptDeployment.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "ACTIVE"] = 1; + values[valuesById[2] = "CREATING"] = 2; + values[valuesById[3] = "DELETING"] = 3; + values[valuesById[4] = "OUT_OF_SYNC"] = 4; + values[valuesById[5] = "DELETE_FAILED"] = 5; + return values; + })(); + + return InterceptDeployment; + })(); + + v1.ListInterceptDeploymentsRequest = (function() { + + /** + * Properties of a ListInterceptDeploymentsRequest. + * @memberof google.cloud.networksecurity.v1 + * @interface IListInterceptDeploymentsRequest + * @property {string|null} [parent] ListInterceptDeploymentsRequest parent + * @property {number|null} [pageSize] ListInterceptDeploymentsRequest pageSize + * @property {string|null} [pageToken] ListInterceptDeploymentsRequest pageToken + * @property {string|null} [filter] ListInterceptDeploymentsRequest filter + * @property {string|null} [orderBy] ListInterceptDeploymentsRequest orderBy + */ + + /** + * Constructs a new ListInterceptDeploymentsRequest. + * @memberof google.cloud.networksecurity.v1 + * @classdesc Represents a ListInterceptDeploymentsRequest. + * @implements IListInterceptDeploymentsRequest + * @constructor + * @param {google.cloud.networksecurity.v1.IListInterceptDeploymentsRequest=} [properties] Properties to set + */ + function ListInterceptDeploymentsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListInterceptDeploymentsRequest parent. + * @member {string} parent + * @memberof google.cloud.networksecurity.v1.ListInterceptDeploymentsRequest + * @instance + */ + ListInterceptDeploymentsRequest.prototype.parent = ""; + + /** + * ListInterceptDeploymentsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.networksecurity.v1.ListInterceptDeploymentsRequest + * @instance + */ + ListInterceptDeploymentsRequest.prototype.pageSize = 0; + + /** + * ListInterceptDeploymentsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.networksecurity.v1.ListInterceptDeploymentsRequest + * @instance + */ + ListInterceptDeploymentsRequest.prototype.pageToken = ""; + + /** + * ListInterceptDeploymentsRequest filter. + * @member {string} filter + * @memberof google.cloud.networksecurity.v1.ListInterceptDeploymentsRequest + * @instance + */ + ListInterceptDeploymentsRequest.prototype.filter = ""; + + /** + * ListInterceptDeploymentsRequest orderBy. + * @member {string} orderBy + * @memberof google.cloud.networksecurity.v1.ListInterceptDeploymentsRequest + * @instance + */ + ListInterceptDeploymentsRequest.prototype.orderBy = ""; + + /** + * Creates a new ListInterceptDeploymentsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.networksecurity.v1.ListInterceptDeploymentsRequest + * @static + * @param {google.cloud.networksecurity.v1.IListInterceptDeploymentsRequest=} [properties] Properties to set + * @returns {google.cloud.networksecurity.v1.ListInterceptDeploymentsRequest} ListInterceptDeploymentsRequest instance + */ + ListInterceptDeploymentsRequest.create = function create(properties) { + return new ListInterceptDeploymentsRequest(properties); + }; + + /** + * Encodes the specified ListInterceptDeploymentsRequest message. Does not implicitly {@link google.cloud.networksecurity.v1.ListInterceptDeploymentsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.networksecurity.v1.ListInterceptDeploymentsRequest + * @static + * @param {google.cloud.networksecurity.v1.IListInterceptDeploymentsRequest} message ListInterceptDeploymentsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListInterceptDeploymentsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.filter); + if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.orderBy); + return writer; + }; + + /** + * Encodes the specified ListInterceptDeploymentsRequest message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.ListInterceptDeploymentsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.networksecurity.v1.ListInterceptDeploymentsRequest + * @static + * @param {google.cloud.networksecurity.v1.IListInterceptDeploymentsRequest} message ListInterceptDeploymentsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListInterceptDeploymentsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListInterceptDeploymentsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.networksecurity.v1.ListInterceptDeploymentsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.networksecurity.v1.ListInterceptDeploymentsRequest} ListInterceptDeploymentsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListInterceptDeploymentsRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networksecurity.v1.ListInterceptDeploymentsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + case 4: { + message.filter = reader.string(); + break; + } + case 5: { + message.orderBy = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListInterceptDeploymentsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.networksecurity.v1.ListInterceptDeploymentsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.networksecurity.v1.ListInterceptDeploymentsRequest} ListInterceptDeploymentsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListInterceptDeploymentsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListInterceptDeploymentsRequest message. + * @function verify + * @memberof google.cloud.networksecurity.v1.ListInterceptDeploymentsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListInterceptDeploymentsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + if (!$util.isString(message.orderBy)) + return "orderBy: string expected"; + return null; + }; + + /** + * Creates a ListInterceptDeploymentsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.networksecurity.v1.ListInterceptDeploymentsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.networksecurity.v1.ListInterceptDeploymentsRequest} ListInterceptDeploymentsRequest + */ + ListInterceptDeploymentsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networksecurity.v1.ListInterceptDeploymentsRequest) + return object; + var message = new $root.google.cloud.networksecurity.v1.ListInterceptDeploymentsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.filter != null) + message.filter = String(object.filter); + if (object.orderBy != null) + message.orderBy = String(object.orderBy); + return message; + }; + + /** + * Creates a plain object from a ListInterceptDeploymentsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.networksecurity.v1.ListInterceptDeploymentsRequest + * @static + * @param {google.cloud.networksecurity.v1.ListInterceptDeploymentsRequest} message ListInterceptDeploymentsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListInterceptDeploymentsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + object.filter = ""; + object.orderBy = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + object.orderBy = message.orderBy; + return object; + }; + + /** + * Converts this ListInterceptDeploymentsRequest to JSON. + * @function toJSON + * @memberof google.cloud.networksecurity.v1.ListInterceptDeploymentsRequest + * @instance + * @returns {Object.} JSON object + */ + ListInterceptDeploymentsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListInterceptDeploymentsRequest + * @function getTypeUrl + * @memberof google.cloud.networksecurity.v1.ListInterceptDeploymentsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListInterceptDeploymentsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.networksecurity.v1.ListInterceptDeploymentsRequest"; + }; + + return ListInterceptDeploymentsRequest; + })(); + + v1.ListInterceptDeploymentsResponse = (function() { + + /** + * Properties of a ListInterceptDeploymentsResponse. + * @memberof google.cloud.networksecurity.v1 + * @interface IListInterceptDeploymentsResponse + * @property {Array.|null} [interceptDeployments] ListInterceptDeploymentsResponse interceptDeployments + * @property {string|null} [nextPageToken] ListInterceptDeploymentsResponse nextPageToken + * @property {Array.|null} [unreachable] ListInterceptDeploymentsResponse unreachable + */ + + /** + * Constructs a new ListInterceptDeploymentsResponse. + * @memberof google.cloud.networksecurity.v1 + * @classdesc Represents a ListInterceptDeploymentsResponse. + * @implements IListInterceptDeploymentsResponse + * @constructor + * @param {google.cloud.networksecurity.v1.IListInterceptDeploymentsResponse=} [properties] Properties to set + */ + function ListInterceptDeploymentsResponse(properties) { + this.interceptDeployments = []; + this.unreachable = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListInterceptDeploymentsResponse interceptDeployments. + * @member {Array.} interceptDeployments + * @memberof google.cloud.networksecurity.v1.ListInterceptDeploymentsResponse + * @instance + */ + ListInterceptDeploymentsResponse.prototype.interceptDeployments = $util.emptyArray; + + /** + * ListInterceptDeploymentsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.networksecurity.v1.ListInterceptDeploymentsResponse + * @instance + */ + ListInterceptDeploymentsResponse.prototype.nextPageToken = ""; + + /** + * ListInterceptDeploymentsResponse unreachable. + * @member {Array.} unreachable + * @memberof google.cloud.networksecurity.v1.ListInterceptDeploymentsResponse + * @instance + */ + ListInterceptDeploymentsResponse.prototype.unreachable = $util.emptyArray; + + /** + * Creates a new ListInterceptDeploymentsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.networksecurity.v1.ListInterceptDeploymentsResponse + * @static + * @param {google.cloud.networksecurity.v1.IListInterceptDeploymentsResponse=} [properties] Properties to set + * @returns {google.cloud.networksecurity.v1.ListInterceptDeploymentsResponse} ListInterceptDeploymentsResponse instance + */ + ListInterceptDeploymentsResponse.create = function create(properties) { + return new ListInterceptDeploymentsResponse(properties); + }; + + /** + * Encodes the specified ListInterceptDeploymentsResponse message. Does not implicitly {@link google.cloud.networksecurity.v1.ListInterceptDeploymentsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.networksecurity.v1.ListInterceptDeploymentsResponse + * @static + * @param {google.cloud.networksecurity.v1.IListInterceptDeploymentsResponse} message ListInterceptDeploymentsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListInterceptDeploymentsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.interceptDeployments != null && message.interceptDeployments.length) + for (var i = 0; i < message.interceptDeployments.length; ++i) + $root.google.cloud.networksecurity.v1.InterceptDeployment.encode(message.interceptDeployments[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + if (message.unreachable != null && message.unreachable.length) + for (var i = 0; i < message.unreachable.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.unreachable[i]); + return writer; + }; + + /** + * Encodes the specified ListInterceptDeploymentsResponse message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.ListInterceptDeploymentsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.networksecurity.v1.ListInterceptDeploymentsResponse + * @static + * @param {google.cloud.networksecurity.v1.IListInterceptDeploymentsResponse} message ListInterceptDeploymentsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListInterceptDeploymentsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListInterceptDeploymentsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.networksecurity.v1.ListInterceptDeploymentsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.networksecurity.v1.ListInterceptDeploymentsResponse} ListInterceptDeploymentsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListInterceptDeploymentsResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networksecurity.v1.ListInterceptDeploymentsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.interceptDeployments && message.interceptDeployments.length)) + message.interceptDeployments = []; + message.interceptDeployments.push($root.google.cloud.networksecurity.v1.InterceptDeployment.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + case 3: { + if (!(message.unreachable && message.unreachable.length)) + message.unreachable = []; + message.unreachable.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListInterceptDeploymentsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.networksecurity.v1.ListInterceptDeploymentsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.networksecurity.v1.ListInterceptDeploymentsResponse} ListInterceptDeploymentsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListInterceptDeploymentsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListInterceptDeploymentsResponse message. + * @function verify + * @memberof google.cloud.networksecurity.v1.ListInterceptDeploymentsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListInterceptDeploymentsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.interceptDeployments != null && message.hasOwnProperty("interceptDeployments")) { + if (!Array.isArray(message.interceptDeployments)) + return "interceptDeployments: array expected"; + for (var i = 0; i < message.interceptDeployments.length; ++i) { + var error = $root.google.cloud.networksecurity.v1.InterceptDeployment.verify(message.interceptDeployments[i]); + if (error) + return "interceptDeployments." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + if (message.unreachable != null && message.hasOwnProperty("unreachable")) { + if (!Array.isArray(message.unreachable)) + return "unreachable: array expected"; + for (var i = 0; i < message.unreachable.length; ++i) + if (!$util.isString(message.unreachable[i])) + return "unreachable: string[] expected"; + } + return null; + }; + + /** + * Creates a ListInterceptDeploymentsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.networksecurity.v1.ListInterceptDeploymentsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.networksecurity.v1.ListInterceptDeploymentsResponse} ListInterceptDeploymentsResponse + */ + ListInterceptDeploymentsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networksecurity.v1.ListInterceptDeploymentsResponse) + return object; + var message = new $root.google.cloud.networksecurity.v1.ListInterceptDeploymentsResponse(); + if (object.interceptDeployments) { + if (!Array.isArray(object.interceptDeployments)) + throw TypeError(".google.cloud.networksecurity.v1.ListInterceptDeploymentsResponse.interceptDeployments: array expected"); + message.interceptDeployments = []; + for (var i = 0; i < object.interceptDeployments.length; ++i) { + if (typeof object.interceptDeployments[i] !== "object") + throw TypeError(".google.cloud.networksecurity.v1.ListInterceptDeploymentsResponse.interceptDeployments: object expected"); + message.interceptDeployments[i] = $root.google.cloud.networksecurity.v1.InterceptDeployment.fromObject(object.interceptDeployments[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.unreachable) { + if (!Array.isArray(object.unreachable)) + throw TypeError(".google.cloud.networksecurity.v1.ListInterceptDeploymentsResponse.unreachable: array expected"); + message.unreachable = []; + for (var i = 0; i < object.unreachable.length; ++i) + message.unreachable[i] = String(object.unreachable[i]); + } + return message; + }; + + /** + * Creates a plain object from a ListInterceptDeploymentsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.networksecurity.v1.ListInterceptDeploymentsResponse + * @static + * @param {google.cloud.networksecurity.v1.ListInterceptDeploymentsResponse} message ListInterceptDeploymentsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListInterceptDeploymentsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.interceptDeployments = []; + object.unreachable = []; + } + if (options.defaults) + object.nextPageToken = ""; + if (message.interceptDeployments && message.interceptDeployments.length) { + object.interceptDeployments = []; + for (var j = 0; j < message.interceptDeployments.length; ++j) + object.interceptDeployments[j] = $root.google.cloud.networksecurity.v1.InterceptDeployment.toObject(message.interceptDeployments[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + if (message.unreachable && message.unreachable.length) { + object.unreachable = []; + for (var j = 0; j < message.unreachable.length; ++j) + object.unreachable[j] = message.unreachable[j]; + } + return object; + }; + + /** + * Converts this ListInterceptDeploymentsResponse to JSON. + * @function toJSON + * @memberof google.cloud.networksecurity.v1.ListInterceptDeploymentsResponse + * @instance + * @returns {Object.} JSON object + */ + ListInterceptDeploymentsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListInterceptDeploymentsResponse + * @function getTypeUrl + * @memberof google.cloud.networksecurity.v1.ListInterceptDeploymentsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListInterceptDeploymentsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.networksecurity.v1.ListInterceptDeploymentsResponse"; + }; + + return ListInterceptDeploymentsResponse; + })(); + + v1.GetInterceptDeploymentRequest = (function() { + + /** + * Properties of a GetInterceptDeploymentRequest. + * @memberof google.cloud.networksecurity.v1 + * @interface IGetInterceptDeploymentRequest + * @property {string|null} [name] GetInterceptDeploymentRequest name + */ + + /** + * Constructs a new GetInterceptDeploymentRequest. + * @memberof google.cloud.networksecurity.v1 + * @classdesc Represents a GetInterceptDeploymentRequest. + * @implements IGetInterceptDeploymentRequest + * @constructor + * @param {google.cloud.networksecurity.v1.IGetInterceptDeploymentRequest=} [properties] Properties to set + */ + function GetInterceptDeploymentRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetInterceptDeploymentRequest name. + * @member {string} name + * @memberof google.cloud.networksecurity.v1.GetInterceptDeploymentRequest + * @instance + */ + GetInterceptDeploymentRequest.prototype.name = ""; + + /** + * Creates a new GetInterceptDeploymentRequest instance using the specified properties. + * @function create + * @memberof google.cloud.networksecurity.v1.GetInterceptDeploymentRequest + * @static + * @param {google.cloud.networksecurity.v1.IGetInterceptDeploymentRequest=} [properties] Properties to set + * @returns {google.cloud.networksecurity.v1.GetInterceptDeploymentRequest} GetInterceptDeploymentRequest instance + */ + GetInterceptDeploymentRequest.create = function create(properties) { + return new GetInterceptDeploymentRequest(properties); + }; + + /** + * Encodes the specified GetInterceptDeploymentRequest message. Does not implicitly {@link google.cloud.networksecurity.v1.GetInterceptDeploymentRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.networksecurity.v1.GetInterceptDeploymentRequest + * @static + * @param {google.cloud.networksecurity.v1.IGetInterceptDeploymentRequest} message GetInterceptDeploymentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetInterceptDeploymentRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified GetInterceptDeploymentRequest message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.GetInterceptDeploymentRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.networksecurity.v1.GetInterceptDeploymentRequest + * @static + * @param {google.cloud.networksecurity.v1.IGetInterceptDeploymentRequest} message GetInterceptDeploymentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetInterceptDeploymentRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetInterceptDeploymentRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.networksecurity.v1.GetInterceptDeploymentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.networksecurity.v1.GetInterceptDeploymentRequest} GetInterceptDeploymentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetInterceptDeploymentRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networksecurity.v1.GetInterceptDeploymentRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetInterceptDeploymentRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.networksecurity.v1.GetInterceptDeploymentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.networksecurity.v1.GetInterceptDeploymentRequest} GetInterceptDeploymentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetInterceptDeploymentRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetInterceptDeploymentRequest message. + * @function verify + * @memberof google.cloud.networksecurity.v1.GetInterceptDeploymentRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetInterceptDeploymentRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a GetInterceptDeploymentRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.networksecurity.v1.GetInterceptDeploymentRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.networksecurity.v1.GetInterceptDeploymentRequest} GetInterceptDeploymentRequest + */ + GetInterceptDeploymentRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networksecurity.v1.GetInterceptDeploymentRequest) + return object; + var message = new $root.google.cloud.networksecurity.v1.GetInterceptDeploymentRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetInterceptDeploymentRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.networksecurity.v1.GetInterceptDeploymentRequest + * @static + * @param {google.cloud.networksecurity.v1.GetInterceptDeploymentRequest} message GetInterceptDeploymentRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetInterceptDeploymentRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this GetInterceptDeploymentRequest to JSON. + * @function toJSON + * @memberof google.cloud.networksecurity.v1.GetInterceptDeploymentRequest + * @instance + * @returns {Object.} JSON object + */ + GetInterceptDeploymentRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetInterceptDeploymentRequest + * @function getTypeUrl + * @memberof google.cloud.networksecurity.v1.GetInterceptDeploymentRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetInterceptDeploymentRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.networksecurity.v1.GetInterceptDeploymentRequest"; + }; + + return GetInterceptDeploymentRequest; + })(); + + v1.CreateInterceptDeploymentRequest = (function() { + + /** + * Properties of a CreateInterceptDeploymentRequest. + * @memberof google.cloud.networksecurity.v1 + * @interface ICreateInterceptDeploymentRequest + * @property {string|null} [parent] CreateInterceptDeploymentRequest parent + * @property {string|null} [interceptDeploymentId] CreateInterceptDeploymentRequest interceptDeploymentId + * @property {google.cloud.networksecurity.v1.IInterceptDeployment|null} [interceptDeployment] CreateInterceptDeploymentRequest interceptDeployment + * @property {string|null} [requestId] CreateInterceptDeploymentRequest requestId + */ + + /** + * Constructs a new CreateInterceptDeploymentRequest. + * @memberof google.cloud.networksecurity.v1 + * @classdesc Represents a CreateInterceptDeploymentRequest. + * @implements ICreateInterceptDeploymentRequest + * @constructor + * @param {google.cloud.networksecurity.v1.ICreateInterceptDeploymentRequest=} [properties] Properties to set + */ + function CreateInterceptDeploymentRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateInterceptDeploymentRequest parent. + * @member {string} parent + * @memberof google.cloud.networksecurity.v1.CreateInterceptDeploymentRequest + * @instance + */ + CreateInterceptDeploymentRequest.prototype.parent = ""; + + /** + * CreateInterceptDeploymentRequest interceptDeploymentId. + * @member {string} interceptDeploymentId + * @memberof google.cloud.networksecurity.v1.CreateInterceptDeploymentRequest + * @instance + */ + CreateInterceptDeploymentRequest.prototype.interceptDeploymentId = ""; + + /** + * CreateInterceptDeploymentRequest interceptDeployment. + * @member {google.cloud.networksecurity.v1.IInterceptDeployment|null|undefined} interceptDeployment + * @memberof google.cloud.networksecurity.v1.CreateInterceptDeploymentRequest + * @instance + */ + CreateInterceptDeploymentRequest.prototype.interceptDeployment = null; + + /** + * CreateInterceptDeploymentRequest requestId. + * @member {string} requestId + * @memberof google.cloud.networksecurity.v1.CreateInterceptDeploymentRequest + * @instance + */ + CreateInterceptDeploymentRequest.prototype.requestId = ""; + + /** + * Creates a new CreateInterceptDeploymentRequest instance using the specified properties. + * @function create + * @memberof google.cloud.networksecurity.v1.CreateInterceptDeploymentRequest + * @static + * @param {google.cloud.networksecurity.v1.ICreateInterceptDeploymentRequest=} [properties] Properties to set + * @returns {google.cloud.networksecurity.v1.CreateInterceptDeploymentRequest} CreateInterceptDeploymentRequest instance + */ + CreateInterceptDeploymentRequest.create = function create(properties) { + return new CreateInterceptDeploymentRequest(properties); + }; + + /** + * Encodes the specified CreateInterceptDeploymentRequest message. Does not implicitly {@link google.cloud.networksecurity.v1.CreateInterceptDeploymentRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.networksecurity.v1.CreateInterceptDeploymentRequest + * @static + * @param {google.cloud.networksecurity.v1.ICreateInterceptDeploymentRequest} message CreateInterceptDeploymentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateInterceptDeploymentRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.interceptDeploymentId != null && Object.hasOwnProperty.call(message, "interceptDeploymentId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.interceptDeploymentId); + if (message.interceptDeployment != null && Object.hasOwnProperty.call(message, "interceptDeployment")) + $root.google.cloud.networksecurity.v1.InterceptDeployment.encode(message.interceptDeployment, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.requestId); + return writer; + }; + + /** + * Encodes the specified CreateInterceptDeploymentRequest message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.CreateInterceptDeploymentRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.networksecurity.v1.CreateInterceptDeploymentRequest + * @static + * @param {google.cloud.networksecurity.v1.ICreateInterceptDeploymentRequest} message CreateInterceptDeploymentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateInterceptDeploymentRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateInterceptDeploymentRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.networksecurity.v1.CreateInterceptDeploymentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.networksecurity.v1.CreateInterceptDeploymentRequest} CreateInterceptDeploymentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateInterceptDeploymentRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networksecurity.v1.CreateInterceptDeploymentRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.interceptDeploymentId = reader.string(); + break; + } + case 3: { + message.interceptDeployment = $root.google.cloud.networksecurity.v1.InterceptDeployment.decode(reader, reader.uint32()); + break; + } + case 4: { + message.requestId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateInterceptDeploymentRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.networksecurity.v1.CreateInterceptDeploymentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.networksecurity.v1.CreateInterceptDeploymentRequest} CreateInterceptDeploymentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateInterceptDeploymentRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateInterceptDeploymentRequest message. + * @function verify + * @memberof google.cloud.networksecurity.v1.CreateInterceptDeploymentRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateInterceptDeploymentRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.interceptDeploymentId != null && message.hasOwnProperty("interceptDeploymentId")) + if (!$util.isString(message.interceptDeploymentId)) + return "interceptDeploymentId: string expected"; + if (message.interceptDeployment != null && message.hasOwnProperty("interceptDeployment")) { + var error = $root.google.cloud.networksecurity.v1.InterceptDeployment.verify(message.interceptDeployment); + if (error) + return "interceptDeployment." + error; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + return null; + }; + + /** + * Creates a CreateInterceptDeploymentRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.networksecurity.v1.CreateInterceptDeploymentRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.networksecurity.v1.CreateInterceptDeploymentRequest} CreateInterceptDeploymentRequest + */ + CreateInterceptDeploymentRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networksecurity.v1.CreateInterceptDeploymentRequest) + return object; + var message = new $root.google.cloud.networksecurity.v1.CreateInterceptDeploymentRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.interceptDeploymentId != null) + message.interceptDeploymentId = String(object.interceptDeploymentId); + if (object.interceptDeployment != null) { + if (typeof object.interceptDeployment !== "object") + throw TypeError(".google.cloud.networksecurity.v1.CreateInterceptDeploymentRequest.interceptDeployment: object expected"); + message.interceptDeployment = $root.google.cloud.networksecurity.v1.InterceptDeployment.fromObject(object.interceptDeployment); + } + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from a CreateInterceptDeploymentRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.networksecurity.v1.CreateInterceptDeploymentRequest + * @static + * @param {google.cloud.networksecurity.v1.CreateInterceptDeploymentRequest} message CreateInterceptDeploymentRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateInterceptDeploymentRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.interceptDeploymentId = ""; + object.interceptDeployment = null; + object.requestId = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.interceptDeploymentId != null && message.hasOwnProperty("interceptDeploymentId")) + object.interceptDeploymentId = message.interceptDeploymentId; + if (message.interceptDeployment != null && message.hasOwnProperty("interceptDeployment")) + object.interceptDeployment = $root.google.cloud.networksecurity.v1.InterceptDeployment.toObject(message.interceptDeployment, options); + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + return object; + }; + + /** + * Converts this CreateInterceptDeploymentRequest to JSON. + * @function toJSON + * @memberof google.cloud.networksecurity.v1.CreateInterceptDeploymentRequest + * @instance + * @returns {Object.} JSON object + */ + CreateInterceptDeploymentRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateInterceptDeploymentRequest + * @function getTypeUrl + * @memberof google.cloud.networksecurity.v1.CreateInterceptDeploymentRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateInterceptDeploymentRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.networksecurity.v1.CreateInterceptDeploymentRequest"; + }; + + return CreateInterceptDeploymentRequest; + })(); + + v1.UpdateInterceptDeploymentRequest = (function() { + + /** + * Properties of an UpdateInterceptDeploymentRequest. + * @memberof google.cloud.networksecurity.v1 + * @interface IUpdateInterceptDeploymentRequest + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateInterceptDeploymentRequest updateMask + * @property {google.cloud.networksecurity.v1.IInterceptDeployment|null} [interceptDeployment] UpdateInterceptDeploymentRequest interceptDeployment + * @property {string|null} [requestId] UpdateInterceptDeploymentRequest requestId + */ + + /** + * Constructs a new UpdateInterceptDeploymentRequest. + * @memberof google.cloud.networksecurity.v1 + * @classdesc Represents an UpdateInterceptDeploymentRequest. + * @implements IUpdateInterceptDeploymentRequest + * @constructor + * @param {google.cloud.networksecurity.v1.IUpdateInterceptDeploymentRequest=} [properties] Properties to set + */ + function UpdateInterceptDeploymentRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateInterceptDeploymentRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.networksecurity.v1.UpdateInterceptDeploymentRequest + * @instance + */ + UpdateInterceptDeploymentRequest.prototype.updateMask = null; + + /** + * UpdateInterceptDeploymentRequest interceptDeployment. + * @member {google.cloud.networksecurity.v1.IInterceptDeployment|null|undefined} interceptDeployment + * @memberof google.cloud.networksecurity.v1.UpdateInterceptDeploymentRequest + * @instance + */ + UpdateInterceptDeploymentRequest.prototype.interceptDeployment = null; + + /** + * UpdateInterceptDeploymentRequest requestId. + * @member {string} requestId + * @memberof google.cloud.networksecurity.v1.UpdateInterceptDeploymentRequest + * @instance + */ + UpdateInterceptDeploymentRequest.prototype.requestId = ""; + + /** + * Creates a new UpdateInterceptDeploymentRequest instance using the specified properties. + * @function create + * @memberof google.cloud.networksecurity.v1.UpdateInterceptDeploymentRequest + * @static + * @param {google.cloud.networksecurity.v1.IUpdateInterceptDeploymentRequest=} [properties] Properties to set + * @returns {google.cloud.networksecurity.v1.UpdateInterceptDeploymentRequest} UpdateInterceptDeploymentRequest instance + */ + UpdateInterceptDeploymentRequest.create = function create(properties) { + return new UpdateInterceptDeploymentRequest(properties); + }; + + /** + * Encodes the specified UpdateInterceptDeploymentRequest message. Does not implicitly {@link google.cloud.networksecurity.v1.UpdateInterceptDeploymentRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.networksecurity.v1.UpdateInterceptDeploymentRequest + * @static + * @param {google.cloud.networksecurity.v1.IUpdateInterceptDeploymentRequest} message UpdateInterceptDeploymentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateInterceptDeploymentRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.interceptDeployment != null && Object.hasOwnProperty.call(message, "interceptDeployment")) + $root.google.cloud.networksecurity.v1.InterceptDeployment.encode(message.interceptDeployment, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.requestId); + return writer; + }; + + /** + * Encodes the specified UpdateInterceptDeploymentRequest message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.UpdateInterceptDeploymentRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.networksecurity.v1.UpdateInterceptDeploymentRequest + * @static + * @param {google.cloud.networksecurity.v1.IUpdateInterceptDeploymentRequest} message UpdateInterceptDeploymentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateInterceptDeploymentRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateInterceptDeploymentRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.networksecurity.v1.UpdateInterceptDeploymentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.networksecurity.v1.UpdateInterceptDeploymentRequest} UpdateInterceptDeploymentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateInterceptDeploymentRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networksecurity.v1.UpdateInterceptDeploymentRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + case 2: { + message.interceptDeployment = $root.google.cloud.networksecurity.v1.InterceptDeployment.decode(reader, reader.uint32()); + break; + } + case 3: { + message.requestId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateInterceptDeploymentRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.networksecurity.v1.UpdateInterceptDeploymentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.networksecurity.v1.UpdateInterceptDeploymentRequest} UpdateInterceptDeploymentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateInterceptDeploymentRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateInterceptDeploymentRequest message. + * @function verify + * @memberof google.cloud.networksecurity.v1.UpdateInterceptDeploymentRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateInterceptDeploymentRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + if (message.interceptDeployment != null && message.hasOwnProperty("interceptDeployment")) { + var error = $root.google.cloud.networksecurity.v1.InterceptDeployment.verify(message.interceptDeployment); + if (error) + return "interceptDeployment." + error; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + return null; + }; + + /** + * Creates an UpdateInterceptDeploymentRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.networksecurity.v1.UpdateInterceptDeploymentRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.networksecurity.v1.UpdateInterceptDeploymentRequest} UpdateInterceptDeploymentRequest + */ + UpdateInterceptDeploymentRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networksecurity.v1.UpdateInterceptDeploymentRequest) + return object; + var message = new $root.google.cloud.networksecurity.v1.UpdateInterceptDeploymentRequest(); + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.networksecurity.v1.UpdateInterceptDeploymentRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + if (object.interceptDeployment != null) { + if (typeof object.interceptDeployment !== "object") + throw TypeError(".google.cloud.networksecurity.v1.UpdateInterceptDeploymentRequest.interceptDeployment: object expected"); + message.interceptDeployment = $root.google.cloud.networksecurity.v1.InterceptDeployment.fromObject(object.interceptDeployment); + } + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from an UpdateInterceptDeploymentRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.networksecurity.v1.UpdateInterceptDeploymentRequest + * @static + * @param {google.cloud.networksecurity.v1.UpdateInterceptDeploymentRequest} message UpdateInterceptDeploymentRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateInterceptDeploymentRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.updateMask = null; + object.interceptDeployment = null; + object.requestId = ""; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + if (message.interceptDeployment != null && message.hasOwnProperty("interceptDeployment")) + object.interceptDeployment = $root.google.cloud.networksecurity.v1.InterceptDeployment.toObject(message.interceptDeployment, options); + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + return object; + }; + + /** + * Converts this UpdateInterceptDeploymentRequest to JSON. + * @function toJSON + * @memberof google.cloud.networksecurity.v1.UpdateInterceptDeploymentRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateInterceptDeploymentRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateInterceptDeploymentRequest + * @function getTypeUrl + * @memberof google.cloud.networksecurity.v1.UpdateInterceptDeploymentRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateInterceptDeploymentRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.networksecurity.v1.UpdateInterceptDeploymentRequest"; + }; + + return UpdateInterceptDeploymentRequest; + })(); + + v1.DeleteInterceptDeploymentRequest = (function() { + + /** + * Properties of a DeleteInterceptDeploymentRequest. + * @memberof google.cloud.networksecurity.v1 + * @interface IDeleteInterceptDeploymentRequest + * @property {string|null} [name] DeleteInterceptDeploymentRequest name + * @property {string|null} [requestId] DeleteInterceptDeploymentRequest requestId + */ + + /** + * Constructs a new DeleteInterceptDeploymentRequest. + * @memberof google.cloud.networksecurity.v1 + * @classdesc Represents a DeleteInterceptDeploymentRequest. + * @implements IDeleteInterceptDeploymentRequest + * @constructor + * @param {google.cloud.networksecurity.v1.IDeleteInterceptDeploymentRequest=} [properties] Properties to set + */ + function DeleteInterceptDeploymentRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteInterceptDeploymentRequest name. + * @member {string} name + * @memberof google.cloud.networksecurity.v1.DeleteInterceptDeploymentRequest + * @instance + */ + DeleteInterceptDeploymentRequest.prototype.name = ""; + + /** + * DeleteInterceptDeploymentRequest requestId. + * @member {string} requestId + * @memberof google.cloud.networksecurity.v1.DeleteInterceptDeploymentRequest + * @instance + */ + DeleteInterceptDeploymentRequest.prototype.requestId = ""; + + /** + * Creates a new DeleteInterceptDeploymentRequest instance using the specified properties. + * @function create + * @memberof google.cloud.networksecurity.v1.DeleteInterceptDeploymentRequest + * @static + * @param {google.cloud.networksecurity.v1.IDeleteInterceptDeploymentRequest=} [properties] Properties to set + * @returns {google.cloud.networksecurity.v1.DeleteInterceptDeploymentRequest} DeleteInterceptDeploymentRequest instance + */ + DeleteInterceptDeploymentRequest.create = function create(properties) { + return new DeleteInterceptDeploymentRequest(properties); + }; + + /** + * Encodes the specified DeleteInterceptDeploymentRequest message. Does not implicitly {@link google.cloud.networksecurity.v1.DeleteInterceptDeploymentRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.networksecurity.v1.DeleteInterceptDeploymentRequest + * @static + * @param {google.cloud.networksecurity.v1.IDeleteInterceptDeploymentRequest} message DeleteInterceptDeploymentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteInterceptDeploymentRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.requestId); + return writer; + }; + + /** + * Encodes the specified DeleteInterceptDeploymentRequest message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.DeleteInterceptDeploymentRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.networksecurity.v1.DeleteInterceptDeploymentRequest + * @static + * @param {google.cloud.networksecurity.v1.IDeleteInterceptDeploymentRequest} message DeleteInterceptDeploymentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteInterceptDeploymentRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteInterceptDeploymentRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.networksecurity.v1.DeleteInterceptDeploymentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.networksecurity.v1.DeleteInterceptDeploymentRequest} DeleteInterceptDeploymentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteInterceptDeploymentRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networksecurity.v1.DeleteInterceptDeploymentRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.requestId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteInterceptDeploymentRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.networksecurity.v1.DeleteInterceptDeploymentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.networksecurity.v1.DeleteInterceptDeploymentRequest} DeleteInterceptDeploymentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteInterceptDeploymentRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteInterceptDeploymentRequest message. + * @function verify + * @memberof google.cloud.networksecurity.v1.DeleteInterceptDeploymentRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteInterceptDeploymentRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + return null; + }; + + /** + * Creates a DeleteInterceptDeploymentRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.networksecurity.v1.DeleteInterceptDeploymentRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.networksecurity.v1.DeleteInterceptDeploymentRequest} DeleteInterceptDeploymentRequest + */ + DeleteInterceptDeploymentRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networksecurity.v1.DeleteInterceptDeploymentRequest) + return object; + var message = new $root.google.cloud.networksecurity.v1.DeleteInterceptDeploymentRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from a DeleteInterceptDeploymentRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.networksecurity.v1.DeleteInterceptDeploymentRequest + * @static + * @param {google.cloud.networksecurity.v1.DeleteInterceptDeploymentRequest} message DeleteInterceptDeploymentRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteInterceptDeploymentRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.requestId = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + return object; + }; + + /** + * Converts this DeleteInterceptDeploymentRequest to JSON. + * @function toJSON + * @memberof google.cloud.networksecurity.v1.DeleteInterceptDeploymentRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteInterceptDeploymentRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteInterceptDeploymentRequest + * @function getTypeUrl + * @memberof google.cloud.networksecurity.v1.DeleteInterceptDeploymentRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteInterceptDeploymentRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.networksecurity.v1.DeleteInterceptDeploymentRequest"; + }; + + return DeleteInterceptDeploymentRequest; + })(); + + v1.InterceptLocation = (function() { + + /** + * Properties of an InterceptLocation. + * @memberof google.cloud.networksecurity.v1 + * @interface IInterceptLocation + * @property {string|null} [location] InterceptLocation location + * @property {google.cloud.networksecurity.v1.InterceptLocation.State|null} [state] InterceptLocation state + */ + + /** + * Constructs a new InterceptLocation. + * @memberof google.cloud.networksecurity.v1 + * @classdesc Represents an InterceptLocation. + * @implements IInterceptLocation + * @constructor + * @param {google.cloud.networksecurity.v1.IInterceptLocation=} [properties] Properties to set + */ + function InterceptLocation(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * InterceptLocation location. + * @member {string} location + * @memberof google.cloud.networksecurity.v1.InterceptLocation + * @instance + */ + InterceptLocation.prototype.location = ""; + + /** + * InterceptLocation state. + * @member {google.cloud.networksecurity.v1.InterceptLocation.State} state + * @memberof google.cloud.networksecurity.v1.InterceptLocation + * @instance + */ + InterceptLocation.prototype.state = 0; + + /** + * Creates a new InterceptLocation instance using the specified properties. + * @function create + * @memberof google.cloud.networksecurity.v1.InterceptLocation + * @static + * @param {google.cloud.networksecurity.v1.IInterceptLocation=} [properties] Properties to set + * @returns {google.cloud.networksecurity.v1.InterceptLocation} InterceptLocation instance + */ + InterceptLocation.create = function create(properties) { + return new InterceptLocation(properties); + }; + + /** + * Encodes the specified InterceptLocation message. Does not implicitly {@link google.cloud.networksecurity.v1.InterceptLocation.verify|verify} messages. + * @function encode + * @memberof google.cloud.networksecurity.v1.InterceptLocation + * @static + * @param {google.cloud.networksecurity.v1.IInterceptLocation} message InterceptLocation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InterceptLocation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.location != null && Object.hasOwnProperty.call(message, "location")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.location); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.state); + return writer; + }; + + /** + * Encodes the specified InterceptLocation message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.InterceptLocation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.networksecurity.v1.InterceptLocation + * @static + * @param {google.cloud.networksecurity.v1.IInterceptLocation} message InterceptLocation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InterceptLocation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an InterceptLocation message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.networksecurity.v1.InterceptLocation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.networksecurity.v1.InterceptLocation} InterceptLocation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InterceptLocation.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networksecurity.v1.InterceptLocation(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.location = reader.string(); + break; + } + case 2: { + message.state = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an InterceptLocation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.networksecurity.v1.InterceptLocation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.networksecurity.v1.InterceptLocation} InterceptLocation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InterceptLocation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an InterceptLocation message. + * @function verify + * @memberof google.cloud.networksecurity.v1.InterceptLocation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + InterceptLocation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.location != null && message.hasOwnProperty("location")) + if (!$util.isString(message.location)) + return "location: string expected"; + if (message.state != null && message.hasOwnProperty("state")) + switch (message.state) { + default: + return "state: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates an InterceptLocation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.networksecurity.v1.InterceptLocation + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.networksecurity.v1.InterceptLocation} InterceptLocation + */ + InterceptLocation.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networksecurity.v1.InterceptLocation) + return object; + var message = new $root.google.cloud.networksecurity.v1.InterceptLocation(); + if (object.location != null) + message.location = String(object.location); + switch (object.state) { + default: + if (typeof object.state === "number") { + message.state = object.state; + break; + } + break; + case "STATE_UNSPECIFIED": + case 0: + message.state = 0; + break; + case "ACTIVE": + case 1: + message.state = 1; + break; + case "OUT_OF_SYNC": + case 2: + message.state = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from an InterceptLocation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.networksecurity.v1.InterceptLocation + * @static + * @param {google.cloud.networksecurity.v1.InterceptLocation} message InterceptLocation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + InterceptLocation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.location = ""; + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + } + if (message.location != null && message.hasOwnProperty("location")) + object.location = message.location; + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.networksecurity.v1.InterceptLocation.State[message.state] === undefined ? message.state : $root.google.cloud.networksecurity.v1.InterceptLocation.State[message.state] : message.state; + return object; + }; + + /** + * Converts this InterceptLocation to JSON. + * @function toJSON + * @memberof google.cloud.networksecurity.v1.InterceptLocation + * @instance + * @returns {Object.} JSON object + */ + InterceptLocation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for InterceptLocation + * @function getTypeUrl + * @memberof google.cloud.networksecurity.v1.InterceptLocation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + InterceptLocation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.networksecurity.v1.InterceptLocation"; + }; + + /** + * State enum. + * @name google.cloud.networksecurity.v1.InterceptLocation.State + * @enum {number} + * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value + * @property {number} ACTIVE=1 ACTIVE value + * @property {number} OUT_OF_SYNC=2 OUT_OF_SYNC value + */ + InterceptLocation.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "ACTIVE"] = 1; + values[valuesById[2] = "OUT_OF_SYNC"] = 2; + return values; + })(); + + return InterceptLocation; + })(); + + v1.Mirroring = (function() { + + /** + * Constructs a new Mirroring service. + * @memberof google.cloud.networksecurity.v1 + * @classdesc Represents a Mirroring + * @extends $protobuf.rpc.Service + * @constructor + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + */ + function Mirroring(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (Mirroring.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Mirroring; + + /** + * Creates new Mirroring service using the specified rpc implementation. + * @function create + * @memberof google.cloud.networksecurity.v1.Mirroring + * @static + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + * @returns {Mirroring} RPC service. Useful where requests and/or responses are streamed. + */ + Mirroring.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.networksecurity.v1.Mirroring|listMirroringEndpointGroups}. + * @memberof google.cloud.networksecurity.v1.Mirroring + * @typedef ListMirroringEndpointGroupsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.networksecurity.v1.ListMirroringEndpointGroupsResponse} [response] ListMirroringEndpointGroupsResponse + */ + + /** + * Calls ListMirroringEndpointGroups. + * @function listMirroringEndpointGroups + * @memberof google.cloud.networksecurity.v1.Mirroring + * @instance + * @param {google.cloud.networksecurity.v1.IListMirroringEndpointGroupsRequest} request ListMirroringEndpointGroupsRequest message or plain object + * @param {google.cloud.networksecurity.v1.Mirroring.ListMirroringEndpointGroupsCallback} callback Node-style callback called with the error, if any, and ListMirroringEndpointGroupsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Mirroring.prototype.listMirroringEndpointGroups = function listMirroringEndpointGroups(request, callback) { + return this.rpcCall(listMirroringEndpointGroups, $root.google.cloud.networksecurity.v1.ListMirroringEndpointGroupsRequest, $root.google.cloud.networksecurity.v1.ListMirroringEndpointGroupsResponse, request, callback); + }, "name", { value: "ListMirroringEndpointGroups" }); + + /** + * Calls ListMirroringEndpointGroups. + * @function listMirroringEndpointGroups + * @memberof google.cloud.networksecurity.v1.Mirroring + * @instance + * @param {google.cloud.networksecurity.v1.IListMirroringEndpointGroupsRequest} request ListMirroringEndpointGroupsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.networksecurity.v1.Mirroring|getMirroringEndpointGroup}. + * @memberof google.cloud.networksecurity.v1.Mirroring + * @typedef GetMirroringEndpointGroupCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.networksecurity.v1.MirroringEndpointGroup} [response] MirroringEndpointGroup + */ + + /** + * Calls GetMirroringEndpointGroup. + * @function getMirroringEndpointGroup + * @memberof google.cloud.networksecurity.v1.Mirroring + * @instance + * @param {google.cloud.networksecurity.v1.IGetMirroringEndpointGroupRequest} request GetMirroringEndpointGroupRequest message or plain object + * @param {google.cloud.networksecurity.v1.Mirroring.GetMirroringEndpointGroupCallback} callback Node-style callback called with the error, if any, and MirroringEndpointGroup + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Mirroring.prototype.getMirroringEndpointGroup = function getMirroringEndpointGroup(request, callback) { + return this.rpcCall(getMirroringEndpointGroup, $root.google.cloud.networksecurity.v1.GetMirroringEndpointGroupRequest, $root.google.cloud.networksecurity.v1.MirroringEndpointGroup, request, callback); + }, "name", { value: "GetMirroringEndpointGroup" }); + + /** + * Calls GetMirroringEndpointGroup. + * @function getMirroringEndpointGroup + * @memberof google.cloud.networksecurity.v1.Mirroring + * @instance + * @param {google.cloud.networksecurity.v1.IGetMirroringEndpointGroupRequest} request GetMirroringEndpointGroupRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.networksecurity.v1.Mirroring|createMirroringEndpointGroup}. + * @memberof google.cloud.networksecurity.v1.Mirroring + * @typedef CreateMirroringEndpointGroupCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls CreateMirroringEndpointGroup. + * @function createMirroringEndpointGroup + * @memberof google.cloud.networksecurity.v1.Mirroring + * @instance + * @param {google.cloud.networksecurity.v1.ICreateMirroringEndpointGroupRequest} request CreateMirroringEndpointGroupRequest message or plain object + * @param {google.cloud.networksecurity.v1.Mirroring.CreateMirroringEndpointGroupCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Mirroring.prototype.createMirroringEndpointGroup = function createMirroringEndpointGroup(request, callback) { + return this.rpcCall(createMirroringEndpointGroup, $root.google.cloud.networksecurity.v1.CreateMirroringEndpointGroupRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "CreateMirroringEndpointGroup" }); + + /** + * Calls CreateMirroringEndpointGroup. + * @function createMirroringEndpointGroup + * @memberof google.cloud.networksecurity.v1.Mirroring + * @instance + * @param {google.cloud.networksecurity.v1.ICreateMirroringEndpointGroupRequest} request CreateMirroringEndpointGroupRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.networksecurity.v1.Mirroring|updateMirroringEndpointGroup}. + * @memberof google.cloud.networksecurity.v1.Mirroring + * @typedef UpdateMirroringEndpointGroupCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls UpdateMirroringEndpointGroup. + * @function updateMirroringEndpointGroup + * @memberof google.cloud.networksecurity.v1.Mirroring + * @instance + * @param {google.cloud.networksecurity.v1.IUpdateMirroringEndpointGroupRequest} request UpdateMirroringEndpointGroupRequest message or plain object + * @param {google.cloud.networksecurity.v1.Mirroring.UpdateMirroringEndpointGroupCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Mirroring.prototype.updateMirroringEndpointGroup = function updateMirroringEndpointGroup(request, callback) { + return this.rpcCall(updateMirroringEndpointGroup, $root.google.cloud.networksecurity.v1.UpdateMirroringEndpointGroupRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "UpdateMirroringEndpointGroup" }); + + /** + * Calls UpdateMirroringEndpointGroup. + * @function updateMirroringEndpointGroup + * @memberof google.cloud.networksecurity.v1.Mirroring + * @instance + * @param {google.cloud.networksecurity.v1.IUpdateMirroringEndpointGroupRequest} request UpdateMirroringEndpointGroupRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.networksecurity.v1.Mirroring|deleteMirroringEndpointGroup}. + * @memberof google.cloud.networksecurity.v1.Mirroring + * @typedef DeleteMirroringEndpointGroupCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls DeleteMirroringEndpointGroup. + * @function deleteMirroringEndpointGroup + * @memberof google.cloud.networksecurity.v1.Mirroring + * @instance + * @param {google.cloud.networksecurity.v1.IDeleteMirroringEndpointGroupRequest} request DeleteMirroringEndpointGroupRequest message or plain object + * @param {google.cloud.networksecurity.v1.Mirroring.DeleteMirroringEndpointGroupCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Mirroring.prototype.deleteMirroringEndpointGroup = function deleteMirroringEndpointGroup(request, callback) { + return this.rpcCall(deleteMirroringEndpointGroup, $root.google.cloud.networksecurity.v1.DeleteMirroringEndpointGroupRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "DeleteMirroringEndpointGroup" }); + + /** + * Calls DeleteMirroringEndpointGroup. + * @function deleteMirroringEndpointGroup + * @memberof google.cloud.networksecurity.v1.Mirroring + * @instance + * @param {google.cloud.networksecurity.v1.IDeleteMirroringEndpointGroupRequest} request DeleteMirroringEndpointGroupRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.networksecurity.v1.Mirroring|listMirroringEndpointGroupAssociations}. + * @memberof google.cloud.networksecurity.v1.Mirroring + * @typedef ListMirroringEndpointGroupAssociationsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.networksecurity.v1.ListMirroringEndpointGroupAssociationsResponse} [response] ListMirroringEndpointGroupAssociationsResponse + */ + + /** + * Calls ListMirroringEndpointGroupAssociations. + * @function listMirroringEndpointGroupAssociations + * @memberof google.cloud.networksecurity.v1.Mirroring + * @instance + * @param {google.cloud.networksecurity.v1.IListMirroringEndpointGroupAssociationsRequest} request ListMirroringEndpointGroupAssociationsRequest message or plain object + * @param {google.cloud.networksecurity.v1.Mirroring.ListMirroringEndpointGroupAssociationsCallback} callback Node-style callback called with the error, if any, and ListMirroringEndpointGroupAssociationsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Mirroring.prototype.listMirroringEndpointGroupAssociations = function listMirroringEndpointGroupAssociations(request, callback) { + return this.rpcCall(listMirroringEndpointGroupAssociations, $root.google.cloud.networksecurity.v1.ListMirroringEndpointGroupAssociationsRequest, $root.google.cloud.networksecurity.v1.ListMirroringEndpointGroupAssociationsResponse, request, callback); + }, "name", { value: "ListMirroringEndpointGroupAssociations" }); + + /** + * Calls ListMirroringEndpointGroupAssociations. + * @function listMirroringEndpointGroupAssociations + * @memberof google.cloud.networksecurity.v1.Mirroring + * @instance + * @param {google.cloud.networksecurity.v1.IListMirroringEndpointGroupAssociationsRequest} request ListMirroringEndpointGroupAssociationsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.networksecurity.v1.Mirroring|getMirroringEndpointGroupAssociation}. + * @memberof google.cloud.networksecurity.v1.Mirroring + * @typedef GetMirroringEndpointGroupAssociationCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.networksecurity.v1.MirroringEndpointGroupAssociation} [response] MirroringEndpointGroupAssociation + */ + + /** + * Calls GetMirroringEndpointGroupAssociation. + * @function getMirroringEndpointGroupAssociation + * @memberof google.cloud.networksecurity.v1.Mirroring + * @instance + * @param {google.cloud.networksecurity.v1.IGetMirroringEndpointGroupAssociationRequest} request GetMirroringEndpointGroupAssociationRequest message or plain object + * @param {google.cloud.networksecurity.v1.Mirroring.GetMirroringEndpointGroupAssociationCallback} callback Node-style callback called with the error, if any, and MirroringEndpointGroupAssociation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Mirroring.prototype.getMirroringEndpointGroupAssociation = function getMirroringEndpointGroupAssociation(request, callback) { + return this.rpcCall(getMirroringEndpointGroupAssociation, $root.google.cloud.networksecurity.v1.GetMirroringEndpointGroupAssociationRequest, $root.google.cloud.networksecurity.v1.MirroringEndpointGroupAssociation, request, callback); + }, "name", { value: "GetMirroringEndpointGroupAssociation" }); + + /** + * Calls GetMirroringEndpointGroupAssociation. + * @function getMirroringEndpointGroupAssociation + * @memberof google.cloud.networksecurity.v1.Mirroring + * @instance + * @param {google.cloud.networksecurity.v1.IGetMirroringEndpointGroupAssociationRequest} request GetMirroringEndpointGroupAssociationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.networksecurity.v1.Mirroring|createMirroringEndpointGroupAssociation}. + * @memberof google.cloud.networksecurity.v1.Mirroring + * @typedef CreateMirroringEndpointGroupAssociationCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls CreateMirroringEndpointGroupAssociation. + * @function createMirroringEndpointGroupAssociation + * @memberof google.cloud.networksecurity.v1.Mirroring + * @instance + * @param {google.cloud.networksecurity.v1.ICreateMirroringEndpointGroupAssociationRequest} request CreateMirroringEndpointGroupAssociationRequest message or plain object + * @param {google.cloud.networksecurity.v1.Mirroring.CreateMirroringEndpointGroupAssociationCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Mirroring.prototype.createMirroringEndpointGroupAssociation = function createMirroringEndpointGroupAssociation(request, callback) { + return this.rpcCall(createMirroringEndpointGroupAssociation, $root.google.cloud.networksecurity.v1.CreateMirroringEndpointGroupAssociationRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "CreateMirroringEndpointGroupAssociation" }); + + /** + * Calls CreateMirroringEndpointGroupAssociation. + * @function createMirroringEndpointGroupAssociation + * @memberof google.cloud.networksecurity.v1.Mirroring + * @instance + * @param {google.cloud.networksecurity.v1.ICreateMirroringEndpointGroupAssociationRequest} request CreateMirroringEndpointGroupAssociationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.networksecurity.v1.Mirroring|updateMirroringEndpointGroupAssociation}. + * @memberof google.cloud.networksecurity.v1.Mirroring + * @typedef UpdateMirroringEndpointGroupAssociationCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls UpdateMirroringEndpointGroupAssociation. + * @function updateMirroringEndpointGroupAssociation + * @memberof google.cloud.networksecurity.v1.Mirroring + * @instance + * @param {google.cloud.networksecurity.v1.IUpdateMirroringEndpointGroupAssociationRequest} request UpdateMirroringEndpointGroupAssociationRequest message or plain object + * @param {google.cloud.networksecurity.v1.Mirroring.UpdateMirroringEndpointGroupAssociationCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Mirroring.prototype.updateMirroringEndpointGroupAssociation = function updateMirroringEndpointGroupAssociation(request, callback) { + return this.rpcCall(updateMirroringEndpointGroupAssociation, $root.google.cloud.networksecurity.v1.UpdateMirroringEndpointGroupAssociationRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "UpdateMirroringEndpointGroupAssociation" }); + + /** + * Calls UpdateMirroringEndpointGroupAssociation. + * @function updateMirroringEndpointGroupAssociation + * @memberof google.cloud.networksecurity.v1.Mirroring + * @instance + * @param {google.cloud.networksecurity.v1.IUpdateMirroringEndpointGroupAssociationRequest} request UpdateMirroringEndpointGroupAssociationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.networksecurity.v1.Mirroring|deleteMirroringEndpointGroupAssociation}. + * @memberof google.cloud.networksecurity.v1.Mirroring + * @typedef DeleteMirroringEndpointGroupAssociationCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls DeleteMirroringEndpointGroupAssociation. + * @function deleteMirroringEndpointGroupAssociation + * @memberof google.cloud.networksecurity.v1.Mirroring + * @instance + * @param {google.cloud.networksecurity.v1.IDeleteMirroringEndpointGroupAssociationRequest} request DeleteMirroringEndpointGroupAssociationRequest message or plain object + * @param {google.cloud.networksecurity.v1.Mirroring.DeleteMirroringEndpointGroupAssociationCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Mirroring.prototype.deleteMirroringEndpointGroupAssociation = function deleteMirroringEndpointGroupAssociation(request, callback) { + return this.rpcCall(deleteMirroringEndpointGroupAssociation, $root.google.cloud.networksecurity.v1.DeleteMirroringEndpointGroupAssociationRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "DeleteMirroringEndpointGroupAssociation" }); + + /** + * Calls DeleteMirroringEndpointGroupAssociation. + * @function deleteMirroringEndpointGroupAssociation + * @memberof google.cloud.networksecurity.v1.Mirroring + * @instance + * @param {google.cloud.networksecurity.v1.IDeleteMirroringEndpointGroupAssociationRequest} request DeleteMirroringEndpointGroupAssociationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.networksecurity.v1.Mirroring|listMirroringDeploymentGroups}. + * @memberof google.cloud.networksecurity.v1.Mirroring + * @typedef ListMirroringDeploymentGroupsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.networksecurity.v1.ListMirroringDeploymentGroupsResponse} [response] ListMirroringDeploymentGroupsResponse + */ + + /** + * Calls ListMirroringDeploymentGroups. + * @function listMirroringDeploymentGroups + * @memberof google.cloud.networksecurity.v1.Mirroring + * @instance + * @param {google.cloud.networksecurity.v1.IListMirroringDeploymentGroupsRequest} request ListMirroringDeploymentGroupsRequest message or plain object + * @param {google.cloud.networksecurity.v1.Mirroring.ListMirroringDeploymentGroupsCallback} callback Node-style callback called with the error, if any, and ListMirroringDeploymentGroupsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Mirroring.prototype.listMirroringDeploymentGroups = function listMirroringDeploymentGroups(request, callback) { + return this.rpcCall(listMirroringDeploymentGroups, $root.google.cloud.networksecurity.v1.ListMirroringDeploymentGroupsRequest, $root.google.cloud.networksecurity.v1.ListMirroringDeploymentGroupsResponse, request, callback); + }, "name", { value: "ListMirroringDeploymentGroups" }); + + /** + * Calls ListMirroringDeploymentGroups. + * @function listMirroringDeploymentGroups + * @memberof google.cloud.networksecurity.v1.Mirroring + * @instance + * @param {google.cloud.networksecurity.v1.IListMirroringDeploymentGroupsRequest} request ListMirroringDeploymentGroupsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.networksecurity.v1.Mirroring|getMirroringDeploymentGroup}. + * @memberof google.cloud.networksecurity.v1.Mirroring + * @typedef GetMirroringDeploymentGroupCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.networksecurity.v1.MirroringDeploymentGroup} [response] MirroringDeploymentGroup + */ + + /** + * Calls GetMirroringDeploymentGroup. + * @function getMirroringDeploymentGroup + * @memberof google.cloud.networksecurity.v1.Mirroring + * @instance + * @param {google.cloud.networksecurity.v1.IGetMirroringDeploymentGroupRequest} request GetMirroringDeploymentGroupRequest message or plain object + * @param {google.cloud.networksecurity.v1.Mirroring.GetMirroringDeploymentGroupCallback} callback Node-style callback called with the error, if any, and MirroringDeploymentGroup + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Mirroring.prototype.getMirroringDeploymentGroup = function getMirroringDeploymentGroup(request, callback) { + return this.rpcCall(getMirroringDeploymentGroup, $root.google.cloud.networksecurity.v1.GetMirroringDeploymentGroupRequest, $root.google.cloud.networksecurity.v1.MirroringDeploymentGroup, request, callback); + }, "name", { value: "GetMirroringDeploymentGroup" }); + + /** + * Calls GetMirroringDeploymentGroup. + * @function getMirroringDeploymentGroup + * @memberof google.cloud.networksecurity.v1.Mirroring + * @instance + * @param {google.cloud.networksecurity.v1.IGetMirroringDeploymentGroupRequest} request GetMirroringDeploymentGroupRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.networksecurity.v1.Mirroring|createMirroringDeploymentGroup}. + * @memberof google.cloud.networksecurity.v1.Mirroring + * @typedef CreateMirroringDeploymentGroupCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls CreateMirroringDeploymentGroup. + * @function createMirroringDeploymentGroup + * @memberof google.cloud.networksecurity.v1.Mirroring + * @instance + * @param {google.cloud.networksecurity.v1.ICreateMirroringDeploymentGroupRequest} request CreateMirroringDeploymentGroupRequest message or plain object + * @param {google.cloud.networksecurity.v1.Mirroring.CreateMirroringDeploymentGroupCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Mirroring.prototype.createMirroringDeploymentGroup = function createMirroringDeploymentGroup(request, callback) { + return this.rpcCall(createMirroringDeploymentGroup, $root.google.cloud.networksecurity.v1.CreateMirroringDeploymentGroupRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "CreateMirroringDeploymentGroup" }); + + /** + * Calls CreateMirroringDeploymentGroup. + * @function createMirroringDeploymentGroup + * @memberof google.cloud.networksecurity.v1.Mirroring + * @instance + * @param {google.cloud.networksecurity.v1.ICreateMirroringDeploymentGroupRequest} request CreateMirroringDeploymentGroupRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.networksecurity.v1.Mirroring|updateMirroringDeploymentGroup}. + * @memberof google.cloud.networksecurity.v1.Mirroring + * @typedef UpdateMirroringDeploymentGroupCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls UpdateMirroringDeploymentGroup. + * @function updateMirroringDeploymentGroup + * @memberof google.cloud.networksecurity.v1.Mirroring + * @instance + * @param {google.cloud.networksecurity.v1.IUpdateMirroringDeploymentGroupRequest} request UpdateMirroringDeploymentGroupRequest message or plain object + * @param {google.cloud.networksecurity.v1.Mirroring.UpdateMirroringDeploymentGroupCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Mirroring.prototype.updateMirroringDeploymentGroup = function updateMirroringDeploymentGroup(request, callback) { + return this.rpcCall(updateMirroringDeploymentGroup, $root.google.cloud.networksecurity.v1.UpdateMirroringDeploymentGroupRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "UpdateMirroringDeploymentGroup" }); + + /** + * Calls UpdateMirroringDeploymentGroup. + * @function updateMirroringDeploymentGroup + * @memberof google.cloud.networksecurity.v1.Mirroring + * @instance + * @param {google.cloud.networksecurity.v1.IUpdateMirroringDeploymentGroupRequest} request UpdateMirroringDeploymentGroupRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.networksecurity.v1.Mirroring|deleteMirroringDeploymentGroup}. + * @memberof google.cloud.networksecurity.v1.Mirroring + * @typedef DeleteMirroringDeploymentGroupCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls DeleteMirroringDeploymentGroup. + * @function deleteMirroringDeploymentGroup + * @memberof google.cloud.networksecurity.v1.Mirroring + * @instance + * @param {google.cloud.networksecurity.v1.IDeleteMirroringDeploymentGroupRequest} request DeleteMirroringDeploymentGroupRequest message or plain object + * @param {google.cloud.networksecurity.v1.Mirroring.DeleteMirroringDeploymentGroupCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Mirroring.prototype.deleteMirroringDeploymentGroup = function deleteMirroringDeploymentGroup(request, callback) { + return this.rpcCall(deleteMirroringDeploymentGroup, $root.google.cloud.networksecurity.v1.DeleteMirroringDeploymentGroupRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "DeleteMirroringDeploymentGroup" }); + + /** + * Calls DeleteMirroringDeploymentGroup. + * @function deleteMirroringDeploymentGroup + * @memberof google.cloud.networksecurity.v1.Mirroring + * @instance + * @param {google.cloud.networksecurity.v1.IDeleteMirroringDeploymentGroupRequest} request DeleteMirroringDeploymentGroupRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.networksecurity.v1.Mirroring|listMirroringDeployments}. + * @memberof google.cloud.networksecurity.v1.Mirroring + * @typedef ListMirroringDeploymentsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.networksecurity.v1.ListMirroringDeploymentsResponse} [response] ListMirroringDeploymentsResponse + */ + + /** + * Calls ListMirroringDeployments. + * @function listMirroringDeployments + * @memberof google.cloud.networksecurity.v1.Mirroring + * @instance + * @param {google.cloud.networksecurity.v1.IListMirroringDeploymentsRequest} request ListMirroringDeploymentsRequest message or plain object + * @param {google.cloud.networksecurity.v1.Mirroring.ListMirroringDeploymentsCallback} callback Node-style callback called with the error, if any, and ListMirroringDeploymentsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Mirroring.prototype.listMirroringDeployments = function listMirroringDeployments(request, callback) { + return this.rpcCall(listMirroringDeployments, $root.google.cloud.networksecurity.v1.ListMirroringDeploymentsRequest, $root.google.cloud.networksecurity.v1.ListMirroringDeploymentsResponse, request, callback); + }, "name", { value: "ListMirroringDeployments" }); + + /** + * Calls ListMirroringDeployments. + * @function listMirroringDeployments + * @memberof google.cloud.networksecurity.v1.Mirroring + * @instance + * @param {google.cloud.networksecurity.v1.IListMirroringDeploymentsRequest} request ListMirroringDeploymentsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.networksecurity.v1.Mirroring|getMirroringDeployment}. + * @memberof google.cloud.networksecurity.v1.Mirroring + * @typedef GetMirroringDeploymentCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.networksecurity.v1.MirroringDeployment} [response] MirroringDeployment + */ + + /** + * Calls GetMirroringDeployment. + * @function getMirroringDeployment + * @memberof google.cloud.networksecurity.v1.Mirroring + * @instance + * @param {google.cloud.networksecurity.v1.IGetMirroringDeploymentRequest} request GetMirroringDeploymentRequest message or plain object + * @param {google.cloud.networksecurity.v1.Mirroring.GetMirroringDeploymentCallback} callback Node-style callback called with the error, if any, and MirroringDeployment + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Mirroring.prototype.getMirroringDeployment = function getMirroringDeployment(request, callback) { + return this.rpcCall(getMirroringDeployment, $root.google.cloud.networksecurity.v1.GetMirroringDeploymentRequest, $root.google.cloud.networksecurity.v1.MirroringDeployment, request, callback); + }, "name", { value: "GetMirroringDeployment" }); + + /** + * Calls GetMirroringDeployment. + * @function getMirroringDeployment + * @memberof google.cloud.networksecurity.v1.Mirroring + * @instance + * @param {google.cloud.networksecurity.v1.IGetMirroringDeploymentRequest} request GetMirroringDeploymentRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.networksecurity.v1.Mirroring|createMirroringDeployment}. + * @memberof google.cloud.networksecurity.v1.Mirroring + * @typedef CreateMirroringDeploymentCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls CreateMirroringDeployment. + * @function createMirroringDeployment + * @memberof google.cloud.networksecurity.v1.Mirroring + * @instance + * @param {google.cloud.networksecurity.v1.ICreateMirroringDeploymentRequest} request CreateMirroringDeploymentRequest message or plain object + * @param {google.cloud.networksecurity.v1.Mirroring.CreateMirroringDeploymentCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Mirroring.prototype.createMirroringDeployment = function createMirroringDeployment(request, callback) { + return this.rpcCall(createMirroringDeployment, $root.google.cloud.networksecurity.v1.CreateMirroringDeploymentRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "CreateMirroringDeployment" }); + + /** + * Calls CreateMirroringDeployment. + * @function createMirroringDeployment + * @memberof google.cloud.networksecurity.v1.Mirroring + * @instance + * @param {google.cloud.networksecurity.v1.ICreateMirroringDeploymentRequest} request CreateMirroringDeploymentRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.networksecurity.v1.Mirroring|updateMirroringDeployment}. + * @memberof google.cloud.networksecurity.v1.Mirroring + * @typedef UpdateMirroringDeploymentCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls UpdateMirroringDeployment. + * @function updateMirroringDeployment + * @memberof google.cloud.networksecurity.v1.Mirroring + * @instance + * @param {google.cloud.networksecurity.v1.IUpdateMirroringDeploymentRequest} request UpdateMirroringDeploymentRequest message or plain object + * @param {google.cloud.networksecurity.v1.Mirroring.UpdateMirroringDeploymentCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Mirroring.prototype.updateMirroringDeployment = function updateMirroringDeployment(request, callback) { + return this.rpcCall(updateMirroringDeployment, $root.google.cloud.networksecurity.v1.UpdateMirroringDeploymentRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "UpdateMirroringDeployment" }); + + /** + * Calls UpdateMirroringDeployment. + * @function updateMirroringDeployment + * @memberof google.cloud.networksecurity.v1.Mirroring + * @instance + * @param {google.cloud.networksecurity.v1.IUpdateMirroringDeploymentRequest} request UpdateMirroringDeploymentRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.networksecurity.v1.Mirroring|deleteMirroringDeployment}. + * @memberof google.cloud.networksecurity.v1.Mirroring + * @typedef DeleteMirroringDeploymentCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls DeleteMirroringDeployment. + * @function deleteMirroringDeployment + * @memberof google.cloud.networksecurity.v1.Mirroring + * @instance + * @param {google.cloud.networksecurity.v1.IDeleteMirroringDeploymentRequest} request DeleteMirroringDeploymentRequest message or plain object + * @param {google.cloud.networksecurity.v1.Mirroring.DeleteMirroringDeploymentCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Mirroring.prototype.deleteMirroringDeployment = function deleteMirroringDeployment(request, callback) { + return this.rpcCall(deleteMirroringDeployment, $root.google.cloud.networksecurity.v1.DeleteMirroringDeploymentRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "DeleteMirroringDeployment" }); + + /** + * Calls DeleteMirroringDeployment. + * @function deleteMirroringDeployment + * @memberof google.cloud.networksecurity.v1.Mirroring + * @instance + * @param {google.cloud.networksecurity.v1.IDeleteMirroringDeploymentRequest} request DeleteMirroringDeploymentRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return Mirroring; + })(); + + v1.MirroringEndpointGroup = (function() { + + /** + * Properties of a MirroringEndpointGroup. + * @memberof google.cloud.networksecurity.v1 + * @interface IMirroringEndpointGroup + * @property {string|null} [name] MirroringEndpointGroup name + * @property {google.protobuf.ITimestamp|null} [createTime] MirroringEndpointGroup createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] MirroringEndpointGroup updateTime + * @property {Object.|null} [labels] MirroringEndpointGroup labels + * @property {string|null} [mirroringDeploymentGroup] MirroringEndpointGroup mirroringDeploymentGroup + * @property {Array.|null} [connectedDeploymentGroups] MirroringEndpointGroup connectedDeploymentGroups + * @property {google.cloud.networksecurity.v1.MirroringEndpointGroup.State|null} [state] MirroringEndpointGroup state + * @property {boolean|null} [reconciling] MirroringEndpointGroup reconciling + * @property {google.cloud.networksecurity.v1.MirroringEndpointGroup.Type|null} [type] MirroringEndpointGroup type + * @property {Array.|null} [associations] MirroringEndpointGroup associations + * @property {string|null} [description] MirroringEndpointGroup description + */ + + /** + * Constructs a new MirroringEndpointGroup. + * @memberof google.cloud.networksecurity.v1 + * @classdesc Represents a MirroringEndpointGroup. + * @implements IMirroringEndpointGroup + * @constructor + * @param {google.cloud.networksecurity.v1.IMirroringEndpointGroup=} [properties] Properties to set + */ + function MirroringEndpointGroup(properties) { + this.labels = {}; + this.connectedDeploymentGroups = []; + this.associations = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MirroringEndpointGroup name. + * @member {string} name + * @memberof google.cloud.networksecurity.v1.MirroringEndpointGroup + * @instance + */ + MirroringEndpointGroup.prototype.name = ""; + + /** + * MirroringEndpointGroup createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.networksecurity.v1.MirroringEndpointGroup + * @instance + */ + MirroringEndpointGroup.prototype.createTime = null; + + /** + * MirroringEndpointGroup updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.networksecurity.v1.MirroringEndpointGroup + * @instance + */ + MirroringEndpointGroup.prototype.updateTime = null; + + /** + * MirroringEndpointGroup labels. + * @member {Object.} labels + * @memberof google.cloud.networksecurity.v1.MirroringEndpointGroup + * @instance + */ + MirroringEndpointGroup.prototype.labels = $util.emptyObject; + + /** + * MirroringEndpointGroup mirroringDeploymentGroup. + * @member {string} mirroringDeploymentGroup + * @memberof google.cloud.networksecurity.v1.MirroringEndpointGroup + * @instance + */ + MirroringEndpointGroup.prototype.mirroringDeploymentGroup = ""; + + /** + * MirroringEndpointGroup connectedDeploymentGroups. + * @member {Array.} connectedDeploymentGroups + * @memberof google.cloud.networksecurity.v1.MirroringEndpointGroup + * @instance + */ + MirroringEndpointGroup.prototype.connectedDeploymentGroups = $util.emptyArray; + + /** + * MirroringEndpointGroup state. + * @member {google.cloud.networksecurity.v1.MirroringEndpointGroup.State} state + * @memberof google.cloud.networksecurity.v1.MirroringEndpointGroup + * @instance + */ + MirroringEndpointGroup.prototype.state = 0; + + /** + * MirroringEndpointGroup reconciling. + * @member {boolean} reconciling + * @memberof google.cloud.networksecurity.v1.MirroringEndpointGroup + * @instance + */ + MirroringEndpointGroup.prototype.reconciling = false; + + /** + * MirroringEndpointGroup type. + * @member {google.cloud.networksecurity.v1.MirroringEndpointGroup.Type} type + * @memberof google.cloud.networksecurity.v1.MirroringEndpointGroup + * @instance + */ + MirroringEndpointGroup.prototype.type = 0; + + /** + * MirroringEndpointGroup associations. + * @member {Array.} associations + * @memberof google.cloud.networksecurity.v1.MirroringEndpointGroup + * @instance + */ + MirroringEndpointGroup.prototype.associations = $util.emptyArray; + + /** + * MirroringEndpointGroup description. + * @member {string} description + * @memberof google.cloud.networksecurity.v1.MirroringEndpointGroup + * @instance + */ + MirroringEndpointGroup.prototype.description = ""; + + /** + * Creates a new MirroringEndpointGroup instance using the specified properties. + * @function create + * @memberof google.cloud.networksecurity.v1.MirroringEndpointGroup + * @static + * @param {google.cloud.networksecurity.v1.IMirroringEndpointGroup=} [properties] Properties to set + * @returns {google.cloud.networksecurity.v1.MirroringEndpointGroup} MirroringEndpointGroup instance + */ + MirroringEndpointGroup.create = function create(properties) { + return new MirroringEndpointGroup(properties); + }; + + /** + * Encodes the specified MirroringEndpointGroup message. Does not implicitly {@link google.cloud.networksecurity.v1.MirroringEndpointGroup.verify|verify} messages. + * @function encode + * @memberof google.cloud.networksecurity.v1.MirroringEndpointGroup + * @static + * @param {google.cloud.networksecurity.v1.IMirroringEndpointGroup} message MirroringEndpointGroup message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MirroringEndpointGroup.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) + for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) + writer.uint32(/* id 4, wireType 2 =*/34).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); + if (message.mirroringDeploymentGroup != null && Object.hasOwnProperty.call(message, "mirroringDeploymentGroup")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.mirroringDeploymentGroup); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 7, wireType 0 =*/56).int32(message.state); + if (message.reconciling != null && Object.hasOwnProperty.call(message, "reconciling")) + writer.uint32(/* id 8, wireType 0 =*/64).bool(message.reconciling); + if (message.associations != null && message.associations.length) + for (var i = 0; i < message.associations.length; ++i) + $root.google.cloud.networksecurity.v1.MirroringEndpointGroup.AssociationDetails.encode(message.associations[i], writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.description); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 11, wireType 0 =*/88).int32(message.type); + if (message.connectedDeploymentGroups != null && message.connectedDeploymentGroups.length) + for (var i = 0; i < message.connectedDeploymentGroups.length; ++i) + $root.google.cloud.networksecurity.v1.MirroringEndpointGroup.ConnectedDeploymentGroup.encode(message.connectedDeploymentGroups[i], writer.uint32(/* id 13, wireType 2 =*/106).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified MirroringEndpointGroup message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.MirroringEndpointGroup.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.networksecurity.v1.MirroringEndpointGroup + * @static + * @param {google.cloud.networksecurity.v1.IMirroringEndpointGroup} message MirroringEndpointGroup message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MirroringEndpointGroup.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MirroringEndpointGroup message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.networksecurity.v1.MirroringEndpointGroup + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.networksecurity.v1.MirroringEndpointGroup} MirroringEndpointGroup + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MirroringEndpointGroup.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networksecurity.v1.MirroringEndpointGroup(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 3: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 4: { + if (message.labels === $util.emptyObject) + message.labels = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.labels[key] = value; + break; + } + case 5: { + message.mirroringDeploymentGroup = reader.string(); + break; + } + case 13: { + if (!(message.connectedDeploymentGroups && message.connectedDeploymentGroups.length)) + message.connectedDeploymentGroups = []; + message.connectedDeploymentGroups.push($root.google.cloud.networksecurity.v1.MirroringEndpointGroup.ConnectedDeploymentGroup.decode(reader, reader.uint32())); + break; + } + case 7: { + message.state = reader.int32(); + break; + } + case 8: { + message.reconciling = reader.bool(); + break; + } + case 11: { + message.type = reader.int32(); + break; + } + case 9: { + if (!(message.associations && message.associations.length)) + message.associations = []; + message.associations.push($root.google.cloud.networksecurity.v1.MirroringEndpointGroup.AssociationDetails.decode(reader, reader.uint32())); + break; + } + case 10: { + message.description = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MirroringEndpointGroup message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.networksecurity.v1.MirroringEndpointGroup + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.networksecurity.v1.MirroringEndpointGroup} MirroringEndpointGroup + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MirroringEndpointGroup.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MirroringEndpointGroup message. + * @function verify + * @memberof google.cloud.networksecurity.v1.MirroringEndpointGroup + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MirroringEndpointGroup.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime); + if (error) + return "updateTime." + error; + } + if (message.labels != null && message.hasOwnProperty("labels")) { + if (!$util.isObject(message.labels)) + return "labels: object expected"; + var key = Object.keys(message.labels); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.labels[key[i]])) + return "labels: string{k:string} expected"; + } + if (message.mirroringDeploymentGroup != null && message.hasOwnProperty("mirroringDeploymentGroup")) + if (!$util.isString(message.mirroringDeploymentGroup)) + return "mirroringDeploymentGroup: string expected"; + if (message.connectedDeploymentGroups != null && message.hasOwnProperty("connectedDeploymentGroups")) { + if (!Array.isArray(message.connectedDeploymentGroups)) + return "connectedDeploymentGroups: array expected"; + for (var i = 0; i < message.connectedDeploymentGroups.length; ++i) { + var error = $root.google.cloud.networksecurity.v1.MirroringEndpointGroup.ConnectedDeploymentGroup.verify(message.connectedDeploymentGroups[i]); + if (error) + return "connectedDeploymentGroups." + error; + } + } + if (message.state != null && message.hasOwnProperty("state")) + switch (message.state) { + default: + return "state: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + break; + } + if (message.reconciling != null && message.hasOwnProperty("reconciling")) + if (typeof message.reconciling !== "boolean") + return "reconciling: boolean expected"; + if (message.type != null && message.hasOwnProperty("type")) + switch (message.type) { + default: + return "type: enum value expected"; + case 0: + case 1: + break; + } + if (message.associations != null && message.hasOwnProperty("associations")) { + if (!Array.isArray(message.associations)) + return "associations: array expected"; + for (var i = 0; i < message.associations.length; ++i) { + var error = $root.google.cloud.networksecurity.v1.MirroringEndpointGroup.AssociationDetails.verify(message.associations[i]); + if (error) + return "associations." + error; + } + } + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + return null; + }; + + /** + * Creates a MirroringEndpointGroup message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.networksecurity.v1.MirroringEndpointGroup + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.networksecurity.v1.MirroringEndpointGroup} MirroringEndpointGroup + */ + MirroringEndpointGroup.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networksecurity.v1.MirroringEndpointGroup) + return object; + var message = new $root.google.cloud.networksecurity.v1.MirroringEndpointGroup(); + if (object.name != null) + message.name = String(object.name); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.networksecurity.v1.MirroringEndpointGroup.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.updateTime != null) { + if (typeof object.updateTime !== "object") + throw TypeError(".google.cloud.networksecurity.v1.MirroringEndpointGroup.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.cloud.networksecurity.v1.MirroringEndpointGroup.labels: object expected"); + message.labels = {}; + for (var keys = Object.keys(object.labels), i = 0; i < keys.length; ++i) + message.labels[keys[i]] = String(object.labels[keys[i]]); + } + if (object.mirroringDeploymentGroup != null) + message.mirroringDeploymentGroup = String(object.mirroringDeploymentGroup); + if (object.connectedDeploymentGroups) { + if (!Array.isArray(object.connectedDeploymentGroups)) + throw TypeError(".google.cloud.networksecurity.v1.MirroringEndpointGroup.connectedDeploymentGroups: array expected"); + message.connectedDeploymentGroups = []; + for (var i = 0; i < object.connectedDeploymentGroups.length; ++i) { + if (typeof object.connectedDeploymentGroups[i] !== "object") + throw TypeError(".google.cloud.networksecurity.v1.MirroringEndpointGroup.connectedDeploymentGroups: object expected"); + message.connectedDeploymentGroups[i] = $root.google.cloud.networksecurity.v1.MirroringEndpointGroup.ConnectedDeploymentGroup.fromObject(object.connectedDeploymentGroups[i]); + } + } + switch (object.state) { + default: + if (typeof object.state === "number") { + message.state = object.state; + break; + } + break; + case "STATE_UNSPECIFIED": + case 0: + message.state = 0; + break; + case "ACTIVE": + case 1: + message.state = 1; + break; + case "CLOSED": + case 2: + message.state = 2; + break; + case "CREATING": + case 3: + message.state = 3; + break; + case "DELETING": + case 4: + message.state = 4; + break; + case "OUT_OF_SYNC": + case 5: + message.state = 5; + break; + case "DELETE_FAILED": + case 6: + message.state = 6; + break; + } + if (object.reconciling != null) + message.reconciling = Boolean(object.reconciling); + switch (object.type) { + default: + if (typeof object.type === "number") { + message.type = object.type; + break; + } + break; + case "TYPE_UNSPECIFIED": + case 0: + message.type = 0; + break; + case "DIRECT": + case 1: + message.type = 1; + break; + } + if (object.associations) { + if (!Array.isArray(object.associations)) + throw TypeError(".google.cloud.networksecurity.v1.MirroringEndpointGroup.associations: array expected"); + message.associations = []; + for (var i = 0; i < object.associations.length; ++i) { + if (typeof object.associations[i] !== "object") + throw TypeError(".google.cloud.networksecurity.v1.MirroringEndpointGroup.associations: object expected"); + message.associations[i] = $root.google.cloud.networksecurity.v1.MirroringEndpointGroup.AssociationDetails.fromObject(object.associations[i]); + } + } + if (object.description != null) + message.description = String(object.description); + return message; + }; + + /** + * Creates a plain object from a MirroringEndpointGroup message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.networksecurity.v1.MirroringEndpointGroup + * @static + * @param {google.cloud.networksecurity.v1.MirroringEndpointGroup} message MirroringEndpointGroup + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MirroringEndpointGroup.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.associations = []; + object.connectedDeploymentGroups = []; + } + if (options.objects || options.defaults) + object.labels = {}; + if (options.defaults) { + object.name = ""; + object.createTime = null; + object.updateTime = null; + object.mirroringDeploymentGroup = ""; + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + object.reconciling = false; + object.description = ""; + object.type = options.enums === String ? "TYPE_UNSPECIFIED" : 0; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.updateTime != null && message.hasOwnProperty("updateTime")) + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); + var keys2; + if (message.labels && (keys2 = Object.keys(message.labels)).length) { + object.labels = {}; + for (var j = 0; j < keys2.length; ++j) + object.labels[keys2[j]] = message.labels[keys2[j]]; + } + if (message.mirroringDeploymentGroup != null && message.hasOwnProperty("mirroringDeploymentGroup")) + object.mirroringDeploymentGroup = message.mirroringDeploymentGroup; + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.networksecurity.v1.MirroringEndpointGroup.State[message.state] === undefined ? message.state : $root.google.cloud.networksecurity.v1.MirroringEndpointGroup.State[message.state] : message.state; + if (message.reconciling != null && message.hasOwnProperty("reconciling")) + object.reconciling = message.reconciling; + if (message.associations && message.associations.length) { + object.associations = []; + for (var j = 0; j < message.associations.length; ++j) + object.associations[j] = $root.google.cloud.networksecurity.v1.MirroringEndpointGroup.AssociationDetails.toObject(message.associations[j], options); + } + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.type != null && message.hasOwnProperty("type")) + object.type = options.enums === String ? $root.google.cloud.networksecurity.v1.MirroringEndpointGroup.Type[message.type] === undefined ? message.type : $root.google.cloud.networksecurity.v1.MirroringEndpointGroup.Type[message.type] : message.type; + if (message.connectedDeploymentGroups && message.connectedDeploymentGroups.length) { + object.connectedDeploymentGroups = []; + for (var j = 0; j < message.connectedDeploymentGroups.length; ++j) + object.connectedDeploymentGroups[j] = $root.google.cloud.networksecurity.v1.MirroringEndpointGroup.ConnectedDeploymentGroup.toObject(message.connectedDeploymentGroups[j], options); + } + return object; + }; + + /** + * Converts this MirroringEndpointGroup to JSON. + * @function toJSON + * @memberof google.cloud.networksecurity.v1.MirroringEndpointGroup + * @instance + * @returns {Object.} JSON object + */ + MirroringEndpointGroup.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MirroringEndpointGroup + * @function getTypeUrl + * @memberof google.cloud.networksecurity.v1.MirroringEndpointGroup + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MirroringEndpointGroup.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.networksecurity.v1.MirroringEndpointGroup"; + }; + + MirroringEndpointGroup.ConnectedDeploymentGroup = (function() { + + /** + * Properties of a ConnectedDeploymentGroup. + * @memberof google.cloud.networksecurity.v1.MirroringEndpointGroup + * @interface IConnectedDeploymentGroup + * @property {string|null} [name] ConnectedDeploymentGroup name + * @property {Array.|null} [locations] ConnectedDeploymentGroup locations + */ + + /** + * Constructs a new ConnectedDeploymentGroup. + * @memberof google.cloud.networksecurity.v1.MirroringEndpointGroup + * @classdesc Represents a ConnectedDeploymentGroup. + * @implements IConnectedDeploymentGroup + * @constructor + * @param {google.cloud.networksecurity.v1.MirroringEndpointGroup.IConnectedDeploymentGroup=} [properties] Properties to set + */ + function ConnectedDeploymentGroup(properties) { + this.locations = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ConnectedDeploymentGroup name. + * @member {string} name + * @memberof google.cloud.networksecurity.v1.MirroringEndpointGroup.ConnectedDeploymentGroup + * @instance + */ + ConnectedDeploymentGroup.prototype.name = ""; + + /** + * ConnectedDeploymentGroup locations. + * @member {Array.} locations + * @memberof google.cloud.networksecurity.v1.MirroringEndpointGroup.ConnectedDeploymentGroup + * @instance + */ + ConnectedDeploymentGroup.prototype.locations = $util.emptyArray; + + /** + * Creates a new ConnectedDeploymentGroup instance using the specified properties. + * @function create + * @memberof google.cloud.networksecurity.v1.MirroringEndpointGroup.ConnectedDeploymentGroup + * @static + * @param {google.cloud.networksecurity.v1.MirroringEndpointGroup.IConnectedDeploymentGroup=} [properties] Properties to set + * @returns {google.cloud.networksecurity.v1.MirroringEndpointGroup.ConnectedDeploymentGroup} ConnectedDeploymentGroup instance + */ + ConnectedDeploymentGroup.create = function create(properties) { + return new ConnectedDeploymentGroup(properties); + }; + + /** + * Encodes the specified ConnectedDeploymentGroup message. Does not implicitly {@link google.cloud.networksecurity.v1.MirroringEndpointGroup.ConnectedDeploymentGroup.verify|verify} messages. + * @function encode + * @memberof google.cloud.networksecurity.v1.MirroringEndpointGroup.ConnectedDeploymentGroup + * @static + * @param {google.cloud.networksecurity.v1.MirroringEndpointGroup.IConnectedDeploymentGroup} message ConnectedDeploymentGroup message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ConnectedDeploymentGroup.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.locations != null && message.locations.length) + for (var i = 0; i < message.locations.length; ++i) + $root.google.cloud.networksecurity.v1.MirroringLocation.encode(message.locations[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ConnectedDeploymentGroup message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.MirroringEndpointGroup.ConnectedDeploymentGroup.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.networksecurity.v1.MirroringEndpointGroup.ConnectedDeploymentGroup + * @static + * @param {google.cloud.networksecurity.v1.MirroringEndpointGroup.IConnectedDeploymentGroup} message ConnectedDeploymentGroup message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ConnectedDeploymentGroup.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ConnectedDeploymentGroup message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.networksecurity.v1.MirroringEndpointGroup.ConnectedDeploymentGroup + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.networksecurity.v1.MirroringEndpointGroup.ConnectedDeploymentGroup} ConnectedDeploymentGroup + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ConnectedDeploymentGroup.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networksecurity.v1.MirroringEndpointGroup.ConnectedDeploymentGroup(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + if (!(message.locations && message.locations.length)) + message.locations = []; + message.locations.push($root.google.cloud.networksecurity.v1.MirroringLocation.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ConnectedDeploymentGroup message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.networksecurity.v1.MirroringEndpointGroup.ConnectedDeploymentGroup + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.networksecurity.v1.MirroringEndpointGroup.ConnectedDeploymentGroup} ConnectedDeploymentGroup + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ConnectedDeploymentGroup.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ConnectedDeploymentGroup message. + * @function verify + * @memberof google.cloud.networksecurity.v1.MirroringEndpointGroup.ConnectedDeploymentGroup + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ConnectedDeploymentGroup.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.locations != null && message.hasOwnProperty("locations")) { + if (!Array.isArray(message.locations)) + return "locations: array expected"; + for (var i = 0; i < message.locations.length; ++i) { + var error = $root.google.cloud.networksecurity.v1.MirroringLocation.verify(message.locations[i]); + if (error) + return "locations." + error; + } + } + return null; + }; + + /** + * Creates a ConnectedDeploymentGroup message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.networksecurity.v1.MirroringEndpointGroup.ConnectedDeploymentGroup + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.networksecurity.v1.MirroringEndpointGroup.ConnectedDeploymentGroup} ConnectedDeploymentGroup + */ + ConnectedDeploymentGroup.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networksecurity.v1.MirroringEndpointGroup.ConnectedDeploymentGroup) + return object; + var message = new $root.google.cloud.networksecurity.v1.MirroringEndpointGroup.ConnectedDeploymentGroup(); + if (object.name != null) + message.name = String(object.name); + if (object.locations) { + if (!Array.isArray(object.locations)) + throw TypeError(".google.cloud.networksecurity.v1.MirroringEndpointGroup.ConnectedDeploymentGroup.locations: array expected"); + message.locations = []; + for (var i = 0; i < object.locations.length; ++i) { + if (typeof object.locations[i] !== "object") + throw TypeError(".google.cloud.networksecurity.v1.MirroringEndpointGroup.ConnectedDeploymentGroup.locations: object expected"); + message.locations[i] = $root.google.cloud.networksecurity.v1.MirroringLocation.fromObject(object.locations[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a ConnectedDeploymentGroup message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.networksecurity.v1.MirroringEndpointGroup.ConnectedDeploymentGroup + * @static + * @param {google.cloud.networksecurity.v1.MirroringEndpointGroup.ConnectedDeploymentGroup} message ConnectedDeploymentGroup + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ConnectedDeploymentGroup.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.locations = []; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.locations && message.locations.length) { + object.locations = []; + for (var j = 0; j < message.locations.length; ++j) + object.locations[j] = $root.google.cloud.networksecurity.v1.MirroringLocation.toObject(message.locations[j], options); + } + return object; + }; + + /** + * Converts this ConnectedDeploymentGroup to JSON. + * @function toJSON + * @memberof google.cloud.networksecurity.v1.MirroringEndpointGroup.ConnectedDeploymentGroup + * @instance + * @returns {Object.} JSON object + */ + ConnectedDeploymentGroup.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ConnectedDeploymentGroup + * @function getTypeUrl + * @memberof google.cloud.networksecurity.v1.MirroringEndpointGroup.ConnectedDeploymentGroup + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ConnectedDeploymentGroup.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.networksecurity.v1.MirroringEndpointGroup.ConnectedDeploymentGroup"; + }; + + return ConnectedDeploymentGroup; + })(); + + MirroringEndpointGroup.AssociationDetails = (function() { + + /** + * Properties of an AssociationDetails. + * @memberof google.cloud.networksecurity.v1.MirroringEndpointGroup + * @interface IAssociationDetails + * @property {string|null} [name] AssociationDetails name + * @property {string|null} [network] AssociationDetails network + * @property {google.cloud.networksecurity.v1.MirroringEndpointGroupAssociation.State|null} [state] AssociationDetails state + */ + + /** + * Constructs a new AssociationDetails. + * @memberof google.cloud.networksecurity.v1.MirroringEndpointGroup + * @classdesc Represents an AssociationDetails. + * @implements IAssociationDetails + * @constructor + * @param {google.cloud.networksecurity.v1.MirroringEndpointGroup.IAssociationDetails=} [properties] Properties to set + */ + function AssociationDetails(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AssociationDetails name. + * @member {string} name + * @memberof google.cloud.networksecurity.v1.MirroringEndpointGroup.AssociationDetails + * @instance + */ + AssociationDetails.prototype.name = ""; + + /** + * AssociationDetails network. + * @member {string} network + * @memberof google.cloud.networksecurity.v1.MirroringEndpointGroup.AssociationDetails + * @instance + */ + AssociationDetails.prototype.network = ""; + + /** + * AssociationDetails state. + * @member {google.cloud.networksecurity.v1.MirroringEndpointGroupAssociation.State} state + * @memberof google.cloud.networksecurity.v1.MirroringEndpointGroup.AssociationDetails + * @instance + */ + AssociationDetails.prototype.state = 0; + + /** + * Creates a new AssociationDetails instance using the specified properties. + * @function create + * @memberof google.cloud.networksecurity.v1.MirroringEndpointGroup.AssociationDetails + * @static + * @param {google.cloud.networksecurity.v1.MirroringEndpointGroup.IAssociationDetails=} [properties] Properties to set + * @returns {google.cloud.networksecurity.v1.MirroringEndpointGroup.AssociationDetails} AssociationDetails instance + */ + AssociationDetails.create = function create(properties) { + return new AssociationDetails(properties); + }; + + /** + * Encodes the specified AssociationDetails message. Does not implicitly {@link google.cloud.networksecurity.v1.MirroringEndpointGroup.AssociationDetails.verify|verify} messages. + * @function encode + * @memberof google.cloud.networksecurity.v1.MirroringEndpointGroup.AssociationDetails + * @static + * @param {google.cloud.networksecurity.v1.MirroringEndpointGroup.IAssociationDetails} message AssociationDetails message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AssociationDetails.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.network != null && Object.hasOwnProperty.call(message, "network")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.network); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.state); + return writer; + }; + + /** + * Encodes the specified AssociationDetails message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.MirroringEndpointGroup.AssociationDetails.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.networksecurity.v1.MirroringEndpointGroup.AssociationDetails + * @static + * @param {google.cloud.networksecurity.v1.MirroringEndpointGroup.IAssociationDetails} message AssociationDetails message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AssociationDetails.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AssociationDetails message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.networksecurity.v1.MirroringEndpointGroup.AssociationDetails + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.networksecurity.v1.MirroringEndpointGroup.AssociationDetails} AssociationDetails + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AssociationDetails.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networksecurity.v1.MirroringEndpointGroup.AssociationDetails(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.network = reader.string(); + break; + } + case 3: { + message.state = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AssociationDetails message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.networksecurity.v1.MirroringEndpointGroup.AssociationDetails + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.networksecurity.v1.MirroringEndpointGroup.AssociationDetails} AssociationDetails + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AssociationDetails.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AssociationDetails message. + * @function verify + * @memberof google.cloud.networksecurity.v1.MirroringEndpointGroup.AssociationDetails + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AssociationDetails.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.network != null && message.hasOwnProperty("network")) + if (!$util.isString(message.network)) + return "network: string expected"; + if (message.state != null && message.hasOwnProperty("state")) + switch (message.state) { + default: + return "state: enum value expected"; + case 0: + case 1: + case 3: + case 4: + case 5: + case 6: + case 7: + break; + } + return null; + }; + + /** + * Creates an AssociationDetails message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.networksecurity.v1.MirroringEndpointGroup.AssociationDetails + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.networksecurity.v1.MirroringEndpointGroup.AssociationDetails} AssociationDetails + */ + AssociationDetails.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networksecurity.v1.MirroringEndpointGroup.AssociationDetails) + return object; + var message = new $root.google.cloud.networksecurity.v1.MirroringEndpointGroup.AssociationDetails(); + if (object.name != null) + message.name = String(object.name); + if (object.network != null) + message.network = String(object.network); + switch (object.state) { + default: + if (typeof object.state === "number") { + message.state = object.state; + break; + } + break; + case "STATE_UNSPECIFIED": + case 0: + message.state = 0; + break; + case "ACTIVE": + case 1: + message.state = 1; + break; + case "CREATING": + case 3: + message.state = 3; + break; + case "DELETING": + case 4: + message.state = 4; + break; + case "CLOSED": + case 5: + message.state = 5; + break; + case "OUT_OF_SYNC": + case 6: + message.state = 6; + break; + case "DELETE_FAILED": + case 7: + message.state = 7; + break; + } + return message; + }; + + /** + * Creates a plain object from an AssociationDetails message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.networksecurity.v1.MirroringEndpointGroup.AssociationDetails + * @static + * @param {google.cloud.networksecurity.v1.MirroringEndpointGroup.AssociationDetails} message AssociationDetails + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AssociationDetails.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.network = ""; + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.network != null && message.hasOwnProperty("network")) + object.network = message.network; + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.networksecurity.v1.MirroringEndpointGroupAssociation.State[message.state] === undefined ? message.state : $root.google.cloud.networksecurity.v1.MirroringEndpointGroupAssociation.State[message.state] : message.state; + return object; + }; + + /** + * Converts this AssociationDetails to JSON. + * @function toJSON + * @memberof google.cloud.networksecurity.v1.MirroringEndpointGroup.AssociationDetails + * @instance + * @returns {Object.} JSON object + */ + AssociationDetails.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AssociationDetails + * @function getTypeUrl + * @memberof google.cloud.networksecurity.v1.MirroringEndpointGroup.AssociationDetails + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AssociationDetails.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.networksecurity.v1.MirroringEndpointGroup.AssociationDetails"; + }; + + return AssociationDetails; + })(); + + /** + * State enum. + * @name google.cloud.networksecurity.v1.MirroringEndpointGroup.State + * @enum {number} + * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value + * @property {number} ACTIVE=1 ACTIVE value + * @property {number} CLOSED=2 CLOSED value + * @property {number} CREATING=3 CREATING value + * @property {number} DELETING=4 DELETING value + * @property {number} OUT_OF_SYNC=5 OUT_OF_SYNC value + * @property {number} DELETE_FAILED=6 DELETE_FAILED value + */ + MirroringEndpointGroup.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "ACTIVE"] = 1; + values[valuesById[2] = "CLOSED"] = 2; + values[valuesById[3] = "CREATING"] = 3; + values[valuesById[4] = "DELETING"] = 4; + values[valuesById[5] = "OUT_OF_SYNC"] = 5; + values[valuesById[6] = "DELETE_FAILED"] = 6; + return values; + })(); + + /** + * Type enum. + * @name google.cloud.networksecurity.v1.MirroringEndpointGroup.Type + * @enum {number} + * @property {number} TYPE_UNSPECIFIED=0 TYPE_UNSPECIFIED value + * @property {number} DIRECT=1 DIRECT value + */ + MirroringEndpointGroup.Type = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "DIRECT"] = 1; + return values; + })(); + + return MirroringEndpointGroup; + })(); + + v1.ListMirroringEndpointGroupsRequest = (function() { + + /** + * Properties of a ListMirroringEndpointGroupsRequest. + * @memberof google.cloud.networksecurity.v1 + * @interface IListMirroringEndpointGroupsRequest + * @property {string|null} [parent] ListMirroringEndpointGroupsRequest parent + * @property {number|null} [pageSize] ListMirroringEndpointGroupsRequest pageSize + * @property {string|null} [pageToken] ListMirroringEndpointGroupsRequest pageToken + * @property {string|null} [filter] ListMirroringEndpointGroupsRequest filter + * @property {string|null} [orderBy] ListMirroringEndpointGroupsRequest orderBy + */ + + /** + * Constructs a new ListMirroringEndpointGroupsRequest. + * @memberof google.cloud.networksecurity.v1 + * @classdesc Represents a ListMirroringEndpointGroupsRequest. + * @implements IListMirroringEndpointGroupsRequest + * @constructor + * @param {google.cloud.networksecurity.v1.IListMirroringEndpointGroupsRequest=} [properties] Properties to set + */ + function ListMirroringEndpointGroupsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListMirroringEndpointGroupsRequest parent. + * @member {string} parent + * @memberof google.cloud.networksecurity.v1.ListMirroringEndpointGroupsRequest + * @instance + */ + ListMirroringEndpointGroupsRequest.prototype.parent = ""; + + /** + * ListMirroringEndpointGroupsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.networksecurity.v1.ListMirroringEndpointGroupsRequest + * @instance + */ + ListMirroringEndpointGroupsRequest.prototype.pageSize = 0; + + /** + * ListMirroringEndpointGroupsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.networksecurity.v1.ListMirroringEndpointGroupsRequest + * @instance + */ + ListMirroringEndpointGroupsRequest.prototype.pageToken = ""; + + /** + * ListMirroringEndpointGroupsRequest filter. + * @member {string} filter + * @memberof google.cloud.networksecurity.v1.ListMirroringEndpointGroupsRequest + * @instance + */ + ListMirroringEndpointGroupsRequest.prototype.filter = ""; + + /** + * ListMirroringEndpointGroupsRequest orderBy. + * @member {string} orderBy + * @memberof google.cloud.networksecurity.v1.ListMirroringEndpointGroupsRequest + * @instance + */ + ListMirroringEndpointGroupsRequest.prototype.orderBy = ""; + + /** + * Creates a new ListMirroringEndpointGroupsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.networksecurity.v1.ListMirroringEndpointGroupsRequest + * @static + * @param {google.cloud.networksecurity.v1.IListMirroringEndpointGroupsRequest=} [properties] Properties to set + * @returns {google.cloud.networksecurity.v1.ListMirroringEndpointGroupsRequest} ListMirroringEndpointGroupsRequest instance + */ + ListMirroringEndpointGroupsRequest.create = function create(properties) { + return new ListMirroringEndpointGroupsRequest(properties); + }; + + /** + * Encodes the specified ListMirroringEndpointGroupsRequest message. Does not implicitly {@link google.cloud.networksecurity.v1.ListMirroringEndpointGroupsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.networksecurity.v1.ListMirroringEndpointGroupsRequest + * @static + * @param {google.cloud.networksecurity.v1.IListMirroringEndpointGroupsRequest} message ListMirroringEndpointGroupsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListMirroringEndpointGroupsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.filter); + if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.orderBy); + return writer; + }; + + /** + * Encodes the specified ListMirroringEndpointGroupsRequest message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.ListMirroringEndpointGroupsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.networksecurity.v1.ListMirroringEndpointGroupsRequest + * @static + * @param {google.cloud.networksecurity.v1.IListMirroringEndpointGroupsRequest} message ListMirroringEndpointGroupsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListMirroringEndpointGroupsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListMirroringEndpointGroupsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.networksecurity.v1.ListMirroringEndpointGroupsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.networksecurity.v1.ListMirroringEndpointGroupsRequest} ListMirroringEndpointGroupsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListMirroringEndpointGroupsRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networksecurity.v1.ListMirroringEndpointGroupsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + case 4: { + message.filter = reader.string(); + break; + } + case 5: { + message.orderBy = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListMirroringEndpointGroupsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.networksecurity.v1.ListMirroringEndpointGroupsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.networksecurity.v1.ListMirroringEndpointGroupsRequest} ListMirroringEndpointGroupsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListMirroringEndpointGroupsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListMirroringEndpointGroupsRequest message. + * @function verify + * @memberof google.cloud.networksecurity.v1.ListMirroringEndpointGroupsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListMirroringEndpointGroupsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + if (!$util.isString(message.orderBy)) + return "orderBy: string expected"; + return null; + }; + + /** + * Creates a ListMirroringEndpointGroupsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.networksecurity.v1.ListMirroringEndpointGroupsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.networksecurity.v1.ListMirroringEndpointGroupsRequest} ListMirroringEndpointGroupsRequest + */ + ListMirroringEndpointGroupsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networksecurity.v1.ListMirroringEndpointGroupsRequest) + return object; + var message = new $root.google.cloud.networksecurity.v1.ListMirroringEndpointGroupsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.filter != null) + message.filter = String(object.filter); + if (object.orderBy != null) + message.orderBy = String(object.orderBy); + return message; + }; + + /** + * Creates a plain object from a ListMirroringEndpointGroupsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.networksecurity.v1.ListMirroringEndpointGroupsRequest + * @static + * @param {google.cloud.networksecurity.v1.ListMirroringEndpointGroupsRequest} message ListMirroringEndpointGroupsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListMirroringEndpointGroupsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + object.filter = ""; + object.orderBy = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + object.orderBy = message.orderBy; + return object; + }; + + /** + * Converts this ListMirroringEndpointGroupsRequest to JSON. + * @function toJSON + * @memberof google.cloud.networksecurity.v1.ListMirroringEndpointGroupsRequest + * @instance + * @returns {Object.} JSON object + */ + ListMirroringEndpointGroupsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListMirroringEndpointGroupsRequest + * @function getTypeUrl + * @memberof google.cloud.networksecurity.v1.ListMirroringEndpointGroupsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListMirroringEndpointGroupsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.networksecurity.v1.ListMirroringEndpointGroupsRequest"; + }; + + return ListMirroringEndpointGroupsRequest; + })(); + + v1.ListMirroringEndpointGroupsResponse = (function() { + + /** + * Properties of a ListMirroringEndpointGroupsResponse. + * @memberof google.cloud.networksecurity.v1 + * @interface IListMirroringEndpointGroupsResponse + * @property {Array.|null} [mirroringEndpointGroups] ListMirroringEndpointGroupsResponse mirroringEndpointGroups + * @property {string|null} [nextPageToken] ListMirroringEndpointGroupsResponse nextPageToken + */ + + /** + * Constructs a new ListMirroringEndpointGroupsResponse. + * @memberof google.cloud.networksecurity.v1 + * @classdesc Represents a ListMirroringEndpointGroupsResponse. + * @implements IListMirroringEndpointGroupsResponse + * @constructor + * @param {google.cloud.networksecurity.v1.IListMirroringEndpointGroupsResponse=} [properties] Properties to set + */ + function ListMirroringEndpointGroupsResponse(properties) { + this.mirroringEndpointGroups = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListMirroringEndpointGroupsResponse mirroringEndpointGroups. + * @member {Array.} mirroringEndpointGroups + * @memberof google.cloud.networksecurity.v1.ListMirroringEndpointGroupsResponse + * @instance + */ + ListMirroringEndpointGroupsResponse.prototype.mirroringEndpointGroups = $util.emptyArray; + + /** + * ListMirroringEndpointGroupsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.networksecurity.v1.ListMirroringEndpointGroupsResponse + * @instance + */ + ListMirroringEndpointGroupsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListMirroringEndpointGroupsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.networksecurity.v1.ListMirroringEndpointGroupsResponse + * @static + * @param {google.cloud.networksecurity.v1.IListMirroringEndpointGroupsResponse=} [properties] Properties to set + * @returns {google.cloud.networksecurity.v1.ListMirroringEndpointGroupsResponse} ListMirroringEndpointGroupsResponse instance + */ + ListMirroringEndpointGroupsResponse.create = function create(properties) { + return new ListMirroringEndpointGroupsResponse(properties); + }; + + /** + * Encodes the specified ListMirroringEndpointGroupsResponse message. Does not implicitly {@link google.cloud.networksecurity.v1.ListMirroringEndpointGroupsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.networksecurity.v1.ListMirroringEndpointGroupsResponse + * @static + * @param {google.cloud.networksecurity.v1.IListMirroringEndpointGroupsResponse} message ListMirroringEndpointGroupsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListMirroringEndpointGroupsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.mirroringEndpointGroups != null && message.mirroringEndpointGroups.length) + for (var i = 0; i < message.mirroringEndpointGroups.length; ++i) + $root.google.cloud.networksecurity.v1.MirroringEndpointGroup.encode(message.mirroringEndpointGroups[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + return writer; + }; + + /** + * Encodes the specified ListMirroringEndpointGroupsResponse message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.ListMirroringEndpointGroupsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.networksecurity.v1.ListMirroringEndpointGroupsResponse + * @static + * @param {google.cloud.networksecurity.v1.IListMirroringEndpointGroupsResponse} message ListMirroringEndpointGroupsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListMirroringEndpointGroupsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListMirroringEndpointGroupsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.networksecurity.v1.ListMirroringEndpointGroupsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.networksecurity.v1.ListMirroringEndpointGroupsResponse} ListMirroringEndpointGroupsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListMirroringEndpointGroupsResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networksecurity.v1.ListMirroringEndpointGroupsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.mirroringEndpointGroups && message.mirroringEndpointGroups.length)) + message.mirroringEndpointGroups = []; + message.mirroringEndpointGroups.push($root.google.cloud.networksecurity.v1.MirroringEndpointGroup.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListMirroringEndpointGroupsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.networksecurity.v1.ListMirroringEndpointGroupsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.networksecurity.v1.ListMirroringEndpointGroupsResponse} ListMirroringEndpointGroupsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListMirroringEndpointGroupsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListMirroringEndpointGroupsResponse message. + * @function verify + * @memberof google.cloud.networksecurity.v1.ListMirroringEndpointGroupsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListMirroringEndpointGroupsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.mirroringEndpointGroups != null && message.hasOwnProperty("mirroringEndpointGroups")) { + if (!Array.isArray(message.mirroringEndpointGroups)) + return "mirroringEndpointGroups: array expected"; + for (var i = 0; i < message.mirroringEndpointGroups.length; ++i) { + var error = $root.google.cloud.networksecurity.v1.MirroringEndpointGroup.verify(message.mirroringEndpointGroups[i]); + if (error) + return "mirroringEndpointGroups." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListMirroringEndpointGroupsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.networksecurity.v1.ListMirroringEndpointGroupsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.networksecurity.v1.ListMirroringEndpointGroupsResponse} ListMirroringEndpointGroupsResponse + */ + ListMirroringEndpointGroupsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networksecurity.v1.ListMirroringEndpointGroupsResponse) + return object; + var message = new $root.google.cloud.networksecurity.v1.ListMirroringEndpointGroupsResponse(); + if (object.mirroringEndpointGroups) { + if (!Array.isArray(object.mirroringEndpointGroups)) + throw TypeError(".google.cloud.networksecurity.v1.ListMirroringEndpointGroupsResponse.mirroringEndpointGroups: array expected"); + message.mirroringEndpointGroups = []; + for (var i = 0; i < object.mirroringEndpointGroups.length; ++i) { + if (typeof object.mirroringEndpointGroups[i] !== "object") + throw TypeError(".google.cloud.networksecurity.v1.ListMirroringEndpointGroupsResponse.mirroringEndpointGroups: object expected"); + message.mirroringEndpointGroups[i] = $root.google.cloud.networksecurity.v1.MirroringEndpointGroup.fromObject(object.mirroringEndpointGroups[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListMirroringEndpointGroupsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.networksecurity.v1.ListMirroringEndpointGroupsResponse + * @static + * @param {google.cloud.networksecurity.v1.ListMirroringEndpointGroupsResponse} message ListMirroringEndpointGroupsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListMirroringEndpointGroupsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.mirroringEndpointGroups = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.mirroringEndpointGroups && message.mirroringEndpointGroups.length) { + object.mirroringEndpointGroups = []; + for (var j = 0; j < message.mirroringEndpointGroups.length; ++j) + object.mirroringEndpointGroups[j] = $root.google.cloud.networksecurity.v1.MirroringEndpointGroup.toObject(message.mirroringEndpointGroups[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListMirroringEndpointGroupsResponse to JSON. + * @function toJSON + * @memberof google.cloud.networksecurity.v1.ListMirroringEndpointGroupsResponse + * @instance + * @returns {Object.} JSON object + */ + ListMirroringEndpointGroupsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListMirroringEndpointGroupsResponse + * @function getTypeUrl + * @memberof google.cloud.networksecurity.v1.ListMirroringEndpointGroupsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListMirroringEndpointGroupsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.networksecurity.v1.ListMirroringEndpointGroupsResponse"; + }; + + return ListMirroringEndpointGroupsResponse; + })(); + + v1.GetMirroringEndpointGroupRequest = (function() { + + /** + * Properties of a GetMirroringEndpointGroupRequest. + * @memberof google.cloud.networksecurity.v1 + * @interface IGetMirroringEndpointGroupRequest + * @property {string|null} [name] GetMirroringEndpointGroupRequest name + */ + + /** + * Constructs a new GetMirroringEndpointGroupRequest. + * @memberof google.cloud.networksecurity.v1 + * @classdesc Represents a GetMirroringEndpointGroupRequest. + * @implements IGetMirroringEndpointGroupRequest + * @constructor + * @param {google.cloud.networksecurity.v1.IGetMirroringEndpointGroupRequest=} [properties] Properties to set + */ + function GetMirroringEndpointGroupRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetMirroringEndpointGroupRequest name. + * @member {string} name + * @memberof google.cloud.networksecurity.v1.GetMirroringEndpointGroupRequest + * @instance + */ + GetMirroringEndpointGroupRequest.prototype.name = ""; + + /** + * Creates a new GetMirroringEndpointGroupRequest instance using the specified properties. + * @function create + * @memberof google.cloud.networksecurity.v1.GetMirroringEndpointGroupRequest + * @static + * @param {google.cloud.networksecurity.v1.IGetMirroringEndpointGroupRequest=} [properties] Properties to set + * @returns {google.cloud.networksecurity.v1.GetMirroringEndpointGroupRequest} GetMirroringEndpointGroupRequest instance + */ + GetMirroringEndpointGroupRequest.create = function create(properties) { + return new GetMirroringEndpointGroupRequest(properties); + }; + + /** + * Encodes the specified GetMirroringEndpointGroupRequest message. Does not implicitly {@link google.cloud.networksecurity.v1.GetMirroringEndpointGroupRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.networksecurity.v1.GetMirroringEndpointGroupRequest + * @static + * @param {google.cloud.networksecurity.v1.IGetMirroringEndpointGroupRequest} message GetMirroringEndpointGroupRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetMirroringEndpointGroupRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified GetMirroringEndpointGroupRequest message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.GetMirroringEndpointGroupRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.networksecurity.v1.GetMirroringEndpointGroupRequest + * @static + * @param {google.cloud.networksecurity.v1.IGetMirroringEndpointGroupRequest} message GetMirroringEndpointGroupRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetMirroringEndpointGroupRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetMirroringEndpointGroupRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.networksecurity.v1.GetMirroringEndpointGroupRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.networksecurity.v1.GetMirroringEndpointGroupRequest} GetMirroringEndpointGroupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetMirroringEndpointGroupRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networksecurity.v1.GetMirroringEndpointGroupRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetMirroringEndpointGroupRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.networksecurity.v1.GetMirroringEndpointGroupRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.networksecurity.v1.GetMirroringEndpointGroupRequest} GetMirroringEndpointGroupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetMirroringEndpointGroupRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetMirroringEndpointGroupRequest message. + * @function verify + * @memberof google.cloud.networksecurity.v1.GetMirroringEndpointGroupRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetMirroringEndpointGroupRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a GetMirroringEndpointGroupRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.networksecurity.v1.GetMirroringEndpointGroupRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.networksecurity.v1.GetMirroringEndpointGroupRequest} GetMirroringEndpointGroupRequest + */ + GetMirroringEndpointGroupRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networksecurity.v1.GetMirroringEndpointGroupRequest) + return object; + var message = new $root.google.cloud.networksecurity.v1.GetMirroringEndpointGroupRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetMirroringEndpointGroupRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.networksecurity.v1.GetMirroringEndpointGroupRequest + * @static + * @param {google.cloud.networksecurity.v1.GetMirroringEndpointGroupRequest} message GetMirroringEndpointGroupRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetMirroringEndpointGroupRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this GetMirroringEndpointGroupRequest to JSON. + * @function toJSON + * @memberof google.cloud.networksecurity.v1.GetMirroringEndpointGroupRequest + * @instance + * @returns {Object.} JSON object + */ + GetMirroringEndpointGroupRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetMirroringEndpointGroupRequest + * @function getTypeUrl + * @memberof google.cloud.networksecurity.v1.GetMirroringEndpointGroupRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetMirroringEndpointGroupRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.networksecurity.v1.GetMirroringEndpointGroupRequest"; + }; + + return GetMirroringEndpointGroupRequest; + })(); + + v1.CreateMirroringEndpointGroupRequest = (function() { + + /** + * Properties of a CreateMirroringEndpointGroupRequest. + * @memberof google.cloud.networksecurity.v1 + * @interface ICreateMirroringEndpointGroupRequest + * @property {string|null} [parent] CreateMirroringEndpointGroupRequest parent + * @property {string|null} [mirroringEndpointGroupId] CreateMirroringEndpointGroupRequest mirroringEndpointGroupId + * @property {google.cloud.networksecurity.v1.IMirroringEndpointGroup|null} [mirroringEndpointGroup] CreateMirroringEndpointGroupRequest mirroringEndpointGroup + * @property {string|null} [requestId] CreateMirroringEndpointGroupRequest requestId + */ + + /** + * Constructs a new CreateMirroringEndpointGroupRequest. + * @memberof google.cloud.networksecurity.v1 + * @classdesc Represents a CreateMirroringEndpointGroupRequest. + * @implements ICreateMirroringEndpointGroupRequest + * @constructor + * @param {google.cloud.networksecurity.v1.ICreateMirroringEndpointGroupRequest=} [properties] Properties to set + */ + function CreateMirroringEndpointGroupRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateMirroringEndpointGroupRequest parent. + * @member {string} parent + * @memberof google.cloud.networksecurity.v1.CreateMirroringEndpointGroupRequest + * @instance + */ + CreateMirroringEndpointGroupRequest.prototype.parent = ""; + + /** + * CreateMirroringEndpointGroupRequest mirroringEndpointGroupId. + * @member {string} mirroringEndpointGroupId + * @memberof google.cloud.networksecurity.v1.CreateMirroringEndpointGroupRequest + * @instance + */ + CreateMirroringEndpointGroupRequest.prototype.mirroringEndpointGroupId = ""; + + /** + * CreateMirroringEndpointGroupRequest mirroringEndpointGroup. + * @member {google.cloud.networksecurity.v1.IMirroringEndpointGroup|null|undefined} mirroringEndpointGroup + * @memberof google.cloud.networksecurity.v1.CreateMirroringEndpointGroupRequest + * @instance + */ + CreateMirroringEndpointGroupRequest.prototype.mirroringEndpointGroup = null; + + /** + * CreateMirroringEndpointGroupRequest requestId. + * @member {string} requestId + * @memberof google.cloud.networksecurity.v1.CreateMirroringEndpointGroupRequest + * @instance + */ + CreateMirroringEndpointGroupRequest.prototype.requestId = ""; + + /** + * Creates a new CreateMirroringEndpointGroupRequest instance using the specified properties. + * @function create + * @memberof google.cloud.networksecurity.v1.CreateMirroringEndpointGroupRequest + * @static + * @param {google.cloud.networksecurity.v1.ICreateMirroringEndpointGroupRequest=} [properties] Properties to set + * @returns {google.cloud.networksecurity.v1.CreateMirroringEndpointGroupRequest} CreateMirroringEndpointGroupRequest instance + */ + CreateMirroringEndpointGroupRequest.create = function create(properties) { + return new CreateMirroringEndpointGroupRequest(properties); + }; + + /** + * Encodes the specified CreateMirroringEndpointGroupRequest message. Does not implicitly {@link google.cloud.networksecurity.v1.CreateMirroringEndpointGroupRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.networksecurity.v1.CreateMirroringEndpointGroupRequest + * @static + * @param {google.cloud.networksecurity.v1.ICreateMirroringEndpointGroupRequest} message CreateMirroringEndpointGroupRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateMirroringEndpointGroupRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.mirroringEndpointGroupId != null && Object.hasOwnProperty.call(message, "mirroringEndpointGroupId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.mirroringEndpointGroupId); + if (message.mirroringEndpointGroup != null && Object.hasOwnProperty.call(message, "mirroringEndpointGroup")) + $root.google.cloud.networksecurity.v1.MirroringEndpointGroup.encode(message.mirroringEndpointGroup, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.requestId); + return writer; + }; + + /** + * Encodes the specified CreateMirroringEndpointGroupRequest message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.CreateMirroringEndpointGroupRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.networksecurity.v1.CreateMirroringEndpointGroupRequest + * @static + * @param {google.cloud.networksecurity.v1.ICreateMirroringEndpointGroupRequest} message CreateMirroringEndpointGroupRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateMirroringEndpointGroupRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateMirroringEndpointGroupRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.networksecurity.v1.CreateMirroringEndpointGroupRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.networksecurity.v1.CreateMirroringEndpointGroupRequest} CreateMirroringEndpointGroupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateMirroringEndpointGroupRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networksecurity.v1.CreateMirroringEndpointGroupRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.mirroringEndpointGroupId = reader.string(); + break; + } + case 3: { + message.mirroringEndpointGroup = $root.google.cloud.networksecurity.v1.MirroringEndpointGroup.decode(reader, reader.uint32()); + break; + } + case 4: { + message.requestId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateMirroringEndpointGroupRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.networksecurity.v1.CreateMirroringEndpointGroupRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.networksecurity.v1.CreateMirroringEndpointGroupRequest} CreateMirroringEndpointGroupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateMirroringEndpointGroupRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateMirroringEndpointGroupRequest message. + * @function verify + * @memberof google.cloud.networksecurity.v1.CreateMirroringEndpointGroupRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateMirroringEndpointGroupRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.mirroringEndpointGroupId != null && message.hasOwnProperty("mirroringEndpointGroupId")) + if (!$util.isString(message.mirroringEndpointGroupId)) + return "mirroringEndpointGroupId: string expected"; + if (message.mirroringEndpointGroup != null && message.hasOwnProperty("mirroringEndpointGroup")) { + var error = $root.google.cloud.networksecurity.v1.MirroringEndpointGroup.verify(message.mirroringEndpointGroup); + if (error) + return "mirroringEndpointGroup." + error; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + return null; + }; + + /** + * Creates a CreateMirroringEndpointGroupRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.networksecurity.v1.CreateMirroringEndpointGroupRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.networksecurity.v1.CreateMirroringEndpointGroupRequest} CreateMirroringEndpointGroupRequest + */ + CreateMirroringEndpointGroupRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networksecurity.v1.CreateMirroringEndpointGroupRequest) + return object; + var message = new $root.google.cloud.networksecurity.v1.CreateMirroringEndpointGroupRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.mirroringEndpointGroupId != null) + message.mirroringEndpointGroupId = String(object.mirroringEndpointGroupId); + if (object.mirroringEndpointGroup != null) { + if (typeof object.mirroringEndpointGroup !== "object") + throw TypeError(".google.cloud.networksecurity.v1.CreateMirroringEndpointGroupRequest.mirroringEndpointGroup: object expected"); + message.mirroringEndpointGroup = $root.google.cloud.networksecurity.v1.MirroringEndpointGroup.fromObject(object.mirroringEndpointGroup); + } + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from a CreateMirroringEndpointGroupRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.networksecurity.v1.CreateMirroringEndpointGroupRequest + * @static + * @param {google.cloud.networksecurity.v1.CreateMirroringEndpointGroupRequest} message CreateMirroringEndpointGroupRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateMirroringEndpointGroupRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.mirroringEndpointGroupId = ""; + object.mirroringEndpointGroup = null; + object.requestId = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.mirroringEndpointGroupId != null && message.hasOwnProperty("mirroringEndpointGroupId")) + object.mirroringEndpointGroupId = message.mirroringEndpointGroupId; + if (message.mirroringEndpointGroup != null && message.hasOwnProperty("mirroringEndpointGroup")) + object.mirroringEndpointGroup = $root.google.cloud.networksecurity.v1.MirroringEndpointGroup.toObject(message.mirroringEndpointGroup, options); + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + return object; + }; + + /** + * Converts this CreateMirroringEndpointGroupRequest to JSON. + * @function toJSON + * @memberof google.cloud.networksecurity.v1.CreateMirroringEndpointGroupRequest + * @instance + * @returns {Object.} JSON object + */ + CreateMirroringEndpointGroupRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateMirroringEndpointGroupRequest + * @function getTypeUrl + * @memberof google.cloud.networksecurity.v1.CreateMirroringEndpointGroupRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateMirroringEndpointGroupRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.networksecurity.v1.CreateMirroringEndpointGroupRequest"; + }; + + return CreateMirroringEndpointGroupRequest; + })(); + + v1.UpdateMirroringEndpointGroupRequest = (function() { + + /** + * Properties of an UpdateMirroringEndpointGroupRequest. + * @memberof google.cloud.networksecurity.v1 + * @interface IUpdateMirroringEndpointGroupRequest + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateMirroringEndpointGroupRequest updateMask + * @property {google.cloud.networksecurity.v1.IMirroringEndpointGroup|null} [mirroringEndpointGroup] UpdateMirroringEndpointGroupRequest mirroringEndpointGroup + * @property {string|null} [requestId] UpdateMirroringEndpointGroupRequest requestId + */ + + /** + * Constructs a new UpdateMirroringEndpointGroupRequest. + * @memberof google.cloud.networksecurity.v1 + * @classdesc Represents an UpdateMirroringEndpointGroupRequest. + * @implements IUpdateMirroringEndpointGroupRequest + * @constructor + * @param {google.cloud.networksecurity.v1.IUpdateMirroringEndpointGroupRequest=} [properties] Properties to set + */ + function UpdateMirroringEndpointGroupRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateMirroringEndpointGroupRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.networksecurity.v1.UpdateMirroringEndpointGroupRequest + * @instance + */ + UpdateMirroringEndpointGroupRequest.prototype.updateMask = null; + + /** + * UpdateMirroringEndpointGroupRequest mirroringEndpointGroup. + * @member {google.cloud.networksecurity.v1.IMirroringEndpointGroup|null|undefined} mirroringEndpointGroup + * @memberof google.cloud.networksecurity.v1.UpdateMirroringEndpointGroupRequest + * @instance + */ + UpdateMirroringEndpointGroupRequest.prototype.mirroringEndpointGroup = null; + + /** + * UpdateMirroringEndpointGroupRequest requestId. + * @member {string} requestId + * @memberof google.cloud.networksecurity.v1.UpdateMirroringEndpointGroupRequest + * @instance + */ + UpdateMirroringEndpointGroupRequest.prototype.requestId = ""; + + /** + * Creates a new UpdateMirroringEndpointGroupRequest instance using the specified properties. + * @function create + * @memberof google.cloud.networksecurity.v1.UpdateMirroringEndpointGroupRequest + * @static + * @param {google.cloud.networksecurity.v1.IUpdateMirroringEndpointGroupRequest=} [properties] Properties to set + * @returns {google.cloud.networksecurity.v1.UpdateMirroringEndpointGroupRequest} UpdateMirroringEndpointGroupRequest instance + */ + UpdateMirroringEndpointGroupRequest.create = function create(properties) { + return new UpdateMirroringEndpointGroupRequest(properties); + }; + + /** + * Encodes the specified UpdateMirroringEndpointGroupRequest message. Does not implicitly {@link google.cloud.networksecurity.v1.UpdateMirroringEndpointGroupRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.networksecurity.v1.UpdateMirroringEndpointGroupRequest + * @static + * @param {google.cloud.networksecurity.v1.IUpdateMirroringEndpointGroupRequest} message UpdateMirroringEndpointGroupRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateMirroringEndpointGroupRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.mirroringEndpointGroup != null && Object.hasOwnProperty.call(message, "mirroringEndpointGroup")) + $root.google.cloud.networksecurity.v1.MirroringEndpointGroup.encode(message.mirroringEndpointGroup, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.requestId); + return writer; + }; + + /** + * Encodes the specified UpdateMirroringEndpointGroupRequest message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.UpdateMirroringEndpointGroupRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.networksecurity.v1.UpdateMirroringEndpointGroupRequest + * @static + * @param {google.cloud.networksecurity.v1.IUpdateMirroringEndpointGroupRequest} message UpdateMirroringEndpointGroupRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateMirroringEndpointGroupRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateMirroringEndpointGroupRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.networksecurity.v1.UpdateMirroringEndpointGroupRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.networksecurity.v1.UpdateMirroringEndpointGroupRequest} UpdateMirroringEndpointGroupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateMirroringEndpointGroupRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networksecurity.v1.UpdateMirroringEndpointGroupRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + case 2: { + message.mirroringEndpointGroup = $root.google.cloud.networksecurity.v1.MirroringEndpointGroup.decode(reader, reader.uint32()); + break; + } + case 3: { + message.requestId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateMirroringEndpointGroupRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.networksecurity.v1.UpdateMirroringEndpointGroupRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.networksecurity.v1.UpdateMirroringEndpointGroupRequest} UpdateMirroringEndpointGroupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateMirroringEndpointGroupRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateMirroringEndpointGroupRequest message. + * @function verify + * @memberof google.cloud.networksecurity.v1.UpdateMirroringEndpointGroupRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateMirroringEndpointGroupRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + if (message.mirroringEndpointGroup != null && message.hasOwnProperty("mirroringEndpointGroup")) { + var error = $root.google.cloud.networksecurity.v1.MirroringEndpointGroup.verify(message.mirroringEndpointGroup); + if (error) + return "mirroringEndpointGroup." + error; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + return null; + }; + + /** + * Creates an UpdateMirroringEndpointGroupRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.networksecurity.v1.UpdateMirroringEndpointGroupRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.networksecurity.v1.UpdateMirroringEndpointGroupRequest} UpdateMirroringEndpointGroupRequest + */ + UpdateMirroringEndpointGroupRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networksecurity.v1.UpdateMirroringEndpointGroupRequest) + return object; + var message = new $root.google.cloud.networksecurity.v1.UpdateMirroringEndpointGroupRequest(); + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.networksecurity.v1.UpdateMirroringEndpointGroupRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + if (object.mirroringEndpointGroup != null) { + if (typeof object.mirroringEndpointGroup !== "object") + throw TypeError(".google.cloud.networksecurity.v1.UpdateMirroringEndpointGroupRequest.mirroringEndpointGroup: object expected"); + message.mirroringEndpointGroup = $root.google.cloud.networksecurity.v1.MirroringEndpointGroup.fromObject(object.mirroringEndpointGroup); + } + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from an UpdateMirroringEndpointGroupRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.networksecurity.v1.UpdateMirroringEndpointGroupRequest + * @static + * @param {google.cloud.networksecurity.v1.UpdateMirroringEndpointGroupRequest} message UpdateMirroringEndpointGroupRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateMirroringEndpointGroupRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.updateMask = null; + object.mirroringEndpointGroup = null; + object.requestId = ""; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + if (message.mirroringEndpointGroup != null && message.hasOwnProperty("mirroringEndpointGroup")) + object.mirroringEndpointGroup = $root.google.cloud.networksecurity.v1.MirroringEndpointGroup.toObject(message.mirroringEndpointGroup, options); + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + return object; + }; + + /** + * Converts this UpdateMirroringEndpointGroupRequest to JSON. + * @function toJSON + * @memberof google.cloud.networksecurity.v1.UpdateMirroringEndpointGroupRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateMirroringEndpointGroupRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateMirroringEndpointGroupRequest + * @function getTypeUrl + * @memberof google.cloud.networksecurity.v1.UpdateMirroringEndpointGroupRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateMirroringEndpointGroupRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.networksecurity.v1.UpdateMirroringEndpointGroupRequest"; + }; + + return UpdateMirroringEndpointGroupRequest; + })(); + + v1.DeleteMirroringEndpointGroupRequest = (function() { + + /** + * Properties of a DeleteMirroringEndpointGroupRequest. + * @memberof google.cloud.networksecurity.v1 + * @interface IDeleteMirroringEndpointGroupRequest + * @property {string|null} [name] DeleteMirroringEndpointGroupRequest name + * @property {string|null} [requestId] DeleteMirroringEndpointGroupRequest requestId + */ + + /** + * Constructs a new DeleteMirroringEndpointGroupRequest. + * @memberof google.cloud.networksecurity.v1 + * @classdesc Represents a DeleteMirroringEndpointGroupRequest. + * @implements IDeleteMirroringEndpointGroupRequest + * @constructor + * @param {google.cloud.networksecurity.v1.IDeleteMirroringEndpointGroupRequest=} [properties] Properties to set + */ + function DeleteMirroringEndpointGroupRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteMirroringEndpointGroupRequest name. + * @member {string} name + * @memberof google.cloud.networksecurity.v1.DeleteMirroringEndpointGroupRequest + * @instance + */ + DeleteMirroringEndpointGroupRequest.prototype.name = ""; + + /** + * DeleteMirroringEndpointGroupRequest requestId. + * @member {string} requestId + * @memberof google.cloud.networksecurity.v1.DeleteMirroringEndpointGroupRequest + * @instance + */ + DeleteMirroringEndpointGroupRequest.prototype.requestId = ""; + + /** + * Creates a new DeleteMirroringEndpointGroupRequest instance using the specified properties. + * @function create + * @memberof google.cloud.networksecurity.v1.DeleteMirroringEndpointGroupRequest + * @static + * @param {google.cloud.networksecurity.v1.IDeleteMirroringEndpointGroupRequest=} [properties] Properties to set + * @returns {google.cloud.networksecurity.v1.DeleteMirroringEndpointGroupRequest} DeleteMirroringEndpointGroupRequest instance + */ + DeleteMirroringEndpointGroupRequest.create = function create(properties) { + return new DeleteMirroringEndpointGroupRequest(properties); + }; + + /** + * Encodes the specified DeleteMirroringEndpointGroupRequest message. Does not implicitly {@link google.cloud.networksecurity.v1.DeleteMirroringEndpointGroupRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.networksecurity.v1.DeleteMirroringEndpointGroupRequest + * @static + * @param {google.cloud.networksecurity.v1.IDeleteMirroringEndpointGroupRequest} message DeleteMirroringEndpointGroupRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteMirroringEndpointGroupRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.requestId); + return writer; + }; + + /** + * Encodes the specified DeleteMirroringEndpointGroupRequest message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.DeleteMirroringEndpointGroupRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.networksecurity.v1.DeleteMirroringEndpointGroupRequest + * @static + * @param {google.cloud.networksecurity.v1.IDeleteMirroringEndpointGroupRequest} message DeleteMirroringEndpointGroupRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteMirroringEndpointGroupRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteMirroringEndpointGroupRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.networksecurity.v1.DeleteMirroringEndpointGroupRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.networksecurity.v1.DeleteMirroringEndpointGroupRequest} DeleteMirroringEndpointGroupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteMirroringEndpointGroupRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networksecurity.v1.DeleteMirroringEndpointGroupRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.requestId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteMirroringEndpointGroupRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.networksecurity.v1.DeleteMirroringEndpointGroupRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.networksecurity.v1.DeleteMirroringEndpointGroupRequest} DeleteMirroringEndpointGroupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteMirroringEndpointGroupRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteMirroringEndpointGroupRequest message. + * @function verify + * @memberof google.cloud.networksecurity.v1.DeleteMirroringEndpointGroupRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteMirroringEndpointGroupRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + return null; + }; + + /** + * Creates a DeleteMirroringEndpointGroupRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.networksecurity.v1.DeleteMirroringEndpointGroupRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.networksecurity.v1.DeleteMirroringEndpointGroupRequest} DeleteMirroringEndpointGroupRequest + */ + DeleteMirroringEndpointGroupRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networksecurity.v1.DeleteMirroringEndpointGroupRequest) + return object; + var message = new $root.google.cloud.networksecurity.v1.DeleteMirroringEndpointGroupRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from a DeleteMirroringEndpointGroupRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.networksecurity.v1.DeleteMirroringEndpointGroupRequest + * @static + * @param {google.cloud.networksecurity.v1.DeleteMirroringEndpointGroupRequest} message DeleteMirroringEndpointGroupRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteMirroringEndpointGroupRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.requestId = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + return object; + }; + + /** + * Converts this DeleteMirroringEndpointGroupRequest to JSON. + * @function toJSON + * @memberof google.cloud.networksecurity.v1.DeleteMirroringEndpointGroupRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteMirroringEndpointGroupRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteMirroringEndpointGroupRequest + * @function getTypeUrl + * @memberof google.cloud.networksecurity.v1.DeleteMirroringEndpointGroupRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteMirroringEndpointGroupRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.networksecurity.v1.DeleteMirroringEndpointGroupRequest"; + }; + + return DeleteMirroringEndpointGroupRequest; + })(); + + v1.MirroringEndpointGroupAssociation = (function() { + + /** + * Properties of a MirroringEndpointGroupAssociation. + * @memberof google.cloud.networksecurity.v1 + * @interface IMirroringEndpointGroupAssociation + * @property {string|null} [name] MirroringEndpointGroupAssociation name + * @property {google.protobuf.ITimestamp|null} [createTime] MirroringEndpointGroupAssociation createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] MirroringEndpointGroupAssociation updateTime + * @property {Object.|null} [labels] MirroringEndpointGroupAssociation labels + * @property {string|null} [mirroringEndpointGroup] MirroringEndpointGroupAssociation mirroringEndpointGroup + * @property {string|null} [network] MirroringEndpointGroupAssociation network + * @property {Array.|null} [locationsDetails] MirroringEndpointGroupAssociation locationsDetails + * @property {google.cloud.networksecurity.v1.MirroringEndpointGroupAssociation.State|null} [state] MirroringEndpointGroupAssociation state + * @property {boolean|null} [reconciling] MirroringEndpointGroupAssociation reconciling + * @property {Array.|null} [locations] MirroringEndpointGroupAssociation locations + */ + + /** + * Constructs a new MirroringEndpointGroupAssociation. + * @memberof google.cloud.networksecurity.v1 + * @classdesc Represents a MirroringEndpointGroupAssociation. + * @implements IMirroringEndpointGroupAssociation + * @constructor + * @param {google.cloud.networksecurity.v1.IMirroringEndpointGroupAssociation=} [properties] Properties to set + */ + function MirroringEndpointGroupAssociation(properties) { + this.labels = {}; + this.locationsDetails = []; + this.locations = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MirroringEndpointGroupAssociation name. + * @member {string} name + * @memberof google.cloud.networksecurity.v1.MirroringEndpointGroupAssociation + * @instance + */ + MirroringEndpointGroupAssociation.prototype.name = ""; + + /** + * MirroringEndpointGroupAssociation createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.networksecurity.v1.MirroringEndpointGroupAssociation + * @instance + */ + MirroringEndpointGroupAssociation.prototype.createTime = null; + + /** + * MirroringEndpointGroupAssociation updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.networksecurity.v1.MirroringEndpointGroupAssociation + * @instance + */ + MirroringEndpointGroupAssociation.prototype.updateTime = null; + + /** + * MirroringEndpointGroupAssociation labels. + * @member {Object.} labels + * @memberof google.cloud.networksecurity.v1.MirroringEndpointGroupAssociation + * @instance + */ + MirroringEndpointGroupAssociation.prototype.labels = $util.emptyObject; + + /** + * MirroringEndpointGroupAssociation mirroringEndpointGroup. + * @member {string} mirroringEndpointGroup + * @memberof google.cloud.networksecurity.v1.MirroringEndpointGroupAssociation + * @instance + */ + MirroringEndpointGroupAssociation.prototype.mirroringEndpointGroup = ""; + + /** + * MirroringEndpointGroupAssociation network. + * @member {string} network + * @memberof google.cloud.networksecurity.v1.MirroringEndpointGroupAssociation + * @instance + */ + MirroringEndpointGroupAssociation.prototype.network = ""; + + /** + * MirroringEndpointGroupAssociation locationsDetails. + * @member {Array.} locationsDetails + * @memberof google.cloud.networksecurity.v1.MirroringEndpointGroupAssociation + * @instance + */ + MirroringEndpointGroupAssociation.prototype.locationsDetails = $util.emptyArray; + + /** + * MirroringEndpointGroupAssociation state. + * @member {google.cloud.networksecurity.v1.MirroringEndpointGroupAssociation.State} state + * @memberof google.cloud.networksecurity.v1.MirroringEndpointGroupAssociation + * @instance + */ + MirroringEndpointGroupAssociation.prototype.state = 0; + + /** + * MirroringEndpointGroupAssociation reconciling. + * @member {boolean} reconciling + * @memberof google.cloud.networksecurity.v1.MirroringEndpointGroupAssociation + * @instance + */ + MirroringEndpointGroupAssociation.prototype.reconciling = false; + + /** + * MirroringEndpointGroupAssociation locations. + * @member {Array.} locations + * @memberof google.cloud.networksecurity.v1.MirroringEndpointGroupAssociation + * @instance + */ + MirroringEndpointGroupAssociation.prototype.locations = $util.emptyArray; + + /** + * Creates a new MirroringEndpointGroupAssociation instance using the specified properties. + * @function create + * @memberof google.cloud.networksecurity.v1.MirroringEndpointGroupAssociation + * @static + * @param {google.cloud.networksecurity.v1.IMirroringEndpointGroupAssociation=} [properties] Properties to set + * @returns {google.cloud.networksecurity.v1.MirroringEndpointGroupAssociation} MirroringEndpointGroupAssociation instance + */ + MirroringEndpointGroupAssociation.create = function create(properties) { + return new MirroringEndpointGroupAssociation(properties); + }; + + /** + * Encodes the specified MirroringEndpointGroupAssociation message. Does not implicitly {@link google.cloud.networksecurity.v1.MirroringEndpointGroupAssociation.verify|verify} messages. + * @function encode + * @memberof google.cloud.networksecurity.v1.MirroringEndpointGroupAssociation + * @static + * @param {google.cloud.networksecurity.v1.IMirroringEndpointGroupAssociation} message MirroringEndpointGroupAssociation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MirroringEndpointGroupAssociation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) + for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) + writer.uint32(/* id 4, wireType 2 =*/34).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); + if (message.mirroringEndpointGroup != null && Object.hasOwnProperty.call(message, "mirroringEndpointGroup")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.mirroringEndpointGroup); + if (message.network != null && Object.hasOwnProperty.call(message, "network")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.network); + if (message.locationsDetails != null && message.locationsDetails.length) + for (var i = 0; i < message.locationsDetails.length; ++i) + $root.google.cloud.networksecurity.v1.MirroringEndpointGroupAssociation.LocationDetails.encode(message.locationsDetails[i], writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 8, wireType 0 =*/64).int32(message.state); + if (message.reconciling != null && Object.hasOwnProperty.call(message, "reconciling")) + writer.uint32(/* id 9, wireType 0 =*/72).bool(message.reconciling); + if (message.locations != null && message.locations.length) + for (var i = 0; i < message.locations.length; ++i) + $root.google.cloud.networksecurity.v1.MirroringLocation.encode(message.locations[i], writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified MirroringEndpointGroupAssociation message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.MirroringEndpointGroupAssociation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.networksecurity.v1.MirroringEndpointGroupAssociation + * @static + * @param {google.cloud.networksecurity.v1.IMirroringEndpointGroupAssociation} message MirroringEndpointGroupAssociation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MirroringEndpointGroupAssociation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MirroringEndpointGroupAssociation message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.networksecurity.v1.MirroringEndpointGroupAssociation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.networksecurity.v1.MirroringEndpointGroupAssociation} MirroringEndpointGroupAssociation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MirroringEndpointGroupAssociation.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networksecurity.v1.MirroringEndpointGroupAssociation(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 3: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 4: { + if (message.labels === $util.emptyObject) + message.labels = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.labels[key] = value; + break; + } + case 5: { + message.mirroringEndpointGroup = reader.string(); + break; + } + case 6: { + message.network = reader.string(); + break; + } + case 7: { + if (!(message.locationsDetails && message.locationsDetails.length)) + message.locationsDetails = []; + message.locationsDetails.push($root.google.cloud.networksecurity.v1.MirroringEndpointGroupAssociation.LocationDetails.decode(reader, reader.uint32())); + break; + } + case 8: { + message.state = reader.int32(); + break; + } + case 9: { + message.reconciling = reader.bool(); + break; + } + case 10: { + if (!(message.locations && message.locations.length)) + message.locations = []; + message.locations.push($root.google.cloud.networksecurity.v1.MirroringLocation.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MirroringEndpointGroupAssociation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.networksecurity.v1.MirroringEndpointGroupAssociation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.networksecurity.v1.MirroringEndpointGroupAssociation} MirroringEndpointGroupAssociation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MirroringEndpointGroupAssociation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MirroringEndpointGroupAssociation message. + * @function verify + * @memberof google.cloud.networksecurity.v1.MirroringEndpointGroupAssociation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MirroringEndpointGroupAssociation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime); + if (error) + return "updateTime." + error; + } + if (message.labels != null && message.hasOwnProperty("labels")) { + if (!$util.isObject(message.labels)) + return "labels: object expected"; + var key = Object.keys(message.labels); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.labels[key[i]])) + return "labels: string{k:string} expected"; + } + if (message.mirroringEndpointGroup != null && message.hasOwnProperty("mirroringEndpointGroup")) + if (!$util.isString(message.mirroringEndpointGroup)) + return "mirroringEndpointGroup: string expected"; + if (message.network != null && message.hasOwnProperty("network")) + if (!$util.isString(message.network)) + return "network: string expected"; + if (message.locationsDetails != null && message.hasOwnProperty("locationsDetails")) { + if (!Array.isArray(message.locationsDetails)) + return "locationsDetails: array expected"; + for (var i = 0; i < message.locationsDetails.length; ++i) { + var error = $root.google.cloud.networksecurity.v1.MirroringEndpointGroupAssociation.LocationDetails.verify(message.locationsDetails[i]); + if (error) + return "locationsDetails." + error; + } + } + if (message.state != null && message.hasOwnProperty("state")) + switch (message.state) { + default: + return "state: enum value expected"; + case 0: + case 1: + case 3: + case 4: + case 5: + case 6: + case 7: + break; + } + if (message.reconciling != null && message.hasOwnProperty("reconciling")) + if (typeof message.reconciling !== "boolean") + return "reconciling: boolean expected"; + if (message.locations != null && message.hasOwnProperty("locations")) { + if (!Array.isArray(message.locations)) + return "locations: array expected"; + for (var i = 0; i < message.locations.length; ++i) { + var error = $root.google.cloud.networksecurity.v1.MirroringLocation.verify(message.locations[i]); + if (error) + return "locations." + error; + } + } + return null; + }; + + /** + * Creates a MirroringEndpointGroupAssociation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.networksecurity.v1.MirroringEndpointGroupAssociation + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.networksecurity.v1.MirroringEndpointGroupAssociation} MirroringEndpointGroupAssociation + */ + MirroringEndpointGroupAssociation.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networksecurity.v1.MirroringEndpointGroupAssociation) + return object; + var message = new $root.google.cloud.networksecurity.v1.MirroringEndpointGroupAssociation(); + if (object.name != null) + message.name = String(object.name); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.networksecurity.v1.MirroringEndpointGroupAssociation.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.updateTime != null) { + if (typeof object.updateTime !== "object") + throw TypeError(".google.cloud.networksecurity.v1.MirroringEndpointGroupAssociation.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.cloud.networksecurity.v1.MirroringEndpointGroupAssociation.labels: object expected"); + message.labels = {}; + for (var keys = Object.keys(object.labels), i = 0; i < keys.length; ++i) + message.labels[keys[i]] = String(object.labels[keys[i]]); + } + if (object.mirroringEndpointGroup != null) + message.mirroringEndpointGroup = String(object.mirroringEndpointGroup); + if (object.network != null) + message.network = String(object.network); + if (object.locationsDetails) { + if (!Array.isArray(object.locationsDetails)) + throw TypeError(".google.cloud.networksecurity.v1.MirroringEndpointGroupAssociation.locationsDetails: array expected"); + message.locationsDetails = []; + for (var i = 0; i < object.locationsDetails.length; ++i) { + if (typeof object.locationsDetails[i] !== "object") + throw TypeError(".google.cloud.networksecurity.v1.MirroringEndpointGroupAssociation.locationsDetails: object expected"); + message.locationsDetails[i] = $root.google.cloud.networksecurity.v1.MirroringEndpointGroupAssociation.LocationDetails.fromObject(object.locationsDetails[i]); + } + } + switch (object.state) { + default: + if (typeof object.state === "number") { + message.state = object.state; + break; + } + break; + case "STATE_UNSPECIFIED": + case 0: + message.state = 0; + break; + case "ACTIVE": + case 1: + message.state = 1; + break; + case "CREATING": + case 3: + message.state = 3; + break; + case "DELETING": + case 4: + message.state = 4; + break; + case "CLOSED": + case 5: + message.state = 5; + break; + case "OUT_OF_SYNC": + case 6: + message.state = 6; + break; + case "DELETE_FAILED": + case 7: + message.state = 7; + break; + } + if (object.reconciling != null) + message.reconciling = Boolean(object.reconciling); + if (object.locations) { + if (!Array.isArray(object.locations)) + throw TypeError(".google.cloud.networksecurity.v1.MirroringEndpointGroupAssociation.locations: array expected"); + message.locations = []; + for (var i = 0; i < object.locations.length; ++i) { + if (typeof object.locations[i] !== "object") + throw TypeError(".google.cloud.networksecurity.v1.MirroringEndpointGroupAssociation.locations: object expected"); + message.locations[i] = $root.google.cloud.networksecurity.v1.MirroringLocation.fromObject(object.locations[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a MirroringEndpointGroupAssociation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.networksecurity.v1.MirroringEndpointGroupAssociation + * @static + * @param {google.cloud.networksecurity.v1.MirroringEndpointGroupAssociation} message MirroringEndpointGroupAssociation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MirroringEndpointGroupAssociation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.locationsDetails = []; + object.locations = []; + } + if (options.objects || options.defaults) + object.labels = {}; + if (options.defaults) { + object.name = ""; + object.createTime = null; + object.updateTime = null; + object.mirroringEndpointGroup = ""; + object.network = ""; + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + object.reconciling = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.updateTime != null && message.hasOwnProperty("updateTime")) + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); + var keys2; + if (message.labels && (keys2 = Object.keys(message.labels)).length) { + object.labels = {}; + for (var j = 0; j < keys2.length; ++j) + object.labels[keys2[j]] = message.labels[keys2[j]]; + } + if (message.mirroringEndpointGroup != null && message.hasOwnProperty("mirroringEndpointGroup")) + object.mirroringEndpointGroup = message.mirroringEndpointGroup; + if (message.network != null && message.hasOwnProperty("network")) + object.network = message.network; + if (message.locationsDetails && message.locationsDetails.length) { + object.locationsDetails = []; + for (var j = 0; j < message.locationsDetails.length; ++j) + object.locationsDetails[j] = $root.google.cloud.networksecurity.v1.MirroringEndpointGroupAssociation.LocationDetails.toObject(message.locationsDetails[j], options); + } + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.networksecurity.v1.MirroringEndpointGroupAssociation.State[message.state] === undefined ? message.state : $root.google.cloud.networksecurity.v1.MirroringEndpointGroupAssociation.State[message.state] : message.state; + if (message.reconciling != null && message.hasOwnProperty("reconciling")) + object.reconciling = message.reconciling; + if (message.locations && message.locations.length) { + object.locations = []; + for (var j = 0; j < message.locations.length; ++j) + object.locations[j] = $root.google.cloud.networksecurity.v1.MirroringLocation.toObject(message.locations[j], options); + } + return object; + }; + + /** + * Converts this MirroringEndpointGroupAssociation to JSON. + * @function toJSON + * @memberof google.cloud.networksecurity.v1.MirroringEndpointGroupAssociation + * @instance + * @returns {Object.} JSON object + */ + MirroringEndpointGroupAssociation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MirroringEndpointGroupAssociation + * @function getTypeUrl + * @memberof google.cloud.networksecurity.v1.MirroringEndpointGroupAssociation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MirroringEndpointGroupAssociation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.networksecurity.v1.MirroringEndpointGroupAssociation"; + }; + + MirroringEndpointGroupAssociation.LocationDetails = (function() { + + /** + * Properties of a LocationDetails. + * @memberof google.cloud.networksecurity.v1.MirroringEndpointGroupAssociation + * @interface ILocationDetails + * @property {string|null} [location] LocationDetails location + * @property {google.cloud.networksecurity.v1.MirroringEndpointGroupAssociation.LocationDetails.State|null} [state] LocationDetails state + */ + + /** + * Constructs a new LocationDetails. + * @memberof google.cloud.networksecurity.v1.MirroringEndpointGroupAssociation + * @classdesc Represents a LocationDetails. + * @implements ILocationDetails + * @constructor + * @param {google.cloud.networksecurity.v1.MirroringEndpointGroupAssociation.ILocationDetails=} [properties] Properties to set + */ + function LocationDetails(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * LocationDetails location. + * @member {string} location + * @memberof google.cloud.networksecurity.v1.MirroringEndpointGroupAssociation.LocationDetails + * @instance + */ + LocationDetails.prototype.location = ""; + + /** + * LocationDetails state. + * @member {google.cloud.networksecurity.v1.MirroringEndpointGroupAssociation.LocationDetails.State} state + * @memberof google.cloud.networksecurity.v1.MirroringEndpointGroupAssociation.LocationDetails + * @instance + */ + LocationDetails.prototype.state = 0; + + /** + * Creates a new LocationDetails instance using the specified properties. + * @function create + * @memberof google.cloud.networksecurity.v1.MirroringEndpointGroupAssociation.LocationDetails + * @static + * @param {google.cloud.networksecurity.v1.MirroringEndpointGroupAssociation.ILocationDetails=} [properties] Properties to set + * @returns {google.cloud.networksecurity.v1.MirroringEndpointGroupAssociation.LocationDetails} LocationDetails instance + */ + LocationDetails.create = function create(properties) { + return new LocationDetails(properties); + }; + + /** + * Encodes the specified LocationDetails message. Does not implicitly {@link google.cloud.networksecurity.v1.MirroringEndpointGroupAssociation.LocationDetails.verify|verify} messages. + * @function encode + * @memberof google.cloud.networksecurity.v1.MirroringEndpointGroupAssociation.LocationDetails + * @static + * @param {google.cloud.networksecurity.v1.MirroringEndpointGroupAssociation.ILocationDetails} message LocationDetails message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LocationDetails.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.location != null && Object.hasOwnProperty.call(message, "location")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.location); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.state); + return writer; + }; + + /** + * Encodes the specified LocationDetails message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.MirroringEndpointGroupAssociation.LocationDetails.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.networksecurity.v1.MirroringEndpointGroupAssociation.LocationDetails + * @static + * @param {google.cloud.networksecurity.v1.MirroringEndpointGroupAssociation.ILocationDetails} message LocationDetails message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LocationDetails.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a LocationDetails message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.networksecurity.v1.MirroringEndpointGroupAssociation.LocationDetails + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.networksecurity.v1.MirroringEndpointGroupAssociation.LocationDetails} LocationDetails + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LocationDetails.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networksecurity.v1.MirroringEndpointGroupAssociation.LocationDetails(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.location = reader.string(); + break; + } + case 2: { + message.state = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a LocationDetails message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.networksecurity.v1.MirroringEndpointGroupAssociation.LocationDetails + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.networksecurity.v1.MirroringEndpointGroupAssociation.LocationDetails} LocationDetails + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LocationDetails.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a LocationDetails message. + * @function verify + * @memberof google.cloud.networksecurity.v1.MirroringEndpointGroupAssociation.LocationDetails + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LocationDetails.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.location != null && message.hasOwnProperty("location")) + if (!$util.isString(message.location)) + return "location: string expected"; + if (message.state != null && message.hasOwnProperty("state")) + switch (message.state) { + default: + return "state: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates a LocationDetails message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.networksecurity.v1.MirroringEndpointGroupAssociation.LocationDetails + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.networksecurity.v1.MirroringEndpointGroupAssociation.LocationDetails} LocationDetails + */ + LocationDetails.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networksecurity.v1.MirroringEndpointGroupAssociation.LocationDetails) + return object; + var message = new $root.google.cloud.networksecurity.v1.MirroringEndpointGroupAssociation.LocationDetails(); + if (object.location != null) + message.location = String(object.location); + switch (object.state) { + default: + if (typeof object.state === "number") { + message.state = object.state; + break; + } + break; + case "STATE_UNSPECIFIED": + case 0: + message.state = 0; + break; + case "ACTIVE": + case 1: + message.state = 1; + break; + case "OUT_OF_SYNC": + case 2: + message.state = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from a LocationDetails message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.networksecurity.v1.MirroringEndpointGroupAssociation.LocationDetails + * @static + * @param {google.cloud.networksecurity.v1.MirroringEndpointGroupAssociation.LocationDetails} message LocationDetails + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LocationDetails.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.location = ""; + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + } + if (message.location != null && message.hasOwnProperty("location")) + object.location = message.location; + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.networksecurity.v1.MirroringEndpointGroupAssociation.LocationDetails.State[message.state] === undefined ? message.state : $root.google.cloud.networksecurity.v1.MirroringEndpointGroupAssociation.LocationDetails.State[message.state] : message.state; + return object; + }; + + /** + * Converts this LocationDetails to JSON. + * @function toJSON + * @memberof google.cloud.networksecurity.v1.MirroringEndpointGroupAssociation.LocationDetails + * @instance + * @returns {Object.} JSON object + */ + LocationDetails.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for LocationDetails + * @function getTypeUrl + * @memberof google.cloud.networksecurity.v1.MirroringEndpointGroupAssociation.LocationDetails + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + LocationDetails.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.networksecurity.v1.MirroringEndpointGroupAssociation.LocationDetails"; + }; + + /** + * State enum. + * @name google.cloud.networksecurity.v1.MirroringEndpointGroupAssociation.LocationDetails.State + * @enum {number} + * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value + * @property {number} ACTIVE=1 ACTIVE value + * @property {number} OUT_OF_SYNC=2 OUT_OF_SYNC value + */ + LocationDetails.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "ACTIVE"] = 1; + values[valuesById[2] = "OUT_OF_SYNC"] = 2; + return values; + })(); + + return LocationDetails; + })(); + + /** + * State enum. + * @name google.cloud.networksecurity.v1.MirroringEndpointGroupAssociation.State + * @enum {number} + * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value + * @property {number} ACTIVE=1 ACTIVE value + * @property {number} CREATING=3 CREATING value + * @property {number} DELETING=4 DELETING value + * @property {number} CLOSED=5 CLOSED value + * @property {number} OUT_OF_SYNC=6 OUT_OF_SYNC value + * @property {number} DELETE_FAILED=7 DELETE_FAILED value + */ + MirroringEndpointGroupAssociation.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "ACTIVE"] = 1; + values[valuesById[3] = "CREATING"] = 3; + values[valuesById[4] = "DELETING"] = 4; + values[valuesById[5] = "CLOSED"] = 5; + values[valuesById[6] = "OUT_OF_SYNC"] = 6; + values[valuesById[7] = "DELETE_FAILED"] = 7; + return values; + })(); + + return MirroringEndpointGroupAssociation; + })(); + + v1.ListMirroringEndpointGroupAssociationsRequest = (function() { + + /** + * Properties of a ListMirroringEndpointGroupAssociationsRequest. + * @memberof google.cloud.networksecurity.v1 + * @interface IListMirroringEndpointGroupAssociationsRequest + * @property {string|null} [parent] ListMirroringEndpointGroupAssociationsRequest parent + * @property {number|null} [pageSize] ListMirroringEndpointGroupAssociationsRequest pageSize + * @property {string|null} [pageToken] ListMirroringEndpointGroupAssociationsRequest pageToken + * @property {string|null} [filter] ListMirroringEndpointGroupAssociationsRequest filter + * @property {string|null} [orderBy] ListMirroringEndpointGroupAssociationsRequest orderBy + */ + + /** + * Constructs a new ListMirroringEndpointGroupAssociationsRequest. + * @memberof google.cloud.networksecurity.v1 + * @classdesc Represents a ListMirroringEndpointGroupAssociationsRequest. + * @implements IListMirroringEndpointGroupAssociationsRequest + * @constructor + * @param {google.cloud.networksecurity.v1.IListMirroringEndpointGroupAssociationsRequest=} [properties] Properties to set + */ + function ListMirroringEndpointGroupAssociationsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListMirroringEndpointGroupAssociationsRequest parent. + * @member {string} parent + * @memberof google.cloud.networksecurity.v1.ListMirroringEndpointGroupAssociationsRequest + * @instance + */ + ListMirroringEndpointGroupAssociationsRequest.prototype.parent = ""; + + /** + * ListMirroringEndpointGroupAssociationsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.networksecurity.v1.ListMirroringEndpointGroupAssociationsRequest + * @instance + */ + ListMirroringEndpointGroupAssociationsRequest.prototype.pageSize = 0; + + /** + * ListMirroringEndpointGroupAssociationsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.networksecurity.v1.ListMirroringEndpointGroupAssociationsRequest + * @instance + */ + ListMirroringEndpointGroupAssociationsRequest.prototype.pageToken = ""; + + /** + * ListMirroringEndpointGroupAssociationsRequest filter. + * @member {string} filter + * @memberof google.cloud.networksecurity.v1.ListMirroringEndpointGroupAssociationsRequest + * @instance + */ + ListMirroringEndpointGroupAssociationsRequest.prototype.filter = ""; + + /** + * ListMirroringEndpointGroupAssociationsRequest orderBy. + * @member {string} orderBy + * @memberof google.cloud.networksecurity.v1.ListMirroringEndpointGroupAssociationsRequest + * @instance + */ + ListMirroringEndpointGroupAssociationsRequest.prototype.orderBy = ""; + + /** + * Creates a new ListMirroringEndpointGroupAssociationsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.networksecurity.v1.ListMirroringEndpointGroupAssociationsRequest + * @static + * @param {google.cloud.networksecurity.v1.IListMirroringEndpointGroupAssociationsRequest=} [properties] Properties to set + * @returns {google.cloud.networksecurity.v1.ListMirroringEndpointGroupAssociationsRequest} ListMirroringEndpointGroupAssociationsRequest instance + */ + ListMirroringEndpointGroupAssociationsRequest.create = function create(properties) { + return new ListMirroringEndpointGroupAssociationsRequest(properties); + }; + + /** + * Encodes the specified ListMirroringEndpointGroupAssociationsRequest message. Does not implicitly {@link google.cloud.networksecurity.v1.ListMirroringEndpointGroupAssociationsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.networksecurity.v1.ListMirroringEndpointGroupAssociationsRequest + * @static + * @param {google.cloud.networksecurity.v1.IListMirroringEndpointGroupAssociationsRequest} message ListMirroringEndpointGroupAssociationsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListMirroringEndpointGroupAssociationsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.filter); + if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.orderBy); + return writer; + }; + + /** + * Encodes the specified ListMirroringEndpointGroupAssociationsRequest message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.ListMirroringEndpointGroupAssociationsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.networksecurity.v1.ListMirroringEndpointGroupAssociationsRequest + * @static + * @param {google.cloud.networksecurity.v1.IListMirroringEndpointGroupAssociationsRequest} message ListMirroringEndpointGroupAssociationsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListMirroringEndpointGroupAssociationsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListMirroringEndpointGroupAssociationsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.networksecurity.v1.ListMirroringEndpointGroupAssociationsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.networksecurity.v1.ListMirroringEndpointGroupAssociationsRequest} ListMirroringEndpointGroupAssociationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListMirroringEndpointGroupAssociationsRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networksecurity.v1.ListMirroringEndpointGroupAssociationsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + case 4: { + message.filter = reader.string(); + break; + } + case 5: { + message.orderBy = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListMirroringEndpointGroupAssociationsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.networksecurity.v1.ListMirroringEndpointGroupAssociationsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.networksecurity.v1.ListMirroringEndpointGroupAssociationsRequest} ListMirroringEndpointGroupAssociationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListMirroringEndpointGroupAssociationsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListMirroringEndpointGroupAssociationsRequest message. + * @function verify + * @memberof google.cloud.networksecurity.v1.ListMirroringEndpointGroupAssociationsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListMirroringEndpointGroupAssociationsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + if (!$util.isString(message.orderBy)) + return "orderBy: string expected"; + return null; + }; + + /** + * Creates a ListMirroringEndpointGroupAssociationsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.networksecurity.v1.ListMirroringEndpointGroupAssociationsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.networksecurity.v1.ListMirroringEndpointGroupAssociationsRequest} ListMirroringEndpointGroupAssociationsRequest + */ + ListMirroringEndpointGroupAssociationsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networksecurity.v1.ListMirroringEndpointGroupAssociationsRequest) + return object; + var message = new $root.google.cloud.networksecurity.v1.ListMirroringEndpointGroupAssociationsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.filter != null) + message.filter = String(object.filter); + if (object.orderBy != null) + message.orderBy = String(object.orderBy); + return message; + }; + + /** + * Creates a plain object from a ListMirroringEndpointGroupAssociationsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.networksecurity.v1.ListMirroringEndpointGroupAssociationsRequest + * @static + * @param {google.cloud.networksecurity.v1.ListMirroringEndpointGroupAssociationsRequest} message ListMirroringEndpointGroupAssociationsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListMirroringEndpointGroupAssociationsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + object.filter = ""; + object.orderBy = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + object.orderBy = message.orderBy; + return object; + }; + + /** + * Converts this ListMirroringEndpointGroupAssociationsRequest to JSON. + * @function toJSON + * @memberof google.cloud.networksecurity.v1.ListMirroringEndpointGroupAssociationsRequest + * @instance + * @returns {Object.} JSON object + */ + ListMirroringEndpointGroupAssociationsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListMirroringEndpointGroupAssociationsRequest + * @function getTypeUrl + * @memberof google.cloud.networksecurity.v1.ListMirroringEndpointGroupAssociationsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListMirroringEndpointGroupAssociationsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.networksecurity.v1.ListMirroringEndpointGroupAssociationsRequest"; + }; + + return ListMirroringEndpointGroupAssociationsRequest; + })(); + + v1.ListMirroringEndpointGroupAssociationsResponse = (function() { + + /** + * Properties of a ListMirroringEndpointGroupAssociationsResponse. + * @memberof google.cloud.networksecurity.v1 + * @interface IListMirroringEndpointGroupAssociationsResponse + * @property {Array.|null} [mirroringEndpointGroupAssociations] ListMirroringEndpointGroupAssociationsResponse mirroringEndpointGroupAssociations + * @property {string|null} [nextPageToken] ListMirroringEndpointGroupAssociationsResponse nextPageToken + */ + + /** + * Constructs a new ListMirroringEndpointGroupAssociationsResponse. + * @memberof google.cloud.networksecurity.v1 + * @classdesc Represents a ListMirroringEndpointGroupAssociationsResponse. + * @implements IListMirroringEndpointGroupAssociationsResponse + * @constructor + * @param {google.cloud.networksecurity.v1.IListMirroringEndpointGroupAssociationsResponse=} [properties] Properties to set + */ + function ListMirroringEndpointGroupAssociationsResponse(properties) { + this.mirroringEndpointGroupAssociations = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListMirroringEndpointGroupAssociationsResponse mirroringEndpointGroupAssociations. + * @member {Array.} mirroringEndpointGroupAssociations + * @memberof google.cloud.networksecurity.v1.ListMirroringEndpointGroupAssociationsResponse + * @instance + */ + ListMirroringEndpointGroupAssociationsResponse.prototype.mirroringEndpointGroupAssociations = $util.emptyArray; + + /** + * ListMirroringEndpointGroupAssociationsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.networksecurity.v1.ListMirroringEndpointGroupAssociationsResponse + * @instance + */ + ListMirroringEndpointGroupAssociationsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListMirroringEndpointGroupAssociationsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.networksecurity.v1.ListMirroringEndpointGroupAssociationsResponse + * @static + * @param {google.cloud.networksecurity.v1.IListMirroringEndpointGroupAssociationsResponse=} [properties] Properties to set + * @returns {google.cloud.networksecurity.v1.ListMirroringEndpointGroupAssociationsResponse} ListMirroringEndpointGroupAssociationsResponse instance + */ + ListMirroringEndpointGroupAssociationsResponse.create = function create(properties) { + return new ListMirroringEndpointGroupAssociationsResponse(properties); + }; + + /** + * Encodes the specified ListMirroringEndpointGroupAssociationsResponse message. Does not implicitly {@link google.cloud.networksecurity.v1.ListMirroringEndpointGroupAssociationsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.networksecurity.v1.ListMirroringEndpointGroupAssociationsResponse + * @static + * @param {google.cloud.networksecurity.v1.IListMirroringEndpointGroupAssociationsResponse} message ListMirroringEndpointGroupAssociationsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListMirroringEndpointGroupAssociationsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.mirroringEndpointGroupAssociations != null && message.mirroringEndpointGroupAssociations.length) + for (var i = 0; i < message.mirroringEndpointGroupAssociations.length; ++i) + $root.google.cloud.networksecurity.v1.MirroringEndpointGroupAssociation.encode(message.mirroringEndpointGroupAssociations[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + return writer; + }; + + /** + * Encodes the specified ListMirroringEndpointGroupAssociationsResponse message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.ListMirroringEndpointGroupAssociationsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.networksecurity.v1.ListMirroringEndpointGroupAssociationsResponse + * @static + * @param {google.cloud.networksecurity.v1.IListMirroringEndpointGroupAssociationsResponse} message ListMirroringEndpointGroupAssociationsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListMirroringEndpointGroupAssociationsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListMirroringEndpointGroupAssociationsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.networksecurity.v1.ListMirroringEndpointGroupAssociationsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.networksecurity.v1.ListMirroringEndpointGroupAssociationsResponse} ListMirroringEndpointGroupAssociationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListMirroringEndpointGroupAssociationsResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networksecurity.v1.ListMirroringEndpointGroupAssociationsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.mirroringEndpointGroupAssociations && message.mirroringEndpointGroupAssociations.length)) + message.mirroringEndpointGroupAssociations = []; + message.mirroringEndpointGroupAssociations.push($root.google.cloud.networksecurity.v1.MirroringEndpointGroupAssociation.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListMirroringEndpointGroupAssociationsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.networksecurity.v1.ListMirroringEndpointGroupAssociationsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.networksecurity.v1.ListMirroringEndpointGroupAssociationsResponse} ListMirroringEndpointGroupAssociationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListMirroringEndpointGroupAssociationsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListMirroringEndpointGroupAssociationsResponse message. + * @function verify + * @memberof google.cloud.networksecurity.v1.ListMirroringEndpointGroupAssociationsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListMirroringEndpointGroupAssociationsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.mirroringEndpointGroupAssociations != null && message.hasOwnProperty("mirroringEndpointGroupAssociations")) { + if (!Array.isArray(message.mirroringEndpointGroupAssociations)) + return "mirroringEndpointGroupAssociations: array expected"; + for (var i = 0; i < message.mirroringEndpointGroupAssociations.length; ++i) { + var error = $root.google.cloud.networksecurity.v1.MirroringEndpointGroupAssociation.verify(message.mirroringEndpointGroupAssociations[i]); + if (error) + return "mirroringEndpointGroupAssociations." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListMirroringEndpointGroupAssociationsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.networksecurity.v1.ListMirroringEndpointGroupAssociationsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.networksecurity.v1.ListMirroringEndpointGroupAssociationsResponse} ListMirroringEndpointGroupAssociationsResponse + */ + ListMirroringEndpointGroupAssociationsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networksecurity.v1.ListMirroringEndpointGroupAssociationsResponse) + return object; + var message = new $root.google.cloud.networksecurity.v1.ListMirroringEndpointGroupAssociationsResponse(); + if (object.mirroringEndpointGroupAssociations) { + if (!Array.isArray(object.mirroringEndpointGroupAssociations)) + throw TypeError(".google.cloud.networksecurity.v1.ListMirroringEndpointGroupAssociationsResponse.mirroringEndpointGroupAssociations: array expected"); + message.mirroringEndpointGroupAssociations = []; + for (var i = 0; i < object.mirroringEndpointGroupAssociations.length; ++i) { + if (typeof object.mirroringEndpointGroupAssociations[i] !== "object") + throw TypeError(".google.cloud.networksecurity.v1.ListMirroringEndpointGroupAssociationsResponse.mirroringEndpointGroupAssociations: object expected"); + message.mirroringEndpointGroupAssociations[i] = $root.google.cloud.networksecurity.v1.MirroringEndpointGroupAssociation.fromObject(object.mirroringEndpointGroupAssociations[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListMirroringEndpointGroupAssociationsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.networksecurity.v1.ListMirroringEndpointGroupAssociationsResponse + * @static + * @param {google.cloud.networksecurity.v1.ListMirroringEndpointGroupAssociationsResponse} message ListMirroringEndpointGroupAssociationsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListMirroringEndpointGroupAssociationsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.mirroringEndpointGroupAssociations = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.mirroringEndpointGroupAssociations && message.mirroringEndpointGroupAssociations.length) { + object.mirroringEndpointGroupAssociations = []; + for (var j = 0; j < message.mirroringEndpointGroupAssociations.length; ++j) + object.mirroringEndpointGroupAssociations[j] = $root.google.cloud.networksecurity.v1.MirroringEndpointGroupAssociation.toObject(message.mirroringEndpointGroupAssociations[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListMirroringEndpointGroupAssociationsResponse to JSON. + * @function toJSON + * @memberof google.cloud.networksecurity.v1.ListMirroringEndpointGroupAssociationsResponse + * @instance + * @returns {Object.} JSON object + */ + ListMirroringEndpointGroupAssociationsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListMirroringEndpointGroupAssociationsResponse + * @function getTypeUrl + * @memberof google.cloud.networksecurity.v1.ListMirroringEndpointGroupAssociationsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListMirroringEndpointGroupAssociationsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.networksecurity.v1.ListMirroringEndpointGroupAssociationsResponse"; + }; + + return ListMirroringEndpointGroupAssociationsResponse; + })(); + + v1.GetMirroringEndpointGroupAssociationRequest = (function() { + + /** + * Properties of a GetMirroringEndpointGroupAssociationRequest. + * @memberof google.cloud.networksecurity.v1 + * @interface IGetMirroringEndpointGroupAssociationRequest + * @property {string|null} [name] GetMirroringEndpointGroupAssociationRequest name + */ + + /** + * Constructs a new GetMirroringEndpointGroupAssociationRequest. + * @memberof google.cloud.networksecurity.v1 + * @classdesc Represents a GetMirroringEndpointGroupAssociationRequest. + * @implements IGetMirroringEndpointGroupAssociationRequest + * @constructor + * @param {google.cloud.networksecurity.v1.IGetMirroringEndpointGroupAssociationRequest=} [properties] Properties to set + */ + function GetMirroringEndpointGroupAssociationRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetMirroringEndpointGroupAssociationRequest name. + * @member {string} name + * @memberof google.cloud.networksecurity.v1.GetMirroringEndpointGroupAssociationRequest + * @instance + */ + GetMirroringEndpointGroupAssociationRequest.prototype.name = ""; + + /** + * Creates a new GetMirroringEndpointGroupAssociationRequest instance using the specified properties. + * @function create + * @memberof google.cloud.networksecurity.v1.GetMirroringEndpointGroupAssociationRequest + * @static + * @param {google.cloud.networksecurity.v1.IGetMirroringEndpointGroupAssociationRequest=} [properties] Properties to set + * @returns {google.cloud.networksecurity.v1.GetMirroringEndpointGroupAssociationRequest} GetMirroringEndpointGroupAssociationRequest instance + */ + GetMirroringEndpointGroupAssociationRequest.create = function create(properties) { + return new GetMirroringEndpointGroupAssociationRequest(properties); + }; + + /** + * Encodes the specified GetMirroringEndpointGroupAssociationRequest message. Does not implicitly {@link google.cloud.networksecurity.v1.GetMirroringEndpointGroupAssociationRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.networksecurity.v1.GetMirroringEndpointGroupAssociationRequest + * @static + * @param {google.cloud.networksecurity.v1.IGetMirroringEndpointGroupAssociationRequest} message GetMirroringEndpointGroupAssociationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetMirroringEndpointGroupAssociationRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified GetMirroringEndpointGroupAssociationRequest message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.GetMirroringEndpointGroupAssociationRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.networksecurity.v1.GetMirroringEndpointGroupAssociationRequest + * @static + * @param {google.cloud.networksecurity.v1.IGetMirroringEndpointGroupAssociationRequest} message GetMirroringEndpointGroupAssociationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetMirroringEndpointGroupAssociationRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetMirroringEndpointGroupAssociationRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.networksecurity.v1.GetMirroringEndpointGroupAssociationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.networksecurity.v1.GetMirroringEndpointGroupAssociationRequest} GetMirroringEndpointGroupAssociationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetMirroringEndpointGroupAssociationRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networksecurity.v1.GetMirroringEndpointGroupAssociationRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetMirroringEndpointGroupAssociationRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.networksecurity.v1.GetMirroringEndpointGroupAssociationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.networksecurity.v1.GetMirroringEndpointGroupAssociationRequest} GetMirroringEndpointGroupAssociationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetMirroringEndpointGroupAssociationRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetMirroringEndpointGroupAssociationRequest message. + * @function verify + * @memberof google.cloud.networksecurity.v1.GetMirroringEndpointGroupAssociationRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetMirroringEndpointGroupAssociationRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a GetMirroringEndpointGroupAssociationRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.networksecurity.v1.GetMirroringEndpointGroupAssociationRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.networksecurity.v1.GetMirroringEndpointGroupAssociationRequest} GetMirroringEndpointGroupAssociationRequest + */ + GetMirroringEndpointGroupAssociationRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networksecurity.v1.GetMirroringEndpointGroupAssociationRequest) + return object; + var message = new $root.google.cloud.networksecurity.v1.GetMirroringEndpointGroupAssociationRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetMirroringEndpointGroupAssociationRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.networksecurity.v1.GetMirroringEndpointGroupAssociationRequest + * @static + * @param {google.cloud.networksecurity.v1.GetMirroringEndpointGroupAssociationRequest} message GetMirroringEndpointGroupAssociationRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetMirroringEndpointGroupAssociationRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this GetMirroringEndpointGroupAssociationRequest to JSON. + * @function toJSON + * @memberof google.cloud.networksecurity.v1.GetMirroringEndpointGroupAssociationRequest + * @instance + * @returns {Object.} JSON object + */ + GetMirroringEndpointGroupAssociationRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetMirroringEndpointGroupAssociationRequest + * @function getTypeUrl + * @memberof google.cloud.networksecurity.v1.GetMirroringEndpointGroupAssociationRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetMirroringEndpointGroupAssociationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.networksecurity.v1.GetMirroringEndpointGroupAssociationRequest"; + }; + + return GetMirroringEndpointGroupAssociationRequest; + })(); + + v1.CreateMirroringEndpointGroupAssociationRequest = (function() { + + /** + * Properties of a CreateMirroringEndpointGroupAssociationRequest. + * @memberof google.cloud.networksecurity.v1 + * @interface ICreateMirroringEndpointGroupAssociationRequest + * @property {string|null} [parent] CreateMirroringEndpointGroupAssociationRequest parent + * @property {string|null} [mirroringEndpointGroupAssociationId] CreateMirroringEndpointGroupAssociationRequest mirroringEndpointGroupAssociationId + * @property {google.cloud.networksecurity.v1.IMirroringEndpointGroupAssociation|null} [mirroringEndpointGroupAssociation] CreateMirroringEndpointGroupAssociationRequest mirroringEndpointGroupAssociation + * @property {string|null} [requestId] CreateMirroringEndpointGroupAssociationRequest requestId + */ + + /** + * Constructs a new CreateMirroringEndpointGroupAssociationRequest. + * @memberof google.cloud.networksecurity.v1 + * @classdesc Represents a CreateMirroringEndpointGroupAssociationRequest. + * @implements ICreateMirroringEndpointGroupAssociationRequest + * @constructor + * @param {google.cloud.networksecurity.v1.ICreateMirroringEndpointGroupAssociationRequest=} [properties] Properties to set + */ + function CreateMirroringEndpointGroupAssociationRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateMirroringEndpointGroupAssociationRequest parent. + * @member {string} parent + * @memberof google.cloud.networksecurity.v1.CreateMirroringEndpointGroupAssociationRequest + * @instance + */ + CreateMirroringEndpointGroupAssociationRequest.prototype.parent = ""; + + /** + * CreateMirroringEndpointGroupAssociationRequest mirroringEndpointGroupAssociationId. + * @member {string} mirroringEndpointGroupAssociationId + * @memberof google.cloud.networksecurity.v1.CreateMirroringEndpointGroupAssociationRequest + * @instance + */ + CreateMirroringEndpointGroupAssociationRequest.prototype.mirroringEndpointGroupAssociationId = ""; + + /** + * CreateMirroringEndpointGroupAssociationRequest mirroringEndpointGroupAssociation. + * @member {google.cloud.networksecurity.v1.IMirroringEndpointGroupAssociation|null|undefined} mirroringEndpointGroupAssociation + * @memberof google.cloud.networksecurity.v1.CreateMirroringEndpointGroupAssociationRequest + * @instance + */ + CreateMirroringEndpointGroupAssociationRequest.prototype.mirroringEndpointGroupAssociation = null; + + /** + * CreateMirroringEndpointGroupAssociationRequest requestId. + * @member {string} requestId + * @memberof google.cloud.networksecurity.v1.CreateMirroringEndpointGroupAssociationRequest + * @instance + */ + CreateMirroringEndpointGroupAssociationRequest.prototype.requestId = ""; + + /** + * Creates a new CreateMirroringEndpointGroupAssociationRequest instance using the specified properties. + * @function create + * @memberof google.cloud.networksecurity.v1.CreateMirroringEndpointGroupAssociationRequest + * @static + * @param {google.cloud.networksecurity.v1.ICreateMirroringEndpointGroupAssociationRequest=} [properties] Properties to set + * @returns {google.cloud.networksecurity.v1.CreateMirroringEndpointGroupAssociationRequest} CreateMirroringEndpointGroupAssociationRequest instance + */ + CreateMirroringEndpointGroupAssociationRequest.create = function create(properties) { + return new CreateMirroringEndpointGroupAssociationRequest(properties); + }; + + /** + * Encodes the specified CreateMirroringEndpointGroupAssociationRequest message. Does not implicitly {@link google.cloud.networksecurity.v1.CreateMirroringEndpointGroupAssociationRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.networksecurity.v1.CreateMirroringEndpointGroupAssociationRequest + * @static + * @param {google.cloud.networksecurity.v1.ICreateMirroringEndpointGroupAssociationRequest} message CreateMirroringEndpointGroupAssociationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateMirroringEndpointGroupAssociationRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.mirroringEndpointGroupAssociationId != null && Object.hasOwnProperty.call(message, "mirroringEndpointGroupAssociationId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.mirroringEndpointGroupAssociationId); + if (message.mirroringEndpointGroupAssociation != null && Object.hasOwnProperty.call(message, "mirroringEndpointGroupAssociation")) + $root.google.cloud.networksecurity.v1.MirroringEndpointGroupAssociation.encode(message.mirroringEndpointGroupAssociation, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.requestId); + return writer; + }; + + /** + * Encodes the specified CreateMirroringEndpointGroupAssociationRequest message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.CreateMirroringEndpointGroupAssociationRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.networksecurity.v1.CreateMirroringEndpointGroupAssociationRequest + * @static + * @param {google.cloud.networksecurity.v1.ICreateMirroringEndpointGroupAssociationRequest} message CreateMirroringEndpointGroupAssociationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateMirroringEndpointGroupAssociationRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateMirroringEndpointGroupAssociationRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.networksecurity.v1.CreateMirroringEndpointGroupAssociationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.networksecurity.v1.CreateMirroringEndpointGroupAssociationRequest} CreateMirroringEndpointGroupAssociationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateMirroringEndpointGroupAssociationRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networksecurity.v1.CreateMirroringEndpointGroupAssociationRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.mirroringEndpointGroupAssociationId = reader.string(); + break; + } + case 3: { + message.mirroringEndpointGroupAssociation = $root.google.cloud.networksecurity.v1.MirroringEndpointGroupAssociation.decode(reader, reader.uint32()); + break; + } + case 4: { + message.requestId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateMirroringEndpointGroupAssociationRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.networksecurity.v1.CreateMirroringEndpointGroupAssociationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.networksecurity.v1.CreateMirroringEndpointGroupAssociationRequest} CreateMirroringEndpointGroupAssociationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateMirroringEndpointGroupAssociationRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateMirroringEndpointGroupAssociationRequest message. + * @function verify + * @memberof google.cloud.networksecurity.v1.CreateMirroringEndpointGroupAssociationRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateMirroringEndpointGroupAssociationRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.mirroringEndpointGroupAssociationId != null && message.hasOwnProperty("mirroringEndpointGroupAssociationId")) + if (!$util.isString(message.mirroringEndpointGroupAssociationId)) + return "mirroringEndpointGroupAssociationId: string expected"; + if (message.mirroringEndpointGroupAssociation != null && message.hasOwnProperty("mirroringEndpointGroupAssociation")) { + var error = $root.google.cloud.networksecurity.v1.MirroringEndpointGroupAssociation.verify(message.mirroringEndpointGroupAssociation); + if (error) + return "mirroringEndpointGroupAssociation." + error; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + return null; + }; + + /** + * Creates a CreateMirroringEndpointGroupAssociationRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.networksecurity.v1.CreateMirroringEndpointGroupAssociationRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.networksecurity.v1.CreateMirroringEndpointGroupAssociationRequest} CreateMirroringEndpointGroupAssociationRequest + */ + CreateMirroringEndpointGroupAssociationRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networksecurity.v1.CreateMirroringEndpointGroupAssociationRequest) + return object; + var message = new $root.google.cloud.networksecurity.v1.CreateMirroringEndpointGroupAssociationRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.mirroringEndpointGroupAssociationId != null) + message.mirroringEndpointGroupAssociationId = String(object.mirroringEndpointGroupAssociationId); + if (object.mirroringEndpointGroupAssociation != null) { + if (typeof object.mirroringEndpointGroupAssociation !== "object") + throw TypeError(".google.cloud.networksecurity.v1.CreateMirroringEndpointGroupAssociationRequest.mirroringEndpointGroupAssociation: object expected"); + message.mirroringEndpointGroupAssociation = $root.google.cloud.networksecurity.v1.MirroringEndpointGroupAssociation.fromObject(object.mirroringEndpointGroupAssociation); + } + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from a CreateMirroringEndpointGroupAssociationRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.networksecurity.v1.CreateMirroringEndpointGroupAssociationRequest + * @static + * @param {google.cloud.networksecurity.v1.CreateMirroringEndpointGroupAssociationRequest} message CreateMirroringEndpointGroupAssociationRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateMirroringEndpointGroupAssociationRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.mirroringEndpointGroupAssociationId = ""; + object.mirroringEndpointGroupAssociation = null; + object.requestId = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.mirroringEndpointGroupAssociationId != null && message.hasOwnProperty("mirroringEndpointGroupAssociationId")) + object.mirroringEndpointGroupAssociationId = message.mirroringEndpointGroupAssociationId; + if (message.mirroringEndpointGroupAssociation != null && message.hasOwnProperty("mirroringEndpointGroupAssociation")) + object.mirroringEndpointGroupAssociation = $root.google.cloud.networksecurity.v1.MirroringEndpointGroupAssociation.toObject(message.mirroringEndpointGroupAssociation, options); + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + return object; + }; + + /** + * Converts this CreateMirroringEndpointGroupAssociationRequest to JSON. + * @function toJSON + * @memberof google.cloud.networksecurity.v1.CreateMirroringEndpointGroupAssociationRequest + * @instance + * @returns {Object.} JSON object + */ + CreateMirroringEndpointGroupAssociationRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateMirroringEndpointGroupAssociationRequest + * @function getTypeUrl + * @memberof google.cloud.networksecurity.v1.CreateMirroringEndpointGroupAssociationRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateMirroringEndpointGroupAssociationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.networksecurity.v1.CreateMirroringEndpointGroupAssociationRequest"; + }; + + return CreateMirroringEndpointGroupAssociationRequest; + })(); + + v1.UpdateMirroringEndpointGroupAssociationRequest = (function() { + + /** + * Properties of an UpdateMirroringEndpointGroupAssociationRequest. + * @memberof google.cloud.networksecurity.v1 + * @interface IUpdateMirroringEndpointGroupAssociationRequest + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateMirroringEndpointGroupAssociationRequest updateMask + * @property {google.cloud.networksecurity.v1.IMirroringEndpointGroupAssociation|null} [mirroringEndpointGroupAssociation] UpdateMirroringEndpointGroupAssociationRequest mirroringEndpointGroupAssociation + * @property {string|null} [requestId] UpdateMirroringEndpointGroupAssociationRequest requestId + */ + + /** + * Constructs a new UpdateMirroringEndpointGroupAssociationRequest. + * @memberof google.cloud.networksecurity.v1 + * @classdesc Represents an UpdateMirroringEndpointGroupAssociationRequest. + * @implements IUpdateMirroringEndpointGroupAssociationRequest + * @constructor + * @param {google.cloud.networksecurity.v1.IUpdateMirroringEndpointGroupAssociationRequest=} [properties] Properties to set + */ + function UpdateMirroringEndpointGroupAssociationRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateMirroringEndpointGroupAssociationRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.networksecurity.v1.UpdateMirroringEndpointGroupAssociationRequest + * @instance + */ + UpdateMirroringEndpointGroupAssociationRequest.prototype.updateMask = null; + + /** + * UpdateMirroringEndpointGroupAssociationRequest mirroringEndpointGroupAssociation. + * @member {google.cloud.networksecurity.v1.IMirroringEndpointGroupAssociation|null|undefined} mirroringEndpointGroupAssociation + * @memberof google.cloud.networksecurity.v1.UpdateMirroringEndpointGroupAssociationRequest + * @instance + */ + UpdateMirroringEndpointGroupAssociationRequest.prototype.mirroringEndpointGroupAssociation = null; + + /** + * UpdateMirroringEndpointGroupAssociationRequest requestId. + * @member {string} requestId + * @memberof google.cloud.networksecurity.v1.UpdateMirroringEndpointGroupAssociationRequest + * @instance + */ + UpdateMirroringEndpointGroupAssociationRequest.prototype.requestId = ""; + + /** + * Creates a new UpdateMirroringEndpointGroupAssociationRequest instance using the specified properties. + * @function create + * @memberof google.cloud.networksecurity.v1.UpdateMirroringEndpointGroupAssociationRequest + * @static + * @param {google.cloud.networksecurity.v1.IUpdateMirroringEndpointGroupAssociationRequest=} [properties] Properties to set + * @returns {google.cloud.networksecurity.v1.UpdateMirroringEndpointGroupAssociationRequest} UpdateMirroringEndpointGroupAssociationRequest instance + */ + UpdateMirroringEndpointGroupAssociationRequest.create = function create(properties) { + return new UpdateMirroringEndpointGroupAssociationRequest(properties); + }; + + /** + * Encodes the specified UpdateMirroringEndpointGroupAssociationRequest message. Does not implicitly {@link google.cloud.networksecurity.v1.UpdateMirroringEndpointGroupAssociationRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.networksecurity.v1.UpdateMirroringEndpointGroupAssociationRequest + * @static + * @param {google.cloud.networksecurity.v1.IUpdateMirroringEndpointGroupAssociationRequest} message UpdateMirroringEndpointGroupAssociationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateMirroringEndpointGroupAssociationRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.mirroringEndpointGroupAssociation != null && Object.hasOwnProperty.call(message, "mirroringEndpointGroupAssociation")) + $root.google.cloud.networksecurity.v1.MirroringEndpointGroupAssociation.encode(message.mirroringEndpointGroupAssociation, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.requestId); + return writer; + }; + + /** + * Encodes the specified UpdateMirroringEndpointGroupAssociationRequest message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.UpdateMirroringEndpointGroupAssociationRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.networksecurity.v1.UpdateMirroringEndpointGroupAssociationRequest + * @static + * @param {google.cloud.networksecurity.v1.IUpdateMirroringEndpointGroupAssociationRequest} message UpdateMirroringEndpointGroupAssociationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateMirroringEndpointGroupAssociationRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateMirroringEndpointGroupAssociationRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.networksecurity.v1.UpdateMirroringEndpointGroupAssociationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.networksecurity.v1.UpdateMirroringEndpointGroupAssociationRequest} UpdateMirroringEndpointGroupAssociationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateMirroringEndpointGroupAssociationRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networksecurity.v1.UpdateMirroringEndpointGroupAssociationRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + case 2: { + message.mirroringEndpointGroupAssociation = $root.google.cloud.networksecurity.v1.MirroringEndpointGroupAssociation.decode(reader, reader.uint32()); + break; + } + case 3: { + message.requestId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateMirroringEndpointGroupAssociationRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.networksecurity.v1.UpdateMirroringEndpointGroupAssociationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.networksecurity.v1.UpdateMirroringEndpointGroupAssociationRequest} UpdateMirroringEndpointGroupAssociationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateMirroringEndpointGroupAssociationRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateMirroringEndpointGroupAssociationRequest message. + * @function verify + * @memberof google.cloud.networksecurity.v1.UpdateMirroringEndpointGroupAssociationRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateMirroringEndpointGroupAssociationRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + if (message.mirroringEndpointGroupAssociation != null && message.hasOwnProperty("mirroringEndpointGroupAssociation")) { + var error = $root.google.cloud.networksecurity.v1.MirroringEndpointGroupAssociation.verify(message.mirroringEndpointGroupAssociation); + if (error) + return "mirroringEndpointGroupAssociation." + error; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + return null; + }; + + /** + * Creates an UpdateMirroringEndpointGroupAssociationRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.networksecurity.v1.UpdateMirroringEndpointGroupAssociationRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.networksecurity.v1.UpdateMirroringEndpointGroupAssociationRequest} UpdateMirroringEndpointGroupAssociationRequest + */ + UpdateMirroringEndpointGroupAssociationRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networksecurity.v1.UpdateMirroringEndpointGroupAssociationRequest) + return object; + var message = new $root.google.cloud.networksecurity.v1.UpdateMirroringEndpointGroupAssociationRequest(); + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.networksecurity.v1.UpdateMirroringEndpointGroupAssociationRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + if (object.mirroringEndpointGroupAssociation != null) { + if (typeof object.mirroringEndpointGroupAssociation !== "object") + throw TypeError(".google.cloud.networksecurity.v1.UpdateMirroringEndpointGroupAssociationRequest.mirroringEndpointGroupAssociation: object expected"); + message.mirroringEndpointGroupAssociation = $root.google.cloud.networksecurity.v1.MirroringEndpointGroupAssociation.fromObject(object.mirroringEndpointGroupAssociation); + } + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from an UpdateMirroringEndpointGroupAssociationRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.networksecurity.v1.UpdateMirroringEndpointGroupAssociationRequest + * @static + * @param {google.cloud.networksecurity.v1.UpdateMirroringEndpointGroupAssociationRequest} message UpdateMirroringEndpointGroupAssociationRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateMirroringEndpointGroupAssociationRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.updateMask = null; + object.mirroringEndpointGroupAssociation = null; + object.requestId = ""; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + if (message.mirroringEndpointGroupAssociation != null && message.hasOwnProperty("mirroringEndpointGroupAssociation")) + object.mirroringEndpointGroupAssociation = $root.google.cloud.networksecurity.v1.MirroringEndpointGroupAssociation.toObject(message.mirroringEndpointGroupAssociation, options); + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + return object; + }; + + /** + * Converts this UpdateMirroringEndpointGroupAssociationRequest to JSON. + * @function toJSON + * @memberof google.cloud.networksecurity.v1.UpdateMirroringEndpointGroupAssociationRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateMirroringEndpointGroupAssociationRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateMirroringEndpointGroupAssociationRequest + * @function getTypeUrl + * @memberof google.cloud.networksecurity.v1.UpdateMirroringEndpointGroupAssociationRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateMirroringEndpointGroupAssociationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.networksecurity.v1.UpdateMirroringEndpointGroupAssociationRequest"; + }; + + return UpdateMirroringEndpointGroupAssociationRequest; + })(); + + v1.DeleteMirroringEndpointGroupAssociationRequest = (function() { + + /** + * Properties of a DeleteMirroringEndpointGroupAssociationRequest. + * @memberof google.cloud.networksecurity.v1 + * @interface IDeleteMirroringEndpointGroupAssociationRequest + * @property {string|null} [name] DeleteMirroringEndpointGroupAssociationRequest name + * @property {string|null} [requestId] DeleteMirroringEndpointGroupAssociationRequest requestId + */ + + /** + * Constructs a new DeleteMirroringEndpointGroupAssociationRequest. + * @memberof google.cloud.networksecurity.v1 + * @classdesc Represents a DeleteMirroringEndpointGroupAssociationRequest. + * @implements IDeleteMirroringEndpointGroupAssociationRequest + * @constructor + * @param {google.cloud.networksecurity.v1.IDeleteMirroringEndpointGroupAssociationRequest=} [properties] Properties to set + */ + function DeleteMirroringEndpointGroupAssociationRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteMirroringEndpointGroupAssociationRequest name. + * @member {string} name + * @memberof google.cloud.networksecurity.v1.DeleteMirroringEndpointGroupAssociationRequest + * @instance + */ + DeleteMirroringEndpointGroupAssociationRequest.prototype.name = ""; + + /** + * DeleteMirroringEndpointGroupAssociationRequest requestId. + * @member {string} requestId + * @memberof google.cloud.networksecurity.v1.DeleteMirroringEndpointGroupAssociationRequest + * @instance + */ + DeleteMirroringEndpointGroupAssociationRequest.prototype.requestId = ""; + + /** + * Creates a new DeleteMirroringEndpointGroupAssociationRequest instance using the specified properties. + * @function create + * @memberof google.cloud.networksecurity.v1.DeleteMirroringEndpointGroupAssociationRequest + * @static + * @param {google.cloud.networksecurity.v1.IDeleteMirroringEndpointGroupAssociationRequest=} [properties] Properties to set + * @returns {google.cloud.networksecurity.v1.DeleteMirroringEndpointGroupAssociationRequest} DeleteMirroringEndpointGroupAssociationRequest instance + */ + DeleteMirroringEndpointGroupAssociationRequest.create = function create(properties) { + return new DeleteMirroringEndpointGroupAssociationRequest(properties); + }; + + /** + * Encodes the specified DeleteMirroringEndpointGroupAssociationRequest message. Does not implicitly {@link google.cloud.networksecurity.v1.DeleteMirroringEndpointGroupAssociationRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.networksecurity.v1.DeleteMirroringEndpointGroupAssociationRequest + * @static + * @param {google.cloud.networksecurity.v1.IDeleteMirroringEndpointGroupAssociationRequest} message DeleteMirroringEndpointGroupAssociationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteMirroringEndpointGroupAssociationRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.requestId); + return writer; + }; + + /** + * Encodes the specified DeleteMirroringEndpointGroupAssociationRequest message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.DeleteMirroringEndpointGroupAssociationRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.networksecurity.v1.DeleteMirroringEndpointGroupAssociationRequest + * @static + * @param {google.cloud.networksecurity.v1.IDeleteMirroringEndpointGroupAssociationRequest} message DeleteMirroringEndpointGroupAssociationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteMirroringEndpointGroupAssociationRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteMirroringEndpointGroupAssociationRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.networksecurity.v1.DeleteMirroringEndpointGroupAssociationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.networksecurity.v1.DeleteMirroringEndpointGroupAssociationRequest} DeleteMirroringEndpointGroupAssociationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteMirroringEndpointGroupAssociationRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networksecurity.v1.DeleteMirroringEndpointGroupAssociationRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.requestId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteMirroringEndpointGroupAssociationRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.networksecurity.v1.DeleteMirroringEndpointGroupAssociationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.networksecurity.v1.DeleteMirroringEndpointGroupAssociationRequest} DeleteMirroringEndpointGroupAssociationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteMirroringEndpointGroupAssociationRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteMirroringEndpointGroupAssociationRequest message. + * @function verify + * @memberof google.cloud.networksecurity.v1.DeleteMirroringEndpointGroupAssociationRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteMirroringEndpointGroupAssociationRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + return null; + }; + + /** + * Creates a DeleteMirroringEndpointGroupAssociationRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.networksecurity.v1.DeleteMirroringEndpointGroupAssociationRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.networksecurity.v1.DeleteMirroringEndpointGroupAssociationRequest} DeleteMirroringEndpointGroupAssociationRequest + */ + DeleteMirroringEndpointGroupAssociationRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networksecurity.v1.DeleteMirroringEndpointGroupAssociationRequest) + return object; + var message = new $root.google.cloud.networksecurity.v1.DeleteMirroringEndpointGroupAssociationRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from a DeleteMirroringEndpointGroupAssociationRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.networksecurity.v1.DeleteMirroringEndpointGroupAssociationRequest + * @static + * @param {google.cloud.networksecurity.v1.DeleteMirroringEndpointGroupAssociationRequest} message DeleteMirroringEndpointGroupAssociationRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteMirroringEndpointGroupAssociationRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.requestId = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + return object; + }; + + /** + * Converts this DeleteMirroringEndpointGroupAssociationRequest to JSON. + * @function toJSON + * @memberof google.cloud.networksecurity.v1.DeleteMirroringEndpointGroupAssociationRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteMirroringEndpointGroupAssociationRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteMirroringEndpointGroupAssociationRequest + * @function getTypeUrl + * @memberof google.cloud.networksecurity.v1.DeleteMirroringEndpointGroupAssociationRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteMirroringEndpointGroupAssociationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.networksecurity.v1.DeleteMirroringEndpointGroupAssociationRequest"; + }; + + return DeleteMirroringEndpointGroupAssociationRequest; + })(); + + v1.MirroringDeploymentGroup = (function() { + + /** + * Properties of a MirroringDeploymentGroup. + * @memberof google.cloud.networksecurity.v1 + * @interface IMirroringDeploymentGroup + * @property {string|null} [name] MirroringDeploymentGroup name + * @property {google.protobuf.ITimestamp|null} [createTime] MirroringDeploymentGroup createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] MirroringDeploymentGroup updateTime + * @property {Object.|null} [labels] MirroringDeploymentGroup labels + * @property {string|null} [network] MirroringDeploymentGroup network + * @property {Array.|null} [connectedEndpointGroups] MirroringDeploymentGroup connectedEndpointGroups + * @property {Array.|null} [nestedDeployments] MirroringDeploymentGroup nestedDeployments + * @property {google.cloud.networksecurity.v1.MirroringDeploymentGroup.State|null} [state] MirroringDeploymentGroup state + * @property {boolean|null} [reconciling] MirroringDeploymentGroup reconciling + * @property {string|null} [description] MirroringDeploymentGroup description + * @property {Array.|null} [locations] MirroringDeploymentGroup locations + */ + + /** + * Constructs a new MirroringDeploymentGroup. + * @memberof google.cloud.networksecurity.v1 + * @classdesc Represents a MirroringDeploymentGroup. + * @implements IMirroringDeploymentGroup + * @constructor + * @param {google.cloud.networksecurity.v1.IMirroringDeploymentGroup=} [properties] Properties to set + */ + function MirroringDeploymentGroup(properties) { + this.labels = {}; + this.connectedEndpointGroups = []; + this.nestedDeployments = []; + this.locations = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MirroringDeploymentGroup name. + * @member {string} name + * @memberof google.cloud.networksecurity.v1.MirroringDeploymentGroup + * @instance + */ + MirroringDeploymentGroup.prototype.name = ""; + + /** + * MirroringDeploymentGroup createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.networksecurity.v1.MirroringDeploymentGroup + * @instance + */ + MirroringDeploymentGroup.prototype.createTime = null; + + /** + * MirroringDeploymentGroup updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.networksecurity.v1.MirroringDeploymentGroup + * @instance + */ + MirroringDeploymentGroup.prototype.updateTime = null; + + /** + * MirroringDeploymentGroup labels. + * @member {Object.} labels + * @memberof google.cloud.networksecurity.v1.MirroringDeploymentGroup + * @instance + */ + MirroringDeploymentGroup.prototype.labels = $util.emptyObject; + + /** + * MirroringDeploymentGroup network. + * @member {string} network + * @memberof google.cloud.networksecurity.v1.MirroringDeploymentGroup + * @instance + */ + MirroringDeploymentGroup.prototype.network = ""; + + /** + * MirroringDeploymentGroup connectedEndpointGroups. + * @member {Array.} connectedEndpointGroups + * @memberof google.cloud.networksecurity.v1.MirroringDeploymentGroup + * @instance + */ + MirroringDeploymentGroup.prototype.connectedEndpointGroups = $util.emptyArray; + + /** + * MirroringDeploymentGroup nestedDeployments. + * @member {Array.} nestedDeployments + * @memberof google.cloud.networksecurity.v1.MirroringDeploymentGroup + * @instance + */ + MirroringDeploymentGroup.prototype.nestedDeployments = $util.emptyArray; + + /** + * MirroringDeploymentGroup state. + * @member {google.cloud.networksecurity.v1.MirroringDeploymentGroup.State} state + * @memberof google.cloud.networksecurity.v1.MirroringDeploymentGroup + * @instance + */ + MirroringDeploymentGroup.prototype.state = 0; + + /** + * MirroringDeploymentGroup reconciling. + * @member {boolean} reconciling + * @memberof google.cloud.networksecurity.v1.MirroringDeploymentGroup + * @instance + */ + MirroringDeploymentGroup.prototype.reconciling = false; + + /** + * MirroringDeploymentGroup description. + * @member {string} description + * @memberof google.cloud.networksecurity.v1.MirroringDeploymentGroup + * @instance + */ + MirroringDeploymentGroup.prototype.description = ""; + + /** + * MirroringDeploymentGroup locations. + * @member {Array.} locations + * @memberof google.cloud.networksecurity.v1.MirroringDeploymentGroup + * @instance + */ + MirroringDeploymentGroup.prototype.locations = $util.emptyArray; + + /** + * Creates a new MirroringDeploymentGroup instance using the specified properties. + * @function create + * @memberof google.cloud.networksecurity.v1.MirroringDeploymentGroup + * @static + * @param {google.cloud.networksecurity.v1.IMirroringDeploymentGroup=} [properties] Properties to set + * @returns {google.cloud.networksecurity.v1.MirroringDeploymentGroup} MirroringDeploymentGroup instance + */ + MirroringDeploymentGroup.create = function create(properties) { + return new MirroringDeploymentGroup(properties); + }; + + /** + * Encodes the specified MirroringDeploymentGroup message. Does not implicitly {@link google.cloud.networksecurity.v1.MirroringDeploymentGroup.verify|verify} messages. + * @function encode + * @memberof google.cloud.networksecurity.v1.MirroringDeploymentGroup + * @static + * @param {google.cloud.networksecurity.v1.IMirroringDeploymentGroup} message MirroringDeploymentGroup message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MirroringDeploymentGroup.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) + for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) + writer.uint32(/* id 4, wireType 2 =*/34).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); + if (message.network != null && Object.hasOwnProperty.call(message, "network")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.network); + if (message.connectedEndpointGroups != null && message.connectedEndpointGroups.length) + for (var i = 0; i < message.connectedEndpointGroups.length; ++i) + $root.google.cloud.networksecurity.v1.MirroringDeploymentGroup.ConnectedEndpointGroup.encode(message.connectedEndpointGroups[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 7, wireType 0 =*/56).int32(message.state); + if (message.reconciling != null && Object.hasOwnProperty.call(message, "reconciling")) + writer.uint32(/* id 8, wireType 0 =*/64).bool(message.reconciling); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 9, wireType 2 =*/74).string(message.description); + if (message.nestedDeployments != null && message.nestedDeployments.length) + for (var i = 0; i < message.nestedDeployments.length; ++i) + $root.google.cloud.networksecurity.v1.MirroringDeploymentGroup.Deployment.encode(message.nestedDeployments[i], writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + if (message.locations != null && message.locations.length) + for (var i = 0; i < message.locations.length; ++i) + $root.google.cloud.networksecurity.v1.MirroringLocation.encode(message.locations[i], writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified MirroringDeploymentGroup message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.MirroringDeploymentGroup.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.networksecurity.v1.MirroringDeploymentGroup + * @static + * @param {google.cloud.networksecurity.v1.IMirroringDeploymentGroup} message MirroringDeploymentGroup message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MirroringDeploymentGroup.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MirroringDeploymentGroup message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.networksecurity.v1.MirroringDeploymentGroup + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.networksecurity.v1.MirroringDeploymentGroup} MirroringDeploymentGroup + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MirroringDeploymentGroup.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networksecurity.v1.MirroringDeploymentGroup(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 3: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 4: { + if (message.labels === $util.emptyObject) + message.labels = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.labels[key] = value; + break; + } + case 5: { + message.network = reader.string(); + break; + } + case 6: { + if (!(message.connectedEndpointGroups && message.connectedEndpointGroups.length)) + message.connectedEndpointGroups = []; + message.connectedEndpointGroups.push($root.google.cloud.networksecurity.v1.MirroringDeploymentGroup.ConnectedEndpointGroup.decode(reader, reader.uint32())); + break; + } + case 10: { + if (!(message.nestedDeployments && message.nestedDeployments.length)) + message.nestedDeployments = []; + message.nestedDeployments.push($root.google.cloud.networksecurity.v1.MirroringDeploymentGroup.Deployment.decode(reader, reader.uint32())); + break; + } + case 7: { + message.state = reader.int32(); + break; + } + case 8: { + message.reconciling = reader.bool(); + break; + } + case 9: { + message.description = reader.string(); + break; + } + case 11: { + if (!(message.locations && message.locations.length)) + message.locations = []; + message.locations.push($root.google.cloud.networksecurity.v1.MirroringLocation.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MirroringDeploymentGroup message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.networksecurity.v1.MirroringDeploymentGroup + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.networksecurity.v1.MirroringDeploymentGroup} MirroringDeploymentGroup + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MirroringDeploymentGroup.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MirroringDeploymentGroup message. + * @function verify + * @memberof google.cloud.networksecurity.v1.MirroringDeploymentGroup + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MirroringDeploymentGroup.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime); + if (error) + return "updateTime." + error; + } + if (message.labels != null && message.hasOwnProperty("labels")) { + if (!$util.isObject(message.labels)) + return "labels: object expected"; + var key = Object.keys(message.labels); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.labels[key[i]])) + return "labels: string{k:string} expected"; + } + if (message.network != null && message.hasOwnProperty("network")) + if (!$util.isString(message.network)) + return "network: string expected"; + if (message.connectedEndpointGroups != null && message.hasOwnProperty("connectedEndpointGroups")) { + if (!Array.isArray(message.connectedEndpointGroups)) + return "connectedEndpointGroups: array expected"; + for (var i = 0; i < message.connectedEndpointGroups.length; ++i) { + var error = $root.google.cloud.networksecurity.v1.MirroringDeploymentGroup.ConnectedEndpointGroup.verify(message.connectedEndpointGroups[i]); + if (error) + return "connectedEndpointGroups." + error; + } + } + if (message.nestedDeployments != null && message.hasOwnProperty("nestedDeployments")) { + if (!Array.isArray(message.nestedDeployments)) + return "nestedDeployments: array expected"; + for (var i = 0; i < message.nestedDeployments.length; ++i) { + var error = $root.google.cloud.networksecurity.v1.MirroringDeploymentGroup.Deployment.verify(message.nestedDeployments[i]); + if (error) + return "nestedDeployments." + error; + } + } + if (message.state != null && message.hasOwnProperty("state")) + switch (message.state) { + default: + return "state: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + break; + } + if (message.reconciling != null && message.hasOwnProperty("reconciling")) + if (typeof message.reconciling !== "boolean") + return "reconciling: boolean expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.locations != null && message.hasOwnProperty("locations")) { + if (!Array.isArray(message.locations)) + return "locations: array expected"; + for (var i = 0; i < message.locations.length; ++i) { + var error = $root.google.cloud.networksecurity.v1.MirroringLocation.verify(message.locations[i]); + if (error) + return "locations." + error; + } + } + return null; + }; + + /** + * Creates a MirroringDeploymentGroup message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.networksecurity.v1.MirroringDeploymentGroup + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.networksecurity.v1.MirroringDeploymentGroup} MirroringDeploymentGroup + */ + MirroringDeploymentGroup.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networksecurity.v1.MirroringDeploymentGroup) + return object; + var message = new $root.google.cloud.networksecurity.v1.MirroringDeploymentGroup(); + if (object.name != null) + message.name = String(object.name); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.networksecurity.v1.MirroringDeploymentGroup.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.updateTime != null) { + if (typeof object.updateTime !== "object") + throw TypeError(".google.cloud.networksecurity.v1.MirroringDeploymentGroup.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.cloud.networksecurity.v1.MirroringDeploymentGroup.labels: object expected"); + message.labels = {}; + for (var keys = Object.keys(object.labels), i = 0; i < keys.length; ++i) + message.labels[keys[i]] = String(object.labels[keys[i]]); + } + if (object.network != null) + message.network = String(object.network); + if (object.connectedEndpointGroups) { + if (!Array.isArray(object.connectedEndpointGroups)) + throw TypeError(".google.cloud.networksecurity.v1.MirroringDeploymentGroup.connectedEndpointGroups: array expected"); + message.connectedEndpointGroups = []; + for (var i = 0; i < object.connectedEndpointGroups.length; ++i) { + if (typeof object.connectedEndpointGroups[i] !== "object") + throw TypeError(".google.cloud.networksecurity.v1.MirroringDeploymentGroup.connectedEndpointGroups: object expected"); + message.connectedEndpointGroups[i] = $root.google.cloud.networksecurity.v1.MirroringDeploymentGroup.ConnectedEndpointGroup.fromObject(object.connectedEndpointGroups[i]); + } + } + if (object.nestedDeployments) { + if (!Array.isArray(object.nestedDeployments)) + throw TypeError(".google.cloud.networksecurity.v1.MirroringDeploymentGroup.nestedDeployments: array expected"); + message.nestedDeployments = []; + for (var i = 0; i < object.nestedDeployments.length; ++i) { + if (typeof object.nestedDeployments[i] !== "object") + throw TypeError(".google.cloud.networksecurity.v1.MirroringDeploymentGroup.nestedDeployments: object expected"); + message.nestedDeployments[i] = $root.google.cloud.networksecurity.v1.MirroringDeploymentGroup.Deployment.fromObject(object.nestedDeployments[i]); + } + } + switch (object.state) { + default: + if (typeof object.state === "number") { + message.state = object.state; + break; + } + break; + case "STATE_UNSPECIFIED": + case 0: + message.state = 0; + break; + case "ACTIVE": + case 1: + message.state = 1; + break; + case "CREATING": + case 2: + message.state = 2; + break; + case "DELETING": + case 3: + message.state = 3; + break; + case "CLOSED": + case 4: + message.state = 4; + break; + } + if (object.reconciling != null) + message.reconciling = Boolean(object.reconciling); + if (object.description != null) + message.description = String(object.description); + if (object.locations) { + if (!Array.isArray(object.locations)) + throw TypeError(".google.cloud.networksecurity.v1.MirroringDeploymentGroup.locations: array expected"); + message.locations = []; + for (var i = 0; i < object.locations.length; ++i) { + if (typeof object.locations[i] !== "object") + throw TypeError(".google.cloud.networksecurity.v1.MirroringDeploymentGroup.locations: object expected"); + message.locations[i] = $root.google.cloud.networksecurity.v1.MirroringLocation.fromObject(object.locations[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a MirroringDeploymentGroup message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.networksecurity.v1.MirroringDeploymentGroup + * @static + * @param {google.cloud.networksecurity.v1.MirroringDeploymentGroup} message MirroringDeploymentGroup + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MirroringDeploymentGroup.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.connectedEndpointGroups = []; + object.nestedDeployments = []; + object.locations = []; + } + if (options.objects || options.defaults) + object.labels = {}; + if (options.defaults) { + object.name = ""; + object.createTime = null; + object.updateTime = null; + object.network = ""; + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + object.reconciling = false; + object.description = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.updateTime != null && message.hasOwnProperty("updateTime")) + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); + var keys2; + if (message.labels && (keys2 = Object.keys(message.labels)).length) { + object.labels = {}; + for (var j = 0; j < keys2.length; ++j) + object.labels[keys2[j]] = message.labels[keys2[j]]; + } + if (message.network != null && message.hasOwnProperty("network")) + object.network = message.network; + if (message.connectedEndpointGroups && message.connectedEndpointGroups.length) { + object.connectedEndpointGroups = []; + for (var j = 0; j < message.connectedEndpointGroups.length; ++j) + object.connectedEndpointGroups[j] = $root.google.cloud.networksecurity.v1.MirroringDeploymentGroup.ConnectedEndpointGroup.toObject(message.connectedEndpointGroups[j], options); + } + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.networksecurity.v1.MirroringDeploymentGroup.State[message.state] === undefined ? message.state : $root.google.cloud.networksecurity.v1.MirroringDeploymentGroup.State[message.state] : message.state; + if (message.reconciling != null && message.hasOwnProperty("reconciling")) + object.reconciling = message.reconciling; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.nestedDeployments && message.nestedDeployments.length) { + object.nestedDeployments = []; + for (var j = 0; j < message.nestedDeployments.length; ++j) + object.nestedDeployments[j] = $root.google.cloud.networksecurity.v1.MirroringDeploymentGroup.Deployment.toObject(message.nestedDeployments[j], options); + } + if (message.locations && message.locations.length) { + object.locations = []; + for (var j = 0; j < message.locations.length; ++j) + object.locations[j] = $root.google.cloud.networksecurity.v1.MirroringLocation.toObject(message.locations[j], options); + } + return object; + }; + + /** + * Converts this MirroringDeploymentGroup to JSON. + * @function toJSON + * @memberof google.cloud.networksecurity.v1.MirroringDeploymentGroup + * @instance + * @returns {Object.} JSON object + */ + MirroringDeploymentGroup.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MirroringDeploymentGroup + * @function getTypeUrl + * @memberof google.cloud.networksecurity.v1.MirroringDeploymentGroup + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MirroringDeploymentGroup.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.networksecurity.v1.MirroringDeploymentGroup"; + }; + + MirroringDeploymentGroup.ConnectedEndpointGroup = (function() { + + /** + * Properties of a ConnectedEndpointGroup. + * @memberof google.cloud.networksecurity.v1.MirroringDeploymentGroup + * @interface IConnectedEndpointGroup + * @property {string|null} [name] ConnectedEndpointGroup name + */ + + /** + * Constructs a new ConnectedEndpointGroup. + * @memberof google.cloud.networksecurity.v1.MirroringDeploymentGroup + * @classdesc Represents a ConnectedEndpointGroup. + * @implements IConnectedEndpointGroup + * @constructor + * @param {google.cloud.networksecurity.v1.MirroringDeploymentGroup.IConnectedEndpointGroup=} [properties] Properties to set + */ + function ConnectedEndpointGroup(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ConnectedEndpointGroup name. + * @member {string} name + * @memberof google.cloud.networksecurity.v1.MirroringDeploymentGroup.ConnectedEndpointGroup + * @instance + */ + ConnectedEndpointGroup.prototype.name = ""; + + /** + * Creates a new ConnectedEndpointGroup instance using the specified properties. + * @function create + * @memberof google.cloud.networksecurity.v1.MirroringDeploymentGroup.ConnectedEndpointGroup + * @static + * @param {google.cloud.networksecurity.v1.MirroringDeploymentGroup.IConnectedEndpointGroup=} [properties] Properties to set + * @returns {google.cloud.networksecurity.v1.MirroringDeploymentGroup.ConnectedEndpointGroup} ConnectedEndpointGroup instance + */ + ConnectedEndpointGroup.create = function create(properties) { + return new ConnectedEndpointGroup(properties); + }; + + /** + * Encodes the specified ConnectedEndpointGroup message. Does not implicitly {@link google.cloud.networksecurity.v1.MirroringDeploymentGroup.ConnectedEndpointGroup.verify|verify} messages. + * @function encode + * @memberof google.cloud.networksecurity.v1.MirroringDeploymentGroup.ConnectedEndpointGroup + * @static + * @param {google.cloud.networksecurity.v1.MirroringDeploymentGroup.IConnectedEndpointGroup} message ConnectedEndpointGroup message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ConnectedEndpointGroup.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified ConnectedEndpointGroup message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.MirroringDeploymentGroup.ConnectedEndpointGroup.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.networksecurity.v1.MirroringDeploymentGroup.ConnectedEndpointGroup + * @static + * @param {google.cloud.networksecurity.v1.MirroringDeploymentGroup.IConnectedEndpointGroup} message ConnectedEndpointGroup message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ConnectedEndpointGroup.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ConnectedEndpointGroup message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.networksecurity.v1.MirroringDeploymentGroup.ConnectedEndpointGroup + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.networksecurity.v1.MirroringDeploymentGroup.ConnectedEndpointGroup} ConnectedEndpointGroup + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ConnectedEndpointGroup.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networksecurity.v1.MirroringDeploymentGroup.ConnectedEndpointGroup(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ConnectedEndpointGroup message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.networksecurity.v1.MirroringDeploymentGroup.ConnectedEndpointGroup + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.networksecurity.v1.MirroringDeploymentGroup.ConnectedEndpointGroup} ConnectedEndpointGroup + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ConnectedEndpointGroup.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ConnectedEndpointGroup message. + * @function verify + * @memberof google.cloud.networksecurity.v1.MirroringDeploymentGroup.ConnectedEndpointGroup + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ConnectedEndpointGroup.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a ConnectedEndpointGroup message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.networksecurity.v1.MirroringDeploymentGroup.ConnectedEndpointGroup + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.networksecurity.v1.MirroringDeploymentGroup.ConnectedEndpointGroup} ConnectedEndpointGroup + */ + ConnectedEndpointGroup.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networksecurity.v1.MirroringDeploymentGroup.ConnectedEndpointGroup) + return object; + var message = new $root.google.cloud.networksecurity.v1.MirroringDeploymentGroup.ConnectedEndpointGroup(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a ConnectedEndpointGroup message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.networksecurity.v1.MirroringDeploymentGroup.ConnectedEndpointGroup + * @static + * @param {google.cloud.networksecurity.v1.MirroringDeploymentGroup.ConnectedEndpointGroup} message ConnectedEndpointGroup + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ConnectedEndpointGroup.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this ConnectedEndpointGroup to JSON. + * @function toJSON + * @memberof google.cloud.networksecurity.v1.MirroringDeploymentGroup.ConnectedEndpointGroup + * @instance + * @returns {Object.} JSON object + */ + ConnectedEndpointGroup.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ConnectedEndpointGroup + * @function getTypeUrl + * @memberof google.cloud.networksecurity.v1.MirroringDeploymentGroup.ConnectedEndpointGroup + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ConnectedEndpointGroup.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.networksecurity.v1.MirroringDeploymentGroup.ConnectedEndpointGroup"; + }; + + return ConnectedEndpointGroup; + })(); + + MirroringDeploymentGroup.Deployment = (function() { + + /** + * Properties of a Deployment. + * @memberof google.cloud.networksecurity.v1.MirroringDeploymentGroup + * @interface IDeployment + * @property {string|null} [name] Deployment name + * @property {google.cloud.networksecurity.v1.MirroringDeployment.State|null} [state] Deployment state + */ + + /** + * Constructs a new Deployment. + * @memberof google.cloud.networksecurity.v1.MirroringDeploymentGroup + * @classdesc Represents a Deployment. + * @implements IDeployment + * @constructor + * @param {google.cloud.networksecurity.v1.MirroringDeploymentGroup.IDeployment=} [properties] Properties to set + */ + function Deployment(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Deployment name. + * @member {string} name + * @memberof google.cloud.networksecurity.v1.MirroringDeploymentGroup.Deployment + * @instance + */ + Deployment.prototype.name = ""; + + /** + * Deployment state. + * @member {google.cloud.networksecurity.v1.MirroringDeployment.State} state + * @memberof google.cloud.networksecurity.v1.MirroringDeploymentGroup.Deployment + * @instance + */ + Deployment.prototype.state = 0; + + /** + * Creates a new Deployment instance using the specified properties. + * @function create + * @memberof google.cloud.networksecurity.v1.MirroringDeploymentGroup.Deployment + * @static + * @param {google.cloud.networksecurity.v1.MirroringDeploymentGroup.IDeployment=} [properties] Properties to set + * @returns {google.cloud.networksecurity.v1.MirroringDeploymentGroup.Deployment} Deployment instance + */ + Deployment.create = function create(properties) { + return new Deployment(properties); + }; + + /** + * Encodes the specified Deployment message. Does not implicitly {@link google.cloud.networksecurity.v1.MirroringDeploymentGroup.Deployment.verify|verify} messages. + * @function encode + * @memberof google.cloud.networksecurity.v1.MirroringDeploymentGroup.Deployment + * @static + * @param {google.cloud.networksecurity.v1.MirroringDeploymentGroup.IDeployment} message Deployment message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Deployment.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.state); + return writer; + }; + + /** + * Encodes the specified Deployment message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.MirroringDeploymentGroup.Deployment.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.networksecurity.v1.MirroringDeploymentGroup.Deployment + * @static + * @param {google.cloud.networksecurity.v1.MirroringDeploymentGroup.IDeployment} message Deployment message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Deployment.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Deployment message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.networksecurity.v1.MirroringDeploymentGroup.Deployment + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.networksecurity.v1.MirroringDeploymentGroup.Deployment} Deployment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Deployment.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networksecurity.v1.MirroringDeploymentGroup.Deployment(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.state = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Deployment message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.networksecurity.v1.MirroringDeploymentGroup.Deployment + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.networksecurity.v1.MirroringDeploymentGroup.Deployment} Deployment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Deployment.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Deployment message. + * @function verify + * @memberof google.cloud.networksecurity.v1.MirroringDeploymentGroup.Deployment + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Deployment.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.state != null && message.hasOwnProperty("state")) + switch (message.state) { + default: + return "state: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + break; + } + return null; + }; + + /** + * Creates a Deployment message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.networksecurity.v1.MirroringDeploymentGroup.Deployment + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.networksecurity.v1.MirroringDeploymentGroup.Deployment} Deployment + */ + Deployment.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networksecurity.v1.MirroringDeploymentGroup.Deployment) + return object; + var message = new $root.google.cloud.networksecurity.v1.MirroringDeploymentGroup.Deployment(); + if (object.name != null) + message.name = String(object.name); + switch (object.state) { + default: + if (typeof object.state === "number") { + message.state = object.state; + break; + } + break; + case "STATE_UNSPECIFIED": + case 0: + message.state = 0; + break; + case "ACTIVE": + case 1: + message.state = 1; + break; + case "CREATING": + case 2: + message.state = 2; + break; + case "DELETING": + case 3: + message.state = 3; + break; + case "OUT_OF_SYNC": + case 4: + message.state = 4; + break; + case "DELETE_FAILED": + case 5: + message.state = 5; + break; + } + return message; + }; + + /** + * Creates a plain object from a Deployment message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.networksecurity.v1.MirroringDeploymentGroup.Deployment + * @static + * @param {google.cloud.networksecurity.v1.MirroringDeploymentGroup.Deployment} message Deployment + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Deployment.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.networksecurity.v1.MirroringDeployment.State[message.state] === undefined ? message.state : $root.google.cloud.networksecurity.v1.MirroringDeployment.State[message.state] : message.state; + return object; + }; + + /** + * Converts this Deployment to JSON. + * @function toJSON + * @memberof google.cloud.networksecurity.v1.MirroringDeploymentGroup.Deployment + * @instance + * @returns {Object.} JSON object + */ + Deployment.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Deployment + * @function getTypeUrl + * @memberof google.cloud.networksecurity.v1.MirroringDeploymentGroup.Deployment + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Deployment.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.networksecurity.v1.MirroringDeploymentGroup.Deployment"; + }; + + return Deployment; + })(); + + /** + * State enum. + * @name google.cloud.networksecurity.v1.MirroringDeploymentGroup.State + * @enum {number} + * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value + * @property {number} ACTIVE=1 ACTIVE value + * @property {number} CREATING=2 CREATING value + * @property {number} DELETING=3 DELETING value + * @property {number} CLOSED=4 CLOSED value + */ + MirroringDeploymentGroup.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "ACTIVE"] = 1; + values[valuesById[2] = "CREATING"] = 2; + values[valuesById[3] = "DELETING"] = 3; + values[valuesById[4] = "CLOSED"] = 4; + return values; + })(); + + return MirroringDeploymentGroup; + })(); + + v1.ListMirroringDeploymentGroupsRequest = (function() { + + /** + * Properties of a ListMirroringDeploymentGroupsRequest. + * @memberof google.cloud.networksecurity.v1 + * @interface IListMirroringDeploymentGroupsRequest + * @property {string|null} [parent] ListMirroringDeploymentGroupsRequest parent + * @property {number|null} [pageSize] ListMirroringDeploymentGroupsRequest pageSize + * @property {string|null} [pageToken] ListMirroringDeploymentGroupsRequest pageToken + * @property {string|null} [filter] ListMirroringDeploymentGroupsRequest filter + * @property {string|null} [orderBy] ListMirroringDeploymentGroupsRequest orderBy + */ + + /** + * Constructs a new ListMirroringDeploymentGroupsRequest. + * @memberof google.cloud.networksecurity.v1 + * @classdesc Represents a ListMirroringDeploymentGroupsRequest. + * @implements IListMirroringDeploymentGroupsRequest + * @constructor + * @param {google.cloud.networksecurity.v1.IListMirroringDeploymentGroupsRequest=} [properties] Properties to set + */ + function ListMirroringDeploymentGroupsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListMirroringDeploymentGroupsRequest parent. + * @member {string} parent + * @memberof google.cloud.networksecurity.v1.ListMirroringDeploymentGroupsRequest + * @instance + */ + ListMirroringDeploymentGroupsRequest.prototype.parent = ""; + + /** + * ListMirroringDeploymentGroupsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.networksecurity.v1.ListMirroringDeploymentGroupsRequest + * @instance + */ + ListMirroringDeploymentGroupsRequest.prototype.pageSize = 0; + + /** + * ListMirroringDeploymentGroupsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.networksecurity.v1.ListMirroringDeploymentGroupsRequest + * @instance + */ + ListMirroringDeploymentGroupsRequest.prototype.pageToken = ""; + + /** + * ListMirroringDeploymentGroupsRequest filter. + * @member {string} filter + * @memberof google.cloud.networksecurity.v1.ListMirroringDeploymentGroupsRequest + * @instance + */ + ListMirroringDeploymentGroupsRequest.prototype.filter = ""; + + /** + * ListMirroringDeploymentGroupsRequest orderBy. + * @member {string} orderBy + * @memberof google.cloud.networksecurity.v1.ListMirroringDeploymentGroupsRequest + * @instance + */ + ListMirroringDeploymentGroupsRequest.prototype.orderBy = ""; + + /** + * Creates a new ListMirroringDeploymentGroupsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.networksecurity.v1.ListMirroringDeploymentGroupsRequest + * @static + * @param {google.cloud.networksecurity.v1.IListMirroringDeploymentGroupsRequest=} [properties] Properties to set + * @returns {google.cloud.networksecurity.v1.ListMirroringDeploymentGroupsRequest} ListMirroringDeploymentGroupsRequest instance + */ + ListMirroringDeploymentGroupsRequest.create = function create(properties) { + return new ListMirroringDeploymentGroupsRequest(properties); + }; + + /** + * Encodes the specified ListMirroringDeploymentGroupsRequest message. Does not implicitly {@link google.cloud.networksecurity.v1.ListMirroringDeploymentGroupsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.networksecurity.v1.ListMirroringDeploymentGroupsRequest + * @static + * @param {google.cloud.networksecurity.v1.IListMirroringDeploymentGroupsRequest} message ListMirroringDeploymentGroupsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListMirroringDeploymentGroupsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.filter); + if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.orderBy); + return writer; + }; + + /** + * Encodes the specified ListMirroringDeploymentGroupsRequest message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.ListMirroringDeploymentGroupsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.networksecurity.v1.ListMirroringDeploymentGroupsRequest + * @static + * @param {google.cloud.networksecurity.v1.IListMirroringDeploymentGroupsRequest} message ListMirroringDeploymentGroupsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListMirroringDeploymentGroupsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListMirroringDeploymentGroupsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.networksecurity.v1.ListMirroringDeploymentGroupsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.networksecurity.v1.ListMirroringDeploymentGroupsRequest} ListMirroringDeploymentGroupsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListMirroringDeploymentGroupsRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networksecurity.v1.ListMirroringDeploymentGroupsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + case 4: { + message.filter = reader.string(); + break; + } + case 5: { + message.orderBy = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListMirroringDeploymentGroupsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.networksecurity.v1.ListMirroringDeploymentGroupsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.networksecurity.v1.ListMirroringDeploymentGroupsRequest} ListMirroringDeploymentGroupsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListMirroringDeploymentGroupsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListMirroringDeploymentGroupsRequest message. + * @function verify + * @memberof google.cloud.networksecurity.v1.ListMirroringDeploymentGroupsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListMirroringDeploymentGroupsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + if (!$util.isString(message.orderBy)) + return "orderBy: string expected"; + return null; + }; + + /** + * Creates a ListMirroringDeploymentGroupsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.networksecurity.v1.ListMirroringDeploymentGroupsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.networksecurity.v1.ListMirroringDeploymentGroupsRequest} ListMirroringDeploymentGroupsRequest + */ + ListMirroringDeploymentGroupsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networksecurity.v1.ListMirroringDeploymentGroupsRequest) + return object; + var message = new $root.google.cloud.networksecurity.v1.ListMirroringDeploymentGroupsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.filter != null) + message.filter = String(object.filter); + if (object.orderBy != null) + message.orderBy = String(object.orderBy); + return message; + }; + + /** + * Creates a plain object from a ListMirroringDeploymentGroupsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.networksecurity.v1.ListMirroringDeploymentGroupsRequest + * @static + * @param {google.cloud.networksecurity.v1.ListMirroringDeploymentGroupsRequest} message ListMirroringDeploymentGroupsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListMirroringDeploymentGroupsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + object.filter = ""; + object.orderBy = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + object.orderBy = message.orderBy; + return object; + }; + + /** + * Converts this ListMirroringDeploymentGroupsRequest to JSON. + * @function toJSON + * @memberof google.cloud.networksecurity.v1.ListMirroringDeploymentGroupsRequest + * @instance + * @returns {Object.} JSON object + */ + ListMirroringDeploymentGroupsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListMirroringDeploymentGroupsRequest + * @function getTypeUrl + * @memberof google.cloud.networksecurity.v1.ListMirroringDeploymentGroupsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListMirroringDeploymentGroupsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.networksecurity.v1.ListMirroringDeploymentGroupsRequest"; + }; + + return ListMirroringDeploymentGroupsRequest; + })(); + + v1.ListMirroringDeploymentGroupsResponse = (function() { + + /** + * Properties of a ListMirroringDeploymentGroupsResponse. + * @memberof google.cloud.networksecurity.v1 + * @interface IListMirroringDeploymentGroupsResponse + * @property {Array.|null} [mirroringDeploymentGroups] ListMirroringDeploymentGroupsResponse mirroringDeploymentGroups + * @property {string|null} [nextPageToken] ListMirroringDeploymentGroupsResponse nextPageToken + */ + + /** + * Constructs a new ListMirroringDeploymentGroupsResponse. + * @memberof google.cloud.networksecurity.v1 + * @classdesc Represents a ListMirroringDeploymentGroupsResponse. + * @implements IListMirroringDeploymentGroupsResponse + * @constructor + * @param {google.cloud.networksecurity.v1.IListMirroringDeploymentGroupsResponse=} [properties] Properties to set + */ + function ListMirroringDeploymentGroupsResponse(properties) { + this.mirroringDeploymentGroups = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListMirroringDeploymentGroupsResponse mirroringDeploymentGroups. + * @member {Array.} mirroringDeploymentGroups + * @memberof google.cloud.networksecurity.v1.ListMirroringDeploymentGroupsResponse + * @instance + */ + ListMirroringDeploymentGroupsResponse.prototype.mirroringDeploymentGroups = $util.emptyArray; + + /** + * ListMirroringDeploymentGroupsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.networksecurity.v1.ListMirroringDeploymentGroupsResponse + * @instance + */ + ListMirroringDeploymentGroupsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListMirroringDeploymentGroupsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.networksecurity.v1.ListMirroringDeploymentGroupsResponse + * @static + * @param {google.cloud.networksecurity.v1.IListMirroringDeploymentGroupsResponse=} [properties] Properties to set + * @returns {google.cloud.networksecurity.v1.ListMirroringDeploymentGroupsResponse} ListMirroringDeploymentGroupsResponse instance + */ + ListMirroringDeploymentGroupsResponse.create = function create(properties) { + return new ListMirroringDeploymentGroupsResponse(properties); + }; + + /** + * Encodes the specified ListMirroringDeploymentGroupsResponse message. Does not implicitly {@link google.cloud.networksecurity.v1.ListMirroringDeploymentGroupsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.networksecurity.v1.ListMirroringDeploymentGroupsResponse + * @static + * @param {google.cloud.networksecurity.v1.IListMirroringDeploymentGroupsResponse} message ListMirroringDeploymentGroupsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListMirroringDeploymentGroupsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.mirroringDeploymentGroups != null && message.mirroringDeploymentGroups.length) + for (var i = 0; i < message.mirroringDeploymentGroups.length; ++i) + $root.google.cloud.networksecurity.v1.MirroringDeploymentGroup.encode(message.mirroringDeploymentGroups[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + return writer; + }; + + /** + * Encodes the specified ListMirroringDeploymentGroupsResponse message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.ListMirroringDeploymentGroupsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.networksecurity.v1.ListMirroringDeploymentGroupsResponse + * @static + * @param {google.cloud.networksecurity.v1.IListMirroringDeploymentGroupsResponse} message ListMirroringDeploymentGroupsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListMirroringDeploymentGroupsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListMirroringDeploymentGroupsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.networksecurity.v1.ListMirroringDeploymentGroupsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.networksecurity.v1.ListMirroringDeploymentGroupsResponse} ListMirroringDeploymentGroupsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListMirroringDeploymentGroupsResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networksecurity.v1.ListMirroringDeploymentGroupsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.mirroringDeploymentGroups && message.mirroringDeploymentGroups.length)) + message.mirroringDeploymentGroups = []; + message.mirroringDeploymentGroups.push($root.google.cloud.networksecurity.v1.MirroringDeploymentGroup.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListMirroringDeploymentGroupsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.networksecurity.v1.ListMirroringDeploymentGroupsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.networksecurity.v1.ListMirroringDeploymentGroupsResponse} ListMirroringDeploymentGroupsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListMirroringDeploymentGroupsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListMirroringDeploymentGroupsResponse message. + * @function verify + * @memberof google.cloud.networksecurity.v1.ListMirroringDeploymentGroupsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListMirroringDeploymentGroupsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.mirroringDeploymentGroups != null && message.hasOwnProperty("mirroringDeploymentGroups")) { + if (!Array.isArray(message.mirroringDeploymentGroups)) + return "mirroringDeploymentGroups: array expected"; + for (var i = 0; i < message.mirroringDeploymentGroups.length; ++i) { + var error = $root.google.cloud.networksecurity.v1.MirroringDeploymentGroup.verify(message.mirroringDeploymentGroups[i]); + if (error) + return "mirroringDeploymentGroups." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListMirroringDeploymentGroupsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.networksecurity.v1.ListMirroringDeploymentGroupsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.networksecurity.v1.ListMirroringDeploymentGroupsResponse} ListMirroringDeploymentGroupsResponse + */ + ListMirroringDeploymentGroupsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networksecurity.v1.ListMirroringDeploymentGroupsResponse) + return object; + var message = new $root.google.cloud.networksecurity.v1.ListMirroringDeploymentGroupsResponse(); + if (object.mirroringDeploymentGroups) { + if (!Array.isArray(object.mirroringDeploymentGroups)) + throw TypeError(".google.cloud.networksecurity.v1.ListMirroringDeploymentGroupsResponse.mirroringDeploymentGroups: array expected"); + message.mirroringDeploymentGroups = []; + for (var i = 0; i < object.mirroringDeploymentGroups.length; ++i) { + if (typeof object.mirroringDeploymentGroups[i] !== "object") + throw TypeError(".google.cloud.networksecurity.v1.ListMirroringDeploymentGroupsResponse.mirroringDeploymentGroups: object expected"); + message.mirroringDeploymentGroups[i] = $root.google.cloud.networksecurity.v1.MirroringDeploymentGroup.fromObject(object.mirroringDeploymentGroups[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListMirroringDeploymentGroupsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.networksecurity.v1.ListMirroringDeploymentGroupsResponse + * @static + * @param {google.cloud.networksecurity.v1.ListMirroringDeploymentGroupsResponse} message ListMirroringDeploymentGroupsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListMirroringDeploymentGroupsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.mirroringDeploymentGroups = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.mirroringDeploymentGroups && message.mirroringDeploymentGroups.length) { + object.mirroringDeploymentGroups = []; + for (var j = 0; j < message.mirroringDeploymentGroups.length; ++j) + object.mirroringDeploymentGroups[j] = $root.google.cloud.networksecurity.v1.MirroringDeploymentGroup.toObject(message.mirroringDeploymentGroups[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListMirroringDeploymentGroupsResponse to JSON. + * @function toJSON + * @memberof google.cloud.networksecurity.v1.ListMirroringDeploymentGroupsResponse + * @instance + * @returns {Object.} JSON object + */ + ListMirroringDeploymentGroupsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListMirroringDeploymentGroupsResponse + * @function getTypeUrl + * @memberof google.cloud.networksecurity.v1.ListMirroringDeploymentGroupsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListMirroringDeploymentGroupsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.networksecurity.v1.ListMirroringDeploymentGroupsResponse"; + }; + + return ListMirroringDeploymentGroupsResponse; + })(); + + v1.GetMirroringDeploymentGroupRequest = (function() { + + /** + * Properties of a GetMirroringDeploymentGroupRequest. + * @memberof google.cloud.networksecurity.v1 + * @interface IGetMirroringDeploymentGroupRequest + * @property {string|null} [name] GetMirroringDeploymentGroupRequest name + */ + + /** + * Constructs a new GetMirroringDeploymentGroupRequest. + * @memberof google.cloud.networksecurity.v1 + * @classdesc Represents a GetMirroringDeploymentGroupRequest. + * @implements IGetMirroringDeploymentGroupRequest + * @constructor + * @param {google.cloud.networksecurity.v1.IGetMirroringDeploymentGroupRequest=} [properties] Properties to set + */ + function GetMirroringDeploymentGroupRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetMirroringDeploymentGroupRequest name. + * @member {string} name + * @memberof google.cloud.networksecurity.v1.GetMirroringDeploymentGroupRequest + * @instance + */ + GetMirroringDeploymentGroupRequest.prototype.name = ""; + + /** + * Creates a new GetMirroringDeploymentGroupRequest instance using the specified properties. + * @function create + * @memberof google.cloud.networksecurity.v1.GetMirroringDeploymentGroupRequest + * @static + * @param {google.cloud.networksecurity.v1.IGetMirroringDeploymentGroupRequest=} [properties] Properties to set + * @returns {google.cloud.networksecurity.v1.GetMirroringDeploymentGroupRequest} GetMirroringDeploymentGroupRequest instance + */ + GetMirroringDeploymentGroupRequest.create = function create(properties) { + return new GetMirroringDeploymentGroupRequest(properties); + }; + + /** + * Encodes the specified GetMirroringDeploymentGroupRequest message. Does not implicitly {@link google.cloud.networksecurity.v1.GetMirroringDeploymentGroupRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.networksecurity.v1.GetMirroringDeploymentGroupRequest + * @static + * @param {google.cloud.networksecurity.v1.IGetMirroringDeploymentGroupRequest} message GetMirroringDeploymentGroupRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetMirroringDeploymentGroupRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified GetMirroringDeploymentGroupRequest message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.GetMirroringDeploymentGroupRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.networksecurity.v1.GetMirroringDeploymentGroupRequest + * @static + * @param {google.cloud.networksecurity.v1.IGetMirroringDeploymentGroupRequest} message GetMirroringDeploymentGroupRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetMirroringDeploymentGroupRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetMirroringDeploymentGroupRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.networksecurity.v1.GetMirroringDeploymentGroupRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.networksecurity.v1.GetMirroringDeploymentGroupRequest} GetMirroringDeploymentGroupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetMirroringDeploymentGroupRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networksecurity.v1.GetMirroringDeploymentGroupRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetMirroringDeploymentGroupRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.networksecurity.v1.GetMirroringDeploymentGroupRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.networksecurity.v1.GetMirroringDeploymentGroupRequest} GetMirroringDeploymentGroupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetMirroringDeploymentGroupRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetMirroringDeploymentGroupRequest message. + * @function verify + * @memberof google.cloud.networksecurity.v1.GetMirroringDeploymentGroupRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetMirroringDeploymentGroupRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a GetMirroringDeploymentGroupRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.networksecurity.v1.GetMirroringDeploymentGroupRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.networksecurity.v1.GetMirroringDeploymentGroupRequest} GetMirroringDeploymentGroupRequest + */ + GetMirroringDeploymentGroupRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networksecurity.v1.GetMirroringDeploymentGroupRequest) + return object; + var message = new $root.google.cloud.networksecurity.v1.GetMirroringDeploymentGroupRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetMirroringDeploymentGroupRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.networksecurity.v1.GetMirroringDeploymentGroupRequest + * @static + * @param {google.cloud.networksecurity.v1.GetMirroringDeploymentGroupRequest} message GetMirroringDeploymentGroupRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetMirroringDeploymentGroupRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this GetMirroringDeploymentGroupRequest to JSON. + * @function toJSON + * @memberof google.cloud.networksecurity.v1.GetMirroringDeploymentGroupRequest + * @instance + * @returns {Object.} JSON object + */ + GetMirroringDeploymentGroupRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetMirroringDeploymentGroupRequest + * @function getTypeUrl + * @memberof google.cloud.networksecurity.v1.GetMirroringDeploymentGroupRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetMirroringDeploymentGroupRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.networksecurity.v1.GetMirroringDeploymentGroupRequest"; + }; + + return GetMirroringDeploymentGroupRequest; + })(); + + v1.CreateMirroringDeploymentGroupRequest = (function() { + + /** + * Properties of a CreateMirroringDeploymentGroupRequest. + * @memberof google.cloud.networksecurity.v1 + * @interface ICreateMirroringDeploymentGroupRequest + * @property {string|null} [parent] CreateMirroringDeploymentGroupRequest parent + * @property {string|null} [mirroringDeploymentGroupId] CreateMirroringDeploymentGroupRequest mirroringDeploymentGroupId + * @property {google.cloud.networksecurity.v1.IMirroringDeploymentGroup|null} [mirroringDeploymentGroup] CreateMirroringDeploymentGroupRequest mirroringDeploymentGroup + * @property {string|null} [requestId] CreateMirroringDeploymentGroupRequest requestId + */ + + /** + * Constructs a new CreateMirroringDeploymentGroupRequest. + * @memberof google.cloud.networksecurity.v1 + * @classdesc Represents a CreateMirroringDeploymentGroupRequest. + * @implements ICreateMirroringDeploymentGroupRequest + * @constructor + * @param {google.cloud.networksecurity.v1.ICreateMirroringDeploymentGroupRequest=} [properties] Properties to set + */ + function CreateMirroringDeploymentGroupRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateMirroringDeploymentGroupRequest parent. + * @member {string} parent + * @memberof google.cloud.networksecurity.v1.CreateMirroringDeploymentGroupRequest + * @instance + */ + CreateMirroringDeploymentGroupRequest.prototype.parent = ""; + + /** + * CreateMirroringDeploymentGroupRequest mirroringDeploymentGroupId. + * @member {string} mirroringDeploymentGroupId + * @memberof google.cloud.networksecurity.v1.CreateMirroringDeploymentGroupRequest + * @instance + */ + CreateMirroringDeploymentGroupRequest.prototype.mirroringDeploymentGroupId = ""; + + /** + * CreateMirroringDeploymentGroupRequest mirroringDeploymentGroup. + * @member {google.cloud.networksecurity.v1.IMirroringDeploymentGroup|null|undefined} mirroringDeploymentGroup + * @memberof google.cloud.networksecurity.v1.CreateMirroringDeploymentGroupRequest + * @instance + */ + CreateMirroringDeploymentGroupRequest.prototype.mirroringDeploymentGroup = null; + + /** + * CreateMirroringDeploymentGroupRequest requestId. + * @member {string} requestId + * @memberof google.cloud.networksecurity.v1.CreateMirroringDeploymentGroupRequest + * @instance + */ + CreateMirroringDeploymentGroupRequest.prototype.requestId = ""; + + /** + * Creates a new CreateMirroringDeploymentGroupRequest instance using the specified properties. + * @function create + * @memberof google.cloud.networksecurity.v1.CreateMirroringDeploymentGroupRequest + * @static + * @param {google.cloud.networksecurity.v1.ICreateMirroringDeploymentGroupRequest=} [properties] Properties to set + * @returns {google.cloud.networksecurity.v1.CreateMirroringDeploymentGroupRequest} CreateMirroringDeploymentGroupRequest instance + */ + CreateMirroringDeploymentGroupRequest.create = function create(properties) { + return new CreateMirroringDeploymentGroupRequest(properties); + }; + + /** + * Encodes the specified CreateMirroringDeploymentGroupRequest message. Does not implicitly {@link google.cloud.networksecurity.v1.CreateMirroringDeploymentGroupRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.networksecurity.v1.CreateMirroringDeploymentGroupRequest + * @static + * @param {google.cloud.networksecurity.v1.ICreateMirroringDeploymentGroupRequest} message CreateMirroringDeploymentGroupRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateMirroringDeploymentGroupRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.mirroringDeploymentGroupId != null && Object.hasOwnProperty.call(message, "mirroringDeploymentGroupId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.mirroringDeploymentGroupId); + if (message.mirroringDeploymentGroup != null && Object.hasOwnProperty.call(message, "mirroringDeploymentGroup")) + $root.google.cloud.networksecurity.v1.MirroringDeploymentGroup.encode(message.mirroringDeploymentGroup, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.requestId); + return writer; + }; + + /** + * Encodes the specified CreateMirroringDeploymentGroupRequest message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.CreateMirroringDeploymentGroupRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.networksecurity.v1.CreateMirroringDeploymentGroupRequest + * @static + * @param {google.cloud.networksecurity.v1.ICreateMirroringDeploymentGroupRequest} message CreateMirroringDeploymentGroupRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateMirroringDeploymentGroupRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateMirroringDeploymentGroupRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.networksecurity.v1.CreateMirroringDeploymentGroupRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.networksecurity.v1.CreateMirroringDeploymentGroupRequest} CreateMirroringDeploymentGroupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateMirroringDeploymentGroupRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networksecurity.v1.CreateMirroringDeploymentGroupRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.mirroringDeploymentGroupId = reader.string(); + break; + } + case 3: { + message.mirroringDeploymentGroup = $root.google.cloud.networksecurity.v1.MirroringDeploymentGroup.decode(reader, reader.uint32()); + break; + } + case 4: { + message.requestId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateMirroringDeploymentGroupRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.networksecurity.v1.CreateMirroringDeploymentGroupRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.networksecurity.v1.CreateMirroringDeploymentGroupRequest} CreateMirroringDeploymentGroupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateMirroringDeploymentGroupRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateMirroringDeploymentGroupRequest message. + * @function verify + * @memberof google.cloud.networksecurity.v1.CreateMirroringDeploymentGroupRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateMirroringDeploymentGroupRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.mirroringDeploymentGroupId != null && message.hasOwnProperty("mirroringDeploymentGroupId")) + if (!$util.isString(message.mirroringDeploymentGroupId)) + return "mirroringDeploymentGroupId: string expected"; + if (message.mirroringDeploymentGroup != null && message.hasOwnProperty("mirroringDeploymentGroup")) { + var error = $root.google.cloud.networksecurity.v1.MirroringDeploymentGroup.verify(message.mirroringDeploymentGroup); + if (error) + return "mirroringDeploymentGroup." + error; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + return null; + }; + + /** + * Creates a CreateMirroringDeploymentGroupRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.networksecurity.v1.CreateMirroringDeploymentGroupRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.networksecurity.v1.CreateMirroringDeploymentGroupRequest} CreateMirroringDeploymentGroupRequest + */ + CreateMirroringDeploymentGroupRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networksecurity.v1.CreateMirroringDeploymentGroupRequest) + return object; + var message = new $root.google.cloud.networksecurity.v1.CreateMirroringDeploymentGroupRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.mirroringDeploymentGroupId != null) + message.mirroringDeploymentGroupId = String(object.mirroringDeploymentGroupId); + if (object.mirroringDeploymentGroup != null) { + if (typeof object.mirroringDeploymentGroup !== "object") + throw TypeError(".google.cloud.networksecurity.v1.CreateMirroringDeploymentGroupRequest.mirroringDeploymentGroup: object expected"); + message.mirroringDeploymentGroup = $root.google.cloud.networksecurity.v1.MirroringDeploymentGroup.fromObject(object.mirroringDeploymentGroup); + } + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from a CreateMirroringDeploymentGroupRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.networksecurity.v1.CreateMirroringDeploymentGroupRequest + * @static + * @param {google.cloud.networksecurity.v1.CreateMirroringDeploymentGroupRequest} message CreateMirroringDeploymentGroupRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateMirroringDeploymentGroupRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.mirroringDeploymentGroupId = ""; + object.mirroringDeploymentGroup = null; + object.requestId = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.mirroringDeploymentGroupId != null && message.hasOwnProperty("mirroringDeploymentGroupId")) + object.mirroringDeploymentGroupId = message.mirroringDeploymentGroupId; + if (message.mirroringDeploymentGroup != null && message.hasOwnProperty("mirroringDeploymentGroup")) + object.mirroringDeploymentGroup = $root.google.cloud.networksecurity.v1.MirroringDeploymentGroup.toObject(message.mirroringDeploymentGroup, options); + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + return object; + }; + + /** + * Converts this CreateMirroringDeploymentGroupRequest to JSON. + * @function toJSON + * @memberof google.cloud.networksecurity.v1.CreateMirroringDeploymentGroupRequest + * @instance + * @returns {Object.} JSON object + */ + CreateMirroringDeploymentGroupRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateMirroringDeploymentGroupRequest + * @function getTypeUrl + * @memberof google.cloud.networksecurity.v1.CreateMirroringDeploymentGroupRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateMirroringDeploymentGroupRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.networksecurity.v1.CreateMirroringDeploymentGroupRequest"; + }; + + return CreateMirroringDeploymentGroupRequest; + })(); + + v1.UpdateMirroringDeploymentGroupRequest = (function() { + + /** + * Properties of an UpdateMirroringDeploymentGroupRequest. + * @memberof google.cloud.networksecurity.v1 + * @interface IUpdateMirroringDeploymentGroupRequest + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateMirroringDeploymentGroupRequest updateMask + * @property {google.cloud.networksecurity.v1.IMirroringDeploymentGroup|null} [mirroringDeploymentGroup] UpdateMirroringDeploymentGroupRequest mirroringDeploymentGroup + * @property {string|null} [requestId] UpdateMirroringDeploymentGroupRequest requestId + */ + + /** + * Constructs a new UpdateMirroringDeploymentGroupRequest. + * @memberof google.cloud.networksecurity.v1 + * @classdesc Represents an UpdateMirroringDeploymentGroupRequest. + * @implements IUpdateMirroringDeploymentGroupRequest + * @constructor + * @param {google.cloud.networksecurity.v1.IUpdateMirroringDeploymentGroupRequest=} [properties] Properties to set + */ + function UpdateMirroringDeploymentGroupRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateMirroringDeploymentGroupRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.networksecurity.v1.UpdateMirroringDeploymentGroupRequest + * @instance + */ + UpdateMirroringDeploymentGroupRequest.prototype.updateMask = null; + + /** + * UpdateMirroringDeploymentGroupRequest mirroringDeploymentGroup. + * @member {google.cloud.networksecurity.v1.IMirroringDeploymentGroup|null|undefined} mirroringDeploymentGroup + * @memberof google.cloud.networksecurity.v1.UpdateMirroringDeploymentGroupRequest + * @instance + */ + UpdateMirroringDeploymentGroupRequest.prototype.mirroringDeploymentGroup = null; + + /** + * UpdateMirroringDeploymentGroupRequest requestId. + * @member {string} requestId + * @memberof google.cloud.networksecurity.v1.UpdateMirroringDeploymentGroupRequest + * @instance + */ + UpdateMirroringDeploymentGroupRequest.prototype.requestId = ""; + + /** + * Creates a new UpdateMirroringDeploymentGroupRequest instance using the specified properties. + * @function create + * @memberof google.cloud.networksecurity.v1.UpdateMirroringDeploymentGroupRequest + * @static + * @param {google.cloud.networksecurity.v1.IUpdateMirroringDeploymentGroupRequest=} [properties] Properties to set + * @returns {google.cloud.networksecurity.v1.UpdateMirroringDeploymentGroupRequest} UpdateMirroringDeploymentGroupRequest instance + */ + UpdateMirroringDeploymentGroupRequest.create = function create(properties) { + return new UpdateMirroringDeploymentGroupRequest(properties); + }; + + /** + * Encodes the specified UpdateMirroringDeploymentGroupRequest message. Does not implicitly {@link google.cloud.networksecurity.v1.UpdateMirroringDeploymentGroupRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.networksecurity.v1.UpdateMirroringDeploymentGroupRequest + * @static + * @param {google.cloud.networksecurity.v1.IUpdateMirroringDeploymentGroupRequest} message UpdateMirroringDeploymentGroupRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateMirroringDeploymentGroupRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.mirroringDeploymentGroup != null && Object.hasOwnProperty.call(message, "mirroringDeploymentGroup")) + $root.google.cloud.networksecurity.v1.MirroringDeploymentGroup.encode(message.mirroringDeploymentGroup, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.requestId); + return writer; + }; + + /** + * Encodes the specified UpdateMirroringDeploymentGroupRequest message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.UpdateMirroringDeploymentGroupRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.networksecurity.v1.UpdateMirroringDeploymentGroupRequest + * @static + * @param {google.cloud.networksecurity.v1.IUpdateMirroringDeploymentGroupRequest} message UpdateMirroringDeploymentGroupRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateMirroringDeploymentGroupRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateMirroringDeploymentGroupRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.networksecurity.v1.UpdateMirroringDeploymentGroupRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.networksecurity.v1.UpdateMirroringDeploymentGroupRequest} UpdateMirroringDeploymentGroupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateMirroringDeploymentGroupRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networksecurity.v1.UpdateMirroringDeploymentGroupRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + case 2: { + message.mirroringDeploymentGroup = $root.google.cloud.networksecurity.v1.MirroringDeploymentGroup.decode(reader, reader.uint32()); + break; + } + case 3: { + message.requestId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateMirroringDeploymentGroupRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.networksecurity.v1.UpdateMirroringDeploymentGroupRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.networksecurity.v1.UpdateMirroringDeploymentGroupRequest} UpdateMirroringDeploymentGroupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateMirroringDeploymentGroupRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateMirroringDeploymentGroupRequest message. + * @function verify + * @memberof google.cloud.networksecurity.v1.UpdateMirroringDeploymentGroupRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateMirroringDeploymentGroupRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + if (message.mirroringDeploymentGroup != null && message.hasOwnProperty("mirroringDeploymentGroup")) { + var error = $root.google.cloud.networksecurity.v1.MirroringDeploymentGroup.verify(message.mirroringDeploymentGroup); + if (error) + return "mirroringDeploymentGroup." + error; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + return null; + }; + + /** + * Creates an UpdateMirroringDeploymentGroupRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.networksecurity.v1.UpdateMirroringDeploymentGroupRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.networksecurity.v1.UpdateMirroringDeploymentGroupRequest} UpdateMirroringDeploymentGroupRequest + */ + UpdateMirroringDeploymentGroupRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networksecurity.v1.UpdateMirroringDeploymentGroupRequest) + return object; + var message = new $root.google.cloud.networksecurity.v1.UpdateMirroringDeploymentGroupRequest(); + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.networksecurity.v1.UpdateMirroringDeploymentGroupRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + if (object.mirroringDeploymentGroup != null) { + if (typeof object.mirroringDeploymentGroup !== "object") + throw TypeError(".google.cloud.networksecurity.v1.UpdateMirroringDeploymentGroupRequest.mirroringDeploymentGroup: object expected"); + message.mirroringDeploymentGroup = $root.google.cloud.networksecurity.v1.MirroringDeploymentGroup.fromObject(object.mirroringDeploymentGroup); + } + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from an UpdateMirroringDeploymentGroupRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.networksecurity.v1.UpdateMirroringDeploymentGroupRequest + * @static + * @param {google.cloud.networksecurity.v1.UpdateMirroringDeploymentGroupRequest} message UpdateMirroringDeploymentGroupRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateMirroringDeploymentGroupRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.updateMask = null; + object.mirroringDeploymentGroup = null; + object.requestId = ""; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + if (message.mirroringDeploymentGroup != null && message.hasOwnProperty("mirroringDeploymentGroup")) + object.mirroringDeploymentGroup = $root.google.cloud.networksecurity.v1.MirroringDeploymentGroup.toObject(message.mirroringDeploymentGroup, options); + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + return object; + }; + + /** + * Converts this UpdateMirroringDeploymentGroupRequest to JSON. + * @function toJSON + * @memberof google.cloud.networksecurity.v1.UpdateMirroringDeploymentGroupRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateMirroringDeploymentGroupRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateMirroringDeploymentGroupRequest + * @function getTypeUrl + * @memberof google.cloud.networksecurity.v1.UpdateMirroringDeploymentGroupRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateMirroringDeploymentGroupRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.networksecurity.v1.UpdateMirroringDeploymentGroupRequest"; + }; + + return UpdateMirroringDeploymentGroupRequest; + })(); + + v1.DeleteMirroringDeploymentGroupRequest = (function() { + + /** + * Properties of a DeleteMirroringDeploymentGroupRequest. + * @memberof google.cloud.networksecurity.v1 + * @interface IDeleteMirroringDeploymentGroupRequest + * @property {string|null} [name] DeleteMirroringDeploymentGroupRequest name + * @property {string|null} [requestId] DeleteMirroringDeploymentGroupRequest requestId + */ + + /** + * Constructs a new DeleteMirroringDeploymentGroupRequest. + * @memberof google.cloud.networksecurity.v1 + * @classdesc Represents a DeleteMirroringDeploymentGroupRequest. + * @implements IDeleteMirroringDeploymentGroupRequest + * @constructor + * @param {google.cloud.networksecurity.v1.IDeleteMirroringDeploymentGroupRequest=} [properties] Properties to set + */ + function DeleteMirroringDeploymentGroupRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteMirroringDeploymentGroupRequest name. + * @member {string} name + * @memberof google.cloud.networksecurity.v1.DeleteMirroringDeploymentGroupRequest + * @instance + */ + DeleteMirroringDeploymentGroupRequest.prototype.name = ""; + + /** + * DeleteMirroringDeploymentGroupRequest requestId. + * @member {string} requestId + * @memberof google.cloud.networksecurity.v1.DeleteMirroringDeploymentGroupRequest + * @instance + */ + DeleteMirroringDeploymentGroupRequest.prototype.requestId = ""; + + /** + * Creates a new DeleteMirroringDeploymentGroupRequest instance using the specified properties. + * @function create + * @memberof google.cloud.networksecurity.v1.DeleteMirroringDeploymentGroupRequest + * @static + * @param {google.cloud.networksecurity.v1.IDeleteMirroringDeploymentGroupRequest=} [properties] Properties to set + * @returns {google.cloud.networksecurity.v1.DeleteMirroringDeploymentGroupRequest} DeleteMirroringDeploymentGroupRequest instance + */ + DeleteMirroringDeploymentGroupRequest.create = function create(properties) { + return new DeleteMirroringDeploymentGroupRequest(properties); + }; + + /** + * Encodes the specified DeleteMirroringDeploymentGroupRequest message. Does not implicitly {@link google.cloud.networksecurity.v1.DeleteMirroringDeploymentGroupRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.networksecurity.v1.DeleteMirroringDeploymentGroupRequest + * @static + * @param {google.cloud.networksecurity.v1.IDeleteMirroringDeploymentGroupRequest} message DeleteMirroringDeploymentGroupRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteMirroringDeploymentGroupRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.requestId); + return writer; + }; + + /** + * Encodes the specified DeleteMirroringDeploymentGroupRequest message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.DeleteMirroringDeploymentGroupRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.networksecurity.v1.DeleteMirroringDeploymentGroupRequest + * @static + * @param {google.cloud.networksecurity.v1.IDeleteMirroringDeploymentGroupRequest} message DeleteMirroringDeploymentGroupRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteMirroringDeploymentGroupRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteMirroringDeploymentGroupRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.networksecurity.v1.DeleteMirroringDeploymentGroupRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.networksecurity.v1.DeleteMirroringDeploymentGroupRequest} DeleteMirroringDeploymentGroupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteMirroringDeploymentGroupRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networksecurity.v1.DeleteMirroringDeploymentGroupRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.requestId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteMirroringDeploymentGroupRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.networksecurity.v1.DeleteMirroringDeploymentGroupRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.networksecurity.v1.DeleteMirroringDeploymentGroupRequest} DeleteMirroringDeploymentGroupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteMirroringDeploymentGroupRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteMirroringDeploymentGroupRequest message. + * @function verify + * @memberof google.cloud.networksecurity.v1.DeleteMirroringDeploymentGroupRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteMirroringDeploymentGroupRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + return null; + }; + + /** + * Creates a DeleteMirroringDeploymentGroupRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.networksecurity.v1.DeleteMirroringDeploymentGroupRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.networksecurity.v1.DeleteMirroringDeploymentGroupRequest} DeleteMirroringDeploymentGroupRequest + */ + DeleteMirroringDeploymentGroupRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networksecurity.v1.DeleteMirroringDeploymentGroupRequest) + return object; + var message = new $root.google.cloud.networksecurity.v1.DeleteMirroringDeploymentGroupRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from a DeleteMirroringDeploymentGroupRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.networksecurity.v1.DeleteMirroringDeploymentGroupRequest + * @static + * @param {google.cloud.networksecurity.v1.DeleteMirroringDeploymentGroupRequest} message DeleteMirroringDeploymentGroupRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteMirroringDeploymentGroupRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.requestId = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + return object; + }; + + /** + * Converts this DeleteMirroringDeploymentGroupRequest to JSON. + * @function toJSON + * @memberof google.cloud.networksecurity.v1.DeleteMirroringDeploymentGroupRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteMirroringDeploymentGroupRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteMirroringDeploymentGroupRequest + * @function getTypeUrl + * @memberof google.cloud.networksecurity.v1.DeleteMirroringDeploymentGroupRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteMirroringDeploymentGroupRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.networksecurity.v1.DeleteMirroringDeploymentGroupRequest"; + }; + + return DeleteMirroringDeploymentGroupRequest; + })(); + + v1.MirroringDeployment = (function() { + + /** + * Properties of a MirroringDeployment. + * @memberof google.cloud.networksecurity.v1 + * @interface IMirroringDeployment + * @property {string|null} [name] MirroringDeployment name + * @property {google.protobuf.ITimestamp|null} [createTime] MirroringDeployment createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] MirroringDeployment updateTime + * @property {Object.|null} [labels] MirroringDeployment labels + * @property {string|null} [forwardingRule] MirroringDeployment forwardingRule + * @property {string|null} [mirroringDeploymentGroup] MirroringDeployment mirroringDeploymentGroup + * @property {google.cloud.networksecurity.v1.MirroringDeployment.State|null} [state] MirroringDeployment state + * @property {boolean|null} [reconciling] MirroringDeployment reconciling + * @property {string|null} [description] MirroringDeployment description + */ + + /** + * Constructs a new MirroringDeployment. + * @memberof google.cloud.networksecurity.v1 + * @classdesc Represents a MirroringDeployment. + * @implements IMirroringDeployment + * @constructor + * @param {google.cloud.networksecurity.v1.IMirroringDeployment=} [properties] Properties to set + */ + function MirroringDeployment(properties) { + this.labels = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MirroringDeployment name. + * @member {string} name + * @memberof google.cloud.networksecurity.v1.MirroringDeployment + * @instance + */ + MirroringDeployment.prototype.name = ""; + + /** + * MirroringDeployment createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.networksecurity.v1.MirroringDeployment + * @instance + */ + MirroringDeployment.prototype.createTime = null; + + /** + * MirroringDeployment updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.networksecurity.v1.MirroringDeployment + * @instance + */ + MirroringDeployment.prototype.updateTime = null; + + /** + * MirroringDeployment labels. + * @member {Object.} labels + * @memberof google.cloud.networksecurity.v1.MirroringDeployment + * @instance + */ + MirroringDeployment.prototype.labels = $util.emptyObject; + + /** + * MirroringDeployment forwardingRule. + * @member {string} forwardingRule + * @memberof google.cloud.networksecurity.v1.MirroringDeployment + * @instance + */ + MirroringDeployment.prototype.forwardingRule = ""; + + /** + * MirroringDeployment mirroringDeploymentGroup. + * @member {string} mirroringDeploymentGroup + * @memberof google.cloud.networksecurity.v1.MirroringDeployment + * @instance + */ + MirroringDeployment.prototype.mirroringDeploymentGroup = ""; + + /** + * MirroringDeployment state. + * @member {google.cloud.networksecurity.v1.MirroringDeployment.State} state + * @memberof google.cloud.networksecurity.v1.MirroringDeployment + * @instance + */ + MirroringDeployment.prototype.state = 0; + + /** + * MirroringDeployment reconciling. + * @member {boolean} reconciling + * @memberof google.cloud.networksecurity.v1.MirroringDeployment + * @instance + */ + MirroringDeployment.prototype.reconciling = false; + + /** + * MirroringDeployment description. + * @member {string} description + * @memberof google.cloud.networksecurity.v1.MirroringDeployment + * @instance + */ + MirroringDeployment.prototype.description = ""; + + /** + * Creates a new MirroringDeployment instance using the specified properties. + * @function create + * @memberof google.cloud.networksecurity.v1.MirroringDeployment + * @static + * @param {google.cloud.networksecurity.v1.IMirroringDeployment=} [properties] Properties to set + * @returns {google.cloud.networksecurity.v1.MirroringDeployment} MirroringDeployment instance + */ + MirroringDeployment.create = function create(properties) { + return new MirroringDeployment(properties); + }; + + /** + * Encodes the specified MirroringDeployment message. Does not implicitly {@link google.cloud.networksecurity.v1.MirroringDeployment.verify|verify} messages. + * @function encode + * @memberof google.cloud.networksecurity.v1.MirroringDeployment + * @static + * @param {google.cloud.networksecurity.v1.IMirroringDeployment} message MirroringDeployment message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MirroringDeployment.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) + for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) + writer.uint32(/* id 4, wireType 2 =*/34).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); + if (message.forwardingRule != null && Object.hasOwnProperty.call(message, "forwardingRule")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.forwardingRule); + if (message.mirroringDeploymentGroup != null && Object.hasOwnProperty.call(message, "mirroringDeploymentGroup")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.mirroringDeploymentGroup); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 7, wireType 0 =*/56).int32(message.state); + if (message.reconciling != null && Object.hasOwnProperty.call(message, "reconciling")) + writer.uint32(/* id 8, wireType 0 =*/64).bool(message.reconciling); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 9, wireType 2 =*/74).string(message.description); + return writer; + }; + + /** + * Encodes the specified MirroringDeployment message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.MirroringDeployment.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.networksecurity.v1.MirroringDeployment + * @static + * @param {google.cloud.networksecurity.v1.IMirroringDeployment} message MirroringDeployment message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MirroringDeployment.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MirroringDeployment message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.networksecurity.v1.MirroringDeployment + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.networksecurity.v1.MirroringDeployment} MirroringDeployment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MirroringDeployment.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networksecurity.v1.MirroringDeployment(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 3: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 4: { + if (message.labels === $util.emptyObject) + message.labels = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.labels[key] = value; + break; + } + case 5: { + message.forwardingRule = reader.string(); + break; + } + case 6: { + message.mirroringDeploymentGroup = reader.string(); + break; + } + case 7: { + message.state = reader.int32(); + break; + } + case 8: { + message.reconciling = reader.bool(); + break; + } + case 9: { + message.description = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MirroringDeployment message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.networksecurity.v1.MirroringDeployment + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.networksecurity.v1.MirroringDeployment} MirroringDeployment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MirroringDeployment.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MirroringDeployment message. + * @function verify + * @memberof google.cloud.networksecurity.v1.MirroringDeployment + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MirroringDeployment.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime); + if (error) + return "updateTime." + error; + } + if (message.labels != null && message.hasOwnProperty("labels")) { + if (!$util.isObject(message.labels)) + return "labels: object expected"; + var key = Object.keys(message.labels); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.labels[key[i]])) + return "labels: string{k:string} expected"; + } + if (message.forwardingRule != null && message.hasOwnProperty("forwardingRule")) + if (!$util.isString(message.forwardingRule)) + return "forwardingRule: string expected"; + if (message.mirroringDeploymentGroup != null && message.hasOwnProperty("mirroringDeploymentGroup")) + if (!$util.isString(message.mirroringDeploymentGroup)) + return "mirroringDeploymentGroup: string expected"; + if (message.state != null && message.hasOwnProperty("state")) + switch (message.state) { + default: + return "state: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + break; + } + if (message.reconciling != null && message.hasOwnProperty("reconciling")) + if (typeof message.reconciling !== "boolean") + return "reconciling: boolean expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + return null; + }; + + /** + * Creates a MirroringDeployment message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.networksecurity.v1.MirroringDeployment + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.networksecurity.v1.MirroringDeployment} MirroringDeployment + */ + MirroringDeployment.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networksecurity.v1.MirroringDeployment) + return object; + var message = new $root.google.cloud.networksecurity.v1.MirroringDeployment(); + if (object.name != null) + message.name = String(object.name); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.networksecurity.v1.MirroringDeployment.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.updateTime != null) { + if (typeof object.updateTime !== "object") + throw TypeError(".google.cloud.networksecurity.v1.MirroringDeployment.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.cloud.networksecurity.v1.MirroringDeployment.labels: object expected"); + message.labels = {}; + for (var keys = Object.keys(object.labels), i = 0; i < keys.length; ++i) + message.labels[keys[i]] = String(object.labels[keys[i]]); + } + if (object.forwardingRule != null) + message.forwardingRule = String(object.forwardingRule); + if (object.mirroringDeploymentGroup != null) + message.mirroringDeploymentGroup = String(object.mirroringDeploymentGroup); + switch (object.state) { + default: + if (typeof object.state === "number") { + message.state = object.state; + break; + } + break; + case "STATE_UNSPECIFIED": + case 0: + message.state = 0; + break; + case "ACTIVE": + case 1: + message.state = 1; + break; + case "CREATING": + case 2: + message.state = 2; + break; + case "DELETING": + case 3: + message.state = 3; + break; + case "OUT_OF_SYNC": + case 4: + message.state = 4; + break; + case "DELETE_FAILED": + case 5: + message.state = 5; + break; + } + if (object.reconciling != null) + message.reconciling = Boolean(object.reconciling); + if (object.description != null) + message.description = String(object.description); + return message; + }; + + /** + * Creates a plain object from a MirroringDeployment message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.networksecurity.v1.MirroringDeployment + * @static + * @param {google.cloud.networksecurity.v1.MirroringDeployment} message MirroringDeployment + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MirroringDeployment.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.labels = {}; + if (options.defaults) { + object.name = ""; + object.createTime = null; + object.updateTime = null; + object.forwardingRule = ""; + object.mirroringDeploymentGroup = ""; + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + object.reconciling = false; + object.description = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.updateTime != null && message.hasOwnProperty("updateTime")) + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); + var keys2; + if (message.labels && (keys2 = Object.keys(message.labels)).length) { + object.labels = {}; + for (var j = 0; j < keys2.length; ++j) + object.labels[keys2[j]] = message.labels[keys2[j]]; + } + if (message.forwardingRule != null && message.hasOwnProperty("forwardingRule")) + object.forwardingRule = message.forwardingRule; + if (message.mirroringDeploymentGroup != null && message.hasOwnProperty("mirroringDeploymentGroup")) + object.mirroringDeploymentGroup = message.mirroringDeploymentGroup; + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.networksecurity.v1.MirroringDeployment.State[message.state] === undefined ? message.state : $root.google.cloud.networksecurity.v1.MirroringDeployment.State[message.state] : message.state; + if (message.reconciling != null && message.hasOwnProperty("reconciling")) + object.reconciling = message.reconciling; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + return object; + }; + + /** + * Converts this MirroringDeployment to JSON. + * @function toJSON + * @memberof google.cloud.networksecurity.v1.MirroringDeployment + * @instance + * @returns {Object.} JSON object + */ + MirroringDeployment.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MirroringDeployment + * @function getTypeUrl + * @memberof google.cloud.networksecurity.v1.MirroringDeployment + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MirroringDeployment.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.networksecurity.v1.MirroringDeployment"; + }; + + /** + * State enum. + * @name google.cloud.networksecurity.v1.MirroringDeployment.State + * @enum {number} + * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value + * @property {number} ACTIVE=1 ACTIVE value + * @property {number} CREATING=2 CREATING value + * @property {number} DELETING=3 DELETING value + * @property {number} OUT_OF_SYNC=4 OUT_OF_SYNC value + * @property {number} DELETE_FAILED=5 DELETE_FAILED value + */ + MirroringDeployment.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "ACTIVE"] = 1; + values[valuesById[2] = "CREATING"] = 2; + values[valuesById[3] = "DELETING"] = 3; + values[valuesById[4] = "OUT_OF_SYNC"] = 4; + values[valuesById[5] = "DELETE_FAILED"] = 5; + return values; + })(); + + return MirroringDeployment; + })(); + + v1.ListMirroringDeploymentsRequest = (function() { + + /** + * Properties of a ListMirroringDeploymentsRequest. + * @memberof google.cloud.networksecurity.v1 + * @interface IListMirroringDeploymentsRequest + * @property {string|null} [parent] ListMirroringDeploymentsRequest parent + * @property {number|null} [pageSize] ListMirroringDeploymentsRequest pageSize + * @property {string|null} [pageToken] ListMirroringDeploymentsRequest pageToken + * @property {string|null} [filter] ListMirroringDeploymentsRequest filter + * @property {string|null} [orderBy] ListMirroringDeploymentsRequest orderBy + */ + + /** + * Constructs a new ListMirroringDeploymentsRequest. + * @memberof google.cloud.networksecurity.v1 + * @classdesc Represents a ListMirroringDeploymentsRequest. + * @implements IListMirroringDeploymentsRequest + * @constructor + * @param {google.cloud.networksecurity.v1.IListMirroringDeploymentsRequest=} [properties] Properties to set + */ + function ListMirroringDeploymentsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListMirroringDeploymentsRequest parent. + * @member {string} parent + * @memberof google.cloud.networksecurity.v1.ListMirroringDeploymentsRequest + * @instance + */ + ListMirroringDeploymentsRequest.prototype.parent = ""; + + /** + * ListMirroringDeploymentsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.networksecurity.v1.ListMirroringDeploymentsRequest + * @instance + */ + ListMirroringDeploymentsRequest.prototype.pageSize = 0; + + /** + * ListMirroringDeploymentsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.networksecurity.v1.ListMirroringDeploymentsRequest + * @instance + */ + ListMirroringDeploymentsRequest.prototype.pageToken = ""; + + /** + * ListMirroringDeploymentsRequest filter. + * @member {string} filter + * @memberof google.cloud.networksecurity.v1.ListMirroringDeploymentsRequest + * @instance + */ + ListMirroringDeploymentsRequest.prototype.filter = ""; + + /** + * ListMirroringDeploymentsRequest orderBy. + * @member {string} orderBy + * @memberof google.cloud.networksecurity.v1.ListMirroringDeploymentsRequest + * @instance + */ + ListMirroringDeploymentsRequest.prototype.orderBy = ""; + + /** + * Creates a new ListMirroringDeploymentsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.networksecurity.v1.ListMirroringDeploymentsRequest + * @static + * @param {google.cloud.networksecurity.v1.IListMirroringDeploymentsRequest=} [properties] Properties to set + * @returns {google.cloud.networksecurity.v1.ListMirroringDeploymentsRequest} ListMirroringDeploymentsRequest instance + */ + ListMirroringDeploymentsRequest.create = function create(properties) { + return new ListMirroringDeploymentsRequest(properties); + }; + + /** + * Encodes the specified ListMirroringDeploymentsRequest message. Does not implicitly {@link google.cloud.networksecurity.v1.ListMirroringDeploymentsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.networksecurity.v1.ListMirroringDeploymentsRequest + * @static + * @param {google.cloud.networksecurity.v1.IListMirroringDeploymentsRequest} message ListMirroringDeploymentsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListMirroringDeploymentsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.filter); + if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.orderBy); + return writer; + }; + + /** + * Encodes the specified ListMirroringDeploymentsRequest message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.ListMirroringDeploymentsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.networksecurity.v1.ListMirroringDeploymentsRequest + * @static + * @param {google.cloud.networksecurity.v1.IListMirroringDeploymentsRequest} message ListMirroringDeploymentsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListMirroringDeploymentsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListMirroringDeploymentsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.networksecurity.v1.ListMirroringDeploymentsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.networksecurity.v1.ListMirroringDeploymentsRequest} ListMirroringDeploymentsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListMirroringDeploymentsRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networksecurity.v1.ListMirroringDeploymentsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + case 4: { + message.filter = reader.string(); + break; + } + case 5: { + message.orderBy = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListMirroringDeploymentsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.networksecurity.v1.ListMirroringDeploymentsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.networksecurity.v1.ListMirroringDeploymentsRequest} ListMirroringDeploymentsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListMirroringDeploymentsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListMirroringDeploymentsRequest message. + * @function verify + * @memberof google.cloud.networksecurity.v1.ListMirroringDeploymentsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListMirroringDeploymentsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + if (!$util.isString(message.orderBy)) + return "orderBy: string expected"; + return null; + }; + + /** + * Creates a ListMirroringDeploymentsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.networksecurity.v1.ListMirroringDeploymentsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.networksecurity.v1.ListMirroringDeploymentsRequest} ListMirroringDeploymentsRequest + */ + ListMirroringDeploymentsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networksecurity.v1.ListMirroringDeploymentsRequest) + return object; + var message = new $root.google.cloud.networksecurity.v1.ListMirroringDeploymentsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.filter != null) + message.filter = String(object.filter); + if (object.orderBy != null) + message.orderBy = String(object.orderBy); + return message; + }; + + /** + * Creates a plain object from a ListMirroringDeploymentsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.networksecurity.v1.ListMirroringDeploymentsRequest + * @static + * @param {google.cloud.networksecurity.v1.ListMirroringDeploymentsRequest} message ListMirroringDeploymentsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListMirroringDeploymentsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + object.filter = ""; + object.orderBy = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + object.orderBy = message.orderBy; + return object; + }; + + /** + * Converts this ListMirroringDeploymentsRequest to JSON. + * @function toJSON + * @memberof google.cloud.networksecurity.v1.ListMirroringDeploymentsRequest + * @instance + * @returns {Object.} JSON object + */ + ListMirroringDeploymentsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListMirroringDeploymentsRequest + * @function getTypeUrl + * @memberof google.cloud.networksecurity.v1.ListMirroringDeploymentsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListMirroringDeploymentsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.networksecurity.v1.ListMirroringDeploymentsRequest"; + }; + + return ListMirroringDeploymentsRequest; + })(); + + v1.ListMirroringDeploymentsResponse = (function() { + + /** + * Properties of a ListMirroringDeploymentsResponse. + * @memberof google.cloud.networksecurity.v1 + * @interface IListMirroringDeploymentsResponse + * @property {Array.|null} [mirroringDeployments] ListMirroringDeploymentsResponse mirroringDeployments + * @property {string|null} [nextPageToken] ListMirroringDeploymentsResponse nextPageToken + * @property {Array.|null} [unreachable] ListMirroringDeploymentsResponse unreachable + */ + + /** + * Constructs a new ListMirroringDeploymentsResponse. + * @memberof google.cloud.networksecurity.v1 + * @classdesc Represents a ListMirroringDeploymentsResponse. + * @implements IListMirroringDeploymentsResponse + * @constructor + * @param {google.cloud.networksecurity.v1.IListMirroringDeploymentsResponse=} [properties] Properties to set + */ + function ListMirroringDeploymentsResponse(properties) { + this.mirroringDeployments = []; + this.unreachable = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListMirroringDeploymentsResponse mirroringDeployments. + * @member {Array.} mirroringDeployments + * @memberof google.cloud.networksecurity.v1.ListMirroringDeploymentsResponse + * @instance + */ + ListMirroringDeploymentsResponse.prototype.mirroringDeployments = $util.emptyArray; + + /** + * ListMirroringDeploymentsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.networksecurity.v1.ListMirroringDeploymentsResponse + * @instance + */ + ListMirroringDeploymentsResponse.prototype.nextPageToken = ""; + + /** + * ListMirroringDeploymentsResponse unreachable. + * @member {Array.} unreachable + * @memberof google.cloud.networksecurity.v1.ListMirroringDeploymentsResponse + * @instance + */ + ListMirroringDeploymentsResponse.prototype.unreachable = $util.emptyArray; + + /** + * Creates a new ListMirroringDeploymentsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.networksecurity.v1.ListMirroringDeploymentsResponse + * @static + * @param {google.cloud.networksecurity.v1.IListMirroringDeploymentsResponse=} [properties] Properties to set + * @returns {google.cloud.networksecurity.v1.ListMirroringDeploymentsResponse} ListMirroringDeploymentsResponse instance + */ + ListMirroringDeploymentsResponse.create = function create(properties) { + return new ListMirroringDeploymentsResponse(properties); + }; + + /** + * Encodes the specified ListMirroringDeploymentsResponse message. Does not implicitly {@link google.cloud.networksecurity.v1.ListMirroringDeploymentsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.networksecurity.v1.ListMirroringDeploymentsResponse + * @static + * @param {google.cloud.networksecurity.v1.IListMirroringDeploymentsResponse} message ListMirroringDeploymentsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListMirroringDeploymentsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.mirroringDeployments != null && message.mirroringDeployments.length) + for (var i = 0; i < message.mirroringDeployments.length; ++i) + $root.google.cloud.networksecurity.v1.MirroringDeployment.encode(message.mirroringDeployments[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + if (message.unreachable != null && message.unreachable.length) + for (var i = 0; i < message.unreachable.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.unreachable[i]); + return writer; + }; + + /** + * Encodes the specified ListMirroringDeploymentsResponse message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.ListMirroringDeploymentsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.networksecurity.v1.ListMirroringDeploymentsResponse + * @static + * @param {google.cloud.networksecurity.v1.IListMirroringDeploymentsResponse} message ListMirroringDeploymentsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListMirroringDeploymentsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListMirroringDeploymentsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.networksecurity.v1.ListMirroringDeploymentsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.networksecurity.v1.ListMirroringDeploymentsResponse} ListMirroringDeploymentsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListMirroringDeploymentsResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networksecurity.v1.ListMirroringDeploymentsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.mirroringDeployments && message.mirroringDeployments.length)) + message.mirroringDeployments = []; + message.mirroringDeployments.push($root.google.cloud.networksecurity.v1.MirroringDeployment.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + case 3: { + if (!(message.unreachable && message.unreachable.length)) + message.unreachable = []; + message.unreachable.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListMirroringDeploymentsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.networksecurity.v1.ListMirroringDeploymentsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.networksecurity.v1.ListMirroringDeploymentsResponse} ListMirroringDeploymentsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListMirroringDeploymentsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListMirroringDeploymentsResponse message. + * @function verify + * @memberof google.cloud.networksecurity.v1.ListMirroringDeploymentsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListMirroringDeploymentsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.mirroringDeployments != null && message.hasOwnProperty("mirroringDeployments")) { + if (!Array.isArray(message.mirroringDeployments)) + return "mirroringDeployments: array expected"; + for (var i = 0; i < message.mirroringDeployments.length; ++i) { + var error = $root.google.cloud.networksecurity.v1.MirroringDeployment.verify(message.mirroringDeployments[i]); + if (error) + return "mirroringDeployments." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + if (message.unreachable != null && message.hasOwnProperty("unreachable")) { + if (!Array.isArray(message.unreachable)) + return "unreachable: array expected"; + for (var i = 0; i < message.unreachable.length; ++i) + if (!$util.isString(message.unreachable[i])) + return "unreachable: string[] expected"; + } + return null; + }; + + /** + * Creates a ListMirroringDeploymentsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.networksecurity.v1.ListMirroringDeploymentsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.networksecurity.v1.ListMirroringDeploymentsResponse} ListMirroringDeploymentsResponse + */ + ListMirroringDeploymentsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networksecurity.v1.ListMirroringDeploymentsResponse) + return object; + var message = new $root.google.cloud.networksecurity.v1.ListMirroringDeploymentsResponse(); + if (object.mirroringDeployments) { + if (!Array.isArray(object.mirroringDeployments)) + throw TypeError(".google.cloud.networksecurity.v1.ListMirroringDeploymentsResponse.mirroringDeployments: array expected"); + message.mirroringDeployments = []; + for (var i = 0; i < object.mirroringDeployments.length; ++i) { + if (typeof object.mirroringDeployments[i] !== "object") + throw TypeError(".google.cloud.networksecurity.v1.ListMirroringDeploymentsResponse.mirroringDeployments: object expected"); + message.mirroringDeployments[i] = $root.google.cloud.networksecurity.v1.MirroringDeployment.fromObject(object.mirroringDeployments[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.unreachable) { + if (!Array.isArray(object.unreachable)) + throw TypeError(".google.cloud.networksecurity.v1.ListMirroringDeploymentsResponse.unreachable: array expected"); + message.unreachable = []; + for (var i = 0; i < object.unreachable.length; ++i) + message.unreachable[i] = String(object.unreachable[i]); + } + return message; + }; + + /** + * Creates a plain object from a ListMirroringDeploymentsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.networksecurity.v1.ListMirroringDeploymentsResponse + * @static + * @param {google.cloud.networksecurity.v1.ListMirroringDeploymentsResponse} message ListMirroringDeploymentsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListMirroringDeploymentsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.mirroringDeployments = []; + object.unreachable = []; + } + if (options.defaults) + object.nextPageToken = ""; + if (message.mirroringDeployments && message.mirroringDeployments.length) { + object.mirroringDeployments = []; + for (var j = 0; j < message.mirroringDeployments.length; ++j) + object.mirroringDeployments[j] = $root.google.cloud.networksecurity.v1.MirroringDeployment.toObject(message.mirroringDeployments[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + if (message.unreachable && message.unreachable.length) { + object.unreachable = []; + for (var j = 0; j < message.unreachable.length; ++j) + object.unreachable[j] = message.unreachable[j]; + } + return object; + }; + + /** + * Converts this ListMirroringDeploymentsResponse to JSON. + * @function toJSON + * @memberof google.cloud.networksecurity.v1.ListMirroringDeploymentsResponse + * @instance + * @returns {Object.} JSON object + */ + ListMirroringDeploymentsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListMirroringDeploymentsResponse + * @function getTypeUrl + * @memberof google.cloud.networksecurity.v1.ListMirroringDeploymentsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListMirroringDeploymentsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.networksecurity.v1.ListMirroringDeploymentsResponse"; + }; + + return ListMirroringDeploymentsResponse; + })(); + + v1.GetMirroringDeploymentRequest = (function() { + + /** + * Properties of a GetMirroringDeploymentRequest. + * @memberof google.cloud.networksecurity.v1 + * @interface IGetMirroringDeploymentRequest + * @property {string|null} [name] GetMirroringDeploymentRequest name + */ + + /** + * Constructs a new GetMirroringDeploymentRequest. + * @memberof google.cloud.networksecurity.v1 + * @classdesc Represents a GetMirroringDeploymentRequest. + * @implements IGetMirroringDeploymentRequest + * @constructor + * @param {google.cloud.networksecurity.v1.IGetMirroringDeploymentRequest=} [properties] Properties to set + */ + function GetMirroringDeploymentRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetMirroringDeploymentRequest name. + * @member {string} name + * @memberof google.cloud.networksecurity.v1.GetMirroringDeploymentRequest + * @instance + */ + GetMirroringDeploymentRequest.prototype.name = ""; + + /** + * Creates a new GetMirroringDeploymentRequest instance using the specified properties. + * @function create + * @memberof google.cloud.networksecurity.v1.GetMirroringDeploymentRequest + * @static + * @param {google.cloud.networksecurity.v1.IGetMirroringDeploymentRequest=} [properties] Properties to set + * @returns {google.cloud.networksecurity.v1.GetMirroringDeploymentRequest} GetMirroringDeploymentRequest instance + */ + GetMirroringDeploymentRequest.create = function create(properties) { + return new GetMirroringDeploymentRequest(properties); + }; + + /** + * Encodes the specified GetMirroringDeploymentRequest message. Does not implicitly {@link google.cloud.networksecurity.v1.GetMirroringDeploymentRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.networksecurity.v1.GetMirroringDeploymentRequest + * @static + * @param {google.cloud.networksecurity.v1.IGetMirroringDeploymentRequest} message GetMirroringDeploymentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetMirroringDeploymentRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified GetMirroringDeploymentRequest message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.GetMirroringDeploymentRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.networksecurity.v1.GetMirroringDeploymentRequest + * @static + * @param {google.cloud.networksecurity.v1.IGetMirroringDeploymentRequest} message GetMirroringDeploymentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetMirroringDeploymentRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetMirroringDeploymentRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.networksecurity.v1.GetMirroringDeploymentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.networksecurity.v1.GetMirroringDeploymentRequest} GetMirroringDeploymentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetMirroringDeploymentRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networksecurity.v1.GetMirroringDeploymentRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetMirroringDeploymentRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.networksecurity.v1.GetMirroringDeploymentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.networksecurity.v1.GetMirroringDeploymentRequest} GetMirroringDeploymentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetMirroringDeploymentRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetMirroringDeploymentRequest message. + * @function verify + * @memberof google.cloud.networksecurity.v1.GetMirroringDeploymentRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetMirroringDeploymentRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a GetMirroringDeploymentRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.networksecurity.v1.GetMirroringDeploymentRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.networksecurity.v1.GetMirroringDeploymentRequest} GetMirroringDeploymentRequest + */ + GetMirroringDeploymentRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networksecurity.v1.GetMirroringDeploymentRequest) + return object; + var message = new $root.google.cloud.networksecurity.v1.GetMirroringDeploymentRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetMirroringDeploymentRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.networksecurity.v1.GetMirroringDeploymentRequest + * @static + * @param {google.cloud.networksecurity.v1.GetMirroringDeploymentRequest} message GetMirroringDeploymentRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetMirroringDeploymentRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this GetMirroringDeploymentRequest to JSON. + * @function toJSON + * @memberof google.cloud.networksecurity.v1.GetMirroringDeploymentRequest + * @instance + * @returns {Object.} JSON object + */ + GetMirroringDeploymentRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetMirroringDeploymentRequest + * @function getTypeUrl + * @memberof google.cloud.networksecurity.v1.GetMirroringDeploymentRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetMirroringDeploymentRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.networksecurity.v1.GetMirroringDeploymentRequest"; + }; + + return GetMirroringDeploymentRequest; + })(); + + v1.CreateMirroringDeploymentRequest = (function() { + + /** + * Properties of a CreateMirroringDeploymentRequest. + * @memberof google.cloud.networksecurity.v1 + * @interface ICreateMirroringDeploymentRequest + * @property {string|null} [parent] CreateMirroringDeploymentRequest parent + * @property {string|null} [mirroringDeploymentId] CreateMirroringDeploymentRequest mirroringDeploymentId + * @property {google.cloud.networksecurity.v1.IMirroringDeployment|null} [mirroringDeployment] CreateMirroringDeploymentRequest mirroringDeployment + * @property {string|null} [requestId] CreateMirroringDeploymentRequest requestId + */ + + /** + * Constructs a new CreateMirroringDeploymentRequest. + * @memberof google.cloud.networksecurity.v1 + * @classdesc Represents a CreateMirroringDeploymentRequest. + * @implements ICreateMirroringDeploymentRequest + * @constructor + * @param {google.cloud.networksecurity.v1.ICreateMirroringDeploymentRequest=} [properties] Properties to set + */ + function CreateMirroringDeploymentRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateMirroringDeploymentRequest parent. + * @member {string} parent + * @memberof google.cloud.networksecurity.v1.CreateMirroringDeploymentRequest + * @instance + */ + CreateMirroringDeploymentRequest.prototype.parent = ""; + + /** + * CreateMirroringDeploymentRequest mirroringDeploymentId. + * @member {string} mirroringDeploymentId + * @memberof google.cloud.networksecurity.v1.CreateMirroringDeploymentRequest + * @instance + */ + CreateMirroringDeploymentRequest.prototype.mirroringDeploymentId = ""; + + /** + * CreateMirroringDeploymentRequest mirroringDeployment. + * @member {google.cloud.networksecurity.v1.IMirroringDeployment|null|undefined} mirroringDeployment + * @memberof google.cloud.networksecurity.v1.CreateMirroringDeploymentRequest + * @instance + */ + CreateMirroringDeploymentRequest.prototype.mirroringDeployment = null; + + /** + * CreateMirroringDeploymentRequest requestId. + * @member {string} requestId + * @memberof google.cloud.networksecurity.v1.CreateMirroringDeploymentRequest + * @instance + */ + CreateMirroringDeploymentRequest.prototype.requestId = ""; + + /** + * Creates a new CreateMirroringDeploymentRequest instance using the specified properties. + * @function create + * @memberof google.cloud.networksecurity.v1.CreateMirroringDeploymentRequest + * @static + * @param {google.cloud.networksecurity.v1.ICreateMirroringDeploymentRequest=} [properties] Properties to set + * @returns {google.cloud.networksecurity.v1.CreateMirroringDeploymentRequest} CreateMirroringDeploymentRequest instance + */ + CreateMirroringDeploymentRequest.create = function create(properties) { + return new CreateMirroringDeploymentRequest(properties); + }; + + /** + * Encodes the specified CreateMirroringDeploymentRequest message. Does not implicitly {@link google.cloud.networksecurity.v1.CreateMirroringDeploymentRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.networksecurity.v1.CreateMirroringDeploymentRequest + * @static + * @param {google.cloud.networksecurity.v1.ICreateMirroringDeploymentRequest} message CreateMirroringDeploymentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateMirroringDeploymentRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.mirroringDeploymentId != null && Object.hasOwnProperty.call(message, "mirroringDeploymentId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.mirroringDeploymentId); + if (message.mirroringDeployment != null && Object.hasOwnProperty.call(message, "mirroringDeployment")) + $root.google.cloud.networksecurity.v1.MirroringDeployment.encode(message.mirroringDeployment, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.requestId); + return writer; + }; + + /** + * Encodes the specified CreateMirroringDeploymentRequest message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.CreateMirroringDeploymentRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.networksecurity.v1.CreateMirroringDeploymentRequest + * @static + * @param {google.cloud.networksecurity.v1.ICreateMirroringDeploymentRequest} message CreateMirroringDeploymentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateMirroringDeploymentRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateMirroringDeploymentRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.networksecurity.v1.CreateMirroringDeploymentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.networksecurity.v1.CreateMirroringDeploymentRequest} CreateMirroringDeploymentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateMirroringDeploymentRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networksecurity.v1.CreateMirroringDeploymentRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.mirroringDeploymentId = reader.string(); + break; + } + case 3: { + message.mirroringDeployment = $root.google.cloud.networksecurity.v1.MirroringDeployment.decode(reader, reader.uint32()); + break; + } + case 4: { + message.requestId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateMirroringDeploymentRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.networksecurity.v1.CreateMirroringDeploymentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.networksecurity.v1.CreateMirroringDeploymentRequest} CreateMirroringDeploymentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateMirroringDeploymentRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateMirroringDeploymentRequest message. + * @function verify + * @memberof google.cloud.networksecurity.v1.CreateMirroringDeploymentRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateMirroringDeploymentRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.mirroringDeploymentId != null && message.hasOwnProperty("mirroringDeploymentId")) + if (!$util.isString(message.mirroringDeploymentId)) + return "mirroringDeploymentId: string expected"; + if (message.mirroringDeployment != null && message.hasOwnProperty("mirroringDeployment")) { + var error = $root.google.cloud.networksecurity.v1.MirroringDeployment.verify(message.mirroringDeployment); + if (error) + return "mirroringDeployment." + error; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + return null; + }; + + /** + * Creates a CreateMirroringDeploymentRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.networksecurity.v1.CreateMirroringDeploymentRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.networksecurity.v1.CreateMirroringDeploymentRequest} CreateMirroringDeploymentRequest + */ + CreateMirroringDeploymentRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networksecurity.v1.CreateMirroringDeploymentRequest) + return object; + var message = new $root.google.cloud.networksecurity.v1.CreateMirroringDeploymentRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.mirroringDeploymentId != null) + message.mirroringDeploymentId = String(object.mirroringDeploymentId); + if (object.mirroringDeployment != null) { + if (typeof object.mirroringDeployment !== "object") + throw TypeError(".google.cloud.networksecurity.v1.CreateMirroringDeploymentRequest.mirroringDeployment: object expected"); + message.mirroringDeployment = $root.google.cloud.networksecurity.v1.MirroringDeployment.fromObject(object.mirroringDeployment); + } + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from a CreateMirroringDeploymentRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.networksecurity.v1.CreateMirroringDeploymentRequest + * @static + * @param {google.cloud.networksecurity.v1.CreateMirroringDeploymentRequest} message CreateMirroringDeploymentRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateMirroringDeploymentRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.mirroringDeploymentId = ""; + object.mirroringDeployment = null; + object.requestId = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.mirroringDeploymentId != null && message.hasOwnProperty("mirroringDeploymentId")) + object.mirroringDeploymentId = message.mirroringDeploymentId; + if (message.mirroringDeployment != null && message.hasOwnProperty("mirroringDeployment")) + object.mirroringDeployment = $root.google.cloud.networksecurity.v1.MirroringDeployment.toObject(message.mirroringDeployment, options); + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + return object; + }; + + /** + * Converts this CreateMirroringDeploymentRequest to JSON. + * @function toJSON + * @memberof google.cloud.networksecurity.v1.CreateMirroringDeploymentRequest + * @instance + * @returns {Object.} JSON object + */ + CreateMirroringDeploymentRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateMirroringDeploymentRequest + * @function getTypeUrl + * @memberof google.cloud.networksecurity.v1.CreateMirroringDeploymentRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateMirroringDeploymentRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.networksecurity.v1.CreateMirroringDeploymentRequest"; + }; + + return CreateMirroringDeploymentRequest; + })(); + + v1.UpdateMirroringDeploymentRequest = (function() { + + /** + * Properties of an UpdateMirroringDeploymentRequest. + * @memberof google.cloud.networksecurity.v1 + * @interface IUpdateMirroringDeploymentRequest + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateMirroringDeploymentRequest updateMask + * @property {google.cloud.networksecurity.v1.IMirroringDeployment|null} [mirroringDeployment] UpdateMirroringDeploymentRequest mirroringDeployment + * @property {string|null} [requestId] UpdateMirroringDeploymentRequest requestId + */ + + /** + * Constructs a new UpdateMirroringDeploymentRequest. + * @memberof google.cloud.networksecurity.v1 + * @classdesc Represents an UpdateMirroringDeploymentRequest. + * @implements IUpdateMirroringDeploymentRequest + * @constructor + * @param {google.cloud.networksecurity.v1.IUpdateMirroringDeploymentRequest=} [properties] Properties to set + */ + function UpdateMirroringDeploymentRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateMirroringDeploymentRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.networksecurity.v1.UpdateMirroringDeploymentRequest + * @instance + */ + UpdateMirroringDeploymentRequest.prototype.updateMask = null; + + /** + * UpdateMirroringDeploymentRequest mirroringDeployment. + * @member {google.cloud.networksecurity.v1.IMirroringDeployment|null|undefined} mirroringDeployment + * @memberof google.cloud.networksecurity.v1.UpdateMirroringDeploymentRequest + * @instance + */ + UpdateMirroringDeploymentRequest.prototype.mirroringDeployment = null; + + /** + * UpdateMirroringDeploymentRequest requestId. + * @member {string} requestId + * @memberof google.cloud.networksecurity.v1.UpdateMirroringDeploymentRequest + * @instance + */ + UpdateMirroringDeploymentRequest.prototype.requestId = ""; + + /** + * Creates a new UpdateMirroringDeploymentRequest instance using the specified properties. + * @function create + * @memberof google.cloud.networksecurity.v1.UpdateMirroringDeploymentRequest + * @static + * @param {google.cloud.networksecurity.v1.IUpdateMirroringDeploymentRequest=} [properties] Properties to set + * @returns {google.cloud.networksecurity.v1.UpdateMirroringDeploymentRequest} UpdateMirroringDeploymentRequest instance + */ + UpdateMirroringDeploymentRequest.create = function create(properties) { + return new UpdateMirroringDeploymentRequest(properties); + }; + + /** + * Encodes the specified UpdateMirroringDeploymentRequest message. Does not implicitly {@link google.cloud.networksecurity.v1.UpdateMirroringDeploymentRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.networksecurity.v1.UpdateMirroringDeploymentRequest + * @static + * @param {google.cloud.networksecurity.v1.IUpdateMirroringDeploymentRequest} message UpdateMirroringDeploymentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateMirroringDeploymentRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.mirroringDeployment != null && Object.hasOwnProperty.call(message, "mirroringDeployment")) + $root.google.cloud.networksecurity.v1.MirroringDeployment.encode(message.mirroringDeployment, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.requestId); + return writer; + }; + + /** + * Encodes the specified UpdateMirroringDeploymentRequest message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.UpdateMirroringDeploymentRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.networksecurity.v1.UpdateMirroringDeploymentRequest + * @static + * @param {google.cloud.networksecurity.v1.IUpdateMirroringDeploymentRequest} message UpdateMirroringDeploymentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateMirroringDeploymentRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateMirroringDeploymentRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.networksecurity.v1.UpdateMirroringDeploymentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.networksecurity.v1.UpdateMirroringDeploymentRequest} UpdateMirroringDeploymentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateMirroringDeploymentRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networksecurity.v1.UpdateMirroringDeploymentRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + case 2: { + message.mirroringDeployment = $root.google.cloud.networksecurity.v1.MirroringDeployment.decode(reader, reader.uint32()); + break; + } + case 3: { + message.requestId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateMirroringDeploymentRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.networksecurity.v1.UpdateMirroringDeploymentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.networksecurity.v1.UpdateMirroringDeploymentRequest} UpdateMirroringDeploymentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateMirroringDeploymentRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateMirroringDeploymentRequest message. + * @function verify + * @memberof google.cloud.networksecurity.v1.UpdateMirroringDeploymentRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateMirroringDeploymentRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + if (message.mirroringDeployment != null && message.hasOwnProperty("mirroringDeployment")) { + var error = $root.google.cloud.networksecurity.v1.MirroringDeployment.verify(message.mirroringDeployment); + if (error) + return "mirroringDeployment." + error; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + return null; + }; + + /** + * Creates an UpdateMirroringDeploymentRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.networksecurity.v1.UpdateMirroringDeploymentRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.networksecurity.v1.UpdateMirroringDeploymentRequest} UpdateMirroringDeploymentRequest + */ + UpdateMirroringDeploymentRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networksecurity.v1.UpdateMirroringDeploymentRequest) + return object; + var message = new $root.google.cloud.networksecurity.v1.UpdateMirroringDeploymentRequest(); + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.networksecurity.v1.UpdateMirroringDeploymentRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + if (object.mirroringDeployment != null) { + if (typeof object.mirroringDeployment !== "object") + throw TypeError(".google.cloud.networksecurity.v1.UpdateMirroringDeploymentRequest.mirroringDeployment: object expected"); + message.mirroringDeployment = $root.google.cloud.networksecurity.v1.MirroringDeployment.fromObject(object.mirroringDeployment); + } + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from an UpdateMirroringDeploymentRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.networksecurity.v1.UpdateMirroringDeploymentRequest + * @static + * @param {google.cloud.networksecurity.v1.UpdateMirroringDeploymentRequest} message UpdateMirroringDeploymentRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateMirroringDeploymentRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.updateMask = null; + object.mirroringDeployment = null; + object.requestId = ""; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + if (message.mirroringDeployment != null && message.hasOwnProperty("mirroringDeployment")) + object.mirroringDeployment = $root.google.cloud.networksecurity.v1.MirroringDeployment.toObject(message.mirroringDeployment, options); + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + return object; + }; + + /** + * Converts this UpdateMirroringDeploymentRequest to JSON. + * @function toJSON + * @memberof google.cloud.networksecurity.v1.UpdateMirroringDeploymentRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateMirroringDeploymentRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateMirroringDeploymentRequest + * @function getTypeUrl + * @memberof google.cloud.networksecurity.v1.UpdateMirroringDeploymentRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateMirroringDeploymentRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.networksecurity.v1.UpdateMirroringDeploymentRequest"; + }; + + return UpdateMirroringDeploymentRequest; + })(); + + v1.DeleteMirroringDeploymentRequest = (function() { + + /** + * Properties of a DeleteMirroringDeploymentRequest. + * @memberof google.cloud.networksecurity.v1 + * @interface IDeleteMirroringDeploymentRequest + * @property {string|null} [name] DeleteMirroringDeploymentRequest name + * @property {string|null} [requestId] DeleteMirroringDeploymentRequest requestId + */ + + /** + * Constructs a new DeleteMirroringDeploymentRequest. + * @memberof google.cloud.networksecurity.v1 + * @classdesc Represents a DeleteMirroringDeploymentRequest. + * @implements IDeleteMirroringDeploymentRequest + * @constructor + * @param {google.cloud.networksecurity.v1.IDeleteMirroringDeploymentRequest=} [properties] Properties to set + */ + function DeleteMirroringDeploymentRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteMirroringDeploymentRequest name. + * @member {string} name + * @memberof google.cloud.networksecurity.v1.DeleteMirroringDeploymentRequest + * @instance + */ + DeleteMirroringDeploymentRequest.prototype.name = ""; + + /** + * DeleteMirroringDeploymentRequest requestId. + * @member {string} requestId + * @memberof google.cloud.networksecurity.v1.DeleteMirroringDeploymentRequest + * @instance + */ + DeleteMirroringDeploymentRequest.prototype.requestId = ""; + + /** + * Creates a new DeleteMirroringDeploymentRequest instance using the specified properties. + * @function create + * @memberof google.cloud.networksecurity.v1.DeleteMirroringDeploymentRequest + * @static + * @param {google.cloud.networksecurity.v1.IDeleteMirroringDeploymentRequest=} [properties] Properties to set + * @returns {google.cloud.networksecurity.v1.DeleteMirroringDeploymentRequest} DeleteMirroringDeploymentRequest instance + */ + DeleteMirroringDeploymentRequest.create = function create(properties) { + return new DeleteMirroringDeploymentRequest(properties); + }; + + /** + * Encodes the specified DeleteMirroringDeploymentRequest message. Does not implicitly {@link google.cloud.networksecurity.v1.DeleteMirroringDeploymentRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.networksecurity.v1.DeleteMirroringDeploymentRequest + * @static + * @param {google.cloud.networksecurity.v1.IDeleteMirroringDeploymentRequest} message DeleteMirroringDeploymentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteMirroringDeploymentRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.requestId); + return writer; + }; + + /** + * Encodes the specified DeleteMirroringDeploymentRequest message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.DeleteMirroringDeploymentRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.networksecurity.v1.DeleteMirroringDeploymentRequest + * @static + * @param {google.cloud.networksecurity.v1.IDeleteMirroringDeploymentRequest} message DeleteMirroringDeploymentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteMirroringDeploymentRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteMirroringDeploymentRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.networksecurity.v1.DeleteMirroringDeploymentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.networksecurity.v1.DeleteMirroringDeploymentRequest} DeleteMirroringDeploymentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteMirroringDeploymentRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networksecurity.v1.DeleteMirroringDeploymentRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.requestId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteMirroringDeploymentRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.networksecurity.v1.DeleteMirroringDeploymentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.networksecurity.v1.DeleteMirroringDeploymentRequest} DeleteMirroringDeploymentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteMirroringDeploymentRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteMirroringDeploymentRequest message. + * @function verify + * @memberof google.cloud.networksecurity.v1.DeleteMirroringDeploymentRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteMirroringDeploymentRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + return null; + }; + + /** + * Creates a DeleteMirroringDeploymentRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.networksecurity.v1.DeleteMirroringDeploymentRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.networksecurity.v1.DeleteMirroringDeploymentRequest} DeleteMirroringDeploymentRequest + */ + DeleteMirroringDeploymentRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networksecurity.v1.DeleteMirroringDeploymentRequest) + return object; + var message = new $root.google.cloud.networksecurity.v1.DeleteMirroringDeploymentRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from a DeleteMirroringDeploymentRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.networksecurity.v1.DeleteMirroringDeploymentRequest + * @static + * @param {google.cloud.networksecurity.v1.DeleteMirroringDeploymentRequest} message DeleteMirroringDeploymentRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteMirroringDeploymentRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.requestId = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + return object; + }; + + /** + * Converts this DeleteMirroringDeploymentRequest to JSON. + * @function toJSON + * @memberof google.cloud.networksecurity.v1.DeleteMirroringDeploymentRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteMirroringDeploymentRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteMirroringDeploymentRequest + * @function getTypeUrl + * @memberof google.cloud.networksecurity.v1.DeleteMirroringDeploymentRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteMirroringDeploymentRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.networksecurity.v1.DeleteMirroringDeploymentRequest"; + }; + + return DeleteMirroringDeploymentRequest; + })(); + + v1.MirroringLocation = (function() { + + /** + * Properties of a MirroringLocation. + * @memberof google.cloud.networksecurity.v1 + * @interface IMirroringLocation + * @property {string|null} [location] MirroringLocation location + * @property {google.cloud.networksecurity.v1.MirroringLocation.State|null} [state] MirroringLocation state + */ + + /** + * Constructs a new MirroringLocation. + * @memberof google.cloud.networksecurity.v1 + * @classdesc Represents a MirroringLocation. + * @implements IMirroringLocation + * @constructor + * @param {google.cloud.networksecurity.v1.IMirroringLocation=} [properties] Properties to set + */ + function MirroringLocation(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MirroringLocation location. + * @member {string} location + * @memberof google.cloud.networksecurity.v1.MirroringLocation + * @instance + */ + MirroringLocation.prototype.location = ""; + + /** + * MirroringLocation state. + * @member {google.cloud.networksecurity.v1.MirroringLocation.State} state + * @memberof google.cloud.networksecurity.v1.MirroringLocation + * @instance + */ + MirroringLocation.prototype.state = 0; + + /** + * Creates a new MirroringLocation instance using the specified properties. + * @function create + * @memberof google.cloud.networksecurity.v1.MirroringLocation + * @static + * @param {google.cloud.networksecurity.v1.IMirroringLocation=} [properties] Properties to set + * @returns {google.cloud.networksecurity.v1.MirroringLocation} MirroringLocation instance + */ + MirroringLocation.create = function create(properties) { + return new MirroringLocation(properties); + }; + + /** + * Encodes the specified MirroringLocation message. Does not implicitly {@link google.cloud.networksecurity.v1.MirroringLocation.verify|verify} messages. + * @function encode + * @memberof google.cloud.networksecurity.v1.MirroringLocation + * @static + * @param {google.cloud.networksecurity.v1.IMirroringLocation} message MirroringLocation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MirroringLocation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.location != null && Object.hasOwnProperty.call(message, "location")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.location); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.state); + return writer; + }; + + /** + * Encodes the specified MirroringLocation message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.MirroringLocation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.networksecurity.v1.MirroringLocation + * @static + * @param {google.cloud.networksecurity.v1.IMirroringLocation} message MirroringLocation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MirroringLocation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MirroringLocation message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.networksecurity.v1.MirroringLocation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.networksecurity.v1.MirroringLocation} MirroringLocation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MirroringLocation.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networksecurity.v1.MirroringLocation(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.location = reader.string(); + break; + } + case 2: { + message.state = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MirroringLocation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.networksecurity.v1.MirroringLocation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.networksecurity.v1.MirroringLocation} MirroringLocation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MirroringLocation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MirroringLocation message. + * @function verify + * @memberof google.cloud.networksecurity.v1.MirroringLocation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MirroringLocation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.location != null && message.hasOwnProperty("location")) + if (!$util.isString(message.location)) + return "location: string expected"; + if (message.state != null && message.hasOwnProperty("state")) + switch (message.state) { + default: + return "state: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates a MirroringLocation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.networksecurity.v1.MirroringLocation + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.networksecurity.v1.MirroringLocation} MirroringLocation + */ + MirroringLocation.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networksecurity.v1.MirroringLocation) + return object; + var message = new $root.google.cloud.networksecurity.v1.MirroringLocation(); + if (object.location != null) + message.location = String(object.location); + switch (object.state) { + default: + if (typeof object.state === "number") { + message.state = object.state; + break; + } + break; + case "STATE_UNSPECIFIED": + case 0: + message.state = 0; + break; + case "ACTIVE": + case 1: + message.state = 1; + break; + case "OUT_OF_SYNC": + case 2: + message.state = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from a MirroringLocation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.networksecurity.v1.MirroringLocation + * @static + * @param {google.cloud.networksecurity.v1.MirroringLocation} message MirroringLocation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MirroringLocation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.location = ""; + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + } + if (message.location != null && message.hasOwnProperty("location")) + object.location = message.location; + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.networksecurity.v1.MirroringLocation.State[message.state] === undefined ? message.state : $root.google.cloud.networksecurity.v1.MirroringLocation.State[message.state] : message.state; + return object; + }; + + /** + * Converts this MirroringLocation to JSON. + * @function toJSON + * @memberof google.cloud.networksecurity.v1.MirroringLocation + * @instance + * @returns {Object.} JSON object + */ + MirroringLocation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MirroringLocation + * @function getTypeUrl + * @memberof google.cloud.networksecurity.v1.MirroringLocation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MirroringLocation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.networksecurity.v1.MirroringLocation"; + }; + + /** + * State enum. + * @name google.cloud.networksecurity.v1.MirroringLocation.State + * @enum {number} + * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value + * @property {number} ACTIVE=1 ACTIVE value + * @property {number} OUT_OF_SYNC=2 OUT_OF_SYNC value + */ + MirroringLocation.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "ACTIVE"] = 1; + values[valuesById[2] = "OUT_OF_SYNC"] = 2; + return values; + })(); + + return MirroringLocation; + })(); + + v1.NetworkSecurity = (function() { + + /** + * Constructs a new NetworkSecurity service. + * @memberof google.cloud.networksecurity.v1 + * @classdesc Represents a NetworkSecurity + * @extends $protobuf.rpc.Service + * @constructor + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + */ + function NetworkSecurity(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (NetworkSecurity.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = NetworkSecurity; + + /** + * Creates new NetworkSecurity service using the specified rpc implementation. + * @function create + * @memberof google.cloud.networksecurity.v1.NetworkSecurity + * @static + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + * @returns {NetworkSecurity} RPC service. Useful where requests and/or responses are streamed. + */ + NetworkSecurity.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.networksecurity.v1.NetworkSecurity|listAuthorizationPolicies}. + * @memberof google.cloud.networksecurity.v1.NetworkSecurity + * @typedef ListAuthorizationPoliciesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.networksecurity.v1.ListAuthorizationPoliciesResponse} [response] ListAuthorizationPoliciesResponse + */ + + /** + * Calls ListAuthorizationPolicies. + * @function listAuthorizationPolicies + * @memberof google.cloud.networksecurity.v1.NetworkSecurity + * @instance + * @param {google.cloud.networksecurity.v1.IListAuthorizationPoliciesRequest} request ListAuthorizationPoliciesRequest message or plain object + * @param {google.cloud.networksecurity.v1.NetworkSecurity.ListAuthorizationPoliciesCallback} callback Node-style callback called with the error, if any, and ListAuthorizationPoliciesResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(NetworkSecurity.prototype.listAuthorizationPolicies = function listAuthorizationPolicies(request, callback) { + return this.rpcCall(listAuthorizationPolicies, $root.google.cloud.networksecurity.v1.ListAuthorizationPoliciesRequest, $root.google.cloud.networksecurity.v1.ListAuthorizationPoliciesResponse, request, callback); + }, "name", { value: "ListAuthorizationPolicies" }); + + /** + * Calls ListAuthorizationPolicies. + * @function listAuthorizationPolicies + * @memberof google.cloud.networksecurity.v1.NetworkSecurity + * @instance + * @param {google.cloud.networksecurity.v1.IListAuthorizationPoliciesRequest} request ListAuthorizationPoliciesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.networksecurity.v1.NetworkSecurity|getAuthorizationPolicy}. + * @memberof google.cloud.networksecurity.v1.NetworkSecurity + * @typedef GetAuthorizationPolicyCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.networksecurity.v1.AuthorizationPolicy} [response] AuthorizationPolicy + */ + + /** + * Calls GetAuthorizationPolicy. + * @function getAuthorizationPolicy + * @memberof google.cloud.networksecurity.v1.NetworkSecurity + * @instance + * @param {google.cloud.networksecurity.v1.IGetAuthorizationPolicyRequest} request GetAuthorizationPolicyRequest message or plain object + * @param {google.cloud.networksecurity.v1.NetworkSecurity.GetAuthorizationPolicyCallback} callback Node-style callback called with the error, if any, and AuthorizationPolicy + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(NetworkSecurity.prototype.getAuthorizationPolicy = function getAuthorizationPolicy(request, callback) { + return this.rpcCall(getAuthorizationPolicy, $root.google.cloud.networksecurity.v1.GetAuthorizationPolicyRequest, $root.google.cloud.networksecurity.v1.AuthorizationPolicy, request, callback); + }, "name", { value: "GetAuthorizationPolicy" }); + + /** + * Calls GetAuthorizationPolicy. + * @function getAuthorizationPolicy + * @memberof google.cloud.networksecurity.v1.NetworkSecurity + * @instance + * @param {google.cloud.networksecurity.v1.IGetAuthorizationPolicyRequest} request GetAuthorizationPolicyRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.networksecurity.v1.NetworkSecurity|createAuthorizationPolicy}. + * @memberof google.cloud.networksecurity.v1.NetworkSecurity + * @typedef CreateAuthorizationPolicyCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls CreateAuthorizationPolicy. + * @function createAuthorizationPolicy + * @memberof google.cloud.networksecurity.v1.NetworkSecurity + * @instance + * @param {google.cloud.networksecurity.v1.ICreateAuthorizationPolicyRequest} request CreateAuthorizationPolicyRequest message or plain object + * @param {google.cloud.networksecurity.v1.NetworkSecurity.CreateAuthorizationPolicyCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(NetworkSecurity.prototype.createAuthorizationPolicy = function createAuthorizationPolicy(request, callback) { + return this.rpcCall(createAuthorizationPolicy, $root.google.cloud.networksecurity.v1.CreateAuthorizationPolicyRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "CreateAuthorizationPolicy" }); + + /** + * Calls CreateAuthorizationPolicy. + * @function createAuthorizationPolicy + * @memberof google.cloud.networksecurity.v1.NetworkSecurity + * @instance + * @param {google.cloud.networksecurity.v1.ICreateAuthorizationPolicyRequest} request CreateAuthorizationPolicyRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.networksecurity.v1.NetworkSecurity|updateAuthorizationPolicy}. + * @memberof google.cloud.networksecurity.v1.NetworkSecurity + * @typedef UpdateAuthorizationPolicyCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls UpdateAuthorizationPolicy. + * @function updateAuthorizationPolicy + * @memberof google.cloud.networksecurity.v1.NetworkSecurity + * @instance + * @param {google.cloud.networksecurity.v1.IUpdateAuthorizationPolicyRequest} request UpdateAuthorizationPolicyRequest message or plain object + * @param {google.cloud.networksecurity.v1.NetworkSecurity.UpdateAuthorizationPolicyCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(NetworkSecurity.prototype.updateAuthorizationPolicy = function updateAuthorizationPolicy(request, callback) { + return this.rpcCall(updateAuthorizationPolicy, $root.google.cloud.networksecurity.v1.UpdateAuthorizationPolicyRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "UpdateAuthorizationPolicy" }); + + /** + * Calls UpdateAuthorizationPolicy. + * @function updateAuthorizationPolicy + * @memberof google.cloud.networksecurity.v1.NetworkSecurity + * @instance + * @param {google.cloud.networksecurity.v1.IUpdateAuthorizationPolicyRequest} request UpdateAuthorizationPolicyRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.networksecurity.v1.NetworkSecurity|deleteAuthorizationPolicy}. + * @memberof google.cloud.networksecurity.v1.NetworkSecurity + * @typedef DeleteAuthorizationPolicyCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls DeleteAuthorizationPolicy. + * @function deleteAuthorizationPolicy + * @memberof google.cloud.networksecurity.v1.NetworkSecurity + * @instance + * @param {google.cloud.networksecurity.v1.IDeleteAuthorizationPolicyRequest} request DeleteAuthorizationPolicyRequest message or plain object + * @param {google.cloud.networksecurity.v1.NetworkSecurity.DeleteAuthorizationPolicyCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(NetworkSecurity.prototype.deleteAuthorizationPolicy = function deleteAuthorizationPolicy(request, callback) { + return this.rpcCall(deleteAuthorizationPolicy, $root.google.cloud.networksecurity.v1.DeleteAuthorizationPolicyRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "DeleteAuthorizationPolicy" }); + + /** + * Calls DeleteAuthorizationPolicy. + * @function deleteAuthorizationPolicy + * @memberof google.cloud.networksecurity.v1.NetworkSecurity + * @instance + * @param {google.cloud.networksecurity.v1.IDeleteAuthorizationPolicyRequest} request DeleteAuthorizationPolicyRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.networksecurity.v1.NetworkSecurity|listBackendAuthenticationConfigs}. + * @memberof google.cloud.networksecurity.v1.NetworkSecurity + * @typedef ListBackendAuthenticationConfigsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.networksecurity.v1.ListBackendAuthenticationConfigsResponse} [response] ListBackendAuthenticationConfigsResponse + */ + + /** + * Calls ListBackendAuthenticationConfigs. + * @function listBackendAuthenticationConfigs + * @memberof google.cloud.networksecurity.v1.NetworkSecurity + * @instance + * @param {google.cloud.networksecurity.v1.IListBackendAuthenticationConfigsRequest} request ListBackendAuthenticationConfigsRequest message or plain object + * @param {google.cloud.networksecurity.v1.NetworkSecurity.ListBackendAuthenticationConfigsCallback} callback Node-style callback called with the error, if any, and ListBackendAuthenticationConfigsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(NetworkSecurity.prototype.listBackendAuthenticationConfigs = function listBackendAuthenticationConfigs(request, callback) { + return this.rpcCall(listBackendAuthenticationConfigs, $root.google.cloud.networksecurity.v1.ListBackendAuthenticationConfigsRequest, $root.google.cloud.networksecurity.v1.ListBackendAuthenticationConfigsResponse, request, callback); + }, "name", { value: "ListBackendAuthenticationConfigs" }); + + /** + * Calls ListBackendAuthenticationConfigs. + * @function listBackendAuthenticationConfigs + * @memberof google.cloud.networksecurity.v1.NetworkSecurity + * @instance + * @param {google.cloud.networksecurity.v1.IListBackendAuthenticationConfigsRequest} request ListBackendAuthenticationConfigsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.networksecurity.v1.NetworkSecurity|getBackendAuthenticationConfig}. + * @memberof google.cloud.networksecurity.v1.NetworkSecurity + * @typedef GetBackendAuthenticationConfigCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.networksecurity.v1.BackendAuthenticationConfig} [response] BackendAuthenticationConfig + */ + + /** + * Calls GetBackendAuthenticationConfig. + * @function getBackendAuthenticationConfig + * @memberof google.cloud.networksecurity.v1.NetworkSecurity + * @instance + * @param {google.cloud.networksecurity.v1.IGetBackendAuthenticationConfigRequest} request GetBackendAuthenticationConfigRequest message or plain object + * @param {google.cloud.networksecurity.v1.NetworkSecurity.GetBackendAuthenticationConfigCallback} callback Node-style callback called with the error, if any, and BackendAuthenticationConfig + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(NetworkSecurity.prototype.getBackendAuthenticationConfig = function getBackendAuthenticationConfig(request, callback) { + return this.rpcCall(getBackendAuthenticationConfig, $root.google.cloud.networksecurity.v1.GetBackendAuthenticationConfigRequest, $root.google.cloud.networksecurity.v1.BackendAuthenticationConfig, request, callback); + }, "name", { value: "GetBackendAuthenticationConfig" }); + + /** + * Calls GetBackendAuthenticationConfig. + * @function getBackendAuthenticationConfig + * @memberof google.cloud.networksecurity.v1.NetworkSecurity + * @instance + * @param {google.cloud.networksecurity.v1.IGetBackendAuthenticationConfigRequest} request GetBackendAuthenticationConfigRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.networksecurity.v1.NetworkSecurity|createBackendAuthenticationConfig}. + * @memberof google.cloud.networksecurity.v1.NetworkSecurity + * @typedef CreateBackendAuthenticationConfigCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls CreateBackendAuthenticationConfig. + * @function createBackendAuthenticationConfig + * @memberof google.cloud.networksecurity.v1.NetworkSecurity + * @instance + * @param {google.cloud.networksecurity.v1.ICreateBackendAuthenticationConfigRequest} request CreateBackendAuthenticationConfigRequest message or plain object + * @param {google.cloud.networksecurity.v1.NetworkSecurity.CreateBackendAuthenticationConfigCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(NetworkSecurity.prototype.createBackendAuthenticationConfig = function createBackendAuthenticationConfig(request, callback) { + return this.rpcCall(createBackendAuthenticationConfig, $root.google.cloud.networksecurity.v1.CreateBackendAuthenticationConfigRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "CreateBackendAuthenticationConfig" }); + + /** + * Calls CreateBackendAuthenticationConfig. + * @function createBackendAuthenticationConfig + * @memberof google.cloud.networksecurity.v1.NetworkSecurity + * @instance + * @param {google.cloud.networksecurity.v1.ICreateBackendAuthenticationConfigRequest} request CreateBackendAuthenticationConfigRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.networksecurity.v1.NetworkSecurity|updateBackendAuthenticationConfig}. + * @memberof google.cloud.networksecurity.v1.NetworkSecurity + * @typedef UpdateBackendAuthenticationConfigCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls UpdateBackendAuthenticationConfig. + * @function updateBackendAuthenticationConfig + * @memberof google.cloud.networksecurity.v1.NetworkSecurity + * @instance + * @param {google.cloud.networksecurity.v1.IUpdateBackendAuthenticationConfigRequest} request UpdateBackendAuthenticationConfigRequest message or plain object + * @param {google.cloud.networksecurity.v1.NetworkSecurity.UpdateBackendAuthenticationConfigCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(NetworkSecurity.prototype.updateBackendAuthenticationConfig = function updateBackendAuthenticationConfig(request, callback) { + return this.rpcCall(updateBackendAuthenticationConfig, $root.google.cloud.networksecurity.v1.UpdateBackendAuthenticationConfigRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "UpdateBackendAuthenticationConfig" }); + + /** + * Calls UpdateBackendAuthenticationConfig. + * @function updateBackendAuthenticationConfig + * @memberof google.cloud.networksecurity.v1.NetworkSecurity + * @instance + * @param {google.cloud.networksecurity.v1.IUpdateBackendAuthenticationConfigRequest} request UpdateBackendAuthenticationConfigRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.networksecurity.v1.NetworkSecurity|deleteBackendAuthenticationConfig}. + * @memberof google.cloud.networksecurity.v1.NetworkSecurity + * @typedef DeleteBackendAuthenticationConfigCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls DeleteBackendAuthenticationConfig. + * @function deleteBackendAuthenticationConfig + * @memberof google.cloud.networksecurity.v1.NetworkSecurity + * @instance + * @param {google.cloud.networksecurity.v1.IDeleteBackendAuthenticationConfigRequest} request DeleteBackendAuthenticationConfigRequest message or plain object + * @param {google.cloud.networksecurity.v1.NetworkSecurity.DeleteBackendAuthenticationConfigCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(NetworkSecurity.prototype.deleteBackendAuthenticationConfig = function deleteBackendAuthenticationConfig(request, callback) { + return this.rpcCall(deleteBackendAuthenticationConfig, $root.google.cloud.networksecurity.v1.DeleteBackendAuthenticationConfigRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "DeleteBackendAuthenticationConfig" }); + + /** + * Calls DeleteBackendAuthenticationConfig. + * @function deleteBackendAuthenticationConfig + * @memberof google.cloud.networksecurity.v1.NetworkSecurity + * @instance + * @param {google.cloud.networksecurity.v1.IDeleteBackendAuthenticationConfigRequest} request DeleteBackendAuthenticationConfigRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.networksecurity.v1.NetworkSecurity|listServerTlsPolicies}. + * @memberof google.cloud.networksecurity.v1.NetworkSecurity + * @typedef ListServerTlsPoliciesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.networksecurity.v1.ListServerTlsPoliciesResponse} [response] ListServerTlsPoliciesResponse + */ + + /** + * Calls ListServerTlsPolicies. + * @function listServerTlsPolicies + * @memberof google.cloud.networksecurity.v1.NetworkSecurity + * @instance + * @param {google.cloud.networksecurity.v1.IListServerTlsPoliciesRequest} request ListServerTlsPoliciesRequest message or plain object + * @param {google.cloud.networksecurity.v1.NetworkSecurity.ListServerTlsPoliciesCallback} callback Node-style callback called with the error, if any, and ListServerTlsPoliciesResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(NetworkSecurity.prototype.listServerTlsPolicies = function listServerTlsPolicies(request, callback) { + return this.rpcCall(listServerTlsPolicies, $root.google.cloud.networksecurity.v1.ListServerTlsPoliciesRequest, $root.google.cloud.networksecurity.v1.ListServerTlsPoliciesResponse, request, callback); + }, "name", { value: "ListServerTlsPolicies" }); + + /** + * Calls ListServerTlsPolicies. + * @function listServerTlsPolicies + * @memberof google.cloud.networksecurity.v1.NetworkSecurity + * @instance + * @param {google.cloud.networksecurity.v1.IListServerTlsPoliciesRequest} request ListServerTlsPoliciesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.networksecurity.v1.NetworkSecurity|getServerTlsPolicy}. + * @memberof google.cloud.networksecurity.v1.NetworkSecurity + * @typedef GetServerTlsPolicyCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.networksecurity.v1.ServerTlsPolicy} [response] ServerTlsPolicy + */ + + /** + * Calls GetServerTlsPolicy. + * @function getServerTlsPolicy + * @memberof google.cloud.networksecurity.v1.NetworkSecurity + * @instance + * @param {google.cloud.networksecurity.v1.IGetServerTlsPolicyRequest} request GetServerTlsPolicyRequest message or plain object + * @param {google.cloud.networksecurity.v1.NetworkSecurity.GetServerTlsPolicyCallback} callback Node-style callback called with the error, if any, and ServerTlsPolicy + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(NetworkSecurity.prototype.getServerTlsPolicy = function getServerTlsPolicy(request, callback) { + return this.rpcCall(getServerTlsPolicy, $root.google.cloud.networksecurity.v1.GetServerTlsPolicyRequest, $root.google.cloud.networksecurity.v1.ServerTlsPolicy, request, callback); + }, "name", { value: "GetServerTlsPolicy" }); + + /** + * Calls GetServerTlsPolicy. + * @function getServerTlsPolicy + * @memberof google.cloud.networksecurity.v1.NetworkSecurity + * @instance + * @param {google.cloud.networksecurity.v1.IGetServerTlsPolicyRequest} request GetServerTlsPolicyRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.networksecurity.v1.NetworkSecurity|createServerTlsPolicy}. + * @memberof google.cloud.networksecurity.v1.NetworkSecurity + * @typedef CreateServerTlsPolicyCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls CreateServerTlsPolicy. + * @function createServerTlsPolicy + * @memberof google.cloud.networksecurity.v1.NetworkSecurity + * @instance + * @param {google.cloud.networksecurity.v1.ICreateServerTlsPolicyRequest} request CreateServerTlsPolicyRequest message or plain object + * @param {google.cloud.networksecurity.v1.NetworkSecurity.CreateServerTlsPolicyCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(NetworkSecurity.prototype.createServerTlsPolicy = function createServerTlsPolicy(request, callback) { + return this.rpcCall(createServerTlsPolicy, $root.google.cloud.networksecurity.v1.CreateServerTlsPolicyRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "CreateServerTlsPolicy" }); + + /** + * Calls CreateServerTlsPolicy. + * @function createServerTlsPolicy + * @memberof google.cloud.networksecurity.v1.NetworkSecurity + * @instance + * @param {google.cloud.networksecurity.v1.ICreateServerTlsPolicyRequest} request CreateServerTlsPolicyRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.networksecurity.v1.NetworkSecurity|updateServerTlsPolicy}. + * @memberof google.cloud.networksecurity.v1.NetworkSecurity + * @typedef UpdateServerTlsPolicyCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls UpdateServerTlsPolicy. + * @function updateServerTlsPolicy + * @memberof google.cloud.networksecurity.v1.NetworkSecurity + * @instance + * @param {google.cloud.networksecurity.v1.IUpdateServerTlsPolicyRequest} request UpdateServerTlsPolicyRequest message or plain object + * @param {google.cloud.networksecurity.v1.NetworkSecurity.UpdateServerTlsPolicyCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(NetworkSecurity.prototype.updateServerTlsPolicy = function updateServerTlsPolicy(request, callback) { + return this.rpcCall(updateServerTlsPolicy, $root.google.cloud.networksecurity.v1.UpdateServerTlsPolicyRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "UpdateServerTlsPolicy" }); + + /** + * Calls UpdateServerTlsPolicy. + * @function updateServerTlsPolicy + * @memberof google.cloud.networksecurity.v1.NetworkSecurity + * @instance + * @param {google.cloud.networksecurity.v1.IUpdateServerTlsPolicyRequest} request UpdateServerTlsPolicyRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.networksecurity.v1.NetworkSecurity|deleteServerTlsPolicy}. + * @memberof google.cloud.networksecurity.v1.NetworkSecurity + * @typedef DeleteServerTlsPolicyCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls DeleteServerTlsPolicy. + * @function deleteServerTlsPolicy + * @memberof google.cloud.networksecurity.v1.NetworkSecurity + * @instance + * @param {google.cloud.networksecurity.v1.IDeleteServerTlsPolicyRequest} request DeleteServerTlsPolicyRequest message or plain object + * @param {google.cloud.networksecurity.v1.NetworkSecurity.DeleteServerTlsPolicyCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(NetworkSecurity.prototype.deleteServerTlsPolicy = function deleteServerTlsPolicy(request, callback) { + return this.rpcCall(deleteServerTlsPolicy, $root.google.cloud.networksecurity.v1.DeleteServerTlsPolicyRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "DeleteServerTlsPolicy" }); + + /** + * Calls DeleteServerTlsPolicy. + * @function deleteServerTlsPolicy + * @memberof google.cloud.networksecurity.v1.NetworkSecurity + * @instance + * @param {google.cloud.networksecurity.v1.IDeleteServerTlsPolicyRequest} request DeleteServerTlsPolicyRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.networksecurity.v1.NetworkSecurity|listClientTlsPolicies}. + * @memberof google.cloud.networksecurity.v1.NetworkSecurity + * @typedef ListClientTlsPoliciesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.networksecurity.v1.ListClientTlsPoliciesResponse} [response] ListClientTlsPoliciesResponse + */ + + /** + * Calls ListClientTlsPolicies. + * @function listClientTlsPolicies + * @memberof google.cloud.networksecurity.v1.NetworkSecurity + * @instance + * @param {google.cloud.networksecurity.v1.IListClientTlsPoliciesRequest} request ListClientTlsPoliciesRequest message or plain object + * @param {google.cloud.networksecurity.v1.NetworkSecurity.ListClientTlsPoliciesCallback} callback Node-style callback called with the error, if any, and ListClientTlsPoliciesResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(NetworkSecurity.prototype.listClientTlsPolicies = function listClientTlsPolicies(request, callback) { + return this.rpcCall(listClientTlsPolicies, $root.google.cloud.networksecurity.v1.ListClientTlsPoliciesRequest, $root.google.cloud.networksecurity.v1.ListClientTlsPoliciesResponse, request, callback); + }, "name", { value: "ListClientTlsPolicies" }); + + /** + * Calls ListClientTlsPolicies. + * @function listClientTlsPolicies + * @memberof google.cloud.networksecurity.v1.NetworkSecurity + * @instance + * @param {google.cloud.networksecurity.v1.IListClientTlsPoliciesRequest} request ListClientTlsPoliciesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.networksecurity.v1.NetworkSecurity|getClientTlsPolicy}. + * @memberof google.cloud.networksecurity.v1.NetworkSecurity + * @typedef GetClientTlsPolicyCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.networksecurity.v1.ClientTlsPolicy} [response] ClientTlsPolicy + */ + + /** + * Calls GetClientTlsPolicy. + * @function getClientTlsPolicy + * @memberof google.cloud.networksecurity.v1.NetworkSecurity + * @instance + * @param {google.cloud.networksecurity.v1.IGetClientTlsPolicyRequest} request GetClientTlsPolicyRequest message or plain object + * @param {google.cloud.networksecurity.v1.NetworkSecurity.GetClientTlsPolicyCallback} callback Node-style callback called with the error, if any, and ClientTlsPolicy + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(NetworkSecurity.prototype.getClientTlsPolicy = function getClientTlsPolicy(request, callback) { + return this.rpcCall(getClientTlsPolicy, $root.google.cloud.networksecurity.v1.GetClientTlsPolicyRequest, $root.google.cloud.networksecurity.v1.ClientTlsPolicy, request, callback); + }, "name", { value: "GetClientTlsPolicy" }); + + /** + * Calls GetClientTlsPolicy. + * @function getClientTlsPolicy + * @memberof google.cloud.networksecurity.v1.NetworkSecurity + * @instance + * @param {google.cloud.networksecurity.v1.IGetClientTlsPolicyRequest} request GetClientTlsPolicyRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.networksecurity.v1.NetworkSecurity|createClientTlsPolicy}. + * @memberof google.cloud.networksecurity.v1.NetworkSecurity + * @typedef CreateClientTlsPolicyCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls CreateClientTlsPolicy. + * @function createClientTlsPolicy + * @memberof google.cloud.networksecurity.v1.NetworkSecurity + * @instance + * @param {google.cloud.networksecurity.v1.ICreateClientTlsPolicyRequest} request CreateClientTlsPolicyRequest message or plain object + * @param {google.cloud.networksecurity.v1.NetworkSecurity.CreateClientTlsPolicyCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(NetworkSecurity.prototype.createClientTlsPolicy = function createClientTlsPolicy(request, callback) { + return this.rpcCall(createClientTlsPolicy, $root.google.cloud.networksecurity.v1.CreateClientTlsPolicyRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "CreateClientTlsPolicy" }); + + /** + * Calls CreateClientTlsPolicy. + * @function createClientTlsPolicy + * @memberof google.cloud.networksecurity.v1.NetworkSecurity + * @instance + * @param {google.cloud.networksecurity.v1.ICreateClientTlsPolicyRequest} request CreateClientTlsPolicyRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.networksecurity.v1.NetworkSecurity|updateClientTlsPolicy}. + * @memberof google.cloud.networksecurity.v1.NetworkSecurity + * @typedef UpdateClientTlsPolicyCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls UpdateClientTlsPolicy. + * @function updateClientTlsPolicy + * @memberof google.cloud.networksecurity.v1.NetworkSecurity + * @instance + * @param {google.cloud.networksecurity.v1.IUpdateClientTlsPolicyRequest} request UpdateClientTlsPolicyRequest message or plain object + * @param {google.cloud.networksecurity.v1.NetworkSecurity.UpdateClientTlsPolicyCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(NetworkSecurity.prototype.updateClientTlsPolicy = function updateClientTlsPolicy(request, callback) { + return this.rpcCall(updateClientTlsPolicy, $root.google.cloud.networksecurity.v1.UpdateClientTlsPolicyRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "UpdateClientTlsPolicy" }); + + /** + * Calls UpdateClientTlsPolicy. + * @function updateClientTlsPolicy + * @memberof google.cloud.networksecurity.v1.NetworkSecurity + * @instance + * @param {google.cloud.networksecurity.v1.IUpdateClientTlsPolicyRequest} request UpdateClientTlsPolicyRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.networksecurity.v1.NetworkSecurity|deleteClientTlsPolicy}. + * @memberof google.cloud.networksecurity.v1.NetworkSecurity + * @typedef DeleteClientTlsPolicyCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls DeleteClientTlsPolicy. + * @function deleteClientTlsPolicy + * @memberof google.cloud.networksecurity.v1.NetworkSecurity + * @instance + * @param {google.cloud.networksecurity.v1.IDeleteClientTlsPolicyRequest} request DeleteClientTlsPolicyRequest message or plain object + * @param {google.cloud.networksecurity.v1.NetworkSecurity.DeleteClientTlsPolicyCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(NetworkSecurity.prototype.deleteClientTlsPolicy = function deleteClientTlsPolicy(request, callback) { + return this.rpcCall(deleteClientTlsPolicy, $root.google.cloud.networksecurity.v1.DeleteClientTlsPolicyRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "DeleteClientTlsPolicy" }); + + /** + * Calls DeleteClientTlsPolicy. + * @function deleteClientTlsPolicy + * @memberof google.cloud.networksecurity.v1.NetworkSecurity + * @instance + * @param {google.cloud.networksecurity.v1.IDeleteClientTlsPolicyRequest} request DeleteClientTlsPolicyRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.networksecurity.v1.NetworkSecurity|listGatewaySecurityPolicies}. + * @memberof google.cloud.networksecurity.v1.NetworkSecurity + * @typedef ListGatewaySecurityPoliciesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.networksecurity.v1.ListGatewaySecurityPoliciesResponse} [response] ListGatewaySecurityPoliciesResponse + */ + + /** + * Calls ListGatewaySecurityPolicies. + * @function listGatewaySecurityPolicies + * @memberof google.cloud.networksecurity.v1.NetworkSecurity + * @instance + * @param {google.cloud.networksecurity.v1.IListGatewaySecurityPoliciesRequest} request ListGatewaySecurityPoliciesRequest message or plain object + * @param {google.cloud.networksecurity.v1.NetworkSecurity.ListGatewaySecurityPoliciesCallback} callback Node-style callback called with the error, if any, and ListGatewaySecurityPoliciesResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(NetworkSecurity.prototype.listGatewaySecurityPolicies = function listGatewaySecurityPolicies(request, callback) { + return this.rpcCall(listGatewaySecurityPolicies, $root.google.cloud.networksecurity.v1.ListGatewaySecurityPoliciesRequest, $root.google.cloud.networksecurity.v1.ListGatewaySecurityPoliciesResponse, request, callback); + }, "name", { value: "ListGatewaySecurityPolicies" }); + + /** + * Calls ListGatewaySecurityPolicies. + * @function listGatewaySecurityPolicies + * @memberof google.cloud.networksecurity.v1.NetworkSecurity + * @instance + * @param {google.cloud.networksecurity.v1.IListGatewaySecurityPoliciesRequest} request ListGatewaySecurityPoliciesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.networksecurity.v1.NetworkSecurity|getGatewaySecurityPolicy}. + * @memberof google.cloud.networksecurity.v1.NetworkSecurity + * @typedef GetGatewaySecurityPolicyCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.networksecurity.v1.GatewaySecurityPolicy} [response] GatewaySecurityPolicy + */ + + /** + * Calls GetGatewaySecurityPolicy. + * @function getGatewaySecurityPolicy + * @memberof google.cloud.networksecurity.v1.NetworkSecurity + * @instance + * @param {google.cloud.networksecurity.v1.IGetGatewaySecurityPolicyRequest} request GetGatewaySecurityPolicyRequest message or plain object + * @param {google.cloud.networksecurity.v1.NetworkSecurity.GetGatewaySecurityPolicyCallback} callback Node-style callback called with the error, if any, and GatewaySecurityPolicy + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(NetworkSecurity.prototype.getGatewaySecurityPolicy = function getGatewaySecurityPolicy(request, callback) { + return this.rpcCall(getGatewaySecurityPolicy, $root.google.cloud.networksecurity.v1.GetGatewaySecurityPolicyRequest, $root.google.cloud.networksecurity.v1.GatewaySecurityPolicy, request, callback); + }, "name", { value: "GetGatewaySecurityPolicy" }); + + /** + * Calls GetGatewaySecurityPolicy. + * @function getGatewaySecurityPolicy + * @memberof google.cloud.networksecurity.v1.NetworkSecurity + * @instance + * @param {google.cloud.networksecurity.v1.IGetGatewaySecurityPolicyRequest} request GetGatewaySecurityPolicyRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.networksecurity.v1.NetworkSecurity|createGatewaySecurityPolicy}. + * @memberof google.cloud.networksecurity.v1.NetworkSecurity + * @typedef CreateGatewaySecurityPolicyCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls CreateGatewaySecurityPolicy. + * @function createGatewaySecurityPolicy + * @memberof google.cloud.networksecurity.v1.NetworkSecurity + * @instance + * @param {google.cloud.networksecurity.v1.ICreateGatewaySecurityPolicyRequest} request CreateGatewaySecurityPolicyRequest message or plain object + * @param {google.cloud.networksecurity.v1.NetworkSecurity.CreateGatewaySecurityPolicyCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(NetworkSecurity.prototype.createGatewaySecurityPolicy = function createGatewaySecurityPolicy(request, callback) { + return this.rpcCall(createGatewaySecurityPolicy, $root.google.cloud.networksecurity.v1.CreateGatewaySecurityPolicyRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "CreateGatewaySecurityPolicy" }); + + /** + * Calls CreateGatewaySecurityPolicy. + * @function createGatewaySecurityPolicy + * @memberof google.cloud.networksecurity.v1.NetworkSecurity + * @instance + * @param {google.cloud.networksecurity.v1.ICreateGatewaySecurityPolicyRequest} request CreateGatewaySecurityPolicyRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.networksecurity.v1.NetworkSecurity|updateGatewaySecurityPolicy}. + * @memberof google.cloud.networksecurity.v1.NetworkSecurity + * @typedef UpdateGatewaySecurityPolicyCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls UpdateGatewaySecurityPolicy. + * @function updateGatewaySecurityPolicy + * @memberof google.cloud.networksecurity.v1.NetworkSecurity + * @instance + * @param {google.cloud.networksecurity.v1.IUpdateGatewaySecurityPolicyRequest} request UpdateGatewaySecurityPolicyRequest message or plain object + * @param {google.cloud.networksecurity.v1.NetworkSecurity.UpdateGatewaySecurityPolicyCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(NetworkSecurity.prototype.updateGatewaySecurityPolicy = function updateGatewaySecurityPolicy(request, callback) { + return this.rpcCall(updateGatewaySecurityPolicy, $root.google.cloud.networksecurity.v1.UpdateGatewaySecurityPolicyRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "UpdateGatewaySecurityPolicy" }); + + /** + * Calls UpdateGatewaySecurityPolicy. + * @function updateGatewaySecurityPolicy + * @memberof google.cloud.networksecurity.v1.NetworkSecurity + * @instance + * @param {google.cloud.networksecurity.v1.IUpdateGatewaySecurityPolicyRequest} request UpdateGatewaySecurityPolicyRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.networksecurity.v1.NetworkSecurity|deleteGatewaySecurityPolicy}. + * @memberof google.cloud.networksecurity.v1.NetworkSecurity + * @typedef DeleteGatewaySecurityPolicyCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls DeleteGatewaySecurityPolicy. + * @function deleteGatewaySecurityPolicy + * @memberof google.cloud.networksecurity.v1.NetworkSecurity + * @instance + * @param {google.cloud.networksecurity.v1.IDeleteGatewaySecurityPolicyRequest} request DeleteGatewaySecurityPolicyRequest message or plain object + * @param {google.cloud.networksecurity.v1.NetworkSecurity.DeleteGatewaySecurityPolicyCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(NetworkSecurity.prototype.deleteGatewaySecurityPolicy = function deleteGatewaySecurityPolicy(request, callback) { + return this.rpcCall(deleteGatewaySecurityPolicy, $root.google.cloud.networksecurity.v1.DeleteGatewaySecurityPolicyRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "DeleteGatewaySecurityPolicy" }); + + /** + * Calls DeleteGatewaySecurityPolicy. + * @function deleteGatewaySecurityPolicy + * @memberof google.cloud.networksecurity.v1.NetworkSecurity + * @instance + * @param {google.cloud.networksecurity.v1.IDeleteGatewaySecurityPolicyRequest} request DeleteGatewaySecurityPolicyRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.networksecurity.v1.NetworkSecurity|listGatewaySecurityPolicyRules}. + * @memberof google.cloud.networksecurity.v1.NetworkSecurity + * @typedef ListGatewaySecurityPolicyRulesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.networksecurity.v1.ListGatewaySecurityPolicyRulesResponse} [response] ListGatewaySecurityPolicyRulesResponse + */ + + /** + * Calls ListGatewaySecurityPolicyRules. + * @function listGatewaySecurityPolicyRules + * @memberof google.cloud.networksecurity.v1.NetworkSecurity + * @instance + * @param {google.cloud.networksecurity.v1.IListGatewaySecurityPolicyRulesRequest} request ListGatewaySecurityPolicyRulesRequest message or plain object + * @param {google.cloud.networksecurity.v1.NetworkSecurity.ListGatewaySecurityPolicyRulesCallback} callback Node-style callback called with the error, if any, and ListGatewaySecurityPolicyRulesResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(NetworkSecurity.prototype.listGatewaySecurityPolicyRules = function listGatewaySecurityPolicyRules(request, callback) { + return this.rpcCall(listGatewaySecurityPolicyRules, $root.google.cloud.networksecurity.v1.ListGatewaySecurityPolicyRulesRequest, $root.google.cloud.networksecurity.v1.ListGatewaySecurityPolicyRulesResponse, request, callback); + }, "name", { value: "ListGatewaySecurityPolicyRules" }); + + /** + * Calls ListGatewaySecurityPolicyRules. + * @function listGatewaySecurityPolicyRules + * @memberof google.cloud.networksecurity.v1.NetworkSecurity + * @instance + * @param {google.cloud.networksecurity.v1.IListGatewaySecurityPolicyRulesRequest} request ListGatewaySecurityPolicyRulesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.networksecurity.v1.NetworkSecurity|getGatewaySecurityPolicyRule}. + * @memberof google.cloud.networksecurity.v1.NetworkSecurity + * @typedef GetGatewaySecurityPolicyRuleCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.networksecurity.v1.GatewaySecurityPolicyRule} [response] GatewaySecurityPolicyRule + */ + + /** + * Calls GetGatewaySecurityPolicyRule. + * @function getGatewaySecurityPolicyRule + * @memberof google.cloud.networksecurity.v1.NetworkSecurity + * @instance + * @param {google.cloud.networksecurity.v1.IGetGatewaySecurityPolicyRuleRequest} request GetGatewaySecurityPolicyRuleRequest message or plain object + * @param {google.cloud.networksecurity.v1.NetworkSecurity.GetGatewaySecurityPolicyRuleCallback} callback Node-style callback called with the error, if any, and GatewaySecurityPolicyRule + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(NetworkSecurity.prototype.getGatewaySecurityPolicyRule = function getGatewaySecurityPolicyRule(request, callback) { + return this.rpcCall(getGatewaySecurityPolicyRule, $root.google.cloud.networksecurity.v1.GetGatewaySecurityPolicyRuleRequest, $root.google.cloud.networksecurity.v1.GatewaySecurityPolicyRule, request, callback); + }, "name", { value: "GetGatewaySecurityPolicyRule" }); + + /** + * Calls GetGatewaySecurityPolicyRule. + * @function getGatewaySecurityPolicyRule + * @memberof google.cloud.networksecurity.v1.NetworkSecurity + * @instance + * @param {google.cloud.networksecurity.v1.IGetGatewaySecurityPolicyRuleRequest} request GetGatewaySecurityPolicyRuleRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.networksecurity.v1.NetworkSecurity|createGatewaySecurityPolicyRule}. + * @memberof google.cloud.networksecurity.v1.NetworkSecurity + * @typedef CreateGatewaySecurityPolicyRuleCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls CreateGatewaySecurityPolicyRule. + * @function createGatewaySecurityPolicyRule + * @memberof google.cloud.networksecurity.v1.NetworkSecurity + * @instance + * @param {google.cloud.networksecurity.v1.ICreateGatewaySecurityPolicyRuleRequest} request CreateGatewaySecurityPolicyRuleRequest message or plain object + * @param {google.cloud.networksecurity.v1.NetworkSecurity.CreateGatewaySecurityPolicyRuleCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(NetworkSecurity.prototype.createGatewaySecurityPolicyRule = function createGatewaySecurityPolicyRule(request, callback) { + return this.rpcCall(createGatewaySecurityPolicyRule, $root.google.cloud.networksecurity.v1.CreateGatewaySecurityPolicyRuleRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "CreateGatewaySecurityPolicyRule" }); + + /** + * Calls CreateGatewaySecurityPolicyRule. + * @function createGatewaySecurityPolicyRule + * @memberof google.cloud.networksecurity.v1.NetworkSecurity + * @instance + * @param {google.cloud.networksecurity.v1.ICreateGatewaySecurityPolicyRuleRequest} request CreateGatewaySecurityPolicyRuleRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.networksecurity.v1.NetworkSecurity|updateGatewaySecurityPolicyRule}. + * @memberof google.cloud.networksecurity.v1.NetworkSecurity + * @typedef UpdateGatewaySecurityPolicyRuleCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls UpdateGatewaySecurityPolicyRule. + * @function updateGatewaySecurityPolicyRule + * @memberof google.cloud.networksecurity.v1.NetworkSecurity + * @instance + * @param {google.cloud.networksecurity.v1.IUpdateGatewaySecurityPolicyRuleRequest} request UpdateGatewaySecurityPolicyRuleRequest message or plain object + * @param {google.cloud.networksecurity.v1.NetworkSecurity.UpdateGatewaySecurityPolicyRuleCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(NetworkSecurity.prototype.updateGatewaySecurityPolicyRule = function updateGatewaySecurityPolicyRule(request, callback) { + return this.rpcCall(updateGatewaySecurityPolicyRule, $root.google.cloud.networksecurity.v1.UpdateGatewaySecurityPolicyRuleRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "UpdateGatewaySecurityPolicyRule" }); + + /** + * Calls UpdateGatewaySecurityPolicyRule. + * @function updateGatewaySecurityPolicyRule + * @memberof google.cloud.networksecurity.v1.NetworkSecurity + * @instance + * @param {google.cloud.networksecurity.v1.IUpdateGatewaySecurityPolicyRuleRequest} request UpdateGatewaySecurityPolicyRuleRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.networksecurity.v1.NetworkSecurity|deleteGatewaySecurityPolicyRule}. + * @memberof google.cloud.networksecurity.v1.NetworkSecurity + * @typedef DeleteGatewaySecurityPolicyRuleCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls DeleteGatewaySecurityPolicyRule. + * @function deleteGatewaySecurityPolicyRule + * @memberof google.cloud.networksecurity.v1.NetworkSecurity + * @instance + * @param {google.cloud.networksecurity.v1.IDeleteGatewaySecurityPolicyRuleRequest} request DeleteGatewaySecurityPolicyRuleRequest message or plain object + * @param {google.cloud.networksecurity.v1.NetworkSecurity.DeleteGatewaySecurityPolicyRuleCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(NetworkSecurity.prototype.deleteGatewaySecurityPolicyRule = function deleteGatewaySecurityPolicyRule(request, callback) { + return this.rpcCall(deleteGatewaySecurityPolicyRule, $root.google.cloud.networksecurity.v1.DeleteGatewaySecurityPolicyRuleRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "DeleteGatewaySecurityPolicyRule" }); + + /** + * Calls DeleteGatewaySecurityPolicyRule. + * @function deleteGatewaySecurityPolicyRule + * @memberof google.cloud.networksecurity.v1.NetworkSecurity + * @instance + * @param {google.cloud.networksecurity.v1.IDeleteGatewaySecurityPolicyRuleRequest} request DeleteGatewaySecurityPolicyRuleRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.networksecurity.v1.NetworkSecurity|listUrlLists}. + * @memberof google.cloud.networksecurity.v1.NetworkSecurity + * @typedef ListUrlListsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.networksecurity.v1.ListUrlListsResponse} [response] ListUrlListsResponse + */ + + /** + * Calls ListUrlLists. + * @function listUrlLists + * @memberof google.cloud.networksecurity.v1.NetworkSecurity + * @instance + * @param {google.cloud.networksecurity.v1.IListUrlListsRequest} request ListUrlListsRequest message or plain object + * @param {google.cloud.networksecurity.v1.NetworkSecurity.ListUrlListsCallback} callback Node-style callback called with the error, if any, and ListUrlListsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(NetworkSecurity.prototype.listUrlLists = function listUrlLists(request, callback) { + return this.rpcCall(listUrlLists, $root.google.cloud.networksecurity.v1.ListUrlListsRequest, $root.google.cloud.networksecurity.v1.ListUrlListsResponse, request, callback); + }, "name", { value: "ListUrlLists" }); + + /** + * Calls ListUrlLists. + * @function listUrlLists + * @memberof google.cloud.networksecurity.v1.NetworkSecurity + * @instance + * @param {google.cloud.networksecurity.v1.IListUrlListsRequest} request ListUrlListsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.networksecurity.v1.NetworkSecurity|getUrlList}. + * @memberof google.cloud.networksecurity.v1.NetworkSecurity + * @typedef GetUrlListCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.networksecurity.v1.UrlList} [response] UrlList + */ + + /** + * Calls GetUrlList. + * @function getUrlList + * @memberof google.cloud.networksecurity.v1.NetworkSecurity + * @instance + * @param {google.cloud.networksecurity.v1.IGetUrlListRequest} request GetUrlListRequest message or plain object + * @param {google.cloud.networksecurity.v1.NetworkSecurity.GetUrlListCallback} callback Node-style callback called with the error, if any, and UrlList + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(NetworkSecurity.prototype.getUrlList = function getUrlList(request, callback) { + return this.rpcCall(getUrlList, $root.google.cloud.networksecurity.v1.GetUrlListRequest, $root.google.cloud.networksecurity.v1.UrlList, request, callback); + }, "name", { value: "GetUrlList" }); + + /** + * Calls GetUrlList. + * @function getUrlList + * @memberof google.cloud.networksecurity.v1.NetworkSecurity + * @instance + * @param {google.cloud.networksecurity.v1.IGetUrlListRequest} request GetUrlListRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.networksecurity.v1.NetworkSecurity|createUrlList}. + * @memberof google.cloud.networksecurity.v1.NetworkSecurity + * @typedef CreateUrlListCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls CreateUrlList. + * @function createUrlList + * @memberof google.cloud.networksecurity.v1.NetworkSecurity + * @instance + * @param {google.cloud.networksecurity.v1.ICreateUrlListRequest} request CreateUrlListRequest message or plain object + * @param {google.cloud.networksecurity.v1.NetworkSecurity.CreateUrlListCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(NetworkSecurity.prototype.createUrlList = function createUrlList(request, callback) { + return this.rpcCall(createUrlList, $root.google.cloud.networksecurity.v1.CreateUrlListRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "CreateUrlList" }); + + /** + * Calls CreateUrlList. + * @function createUrlList + * @memberof google.cloud.networksecurity.v1.NetworkSecurity + * @instance + * @param {google.cloud.networksecurity.v1.ICreateUrlListRequest} request CreateUrlListRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.networksecurity.v1.NetworkSecurity|updateUrlList}. + * @memberof google.cloud.networksecurity.v1.NetworkSecurity + * @typedef UpdateUrlListCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls UpdateUrlList. + * @function updateUrlList + * @memberof google.cloud.networksecurity.v1.NetworkSecurity + * @instance + * @param {google.cloud.networksecurity.v1.IUpdateUrlListRequest} request UpdateUrlListRequest message or plain object + * @param {google.cloud.networksecurity.v1.NetworkSecurity.UpdateUrlListCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(NetworkSecurity.prototype.updateUrlList = function updateUrlList(request, callback) { + return this.rpcCall(updateUrlList, $root.google.cloud.networksecurity.v1.UpdateUrlListRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "UpdateUrlList" }); + + /** + * Calls UpdateUrlList. + * @function updateUrlList + * @memberof google.cloud.networksecurity.v1.NetworkSecurity + * @instance + * @param {google.cloud.networksecurity.v1.IUpdateUrlListRequest} request UpdateUrlListRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.networksecurity.v1.NetworkSecurity|deleteUrlList}. + * @memberof google.cloud.networksecurity.v1.NetworkSecurity + * @typedef DeleteUrlListCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls DeleteUrlList. + * @function deleteUrlList + * @memberof google.cloud.networksecurity.v1.NetworkSecurity + * @instance + * @param {google.cloud.networksecurity.v1.IDeleteUrlListRequest} request DeleteUrlListRequest message or plain object + * @param {google.cloud.networksecurity.v1.NetworkSecurity.DeleteUrlListCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(NetworkSecurity.prototype.deleteUrlList = function deleteUrlList(request, callback) { + return this.rpcCall(deleteUrlList, $root.google.cloud.networksecurity.v1.DeleteUrlListRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "DeleteUrlList" }); + + /** + * Calls DeleteUrlList. + * @function deleteUrlList + * @memberof google.cloud.networksecurity.v1.NetworkSecurity + * @instance + * @param {google.cloud.networksecurity.v1.IDeleteUrlListRequest} request DeleteUrlListRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.networksecurity.v1.NetworkSecurity|listTlsInspectionPolicies}. + * @memberof google.cloud.networksecurity.v1.NetworkSecurity + * @typedef ListTlsInspectionPoliciesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.networksecurity.v1.ListTlsInspectionPoliciesResponse} [response] ListTlsInspectionPoliciesResponse + */ + + /** + * Calls ListTlsInspectionPolicies. + * @function listTlsInspectionPolicies + * @memberof google.cloud.networksecurity.v1.NetworkSecurity + * @instance + * @param {google.cloud.networksecurity.v1.IListTlsInspectionPoliciesRequest} request ListTlsInspectionPoliciesRequest message or plain object + * @param {google.cloud.networksecurity.v1.NetworkSecurity.ListTlsInspectionPoliciesCallback} callback Node-style callback called with the error, if any, and ListTlsInspectionPoliciesResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(NetworkSecurity.prototype.listTlsInspectionPolicies = function listTlsInspectionPolicies(request, callback) { + return this.rpcCall(listTlsInspectionPolicies, $root.google.cloud.networksecurity.v1.ListTlsInspectionPoliciesRequest, $root.google.cloud.networksecurity.v1.ListTlsInspectionPoliciesResponse, request, callback); + }, "name", { value: "ListTlsInspectionPolicies" }); + + /** + * Calls ListTlsInspectionPolicies. + * @function listTlsInspectionPolicies + * @memberof google.cloud.networksecurity.v1.NetworkSecurity + * @instance + * @param {google.cloud.networksecurity.v1.IListTlsInspectionPoliciesRequest} request ListTlsInspectionPoliciesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.networksecurity.v1.NetworkSecurity|getTlsInspectionPolicy}. + * @memberof google.cloud.networksecurity.v1.NetworkSecurity + * @typedef GetTlsInspectionPolicyCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.networksecurity.v1.TlsInspectionPolicy} [response] TlsInspectionPolicy + */ + + /** + * Calls GetTlsInspectionPolicy. + * @function getTlsInspectionPolicy + * @memberof google.cloud.networksecurity.v1.NetworkSecurity + * @instance + * @param {google.cloud.networksecurity.v1.IGetTlsInspectionPolicyRequest} request GetTlsInspectionPolicyRequest message or plain object + * @param {google.cloud.networksecurity.v1.NetworkSecurity.GetTlsInspectionPolicyCallback} callback Node-style callback called with the error, if any, and TlsInspectionPolicy + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(NetworkSecurity.prototype.getTlsInspectionPolicy = function getTlsInspectionPolicy(request, callback) { + return this.rpcCall(getTlsInspectionPolicy, $root.google.cloud.networksecurity.v1.GetTlsInspectionPolicyRequest, $root.google.cloud.networksecurity.v1.TlsInspectionPolicy, request, callback); + }, "name", { value: "GetTlsInspectionPolicy" }); + + /** + * Calls GetTlsInspectionPolicy. + * @function getTlsInspectionPolicy + * @memberof google.cloud.networksecurity.v1.NetworkSecurity + * @instance + * @param {google.cloud.networksecurity.v1.IGetTlsInspectionPolicyRequest} request GetTlsInspectionPolicyRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.networksecurity.v1.NetworkSecurity|createTlsInspectionPolicy}. + * @memberof google.cloud.networksecurity.v1.NetworkSecurity + * @typedef CreateTlsInspectionPolicyCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls CreateTlsInspectionPolicy. + * @function createTlsInspectionPolicy + * @memberof google.cloud.networksecurity.v1.NetworkSecurity + * @instance + * @param {google.cloud.networksecurity.v1.ICreateTlsInspectionPolicyRequest} request CreateTlsInspectionPolicyRequest message or plain object + * @param {google.cloud.networksecurity.v1.NetworkSecurity.CreateTlsInspectionPolicyCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(NetworkSecurity.prototype.createTlsInspectionPolicy = function createTlsInspectionPolicy(request, callback) { + return this.rpcCall(createTlsInspectionPolicy, $root.google.cloud.networksecurity.v1.CreateTlsInspectionPolicyRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "CreateTlsInspectionPolicy" }); + + /** + * Calls CreateTlsInspectionPolicy. + * @function createTlsInspectionPolicy + * @memberof google.cloud.networksecurity.v1.NetworkSecurity + * @instance + * @param {google.cloud.networksecurity.v1.ICreateTlsInspectionPolicyRequest} request CreateTlsInspectionPolicyRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.networksecurity.v1.NetworkSecurity|updateTlsInspectionPolicy}. + * @memberof google.cloud.networksecurity.v1.NetworkSecurity + * @typedef UpdateTlsInspectionPolicyCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls UpdateTlsInspectionPolicy. + * @function updateTlsInspectionPolicy + * @memberof google.cloud.networksecurity.v1.NetworkSecurity + * @instance + * @param {google.cloud.networksecurity.v1.IUpdateTlsInspectionPolicyRequest} request UpdateTlsInspectionPolicyRequest message or plain object + * @param {google.cloud.networksecurity.v1.NetworkSecurity.UpdateTlsInspectionPolicyCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(NetworkSecurity.prototype.updateTlsInspectionPolicy = function updateTlsInspectionPolicy(request, callback) { + return this.rpcCall(updateTlsInspectionPolicy, $root.google.cloud.networksecurity.v1.UpdateTlsInspectionPolicyRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "UpdateTlsInspectionPolicy" }); + + /** + * Calls UpdateTlsInspectionPolicy. + * @function updateTlsInspectionPolicy + * @memberof google.cloud.networksecurity.v1.NetworkSecurity + * @instance + * @param {google.cloud.networksecurity.v1.IUpdateTlsInspectionPolicyRequest} request UpdateTlsInspectionPolicyRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.networksecurity.v1.NetworkSecurity|deleteTlsInspectionPolicy}. + * @memberof google.cloud.networksecurity.v1.NetworkSecurity + * @typedef DeleteTlsInspectionPolicyCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls DeleteTlsInspectionPolicy. + * @function deleteTlsInspectionPolicy + * @memberof google.cloud.networksecurity.v1.NetworkSecurity + * @instance + * @param {google.cloud.networksecurity.v1.IDeleteTlsInspectionPolicyRequest} request DeleteTlsInspectionPolicyRequest message or plain object + * @param {google.cloud.networksecurity.v1.NetworkSecurity.DeleteTlsInspectionPolicyCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(NetworkSecurity.prototype.deleteTlsInspectionPolicy = function deleteTlsInspectionPolicy(request, callback) { + return this.rpcCall(deleteTlsInspectionPolicy, $root.google.cloud.networksecurity.v1.DeleteTlsInspectionPolicyRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "DeleteTlsInspectionPolicy" }); + + /** + * Calls DeleteTlsInspectionPolicy. + * @function deleteTlsInspectionPolicy + * @memberof google.cloud.networksecurity.v1.NetworkSecurity + * @instance + * @param {google.cloud.networksecurity.v1.IDeleteTlsInspectionPolicyRequest} request DeleteTlsInspectionPolicyRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.networksecurity.v1.NetworkSecurity|listAuthzPolicies}. + * @memberof google.cloud.networksecurity.v1.NetworkSecurity + * @typedef ListAuthzPoliciesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.networksecurity.v1.ListAuthzPoliciesResponse} [response] ListAuthzPoliciesResponse + */ + + /** + * Calls ListAuthzPolicies. + * @function listAuthzPolicies + * @memberof google.cloud.networksecurity.v1.NetworkSecurity + * @instance + * @param {google.cloud.networksecurity.v1.IListAuthzPoliciesRequest} request ListAuthzPoliciesRequest message or plain object + * @param {google.cloud.networksecurity.v1.NetworkSecurity.ListAuthzPoliciesCallback} callback Node-style callback called with the error, if any, and ListAuthzPoliciesResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(NetworkSecurity.prototype.listAuthzPolicies = function listAuthzPolicies(request, callback) { + return this.rpcCall(listAuthzPolicies, $root.google.cloud.networksecurity.v1.ListAuthzPoliciesRequest, $root.google.cloud.networksecurity.v1.ListAuthzPoliciesResponse, request, callback); + }, "name", { value: "ListAuthzPolicies" }); + + /** + * Calls ListAuthzPolicies. + * @function listAuthzPolicies + * @memberof google.cloud.networksecurity.v1.NetworkSecurity + * @instance + * @param {google.cloud.networksecurity.v1.IListAuthzPoliciesRequest} request ListAuthzPoliciesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.networksecurity.v1.NetworkSecurity|getAuthzPolicy}. + * @memberof google.cloud.networksecurity.v1.NetworkSecurity + * @typedef GetAuthzPolicyCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.networksecurity.v1.AuthzPolicy} [response] AuthzPolicy + */ + + /** + * Calls GetAuthzPolicy. + * @function getAuthzPolicy + * @memberof google.cloud.networksecurity.v1.NetworkSecurity + * @instance + * @param {google.cloud.networksecurity.v1.IGetAuthzPolicyRequest} request GetAuthzPolicyRequest message or plain object + * @param {google.cloud.networksecurity.v1.NetworkSecurity.GetAuthzPolicyCallback} callback Node-style callback called with the error, if any, and AuthzPolicy + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(NetworkSecurity.prototype.getAuthzPolicy = function getAuthzPolicy(request, callback) { + return this.rpcCall(getAuthzPolicy, $root.google.cloud.networksecurity.v1.GetAuthzPolicyRequest, $root.google.cloud.networksecurity.v1.AuthzPolicy, request, callback); + }, "name", { value: "GetAuthzPolicy" }); + + /** + * Calls GetAuthzPolicy. + * @function getAuthzPolicy + * @memberof google.cloud.networksecurity.v1.NetworkSecurity + * @instance + * @param {google.cloud.networksecurity.v1.IGetAuthzPolicyRequest} request GetAuthzPolicyRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.networksecurity.v1.NetworkSecurity|createAuthzPolicy}. + * @memberof google.cloud.networksecurity.v1.NetworkSecurity + * @typedef CreateAuthzPolicyCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls CreateAuthzPolicy. + * @function createAuthzPolicy + * @memberof google.cloud.networksecurity.v1.NetworkSecurity + * @instance + * @param {google.cloud.networksecurity.v1.ICreateAuthzPolicyRequest} request CreateAuthzPolicyRequest message or plain object + * @param {google.cloud.networksecurity.v1.NetworkSecurity.CreateAuthzPolicyCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(NetworkSecurity.prototype.createAuthzPolicy = function createAuthzPolicy(request, callback) { + return this.rpcCall(createAuthzPolicy, $root.google.cloud.networksecurity.v1.CreateAuthzPolicyRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "CreateAuthzPolicy" }); + + /** + * Calls CreateAuthzPolicy. + * @function createAuthzPolicy + * @memberof google.cloud.networksecurity.v1.NetworkSecurity + * @instance + * @param {google.cloud.networksecurity.v1.ICreateAuthzPolicyRequest} request CreateAuthzPolicyRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.networksecurity.v1.NetworkSecurity|updateAuthzPolicy}. + * @memberof google.cloud.networksecurity.v1.NetworkSecurity + * @typedef UpdateAuthzPolicyCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls UpdateAuthzPolicy. + * @function updateAuthzPolicy + * @memberof google.cloud.networksecurity.v1.NetworkSecurity + * @instance + * @param {google.cloud.networksecurity.v1.IUpdateAuthzPolicyRequest} request UpdateAuthzPolicyRequest message or plain object + * @param {google.cloud.networksecurity.v1.NetworkSecurity.UpdateAuthzPolicyCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(NetworkSecurity.prototype.updateAuthzPolicy = function updateAuthzPolicy(request, callback) { + return this.rpcCall(updateAuthzPolicy, $root.google.cloud.networksecurity.v1.UpdateAuthzPolicyRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "UpdateAuthzPolicy" }); + + /** + * Calls UpdateAuthzPolicy. + * @function updateAuthzPolicy + * @memberof google.cloud.networksecurity.v1.NetworkSecurity + * @instance + * @param {google.cloud.networksecurity.v1.IUpdateAuthzPolicyRequest} request UpdateAuthzPolicyRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.networksecurity.v1.NetworkSecurity|deleteAuthzPolicy}. + * @memberof google.cloud.networksecurity.v1.NetworkSecurity + * @typedef DeleteAuthzPolicyCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls DeleteAuthzPolicy. + * @function deleteAuthzPolicy + * @memberof google.cloud.networksecurity.v1.NetworkSecurity + * @instance + * @param {google.cloud.networksecurity.v1.IDeleteAuthzPolicyRequest} request DeleteAuthzPolicyRequest message or plain object + * @param {google.cloud.networksecurity.v1.NetworkSecurity.DeleteAuthzPolicyCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(NetworkSecurity.prototype.deleteAuthzPolicy = function deleteAuthzPolicy(request, callback) { + return this.rpcCall(deleteAuthzPolicy, $root.google.cloud.networksecurity.v1.DeleteAuthzPolicyRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "DeleteAuthzPolicy" }); + + /** + * Calls DeleteAuthzPolicy. + * @function deleteAuthzPolicy + * @memberof google.cloud.networksecurity.v1.NetworkSecurity + * @instance + * @param {google.cloud.networksecurity.v1.IDeleteAuthzPolicyRequest} request DeleteAuthzPolicyRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return NetworkSecurity; + })(); + + v1.ServerTlsPolicy = (function() { + + /** + * Properties of a ServerTlsPolicy. + * @memberof google.cloud.networksecurity.v1 + * @interface IServerTlsPolicy + * @property {string|null} [name] ServerTlsPolicy name + * @property {string|null} [description] ServerTlsPolicy description + * @property {google.protobuf.ITimestamp|null} [createTime] ServerTlsPolicy createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] ServerTlsPolicy updateTime + * @property {Object.|null} [labels] ServerTlsPolicy labels + * @property {boolean|null} [allowOpen] ServerTlsPolicy allowOpen + * @property {google.cloud.networksecurity.v1.ICertificateProvider|null} [serverCertificate] ServerTlsPolicy serverCertificate + * @property {google.cloud.networksecurity.v1.ServerTlsPolicy.IMTLSPolicy|null} [mtlsPolicy] ServerTlsPolicy mtlsPolicy + */ + + /** + * Constructs a new ServerTlsPolicy. + * @memberof google.cloud.networksecurity.v1 + * @classdesc Represents a ServerTlsPolicy. + * @implements IServerTlsPolicy + * @constructor + * @param {google.cloud.networksecurity.v1.IServerTlsPolicy=} [properties] Properties to set + */ + function ServerTlsPolicy(properties) { + this.labels = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ServerTlsPolicy name. + * @member {string} name + * @memberof google.cloud.networksecurity.v1.ServerTlsPolicy + * @instance + */ + ServerTlsPolicy.prototype.name = ""; + + /** + * ServerTlsPolicy description. + * @member {string} description + * @memberof google.cloud.networksecurity.v1.ServerTlsPolicy + * @instance + */ + ServerTlsPolicy.prototype.description = ""; + + /** + * ServerTlsPolicy createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.networksecurity.v1.ServerTlsPolicy + * @instance + */ + ServerTlsPolicy.prototype.createTime = null; + + /** + * ServerTlsPolicy updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.networksecurity.v1.ServerTlsPolicy + * @instance + */ + ServerTlsPolicy.prototype.updateTime = null; + + /** + * ServerTlsPolicy labels. + * @member {Object.} labels + * @memberof google.cloud.networksecurity.v1.ServerTlsPolicy + * @instance + */ + ServerTlsPolicy.prototype.labels = $util.emptyObject; + + /** + * ServerTlsPolicy allowOpen. + * @member {boolean} allowOpen + * @memberof google.cloud.networksecurity.v1.ServerTlsPolicy + * @instance + */ + ServerTlsPolicy.prototype.allowOpen = false; + + /** + * ServerTlsPolicy serverCertificate. + * @member {google.cloud.networksecurity.v1.ICertificateProvider|null|undefined} serverCertificate + * @memberof google.cloud.networksecurity.v1.ServerTlsPolicy + * @instance + */ + ServerTlsPolicy.prototype.serverCertificate = null; + + /** + * ServerTlsPolicy mtlsPolicy. + * @member {google.cloud.networksecurity.v1.ServerTlsPolicy.IMTLSPolicy|null|undefined} mtlsPolicy + * @memberof google.cloud.networksecurity.v1.ServerTlsPolicy + * @instance + */ + ServerTlsPolicy.prototype.mtlsPolicy = null; + + /** + * Creates a new ServerTlsPolicy instance using the specified properties. + * @function create + * @memberof google.cloud.networksecurity.v1.ServerTlsPolicy + * @static + * @param {google.cloud.networksecurity.v1.IServerTlsPolicy=} [properties] Properties to set + * @returns {google.cloud.networksecurity.v1.ServerTlsPolicy} ServerTlsPolicy instance + */ + ServerTlsPolicy.create = function create(properties) { + return new ServerTlsPolicy(properties); + }; + + /** + * Encodes the specified ServerTlsPolicy message. Does not implicitly {@link google.cloud.networksecurity.v1.ServerTlsPolicy.verify|verify} messages. + * @function encode + * @memberof google.cloud.networksecurity.v1.ServerTlsPolicy + * @static + * @param {google.cloud.networksecurity.v1.IServerTlsPolicy} message ServerTlsPolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServerTlsPolicy.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.description); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) + for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) + writer.uint32(/* id 5, wireType 2 =*/42).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); + if (message.allowOpen != null && Object.hasOwnProperty.call(message, "allowOpen")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.allowOpen); + if (message.serverCertificate != null && Object.hasOwnProperty.call(message, "serverCertificate")) + $root.google.cloud.networksecurity.v1.CertificateProvider.encode(message.serverCertificate, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.mtlsPolicy != null && Object.hasOwnProperty.call(message, "mtlsPolicy")) + $root.google.cloud.networksecurity.v1.ServerTlsPolicy.MTLSPolicy.encode(message.mtlsPolicy, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ServerTlsPolicy message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.ServerTlsPolicy.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.networksecurity.v1.ServerTlsPolicy + * @static + * @param {google.cloud.networksecurity.v1.IServerTlsPolicy} message ServerTlsPolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServerTlsPolicy.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ServerTlsPolicy message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.networksecurity.v1.ServerTlsPolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.networksecurity.v1.ServerTlsPolicy} ServerTlsPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServerTlsPolicy.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networksecurity.v1.ServerTlsPolicy(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.description = reader.string(); + break; + } + case 3: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 4: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 5: { + if (message.labels === $util.emptyObject) + message.labels = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.labels[key] = value; + break; + } + case 6: { + message.allowOpen = reader.bool(); + break; + } + case 7: { + message.serverCertificate = $root.google.cloud.networksecurity.v1.CertificateProvider.decode(reader, reader.uint32()); + break; + } + case 8: { + message.mtlsPolicy = $root.google.cloud.networksecurity.v1.ServerTlsPolicy.MTLSPolicy.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ServerTlsPolicy message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.networksecurity.v1.ServerTlsPolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.networksecurity.v1.ServerTlsPolicy} ServerTlsPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServerTlsPolicy.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ServerTlsPolicy message. + * @function verify + * @memberof google.cloud.networksecurity.v1.ServerTlsPolicy + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ServerTlsPolicy.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime); + if (error) + return "updateTime." + error; + } + if (message.labels != null && message.hasOwnProperty("labels")) { + if (!$util.isObject(message.labels)) + return "labels: object expected"; + var key = Object.keys(message.labels); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.labels[key[i]])) + return "labels: string{k:string} expected"; + } + if (message.allowOpen != null && message.hasOwnProperty("allowOpen")) + if (typeof message.allowOpen !== "boolean") + return "allowOpen: boolean expected"; + if (message.serverCertificate != null && message.hasOwnProperty("serverCertificate")) { + var error = $root.google.cloud.networksecurity.v1.CertificateProvider.verify(message.serverCertificate); + if (error) + return "serverCertificate." + error; + } + if (message.mtlsPolicy != null && message.hasOwnProperty("mtlsPolicy")) { + var error = $root.google.cloud.networksecurity.v1.ServerTlsPolicy.MTLSPolicy.verify(message.mtlsPolicy); + if (error) + return "mtlsPolicy." + error; + } + return null; + }; + + /** + * Creates a ServerTlsPolicy message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.networksecurity.v1.ServerTlsPolicy + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.networksecurity.v1.ServerTlsPolicy} ServerTlsPolicy + */ + ServerTlsPolicy.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networksecurity.v1.ServerTlsPolicy) + return object; + var message = new $root.google.cloud.networksecurity.v1.ServerTlsPolicy(); + if (object.name != null) + message.name = String(object.name); + if (object.description != null) + message.description = String(object.description); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.networksecurity.v1.ServerTlsPolicy.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.updateTime != null) { + if (typeof object.updateTime !== "object") + throw TypeError(".google.cloud.networksecurity.v1.ServerTlsPolicy.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.cloud.networksecurity.v1.ServerTlsPolicy.labels: object expected"); + message.labels = {}; + for (var keys = Object.keys(object.labels), i = 0; i < keys.length; ++i) + message.labels[keys[i]] = String(object.labels[keys[i]]); + } + if (object.allowOpen != null) + message.allowOpen = Boolean(object.allowOpen); + if (object.serverCertificate != null) { + if (typeof object.serverCertificate !== "object") + throw TypeError(".google.cloud.networksecurity.v1.ServerTlsPolicy.serverCertificate: object expected"); + message.serverCertificate = $root.google.cloud.networksecurity.v1.CertificateProvider.fromObject(object.serverCertificate); + } + if (object.mtlsPolicy != null) { + if (typeof object.mtlsPolicy !== "object") + throw TypeError(".google.cloud.networksecurity.v1.ServerTlsPolicy.mtlsPolicy: object expected"); + message.mtlsPolicy = $root.google.cloud.networksecurity.v1.ServerTlsPolicy.MTLSPolicy.fromObject(object.mtlsPolicy); + } + return message; + }; + + /** + * Creates a plain object from a ServerTlsPolicy message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.networksecurity.v1.ServerTlsPolicy + * @static + * @param {google.cloud.networksecurity.v1.ServerTlsPolicy} message ServerTlsPolicy + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ServerTlsPolicy.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.labels = {}; + if (options.defaults) { + object.name = ""; + object.description = ""; + object.createTime = null; + object.updateTime = null; + object.allowOpen = false; + object.serverCertificate = null; + object.mtlsPolicy = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.updateTime != null && message.hasOwnProperty("updateTime")) + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); + var keys2; + if (message.labels && (keys2 = Object.keys(message.labels)).length) { + object.labels = {}; + for (var j = 0; j < keys2.length; ++j) + object.labels[keys2[j]] = message.labels[keys2[j]]; + } + if (message.allowOpen != null && message.hasOwnProperty("allowOpen")) + object.allowOpen = message.allowOpen; + if (message.serverCertificate != null && message.hasOwnProperty("serverCertificate")) + object.serverCertificate = $root.google.cloud.networksecurity.v1.CertificateProvider.toObject(message.serverCertificate, options); + if (message.mtlsPolicy != null && message.hasOwnProperty("mtlsPolicy")) + object.mtlsPolicy = $root.google.cloud.networksecurity.v1.ServerTlsPolicy.MTLSPolicy.toObject(message.mtlsPolicy, options); + return object; + }; + + /** + * Converts this ServerTlsPolicy to JSON. + * @function toJSON + * @memberof google.cloud.networksecurity.v1.ServerTlsPolicy + * @instance + * @returns {Object.} JSON object + */ + ServerTlsPolicy.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ServerTlsPolicy + * @function getTypeUrl + * @memberof google.cloud.networksecurity.v1.ServerTlsPolicy + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ServerTlsPolicy.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.networksecurity.v1.ServerTlsPolicy"; + }; + + ServerTlsPolicy.MTLSPolicy = (function() { + + /** + * Properties of a MTLSPolicy. + * @memberof google.cloud.networksecurity.v1.ServerTlsPolicy + * @interface IMTLSPolicy + * @property {google.cloud.networksecurity.v1.ServerTlsPolicy.MTLSPolicy.ClientValidationMode|null} [clientValidationMode] MTLSPolicy clientValidationMode + * @property {Array.|null} [clientValidationCa] MTLSPolicy clientValidationCa + * @property {string|null} [clientValidationTrustConfig] MTLSPolicy clientValidationTrustConfig + */ + + /** + * Constructs a new MTLSPolicy. + * @memberof google.cloud.networksecurity.v1.ServerTlsPolicy + * @classdesc Represents a MTLSPolicy. + * @implements IMTLSPolicy + * @constructor + * @param {google.cloud.networksecurity.v1.ServerTlsPolicy.IMTLSPolicy=} [properties] Properties to set + */ + function MTLSPolicy(properties) { + this.clientValidationCa = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MTLSPolicy clientValidationMode. + * @member {google.cloud.networksecurity.v1.ServerTlsPolicy.MTLSPolicy.ClientValidationMode} clientValidationMode + * @memberof google.cloud.networksecurity.v1.ServerTlsPolicy.MTLSPolicy + * @instance + */ + MTLSPolicy.prototype.clientValidationMode = 0; + + /** + * MTLSPolicy clientValidationCa. + * @member {Array.} clientValidationCa + * @memberof google.cloud.networksecurity.v1.ServerTlsPolicy.MTLSPolicy + * @instance + */ + MTLSPolicy.prototype.clientValidationCa = $util.emptyArray; + + /** + * MTLSPolicy clientValidationTrustConfig. + * @member {string} clientValidationTrustConfig + * @memberof google.cloud.networksecurity.v1.ServerTlsPolicy.MTLSPolicy + * @instance + */ + MTLSPolicy.prototype.clientValidationTrustConfig = ""; + + /** + * Creates a new MTLSPolicy instance using the specified properties. + * @function create + * @memberof google.cloud.networksecurity.v1.ServerTlsPolicy.MTLSPolicy + * @static + * @param {google.cloud.networksecurity.v1.ServerTlsPolicy.IMTLSPolicy=} [properties] Properties to set + * @returns {google.cloud.networksecurity.v1.ServerTlsPolicy.MTLSPolicy} MTLSPolicy instance + */ + MTLSPolicy.create = function create(properties) { + return new MTLSPolicy(properties); + }; + + /** + * Encodes the specified MTLSPolicy message. Does not implicitly {@link google.cloud.networksecurity.v1.ServerTlsPolicy.MTLSPolicy.verify|verify} messages. + * @function encode + * @memberof google.cloud.networksecurity.v1.ServerTlsPolicy.MTLSPolicy + * @static + * @param {google.cloud.networksecurity.v1.ServerTlsPolicy.IMTLSPolicy} message MTLSPolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MTLSPolicy.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.clientValidationCa != null && message.clientValidationCa.length) + for (var i = 0; i < message.clientValidationCa.length; ++i) + $root.google.cloud.networksecurity.v1.ValidationCA.encode(message.clientValidationCa[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.clientValidationMode != null && Object.hasOwnProperty.call(message, "clientValidationMode")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.clientValidationMode); + if (message.clientValidationTrustConfig != null && Object.hasOwnProperty.call(message, "clientValidationTrustConfig")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.clientValidationTrustConfig); + return writer; + }; + + /** + * Encodes the specified MTLSPolicy message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.ServerTlsPolicy.MTLSPolicy.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.networksecurity.v1.ServerTlsPolicy.MTLSPolicy + * @static + * @param {google.cloud.networksecurity.v1.ServerTlsPolicy.IMTLSPolicy} message MTLSPolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MTLSPolicy.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MTLSPolicy message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.networksecurity.v1.ServerTlsPolicy.MTLSPolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.networksecurity.v1.ServerTlsPolicy.MTLSPolicy} MTLSPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MTLSPolicy.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networksecurity.v1.ServerTlsPolicy.MTLSPolicy(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 2: { + message.clientValidationMode = reader.int32(); + break; + } + case 1: { + if (!(message.clientValidationCa && message.clientValidationCa.length)) + message.clientValidationCa = []; + message.clientValidationCa.push($root.google.cloud.networksecurity.v1.ValidationCA.decode(reader, reader.uint32())); + break; + } + case 4: { + message.clientValidationTrustConfig = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MTLSPolicy message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.networksecurity.v1.ServerTlsPolicy.MTLSPolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.networksecurity.v1.ServerTlsPolicy.MTLSPolicy} MTLSPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MTLSPolicy.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MTLSPolicy message. + * @function verify + * @memberof google.cloud.networksecurity.v1.ServerTlsPolicy.MTLSPolicy + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MTLSPolicy.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.clientValidationMode != null && message.hasOwnProperty("clientValidationMode")) + switch (message.clientValidationMode) { + default: + return "clientValidationMode: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.clientValidationCa != null && message.hasOwnProperty("clientValidationCa")) { + if (!Array.isArray(message.clientValidationCa)) + return "clientValidationCa: array expected"; + for (var i = 0; i < message.clientValidationCa.length; ++i) { + var error = $root.google.cloud.networksecurity.v1.ValidationCA.verify(message.clientValidationCa[i]); + if (error) + return "clientValidationCa." + error; + } + } + if (message.clientValidationTrustConfig != null && message.hasOwnProperty("clientValidationTrustConfig")) + if (!$util.isString(message.clientValidationTrustConfig)) + return "clientValidationTrustConfig: string expected"; + return null; + }; + + /** + * Creates a MTLSPolicy message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.networksecurity.v1.ServerTlsPolicy.MTLSPolicy + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.networksecurity.v1.ServerTlsPolicy.MTLSPolicy} MTLSPolicy + */ + MTLSPolicy.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networksecurity.v1.ServerTlsPolicy.MTLSPolicy) + return object; + var message = new $root.google.cloud.networksecurity.v1.ServerTlsPolicy.MTLSPolicy(); + switch (object.clientValidationMode) { + default: + if (typeof object.clientValidationMode === "number") { + message.clientValidationMode = object.clientValidationMode; + break; + } + break; + case "CLIENT_VALIDATION_MODE_UNSPECIFIED": + case 0: + message.clientValidationMode = 0; + break; + case "ALLOW_INVALID_OR_MISSING_CLIENT_CERT": + case 1: + message.clientValidationMode = 1; + break; + case "REJECT_INVALID": + case 2: + message.clientValidationMode = 2; + break; + } + if (object.clientValidationCa) { + if (!Array.isArray(object.clientValidationCa)) + throw TypeError(".google.cloud.networksecurity.v1.ServerTlsPolicy.MTLSPolicy.clientValidationCa: array expected"); + message.clientValidationCa = []; + for (var i = 0; i < object.clientValidationCa.length; ++i) { + if (typeof object.clientValidationCa[i] !== "object") + throw TypeError(".google.cloud.networksecurity.v1.ServerTlsPolicy.MTLSPolicy.clientValidationCa: object expected"); + message.clientValidationCa[i] = $root.google.cloud.networksecurity.v1.ValidationCA.fromObject(object.clientValidationCa[i]); + } + } + if (object.clientValidationTrustConfig != null) + message.clientValidationTrustConfig = String(object.clientValidationTrustConfig); + return message; + }; + + /** + * Creates a plain object from a MTLSPolicy message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.networksecurity.v1.ServerTlsPolicy.MTLSPolicy + * @static + * @param {google.cloud.networksecurity.v1.ServerTlsPolicy.MTLSPolicy} message MTLSPolicy + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MTLSPolicy.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.clientValidationCa = []; + if (options.defaults) { + object.clientValidationMode = options.enums === String ? "CLIENT_VALIDATION_MODE_UNSPECIFIED" : 0; + object.clientValidationTrustConfig = ""; + } + if (message.clientValidationCa && message.clientValidationCa.length) { + object.clientValidationCa = []; + for (var j = 0; j < message.clientValidationCa.length; ++j) + object.clientValidationCa[j] = $root.google.cloud.networksecurity.v1.ValidationCA.toObject(message.clientValidationCa[j], options); + } + if (message.clientValidationMode != null && message.hasOwnProperty("clientValidationMode")) + object.clientValidationMode = options.enums === String ? $root.google.cloud.networksecurity.v1.ServerTlsPolicy.MTLSPolicy.ClientValidationMode[message.clientValidationMode] === undefined ? message.clientValidationMode : $root.google.cloud.networksecurity.v1.ServerTlsPolicy.MTLSPolicy.ClientValidationMode[message.clientValidationMode] : message.clientValidationMode; + if (message.clientValidationTrustConfig != null && message.hasOwnProperty("clientValidationTrustConfig")) + object.clientValidationTrustConfig = message.clientValidationTrustConfig; + return object; + }; + + /** + * Converts this MTLSPolicy to JSON. + * @function toJSON + * @memberof google.cloud.networksecurity.v1.ServerTlsPolicy.MTLSPolicy + * @instance + * @returns {Object.} JSON object + */ + MTLSPolicy.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MTLSPolicy + * @function getTypeUrl + * @memberof google.cloud.networksecurity.v1.ServerTlsPolicy.MTLSPolicy + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MTLSPolicy.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.networksecurity.v1.ServerTlsPolicy.MTLSPolicy"; + }; + + /** + * ClientValidationMode enum. + * @name google.cloud.networksecurity.v1.ServerTlsPolicy.MTLSPolicy.ClientValidationMode + * @enum {number} + * @property {number} CLIENT_VALIDATION_MODE_UNSPECIFIED=0 CLIENT_VALIDATION_MODE_UNSPECIFIED value + * @property {number} ALLOW_INVALID_OR_MISSING_CLIENT_CERT=1 ALLOW_INVALID_OR_MISSING_CLIENT_CERT value + * @property {number} REJECT_INVALID=2 REJECT_INVALID value + */ + MTLSPolicy.ClientValidationMode = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "CLIENT_VALIDATION_MODE_UNSPECIFIED"] = 0; + values[valuesById[1] = "ALLOW_INVALID_OR_MISSING_CLIENT_CERT"] = 1; + values[valuesById[2] = "REJECT_INVALID"] = 2; + return values; + })(); + + return MTLSPolicy; + })(); + + return ServerTlsPolicy; + })(); + + v1.ListServerTlsPoliciesRequest = (function() { + + /** + * Properties of a ListServerTlsPoliciesRequest. + * @memberof google.cloud.networksecurity.v1 + * @interface IListServerTlsPoliciesRequest + * @property {string|null} [parent] ListServerTlsPoliciesRequest parent + * @property {number|null} [pageSize] ListServerTlsPoliciesRequest pageSize + * @property {string|null} [pageToken] ListServerTlsPoliciesRequest pageToken + * @property {boolean|null} [returnPartialSuccess] ListServerTlsPoliciesRequest returnPartialSuccess + */ + + /** + * Constructs a new ListServerTlsPoliciesRequest. + * @memberof google.cloud.networksecurity.v1 + * @classdesc Represents a ListServerTlsPoliciesRequest. + * @implements IListServerTlsPoliciesRequest + * @constructor + * @param {google.cloud.networksecurity.v1.IListServerTlsPoliciesRequest=} [properties] Properties to set + */ + function ListServerTlsPoliciesRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListServerTlsPoliciesRequest parent. + * @member {string} parent + * @memberof google.cloud.networksecurity.v1.ListServerTlsPoliciesRequest + * @instance + */ + ListServerTlsPoliciesRequest.prototype.parent = ""; + + /** + * ListServerTlsPoliciesRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.networksecurity.v1.ListServerTlsPoliciesRequest + * @instance + */ + ListServerTlsPoliciesRequest.prototype.pageSize = 0; + + /** + * ListServerTlsPoliciesRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.networksecurity.v1.ListServerTlsPoliciesRequest + * @instance + */ + ListServerTlsPoliciesRequest.prototype.pageToken = ""; + + /** + * ListServerTlsPoliciesRequest returnPartialSuccess. + * @member {boolean} returnPartialSuccess + * @memberof google.cloud.networksecurity.v1.ListServerTlsPoliciesRequest + * @instance + */ + ListServerTlsPoliciesRequest.prototype.returnPartialSuccess = false; + + /** + * Creates a new ListServerTlsPoliciesRequest instance using the specified properties. + * @function create + * @memberof google.cloud.networksecurity.v1.ListServerTlsPoliciesRequest + * @static + * @param {google.cloud.networksecurity.v1.IListServerTlsPoliciesRequest=} [properties] Properties to set + * @returns {google.cloud.networksecurity.v1.ListServerTlsPoliciesRequest} ListServerTlsPoliciesRequest instance + */ + ListServerTlsPoliciesRequest.create = function create(properties) { + return new ListServerTlsPoliciesRequest(properties); + }; + + /** + * Encodes the specified ListServerTlsPoliciesRequest message. Does not implicitly {@link google.cloud.networksecurity.v1.ListServerTlsPoliciesRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.networksecurity.v1.ListServerTlsPoliciesRequest + * @static + * @param {google.cloud.networksecurity.v1.IListServerTlsPoliciesRequest} message ListServerTlsPoliciesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListServerTlsPoliciesRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + if (message.returnPartialSuccess != null && Object.hasOwnProperty.call(message, "returnPartialSuccess")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.returnPartialSuccess); + return writer; + }; + + /** + * Encodes the specified ListServerTlsPoliciesRequest message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.ListServerTlsPoliciesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.networksecurity.v1.ListServerTlsPoliciesRequest + * @static + * @param {google.cloud.networksecurity.v1.IListServerTlsPoliciesRequest} message ListServerTlsPoliciesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListServerTlsPoliciesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListServerTlsPoliciesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.networksecurity.v1.ListServerTlsPoliciesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.networksecurity.v1.ListServerTlsPoliciesRequest} ListServerTlsPoliciesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListServerTlsPoliciesRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networksecurity.v1.ListServerTlsPoliciesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + case 4: { + message.returnPartialSuccess = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListServerTlsPoliciesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.networksecurity.v1.ListServerTlsPoliciesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.networksecurity.v1.ListServerTlsPoliciesRequest} ListServerTlsPoliciesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListServerTlsPoliciesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListServerTlsPoliciesRequest message. + * @function verify + * @memberof google.cloud.networksecurity.v1.ListServerTlsPoliciesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListServerTlsPoliciesRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + if (message.returnPartialSuccess != null && message.hasOwnProperty("returnPartialSuccess")) + if (typeof message.returnPartialSuccess !== "boolean") + return "returnPartialSuccess: boolean expected"; + return null; + }; + + /** + * Creates a ListServerTlsPoliciesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.networksecurity.v1.ListServerTlsPoliciesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.networksecurity.v1.ListServerTlsPoliciesRequest} ListServerTlsPoliciesRequest + */ + ListServerTlsPoliciesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networksecurity.v1.ListServerTlsPoliciesRequest) + return object; + var message = new $root.google.cloud.networksecurity.v1.ListServerTlsPoliciesRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.returnPartialSuccess != null) + message.returnPartialSuccess = Boolean(object.returnPartialSuccess); + return message; + }; + + /** + * Creates a plain object from a ListServerTlsPoliciesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.networksecurity.v1.ListServerTlsPoliciesRequest + * @static + * @param {google.cloud.networksecurity.v1.ListServerTlsPoliciesRequest} message ListServerTlsPoliciesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListServerTlsPoliciesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + object.returnPartialSuccess = false; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.returnPartialSuccess != null && message.hasOwnProperty("returnPartialSuccess")) + object.returnPartialSuccess = message.returnPartialSuccess; + return object; + }; + + /** + * Converts this ListServerTlsPoliciesRequest to JSON. + * @function toJSON + * @memberof google.cloud.networksecurity.v1.ListServerTlsPoliciesRequest + * @instance + * @returns {Object.} JSON object + */ + ListServerTlsPoliciesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListServerTlsPoliciesRequest + * @function getTypeUrl + * @memberof google.cloud.networksecurity.v1.ListServerTlsPoliciesRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListServerTlsPoliciesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.networksecurity.v1.ListServerTlsPoliciesRequest"; + }; + + return ListServerTlsPoliciesRequest; + })(); + + v1.ListServerTlsPoliciesResponse = (function() { + + /** + * Properties of a ListServerTlsPoliciesResponse. + * @memberof google.cloud.networksecurity.v1 + * @interface IListServerTlsPoliciesResponse + * @property {Array.|null} [serverTlsPolicies] ListServerTlsPoliciesResponse serverTlsPolicies + * @property {string|null} [nextPageToken] ListServerTlsPoliciesResponse nextPageToken + * @property {Array.|null} [unreachable] ListServerTlsPoliciesResponse unreachable + */ + + /** + * Constructs a new ListServerTlsPoliciesResponse. + * @memberof google.cloud.networksecurity.v1 + * @classdesc Represents a ListServerTlsPoliciesResponse. + * @implements IListServerTlsPoliciesResponse + * @constructor + * @param {google.cloud.networksecurity.v1.IListServerTlsPoliciesResponse=} [properties] Properties to set + */ + function ListServerTlsPoliciesResponse(properties) { + this.serverTlsPolicies = []; + this.unreachable = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListServerTlsPoliciesResponse serverTlsPolicies. + * @member {Array.} serverTlsPolicies + * @memberof google.cloud.networksecurity.v1.ListServerTlsPoliciesResponse + * @instance + */ + ListServerTlsPoliciesResponse.prototype.serverTlsPolicies = $util.emptyArray; + + /** + * ListServerTlsPoliciesResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.networksecurity.v1.ListServerTlsPoliciesResponse + * @instance + */ + ListServerTlsPoliciesResponse.prototype.nextPageToken = ""; + + /** + * ListServerTlsPoliciesResponse unreachable. + * @member {Array.} unreachable + * @memberof google.cloud.networksecurity.v1.ListServerTlsPoliciesResponse + * @instance + */ + ListServerTlsPoliciesResponse.prototype.unreachable = $util.emptyArray; + + /** + * Creates a new ListServerTlsPoliciesResponse instance using the specified properties. + * @function create + * @memberof google.cloud.networksecurity.v1.ListServerTlsPoliciesResponse + * @static + * @param {google.cloud.networksecurity.v1.IListServerTlsPoliciesResponse=} [properties] Properties to set + * @returns {google.cloud.networksecurity.v1.ListServerTlsPoliciesResponse} ListServerTlsPoliciesResponse instance + */ + ListServerTlsPoliciesResponse.create = function create(properties) { + return new ListServerTlsPoliciesResponse(properties); + }; + + /** + * Encodes the specified ListServerTlsPoliciesResponse message. Does not implicitly {@link google.cloud.networksecurity.v1.ListServerTlsPoliciesResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.networksecurity.v1.ListServerTlsPoliciesResponse + * @static + * @param {google.cloud.networksecurity.v1.IListServerTlsPoliciesResponse} message ListServerTlsPoliciesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListServerTlsPoliciesResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.serverTlsPolicies != null && message.serverTlsPolicies.length) + for (var i = 0; i < message.serverTlsPolicies.length; ++i) + $root.google.cloud.networksecurity.v1.ServerTlsPolicy.encode(message.serverTlsPolicies[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + if (message.unreachable != null && message.unreachable.length) + for (var i = 0; i < message.unreachable.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.unreachable[i]); + return writer; + }; + + /** + * Encodes the specified ListServerTlsPoliciesResponse message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.ListServerTlsPoliciesResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.networksecurity.v1.ListServerTlsPoliciesResponse + * @static + * @param {google.cloud.networksecurity.v1.IListServerTlsPoliciesResponse} message ListServerTlsPoliciesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListServerTlsPoliciesResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListServerTlsPoliciesResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.networksecurity.v1.ListServerTlsPoliciesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.networksecurity.v1.ListServerTlsPoliciesResponse} ListServerTlsPoliciesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListServerTlsPoliciesResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networksecurity.v1.ListServerTlsPoliciesResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.serverTlsPolicies && message.serverTlsPolicies.length)) + message.serverTlsPolicies = []; + message.serverTlsPolicies.push($root.google.cloud.networksecurity.v1.ServerTlsPolicy.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + case 3: { + if (!(message.unreachable && message.unreachable.length)) + message.unreachable = []; + message.unreachable.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListServerTlsPoliciesResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.networksecurity.v1.ListServerTlsPoliciesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.networksecurity.v1.ListServerTlsPoliciesResponse} ListServerTlsPoliciesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListServerTlsPoliciesResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListServerTlsPoliciesResponse message. + * @function verify + * @memberof google.cloud.networksecurity.v1.ListServerTlsPoliciesResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListServerTlsPoliciesResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.serverTlsPolicies != null && message.hasOwnProperty("serverTlsPolicies")) { + if (!Array.isArray(message.serverTlsPolicies)) + return "serverTlsPolicies: array expected"; + for (var i = 0; i < message.serverTlsPolicies.length; ++i) { + var error = $root.google.cloud.networksecurity.v1.ServerTlsPolicy.verify(message.serverTlsPolicies[i]); + if (error) + return "serverTlsPolicies." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + if (message.unreachable != null && message.hasOwnProperty("unreachable")) { + if (!Array.isArray(message.unreachable)) + return "unreachable: array expected"; + for (var i = 0; i < message.unreachable.length; ++i) + if (!$util.isString(message.unreachable[i])) + return "unreachable: string[] expected"; + } + return null; + }; + + /** + * Creates a ListServerTlsPoliciesResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.networksecurity.v1.ListServerTlsPoliciesResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.networksecurity.v1.ListServerTlsPoliciesResponse} ListServerTlsPoliciesResponse + */ + ListServerTlsPoliciesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networksecurity.v1.ListServerTlsPoliciesResponse) + return object; + var message = new $root.google.cloud.networksecurity.v1.ListServerTlsPoliciesResponse(); + if (object.serverTlsPolicies) { + if (!Array.isArray(object.serverTlsPolicies)) + throw TypeError(".google.cloud.networksecurity.v1.ListServerTlsPoliciesResponse.serverTlsPolicies: array expected"); + message.serverTlsPolicies = []; + for (var i = 0; i < object.serverTlsPolicies.length; ++i) { + if (typeof object.serverTlsPolicies[i] !== "object") + throw TypeError(".google.cloud.networksecurity.v1.ListServerTlsPoliciesResponse.serverTlsPolicies: object expected"); + message.serverTlsPolicies[i] = $root.google.cloud.networksecurity.v1.ServerTlsPolicy.fromObject(object.serverTlsPolicies[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.unreachable) { + if (!Array.isArray(object.unreachable)) + throw TypeError(".google.cloud.networksecurity.v1.ListServerTlsPoliciesResponse.unreachable: array expected"); + message.unreachable = []; + for (var i = 0; i < object.unreachable.length; ++i) + message.unreachable[i] = String(object.unreachable[i]); + } + return message; + }; + + /** + * Creates a plain object from a ListServerTlsPoliciesResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.networksecurity.v1.ListServerTlsPoliciesResponse + * @static + * @param {google.cloud.networksecurity.v1.ListServerTlsPoliciesResponse} message ListServerTlsPoliciesResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListServerTlsPoliciesResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.serverTlsPolicies = []; + object.unreachable = []; + } + if (options.defaults) + object.nextPageToken = ""; + if (message.serverTlsPolicies && message.serverTlsPolicies.length) { + object.serverTlsPolicies = []; + for (var j = 0; j < message.serverTlsPolicies.length; ++j) + object.serverTlsPolicies[j] = $root.google.cloud.networksecurity.v1.ServerTlsPolicy.toObject(message.serverTlsPolicies[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + if (message.unreachable && message.unreachable.length) { + object.unreachable = []; + for (var j = 0; j < message.unreachable.length; ++j) + object.unreachable[j] = message.unreachable[j]; + } + return object; + }; + + /** + * Converts this ListServerTlsPoliciesResponse to JSON. + * @function toJSON + * @memberof google.cloud.networksecurity.v1.ListServerTlsPoliciesResponse + * @instance + * @returns {Object.} JSON object + */ + ListServerTlsPoliciesResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListServerTlsPoliciesResponse + * @function getTypeUrl + * @memberof google.cloud.networksecurity.v1.ListServerTlsPoliciesResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListServerTlsPoliciesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.networksecurity.v1.ListServerTlsPoliciesResponse"; + }; + + return ListServerTlsPoliciesResponse; + })(); + + v1.GetServerTlsPolicyRequest = (function() { + + /** + * Properties of a GetServerTlsPolicyRequest. + * @memberof google.cloud.networksecurity.v1 + * @interface IGetServerTlsPolicyRequest + * @property {string|null} [name] GetServerTlsPolicyRequest name + */ + + /** + * Constructs a new GetServerTlsPolicyRequest. + * @memberof google.cloud.networksecurity.v1 + * @classdesc Represents a GetServerTlsPolicyRequest. + * @implements IGetServerTlsPolicyRequest + * @constructor + * @param {google.cloud.networksecurity.v1.IGetServerTlsPolicyRequest=} [properties] Properties to set + */ + function GetServerTlsPolicyRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetServerTlsPolicyRequest name. + * @member {string} name + * @memberof google.cloud.networksecurity.v1.GetServerTlsPolicyRequest + * @instance + */ + GetServerTlsPolicyRequest.prototype.name = ""; + + /** + * Creates a new GetServerTlsPolicyRequest instance using the specified properties. + * @function create + * @memberof google.cloud.networksecurity.v1.GetServerTlsPolicyRequest + * @static + * @param {google.cloud.networksecurity.v1.IGetServerTlsPolicyRequest=} [properties] Properties to set + * @returns {google.cloud.networksecurity.v1.GetServerTlsPolicyRequest} GetServerTlsPolicyRequest instance + */ + GetServerTlsPolicyRequest.create = function create(properties) { + return new GetServerTlsPolicyRequest(properties); + }; + + /** + * Encodes the specified GetServerTlsPolicyRequest message. Does not implicitly {@link google.cloud.networksecurity.v1.GetServerTlsPolicyRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.networksecurity.v1.GetServerTlsPolicyRequest + * @static + * @param {google.cloud.networksecurity.v1.IGetServerTlsPolicyRequest} message GetServerTlsPolicyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetServerTlsPolicyRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified GetServerTlsPolicyRequest message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.GetServerTlsPolicyRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.networksecurity.v1.GetServerTlsPolicyRequest + * @static + * @param {google.cloud.networksecurity.v1.IGetServerTlsPolicyRequest} message GetServerTlsPolicyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetServerTlsPolicyRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetServerTlsPolicyRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.networksecurity.v1.GetServerTlsPolicyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.networksecurity.v1.GetServerTlsPolicyRequest} GetServerTlsPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetServerTlsPolicyRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networksecurity.v1.GetServerTlsPolicyRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetServerTlsPolicyRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.networksecurity.v1.GetServerTlsPolicyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.networksecurity.v1.GetServerTlsPolicyRequest} GetServerTlsPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetServerTlsPolicyRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetServerTlsPolicyRequest message. + * @function verify + * @memberof google.cloud.networksecurity.v1.GetServerTlsPolicyRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetServerTlsPolicyRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a GetServerTlsPolicyRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.networksecurity.v1.GetServerTlsPolicyRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.networksecurity.v1.GetServerTlsPolicyRequest} GetServerTlsPolicyRequest + */ + GetServerTlsPolicyRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networksecurity.v1.GetServerTlsPolicyRequest) + return object; + var message = new $root.google.cloud.networksecurity.v1.GetServerTlsPolicyRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetServerTlsPolicyRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.networksecurity.v1.GetServerTlsPolicyRequest + * @static + * @param {google.cloud.networksecurity.v1.GetServerTlsPolicyRequest} message GetServerTlsPolicyRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetServerTlsPolicyRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this GetServerTlsPolicyRequest to JSON. + * @function toJSON + * @memberof google.cloud.networksecurity.v1.GetServerTlsPolicyRequest + * @instance + * @returns {Object.} JSON object + */ + GetServerTlsPolicyRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetServerTlsPolicyRequest + * @function getTypeUrl + * @memberof google.cloud.networksecurity.v1.GetServerTlsPolicyRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetServerTlsPolicyRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.networksecurity.v1.GetServerTlsPolicyRequest"; + }; + + return GetServerTlsPolicyRequest; + })(); + + v1.CreateServerTlsPolicyRequest = (function() { + + /** + * Properties of a CreateServerTlsPolicyRequest. + * @memberof google.cloud.networksecurity.v1 + * @interface ICreateServerTlsPolicyRequest + * @property {string|null} [parent] CreateServerTlsPolicyRequest parent + * @property {string|null} [serverTlsPolicyId] CreateServerTlsPolicyRequest serverTlsPolicyId + * @property {google.cloud.networksecurity.v1.IServerTlsPolicy|null} [serverTlsPolicy] CreateServerTlsPolicyRequest serverTlsPolicy + */ + + /** + * Constructs a new CreateServerTlsPolicyRequest. + * @memberof google.cloud.networksecurity.v1 + * @classdesc Represents a CreateServerTlsPolicyRequest. + * @implements ICreateServerTlsPolicyRequest + * @constructor + * @param {google.cloud.networksecurity.v1.ICreateServerTlsPolicyRequest=} [properties] Properties to set + */ + function CreateServerTlsPolicyRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateServerTlsPolicyRequest parent. + * @member {string} parent + * @memberof google.cloud.networksecurity.v1.CreateServerTlsPolicyRequest + * @instance + */ + CreateServerTlsPolicyRequest.prototype.parent = ""; + + /** + * CreateServerTlsPolicyRequest serverTlsPolicyId. + * @member {string} serverTlsPolicyId + * @memberof google.cloud.networksecurity.v1.CreateServerTlsPolicyRequest + * @instance + */ + CreateServerTlsPolicyRequest.prototype.serverTlsPolicyId = ""; + + /** + * CreateServerTlsPolicyRequest serverTlsPolicy. + * @member {google.cloud.networksecurity.v1.IServerTlsPolicy|null|undefined} serverTlsPolicy + * @memberof google.cloud.networksecurity.v1.CreateServerTlsPolicyRequest + * @instance + */ + CreateServerTlsPolicyRequest.prototype.serverTlsPolicy = null; + + /** + * Creates a new CreateServerTlsPolicyRequest instance using the specified properties. + * @function create + * @memberof google.cloud.networksecurity.v1.CreateServerTlsPolicyRequest + * @static + * @param {google.cloud.networksecurity.v1.ICreateServerTlsPolicyRequest=} [properties] Properties to set + * @returns {google.cloud.networksecurity.v1.CreateServerTlsPolicyRequest} CreateServerTlsPolicyRequest instance + */ + CreateServerTlsPolicyRequest.create = function create(properties) { + return new CreateServerTlsPolicyRequest(properties); + }; + + /** + * Encodes the specified CreateServerTlsPolicyRequest message. Does not implicitly {@link google.cloud.networksecurity.v1.CreateServerTlsPolicyRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.networksecurity.v1.CreateServerTlsPolicyRequest + * @static + * @param {google.cloud.networksecurity.v1.ICreateServerTlsPolicyRequest} message CreateServerTlsPolicyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateServerTlsPolicyRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.serverTlsPolicyId != null && Object.hasOwnProperty.call(message, "serverTlsPolicyId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.serverTlsPolicyId); + if (message.serverTlsPolicy != null && Object.hasOwnProperty.call(message, "serverTlsPolicy")) + $root.google.cloud.networksecurity.v1.ServerTlsPolicy.encode(message.serverTlsPolicy, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreateServerTlsPolicyRequest message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.CreateServerTlsPolicyRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.networksecurity.v1.CreateServerTlsPolicyRequest + * @static + * @param {google.cloud.networksecurity.v1.ICreateServerTlsPolicyRequest} message CreateServerTlsPolicyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateServerTlsPolicyRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateServerTlsPolicyRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.networksecurity.v1.CreateServerTlsPolicyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.networksecurity.v1.CreateServerTlsPolicyRequest} CreateServerTlsPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateServerTlsPolicyRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networksecurity.v1.CreateServerTlsPolicyRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.serverTlsPolicyId = reader.string(); + break; + } + case 3: { + message.serverTlsPolicy = $root.google.cloud.networksecurity.v1.ServerTlsPolicy.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateServerTlsPolicyRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.networksecurity.v1.CreateServerTlsPolicyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.networksecurity.v1.CreateServerTlsPolicyRequest} CreateServerTlsPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateServerTlsPolicyRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateServerTlsPolicyRequest message. + * @function verify + * @memberof google.cloud.networksecurity.v1.CreateServerTlsPolicyRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateServerTlsPolicyRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.serverTlsPolicyId != null && message.hasOwnProperty("serverTlsPolicyId")) + if (!$util.isString(message.serverTlsPolicyId)) + return "serverTlsPolicyId: string expected"; + if (message.serverTlsPolicy != null && message.hasOwnProperty("serverTlsPolicy")) { + var error = $root.google.cloud.networksecurity.v1.ServerTlsPolicy.verify(message.serverTlsPolicy); + if (error) + return "serverTlsPolicy." + error; + } + return null; + }; + + /** + * Creates a CreateServerTlsPolicyRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.networksecurity.v1.CreateServerTlsPolicyRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.networksecurity.v1.CreateServerTlsPolicyRequest} CreateServerTlsPolicyRequest + */ + CreateServerTlsPolicyRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networksecurity.v1.CreateServerTlsPolicyRequest) + return object; + var message = new $root.google.cloud.networksecurity.v1.CreateServerTlsPolicyRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.serverTlsPolicyId != null) + message.serverTlsPolicyId = String(object.serverTlsPolicyId); + if (object.serverTlsPolicy != null) { + if (typeof object.serverTlsPolicy !== "object") + throw TypeError(".google.cloud.networksecurity.v1.CreateServerTlsPolicyRequest.serverTlsPolicy: object expected"); + message.serverTlsPolicy = $root.google.cloud.networksecurity.v1.ServerTlsPolicy.fromObject(object.serverTlsPolicy); + } + return message; + }; + + /** + * Creates a plain object from a CreateServerTlsPolicyRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.networksecurity.v1.CreateServerTlsPolicyRequest + * @static + * @param {google.cloud.networksecurity.v1.CreateServerTlsPolicyRequest} message CreateServerTlsPolicyRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateServerTlsPolicyRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.serverTlsPolicyId = ""; + object.serverTlsPolicy = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.serverTlsPolicyId != null && message.hasOwnProperty("serverTlsPolicyId")) + object.serverTlsPolicyId = message.serverTlsPolicyId; + if (message.serverTlsPolicy != null && message.hasOwnProperty("serverTlsPolicy")) + object.serverTlsPolicy = $root.google.cloud.networksecurity.v1.ServerTlsPolicy.toObject(message.serverTlsPolicy, options); + return object; + }; + + /** + * Converts this CreateServerTlsPolicyRequest to JSON. + * @function toJSON + * @memberof google.cloud.networksecurity.v1.CreateServerTlsPolicyRequest + * @instance + * @returns {Object.} JSON object + */ + CreateServerTlsPolicyRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateServerTlsPolicyRequest + * @function getTypeUrl + * @memberof google.cloud.networksecurity.v1.CreateServerTlsPolicyRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateServerTlsPolicyRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.networksecurity.v1.CreateServerTlsPolicyRequest"; + }; + + return CreateServerTlsPolicyRequest; + })(); + + v1.UpdateServerTlsPolicyRequest = (function() { + + /** + * Properties of an UpdateServerTlsPolicyRequest. + * @memberof google.cloud.networksecurity.v1 + * @interface IUpdateServerTlsPolicyRequest + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateServerTlsPolicyRequest updateMask + * @property {google.cloud.networksecurity.v1.IServerTlsPolicy|null} [serverTlsPolicy] UpdateServerTlsPolicyRequest serverTlsPolicy + */ + + /** + * Constructs a new UpdateServerTlsPolicyRequest. + * @memberof google.cloud.networksecurity.v1 + * @classdesc Represents an UpdateServerTlsPolicyRequest. + * @implements IUpdateServerTlsPolicyRequest + * @constructor + * @param {google.cloud.networksecurity.v1.IUpdateServerTlsPolicyRequest=} [properties] Properties to set + */ + function UpdateServerTlsPolicyRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateServerTlsPolicyRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.networksecurity.v1.UpdateServerTlsPolicyRequest + * @instance + */ + UpdateServerTlsPolicyRequest.prototype.updateMask = null; + + /** + * UpdateServerTlsPolicyRequest serverTlsPolicy. + * @member {google.cloud.networksecurity.v1.IServerTlsPolicy|null|undefined} serverTlsPolicy + * @memberof google.cloud.networksecurity.v1.UpdateServerTlsPolicyRequest + * @instance + */ + UpdateServerTlsPolicyRequest.prototype.serverTlsPolicy = null; + + /** + * Creates a new UpdateServerTlsPolicyRequest instance using the specified properties. + * @function create + * @memberof google.cloud.networksecurity.v1.UpdateServerTlsPolicyRequest + * @static + * @param {google.cloud.networksecurity.v1.IUpdateServerTlsPolicyRequest=} [properties] Properties to set + * @returns {google.cloud.networksecurity.v1.UpdateServerTlsPolicyRequest} UpdateServerTlsPolicyRequest instance + */ + UpdateServerTlsPolicyRequest.create = function create(properties) { + return new UpdateServerTlsPolicyRequest(properties); + }; + + /** + * Encodes the specified UpdateServerTlsPolicyRequest message. Does not implicitly {@link google.cloud.networksecurity.v1.UpdateServerTlsPolicyRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.networksecurity.v1.UpdateServerTlsPolicyRequest + * @static + * @param {google.cloud.networksecurity.v1.IUpdateServerTlsPolicyRequest} message UpdateServerTlsPolicyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateServerTlsPolicyRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.serverTlsPolicy != null && Object.hasOwnProperty.call(message, "serverTlsPolicy")) + $root.google.cloud.networksecurity.v1.ServerTlsPolicy.encode(message.serverTlsPolicy, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified UpdateServerTlsPolicyRequest message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.UpdateServerTlsPolicyRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.networksecurity.v1.UpdateServerTlsPolicyRequest + * @static + * @param {google.cloud.networksecurity.v1.IUpdateServerTlsPolicyRequest} message UpdateServerTlsPolicyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateServerTlsPolicyRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateServerTlsPolicyRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.networksecurity.v1.UpdateServerTlsPolicyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.networksecurity.v1.UpdateServerTlsPolicyRequest} UpdateServerTlsPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateServerTlsPolicyRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networksecurity.v1.UpdateServerTlsPolicyRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + case 2: { + message.serverTlsPolicy = $root.google.cloud.networksecurity.v1.ServerTlsPolicy.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateServerTlsPolicyRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.networksecurity.v1.UpdateServerTlsPolicyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.networksecurity.v1.UpdateServerTlsPolicyRequest} UpdateServerTlsPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateServerTlsPolicyRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateServerTlsPolicyRequest message. + * @function verify + * @memberof google.cloud.networksecurity.v1.UpdateServerTlsPolicyRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateServerTlsPolicyRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + if (message.serverTlsPolicy != null && message.hasOwnProperty("serverTlsPolicy")) { + var error = $root.google.cloud.networksecurity.v1.ServerTlsPolicy.verify(message.serverTlsPolicy); + if (error) + return "serverTlsPolicy." + error; + } + return null; + }; + + /** + * Creates an UpdateServerTlsPolicyRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.networksecurity.v1.UpdateServerTlsPolicyRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.networksecurity.v1.UpdateServerTlsPolicyRequest} UpdateServerTlsPolicyRequest + */ + UpdateServerTlsPolicyRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networksecurity.v1.UpdateServerTlsPolicyRequest) + return object; + var message = new $root.google.cloud.networksecurity.v1.UpdateServerTlsPolicyRequest(); + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.networksecurity.v1.UpdateServerTlsPolicyRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + if (object.serverTlsPolicy != null) { + if (typeof object.serverTlsPolicy !== "object") + throw TypeError(".google.cloud.networksecurity.v1.UpdateServerTlsPolicyRequest.serverTlsPolicy: object expected"); + message.serverTlsPolicy = $root.google.cloud.networksecurity.v1.ServerTlsPolicy.fromObject(object.serverTlsPolicy); + } + return message; + }; + + /** + * Creates a plain object from an UpdateServerTlsPolicyRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.networksecurity.v1.UpdateServerTlsPolicyRequest + * @static + * @param {google.cloud.networksecurity.v1.UpdateServerTlsPolicyRequest} message UpdateServerTlsPolicyRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateServerTlsPolicyRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.updateMask = null; + object.serverTlsPolicy = null; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + if (message.serverTlsPolicy != null && message.hasOwnProperty("serverTlsPolicy")) + object.serverTlsPolicy = $root.google.cloud.networksecurity.v1.ServerTlsPolicy.toObject(message.serverTlsPolicy, options); + return object; + }; + + /** + * Converts this UpdateServerTlsPolicyRequest to JSON. + * @function toJSON + * @memberof google.cloud.networksecurity.v1.UpdateServerTlsPolicyRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateServerTlsPolicyRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateServerTlsPolicyRequest + * @function getTypeUrl + * @memberof google.cloud.networksecurity.v1.UpdateServerTlsPolicyRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateServerTlsPolicyRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.networksecurity.v1.UpdateServerTlsPolicyRequest"; + }; + + return UpdateServerTlsPolicyRequest; + })(); + + v1.DeleteServerTlsPolicyRequest = (function() { + + /** + * Properties of a DeleteServerTlsPolicyRequest. + * @memberof google.cloud.networksecurity.v1 + * @interface IDeleteServerTlsPolicyRequest + * @property {string|null} [name] DeleteServerTlsPolicyRequest name + */ + + /** + * Constructs a new DeleteServerTlsPolicyRequest. + * @memberof google.cloud.networksecurity.v1 + * @classdesc Represents a DeleteServerTlsPolicyRequest. + * @implements IDeleteServerTlsPolicyRequest + * @constructor + * @param {google.cloud.networksecurity.v1.IDeleteServerTlsPolicyRequest=} [properties] Properties to set + */ + function DeleteServerTlsPolicyRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteServerTlsPolicyRequest name. + * @member {string} name + * @memberof google.cloud.networksecurity.v1.DeleteServerTlsPolicyRequest + * @instance + */ + DeleteServerTlsPolicyRequest.prototype.name = ""; + + /** + * Creates a new DeleteServerTlsPolicyRequest instance using the specified properties. + * @function create + * @memberof google.cloud.networksecurity.v1.DeleteServerTlsPolicyRequest + * @static + * @param {google.cloud.networksecurity.v1.IDeleteServerTlsPolicyRequest=} [properties] Properties to set + * @returns {google.cloud.networksecurity.v1.DeleteServerTlsPolicyRequest} DeleteServerTlsPolicyRequest instance + */ + DeleteServerTlsPolicyRequest.create = function create(properties) { + return new DeleteServerTlsPolicyRequest(properties); + }; + + /** + * Encodes the specified DeleteServerTlsPolicyRequest message. Does not implicitly {@link google.cloud.networksecurity.v1.DeleteServerTlsPolicyRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.networksecurity.v1.DeleteServerTlsPolicyRequest + * @static + * @param {google.cloud.networksecurity.v1.IDeleteServerTlsPolicyRequest} message DeleteServerTlsPolicyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteServerTlsPolicyRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified DeleteServerTlsPolicyRequest message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.DeleteServerTlsPolicyRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.networksecurity.v1.DeleteServerTlsPolicyRequest + * @static + * @param {google.cloud.networksecurity.v1.IDeleteServerTlsPolicyRequest} message DeleteServerTlsPolicyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteServerTlsPolicyRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteServerTlsPolicyRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.networksecurity.v1.DeleteServerTlsPolicyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.networksecurity.v1.DeleteServerTlsPolicyRequest} DeleteServerTlsPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteServerTlsPolicyRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networksecurity.v1.DeleteServerTlsPolicyRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteServerTlsPolicyRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.networksecurity.v1.DeleteServerTlsPolicyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.networksecurity.v1.DeleteServerTlsPolicyRequest} DeleteServerTlsPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteServerTlsPolicyRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteServerTlsPolicyRequest message. + * @function verify + * @memberof google.cloud.networksecurity.v1.DeleteServerTlsPolicyRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteServerTlsPolicyRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a DeleteServerTlsPolicyRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.networksecurity.v1.DeleteServerTlsPolicyRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.networksecurity.v1.DeleteServerTlsPolicyRequest} DeleteServerTlsPolicyRequest + */ + DeleteServerTlsPolicyRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networksecurity.v1.DeleteServerTlsPolicyRequest) + return object; + var message = new $root.google.cloud.networksecurity.v1.DeleteServerTlsPolicyRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a DeleteServerTlsPolicyRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.networksecurity.v1.DeleteServerTlsPolicyRequest + * @static + * @param {google.cloud.networksecurity.v1.DeleteServerTlsPolicyRequest} message DeleteServerTlsPolicyRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteServerTlsPolicyRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this DeleteServerTlsPolicyRequest to JSON. + * @function toJSON + * @memberof google.cloud.networksecurity.v1.DeleteServerTlsPolicyRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteServerTlsPolicyRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteServerTlsPolicyRequest + * @function getTypeUrl + * @memberof google.cloud.networksecurity.v1.DeleteServerTlsPolicyRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteServerTlsPolicyRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.networksecurity.v1.DeleteServerTlsPolicyRequest"; + }; + + return DeleteServerTlsPolicyRequest; + })(); + + v1.TlsInspectionPolicy = (function() { + + /** + * Properties of a TlsInspectionPolicy. + * @memberof google.cloud.networksecurity.v1 + * @interface ITlsInspectionPolicy + * @property {string|null} [name] TlsInspectionPolicy name + * @property {string|null} [description] TlsInspectionPolicy description + * @property {google.protobuf.ITimestamp|null} [createTime] TlsInspectionPolicy createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] TlsInspectionPolicy updateTime + * @property {string|null} [caPool] TlsInspectionPolicy caPool + * @property {string|null} [trustConfig] TlsInspectionPolicy trustConfig + * @property {boolean|null} [excludePublicCaSet] TlsInspectionPolicy excludePublicCaSet + * @property {google.cloud.networksecurity.v1.TlsInspectionPolicy.TlsVersion|null} [minTlsVersion] TlsInspectionPolicy minTlsVersion + * @property {google.cloud.networksecurity.v1.TlsInspectionPolicy.Profile|null} [tlsFeatureProfile] TlsInspectionPolicy tlsFeatureProfile + * @property {Array.|null} [customTlsFeatures] TlsInspectionPolicy customTlsFeatures + */ + + /** + * Constructs a new TlsInspectionPolicy. + * @memberof google.cloud.networksecurity.v1 + * @classdesc Represents a TlsInspectionPolicy. + * @implements ITlsInspectionPolicy + * @constructor + * @param {google.cloud.networksecurity.v1.ITlsInspectionPolicy=} [properties] Properties to set + */ + function TlsInspectionPolicy(properties) { + this.customTlsFeatures = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TlsInspectionPolicy name. + * @member {string} name + * @memberof google.cloud.networksecurity.v1.TlsInspectionPolicy + * @instance + */ + TlsInspectionPolicy.prototype.name = ""; + + /** + * TlsInspectionPolicy description. + * @member {string} description + * @memberof google.cloud.networksecurity.v1.TlsInspectionPolicy + * @instance + */ + TlsInspectionPolicy.prototype.description = ""; + + /** + * TlsInspectionPolicy createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.networksecurity.v1.TlsInspectionPolicy + * @instance + */ + TlsInspectionPolicy.prototype.createTime = null; + + /** + * TlsInspectionPolicy updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.networksecurity.v1.TlsInspectionPolicy + * @instance + */ + TlsInspectionPolicy.prototype.updateTime = null; + + /** + * TlsInspectionPolicy caPool. + * @member {string} caPool + * @memberof google.cloud.networksecurity.v1.TlsInspectionPolicy + * @instance + */ + TlsInspectionPolicy.prototype.caPool = ""; + + /** + * TlsInspectionPolicy trustConfig. + * @member {string} trustConfig + * @memberof google.cloud.networksecurity.v1.TlsInspectionPolicy + * @instance + */ + TlsInspectionPolicy.prototype.trustConfig = ""; + + /** + * TlsInspectionPolicy excludePublicCaSet. + * @member {boolean|null|undefined} excludePublicCaSet + * @memberof google.cloud.networksecurity.v1.TlsInspectionPolicy + * @instance + */ + TlsInspectionPolicy.prototype.excludePublicCaSet = null; + + /** + * TlsInspectionPolicy minTlsVersion. + * @member {google.cloud.networksecurity.v1.TlsInspectionPolicy.TlsVersion} minTlsVersion + * @memberof google.cloud.networksecurity.v1.TlsInspectionPolicy + * @instance + */ + TlsInspectionPolicy.prototype.minTlsVersion = 0; + + /** + * TlsInspectionPolicy tlsFeatureProfile. + * @member {google.cloud.networksecurity.v1.TlsInspectionPolicy.Profile} tlsFeatureProfile + * @memberof google.cloud.networksecurity.v1.TlsInspectionPolicy + * @instance + */ + TlsInspectionPolicy.prototype.tlsFeatureProfile = 0; + + /** + * TlsInspectionPolicy customTlsFeatures. + * @member {Array.} customTlsFeatures + * @memberof google.cloud.networksecurity.v1.TlsInspectionPolicy + * @instance + */ + TlsInspectionPolicy.prototype.customTlsFeatures = $util.emptyArray; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(TlsInspectionPolicy.prototype, "_excludePublicCaSet", { + get: $util.oneOfGetter($oneOfFields = ["excludePublicCaSet"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new TlsInspectionPolicy instance using the specified properties. + * @function create + * @memberof google.cloud.networksecurity.v1.TlsInspectionPolicy + * @static + * @param {google.cloud.networksecurity.v1.ITlsInspectionPolicy=} [properties] Properties to set + * @returns {google.cloud.networksecurity.v1.TlsInspectionPolicy} TlsInspectionPolicy instance + */ + TlsInspectionPolicy.create = function create(properties) { + return new TlsInspectionPolicy(properties); + }; + + /** + * Encodes the specified TlsInspectionPolicy message. Does not implicitly {@link google.cloud.networksecurity.v1.TlsInspectionPolicy.verify|verify} messages. + * @function encode + * @memberof google.cloud.networksecurity.v1.TlsInspectionPolicy + * @static + * @param {google.cloud.networksecurity.v1.ITlsInspectionPolicy} message TlsInspectionPolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TlsInspectionPolicy.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.description); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.caPool != null && Object.hasOwnProperty.call(message, "caPool")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.caPool); + if (message.trustConfig != null && Object.hasOwnProperty.call(message, "trustConfig")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.trustConfig); + if (message.excludePublicCaSet != null && Object.hasOwnProperty.call(message, "excludePublicCaSet")) + writer.uint32(/* id 7, wireType 0 =*/56).bool(message.excludePublicCaSet); + if (message.minTlsVersion != null && Object.hasOwnProperty.call(message, "minTlsVersion")) + writer.uint32(/* id 8, wireType 0 =*/64).int32(message.minTlsVersion); + if (message.tlsFeatureProfile != null && Object.hasOwnProperty.call(message, "tlsFeatureProfile")) + writer.uint32(/* id 9, wireType 0 =*/72).int32(message.tlsFeatureProfile); + if (message.customTlsFeatures != null && message.customTlsFeatures.length) + for (var i = 0; i < message.customTlsFeatures.length; ++i) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.customTlsFeatures[i]); + return writer; + }; + + /** + * Encodes the specified TlsInspectionPolicy message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.TlsInspectionPolicy.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.networksecurity.v1.TlsInspectionPolicy + * @static + * @param {google.cloud.networksecurity.v1.ITlsInspectionPolicy} message TlsInspectionPolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TlsInspectionPolicy.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TlsInspectionPolicy message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.networksecurity.v1.TlsInspectionPolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.networksecurity.v1.TlsInspectionPolicy} TlsInspectionPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TlsInspectionPolicy.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networksecurity.v1.TlsInspectionPolicy(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.description = reader.string(); + break; + } + case 3: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 4: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 5: { + message.caPool = reader.string(); + break; + } + case 6: { + message.trustConfig = reader.string(); + break; + } + case 7: { + message.excludePublicCaSet = reader.bool(); + break; + } + case 8: { + message.minTlsVersion = reader.int32(); + break; + } + case 9: { + message.tlsFeatureProfile = reader.int32(); + break; + } + case 10: { + if (!(message.customTlsFeatures && message.customTlsFeatures.length)) + message.customTlsFeatures = []; + message.customTlsFeatures.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TlsInspectionPolicy message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.networksecurity.v1.TlsInspectionPolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.networksecurity.v1.TlsInspectionPolicy} TlsInspectionPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TlsInspectionPolicy.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TlsInspectionPolicy message. + * @function verify + * @memberof google.cloud.networksecurity.v1.TlsInspectionPolicy + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TlsInspectionPolicy.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime); + if (error) + return "updateTime." + error; + } + if (message.caPool != null && message.hasOwnProperty("caPool")) + if (!$util.isString(message.caPool)) + return "caPool: string expected"; + if (message.trustConfig != null && message.hasOwnProperty("trustConfig")) + if (!$util.isString(message.trustConfig)) + return "trustConfig: string expected"; + if (message.excludePublicCaSet != null && message.hasOwnProperty("excludePublicCaSet")) { + properties._excludePublicCaSet = 1; + if (typeof message.excludePublicCaSet !== "boolean") + return "excludePublicCaSet: boolean expected"; + } + if (message.minTlsVersion != null && message.hasOwnProperty("minTlsVersion")) + switch (message.minTlsVersion) { + default: + return "minTlsVersion: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + break; + } + if (message.tlsFeatureProfile != null && message.hasOwnProperty("tlsFeatureProfile")) + switch (message.tlsFeatureProfile) { + default: + return "tlsFeatureProfile: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + break; + } + if (message.customTlsFeatures != null && message.hasOwnProperty("customTlsFeatures")) { + if (!Array.isArray(message.customTlsFeatures)) + return "customTlsFeatures: array expected"; + for (var i = 0; i < message.customTlsFeatures.length; ++i) + if (!$util.isString(message.customTlsFeatures[i])) + return "customTlsFeatures: string[] expected"; + } + return null; + }; + + /** + * Creates a TlsInspectionPolicy message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.networksecurity.v1.TlsInspectionPolicy + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.networksecurity.v1.TlsInspectionPolicy} TlsInspectionPolicy + */ + TlsInspectionPolicy.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networksecurity.v1.TlsInspectionPolicy) + return object; + var message = new $root.google.cloud.networksecurity.v1.TlsInspectionPolicy(); + if (object.name != null) + message.name = String(object.name); + if (object.description != null) + message.description = String(object.description); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.networksecurity.v1.TlsInspectionPolicy.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.updateTime != null) { + if (typeof object.updateTime !== "object") + throw TypeError(".google.cloud.networksecurity.v1.TlsInspectionPolicy.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + if (object.caPool != null) + message.caPool = String(object.caPool); + if (object.trustConfig != null) + message.trustConfig = String(object.trustConfig); + if (object.excludePublicCaSet != null) + message.excludePublicCaSet = Boolean(object.excludePublicCaSet); + switch (object.minTlsVersion) { + default: + if (typeof object.minTlsVersion === "number") { + message.minTlsVersion = object.minTlsVersion; + break; + } + break; + case "TLS_VERSION_UNSPECIFIED": + case 0: + message.minTlsVersion = 0; + break; + case "TLS_1_0": + case 1: + message.minTlsVersion = 1; + break; + case "TLS_1_1": + case 2: + message.minTlsVersion = 2; + break; + case "TLS_1_2": + case 3: + message.minTlsVersion = 3; + break; + case "TLS_1_3": + case 4: + message.minTlsVersion = 4; + break; + } + switch (object.tlsFeatureProfile) { + default: + if (typeof object.tlsFeatureProfile === "number") { + message.tlsFeatureProfile = object.tlsFeatureProfile; + break; + } + break; + case "PROFILE_UNSPECIFIED": + case 0: + message.tlsFeatureProfile = 0; + break; + case "PROFILE_COMPATIBLE": + case 1: + message.tlsFeatureProfile = 1; + break; + case "PROFILE_MODERN": + case 2: + message.tlsFeatureProfile = 2; + break; + case "PROFILE_RESTRICTED": + case 3: + message.tlsFeatureProfile = 3; + break; + case "PROFILE_CUSTOM": + case 4: + message.tlsFeatureProfile = 4; + break; + } + if (object.customTlsFeatures) { + if (!Array.isArray(object.customTlsFeatures)) + throw TypeError(".google.cloud.networksecurity.v1.TlsInspectionPolicy.customTlsFeatures: array expected"); + message.customTlsFeatures = []; + for (var i = 0; i < object.customTlsFeatures.length; ++i) + message.customTlsFeatures[i] = String(object.customTlsFeatures[i]); + } + return message; + }; + + /** + * Creates a plain object from a TlsInspectionPolicy message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.networksecurity.v1.TlsInspectionPolicy + * @static + * @param {google.cloud.networksecurity.v1.TlsInspectionPolicy} message TlsInspectionPolicy + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TlsInspectionPolicy.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.customTlsFeatures = []; + if (options.defaults) { + object.name = ""; + object.description = ""; + object.createTime = null; + object.updateTime = null; + object.caPool = ""; + object.trustConfig = ""; + object.minTlsVersion = options.enums === String ? "TLS_VERSION_UNSPECIFIED" : 0; + object.tlsFeatureProfile = options.enums === String ? "PROFILE_UNSPECIFIED" : 0; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.updateTime != null && message.hasOwnProperty("updateTime")) + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); + if (message.caPool != null && message.hasOwnProperty("caPool")) + object.caPool = message.caPool; + if (message.trustConfig != null && message.hasOwnProperty("trustConfig")) + object.trustConfig = message.trustConfig; + if (message.excludePublicCaSet != null && message.hasOwnProperty("excludePublicCaSet")) { + object.excludePublicCaSet = message.excludePublicCaSet; + if (options.oneofs) + object._excludePublicCaSet = "excludePublicCaSet"; + } + if (message.minTlsVersion != null && message.hasOwnProperty("minTlsVersion")) + object.minTlsVersion = options.enums === String ? $root.google.cloud.networksecurity.v1.TlsInspectionPolicy.TlsVersion[message.minTlsVersion] === undefined ? message.minTlsVersion : $root.google.cloud.networksecurity.v1.TlsInspectionPolicy.TlsVersion[message.minTlsVersion] : message.minTlsVersion; + if (message.tlsFeatureProfile != null && message.hasOwnProperty("tlsFeatureProfile")) + object.tlsFeatureProfile = options.enums === String ? $root.google.cloud.networksecurity.v1.TlsInspectionPolicy.Profile[message.tlsFeatureProfile] === undefined ? message.tlsFeatureProfile : $root.google.cloud.networksecurity.v1.TlsInspectionPolicy.Profile[message.tlsFeatureProfile] : message.tlsFeatureProfile; + if (message.customTlsFeatures && message.customTlsFeatures.length) { + object.customTlsFeatures = []; + for (var j = 0; j < message.customTlsFeatures.length; ++j) + object.customTlsFeatures[j] = message.customTlsFeatures[j]; + } + return object; + }; + + /** + * Converts this TlsInspectionPolicy to JSON. + * @function toJSON + * @memberof google.cloud.networksecurity.v1.TlsInspectionPolicy + * @instance + * @returns {Object.} JSON object + */ + TlsInspectionPolicy.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TlsInspectionPolicy + * @function getTypeUrl + * @memberof google.cloud.networksecurity.v1.TlsInspectionPolicy + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TlsInspectionPolicy.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.networksecurity.v1.TlsInspectionPolicy"; + }; + + /** + * TlsVersion enum. + * @name google.cloud.networksecurity.v1.TlsInspectionPolicy.TlsVersion + * @enum {number} + * @property {number} TLS_VERSION_UNSPECIFIED=0 TLS_VERSION_UNSPECIFIED value + * @property {number} TLS_1_0=1 TLS_1_0 value + * @property {number} TLS_1_1=2 TLS_1_1 value + * @property {number} TLS_1_2=3 TLS_1_2 value + * @property {number} TLS_1_3=4 TLS_1_3 value + */ + TlsInspectionPolicy.TlsVersion = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "TLS_VERSION_UNSPECIFIED"] = 0; + values[valuesById[1] = "TLS_1_0"] = 1; + values[valuesById[2] = "TLS_1_1"] = 2; + values[valuesById[3] = "TLS_1_2"] = 3; + values[valuesById[4] = "TLS_1_3"] = 4; + return values; + })(); + + /** + * Profile enum. + * @name google.cloud.networksecurity.v1.TlsInspectionPolicy.Profile + * @enum {number} + * @property {number} PROFILE_UNSPECIFIED=0 PROFILE_UNSPECIFIED value + * @property {number} PROFILE_COMPATIBLE=1 PROFILE_COMPATIBLE value + * @property {number} PROFILE_MODERN=2 PROFILE_MODERN value + * @property {number} PROFILE_RESTRICTED=3 PROFILE_RESTRICTED value + * @property {number} PROFILE_CUSTOM=4 PROFILE_CUSTOM value + */ + TlsInspectionPolicy.Profile = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "PROFILE_UNSPECIFIED"] = 0; + values[valuesById[1] = "PROFILE_COMPATIBLE"] = 1; + values[valuesById[2] = "PROFILE_MODERN"] = 2; + values[valuesById[3] = "PROFILE_RESTRICTED"] = 3; + values[valuesById[4] = "PROFILE_CUSTOM"] = 4; + return values; + })(); + + return TlsInspectionPolicy; + })(); + + v1.CreateTlsInspectionPolicyRequest = (function() { + + /** + * Properties of a CreateTlsInspectionPolicyRequest. + * @memberof google.cloud.networksecurity.v1 + * @interface ICreateTlsInspectionPolicyRequest + * @property {string|null} [parent] CreateTlsInspectionPolicyRequest parent + * @property {string|null} [tlsInspectionPolicyId] CreateTlsInspectionPolicyRequest tlsInspectionPolicyId + * @property {google.cloud.networksecurity.v1.ITlsInspectionPolicy|null} [tlsInspectionPolicy] CreateTlsInspectionPolicyRequest tlsInspectionPolicy + */ + + /** + * Constructs a new CreateTlsInspectionPolicyRequest. + * @memberof google.cloud.networksecurity.v1 + * @classdesc Represents a CreateTlsInspectionPolicyRequest. + * @implements ICreateTlsInspectionPolicyRequest + * @constructor + * @param {google.cloud.networksecurity.v1.ICreateTlsInspectionPolicyRequest=} [properties] Properties to set + */ + function CreateTlsInspectionPolicyRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateTlsInspectionPolicyRequest parent. + * @member {string} parent + * @memberof google.cloud.networksecurity.v1.CreateTlsInspectionPolicyRequest + * @instance + */ + CreateTlsInspectionPolicyRequest.prototype.parent = ""; + + /** + * CreateTlsInspectionPolicyRequest tlsInspectionPolicyId. + * @member {string} tlsInspectionPolicyId + * @memberof google.cloud.networksecurity.v1.CreateTlsInspectionPolicyRequest + * @instance + */ + CreateTlsInspectionPolicyRequest.prototype.tlsInspectionPolicyId = ""; + + /** + * CreateTlsInspectionPolicyRequest tlsInspectionPolicy. + * @member {google.cloud.networksecurity.v1.ITlsInspectionPolicy|null|undefined} tlsInspectionPolicy + * @memberof google.cloud.networksecurity.v1.CreateTlsInspectionPolicyRequest + * @instance + */ + CreateTlsInspectionPolicyRequest.prototype.tlsInspectionPolicy = null; + + /** + * Creates a new CreateTlsInspectionPolicyRequest instance using the specified properties. + * @function create + * @memberof google.cloud.networksecurity.v1.CreateTlsInspectionPolicyRequest + * @static + * @param {google.cloud.networksecurity.v1.ICreateTlsInspectionPolicyRequest=} [properties] Properties to set + * @returns {google.cloud.networksecurity.v1.CreateTlsInspectionPolicyRequest} CreateTlsInspectionPolicyRequest instance + */ + CreateTlsInspectionPolicyRequest.create = function create(properties) { + return new CreateTlsInspectionPolicyRequest(properties); + }; + + /** + * Encodes the specified CreateTlsInspectionPolicyRequest message. Does not implicitly {@link google.cloud.networksecurity.v1.CreateTlsInspectionPolicyRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.networksecurity.v1.CreateTlsInspectionPolicyRequest + * @static + * @param {google.cloud.networksecurity.v1.ICreateTlsInspectionPolicyRequest} message CreateTlsInspectionPolicyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateTlsInspectionPolicyRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.tlsInspectionPolicyId != null && Object.hasOwnProperty.call(message, "tlsInspectionPolicyId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.tlsInspectionPolicyId); + if (message.tlsInspectionPolicy != null && Object.hasOwnProperty.call(message, "tlsInspectionPolicy")) + $root.google.cloud.networksecurity.v1.TlsInspectionPolicy.encode(message.tlsInspectionPolicy, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreateTlsInspectionPolicyRequest message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.CreateTlsInspectionPolicyRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.networksecurity.v1.CreateTlsInspectionPolicyRequest + * @static + * @param {google.cloud.networksecurity.v1.ICreateTlsInspectionPolicyRequest} message CreateTlsInspectionPolicyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateTlsInspectionPolicyRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateTlsInspectionPolicyRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.networksecurity.v1.CreateTlsInspectionPolicyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.networksecurity.v1.CreateTlsInspectionPolicyRequest} CreateTlsInspectionPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateTlsInspectionPolicyRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networksecurity.v1.CreateTlsInspectionPolicyRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.tlsInspectionPolicyId = reader.string(); + break; + } + case 3: { + message.tlsInspectionPolicy = $root.google.cloud.networksecurity.v1.TlsInspectionPolicy.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateTlsInspectionPolicyRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.networksecurity.v1.CreateTlsInspectionPolicyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.networksecurity.v1.CreateTlsInspectionPolicyRequest} CreateTlsInspectionPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateTlsInspectionPolicyRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateTlsInspectionPolicyRequest message. + * @function verify + * @memberof google.cloud.networksecurity.v1.CreateTlsInspectionPolicyRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateTlsInspectionPolicyRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.tlsInspectionPolicyId != null && message.hasOwnProperty("tlsInspectionPolicyId")) + if (!$util.isString(message.tlsInspectionPolicyId)) + return "tlsInspectionPolicyId: string expected"; + if (message.tlsInspectionPolicy != null && message.hasOwnProperty("tlsInspectionPolicy")) { + var error = $root.google.cloud.networksecurity.v1.TlsInspectionPolicy.verify(message.tlsInspectionPolicy); + if (error) + return "tlsInspectionPolicy." + error; + } + return null; + }; + + /** + * Creates a CreateTlsInspectionPolicyRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.networksecurity.v1.CreateTlsInspectionPolicyRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.networksecurity.v1.CreateTlsInspectionPolicyRequest} CreateTlsInspectionPolicyRequest + */ + CreateTlsInspectionPolicyRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networksecurity.v1.CreateTlsInspectionPolicyRequest) + return object; + var message = new $root.google.cloud.networksecurity.v1.CreateTlsInspectionPolicyRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.tlsInspectionPolicyId != null) + message.tlsInspectionPolicyId = String(object.tlsInspectionPolicyId); + if (object.tlsInspectionPolicy != null) { + if (typeof object.tlsInspectionPolicy !== "object") + throw TypeError(".google.cloud.networksecurity.v1.CreateTlsInspectionPolicyRequest.tlsInspectionPolicy: object expected"); + message.tlsInspectionPolicy = $root.google.cloud.networksecurity.v1.TlsInspectionPolicy.fromObject(object.tlsInspectionPolicy); + } + return message; + }; + + /** + * Creates a plain object from a CreateTlsInspectionPolicyRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.networksecurity.v1.CreateTlsInspectionPolicyRequest + * @static + * @param {google.cloud.networksecurity.v1.CreateTlsInspectionPolicyRequest} message CreateTlsInspectionPolicyRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateTlsInspectionPolicyRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.tlsInspectionPolicyId = ""; + object.tlsInspectionPolicy = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.tlsInspectionPolicyId != null && message.hasOwnProperty("tlsInspectionPolicyId")) + object.tlsInspectionPolicyId = message.tlsInspectionPolicyId; + if (message.tlsInspectionPolicy != null && message.hasOwnProperty("tlsInspectionPolicy")) + object.tlsInspectionPolicy = $root.google.cloud.networksecurity.v1.TlsInspectionPolicy.toObject(message.tlsInspectionPolicy, options); + return object; + }; + + /** + * Converts this CreateTlsInspectionPolicyRequest to JSON. + * @function toJSON + * @memberof google.cloud.networksecurity.v1.CreateTlsInspectionPolicyRequest + * @instance + * @returns {Object.} JSON object + */ + CreateTlsInspectionPolicyRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateTlsInspectionPolicyRequest + * @function getTypeUrl + * @memberof google.cloud.networksecurity.v1.CreateTlsInspectionPolicyRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateTlsInspectionPolicyRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.networksecurity.v1.CreateTlsInspectionPolicyRequest"; + }; + + return CreateTlsInspectionPolicyRequest; + })(); + + v1.ListTlsInspectionPoliciesRequest = (function() { + + /** + * Properties of a ListTlsInspectionPoliciesRequest. + * @memberof google.cloud.networksecurity.v1 + * @interface IListTlsInspectionPoliciesRequest + * @property {string|null} [parent] ListTlsInspectionPoliciesRequest parent + * @property {number|null} [pageSize] ListTlsInspectionPoliciesRequest pageSize + * @property {string|null} [pageToken] ListTlsInspectionPoliciesRequest pageToken + */ + + /** + * Constructs a new ListTlsInspectionPoliciesRequest. + * @memberof google.cloud.networksecurity.v1 + * @classdesc Represents a ListTlsInspectionPoliciesRequest. + * @implements IListTlsInspectionPoliciesRequest + * @constructor + * @param {google.cloud.networksecurity.v1.IListTlsInspectionPoliciesRequest=} [properties] Properties to set + */ + function ListTlsInspectionPoliciesRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListTlsInspectionPoliciesRequest parent. + * @member {string} parent + * @memberof google.cloud.networksecurity.v1.ListTlsInspectionPoliciesRequest + * @instance + */ + ListTlsInspectionPoliciesRequest.prototype.parent = ""; + + /** + * ListTlsInspectionPoliciesRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.networksecurity.v1.ListTlsInspectionPoliciesRequest + * @instance + */ + ListTlsInspectionPoliciesRequest.prototype.pageSize = 0; + + /** + * ListTlsInspectionPoliciesRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.networksecurity.v1.ListTlsInspectionPoliciesRequest + * @instance + */ + ListTlsInspectionPoliciesRequest.prototype.pageToken = ""; + + /** + * Creates a new ListTlsInspectionPoliciesRequest instance using the specified properties. + * @function create + * @memberof google.cloud.networksecurity.v1.ListTlsInspectionPoliciesRequest + * @static + * @param {google.cloud.networksecurity.v1.IListTlsInspectionPoliciesRequest=} [properties] Properties to set + * @returns {google.cloud.networksecurity.v1.ListTlsInspectionPoliciesRequest} ListTlsInspectionPoliciesRequest instance + */ + ListTlsInspectionPoliciesRequest.create = function create(properties) { + return new ListTlsInspectionPoliciesRequest(properties); + }; + + /** + * Encodes the specified ListTlsInspectionPoliciesRequest message. Does not implicitly {@link google.cloud.networksecurity.v1.ListTlsInspectionPoliciesRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.networksecurity.v1.ListTlsInspectionPoliciesRequest + * @static + * @param {google.cloud.networksecurity.v1.IListTlsInspectionPoliciesRequest} message ListTlsInspectionPoliciesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListTlsInspectionPoliciesRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + return writer; + }; + + /** + * Encodes the specified ListTlsInspectionPoliciesRequest message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.ListTlsInspectionPoliciesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.networksecurity.v1.ListTlsInspectionPoliciesRequest + * @static + * @param {google.cloud.networksecurity.v1.IListTlsInspectionPoliciesRequest} message ListTlsInspectionPoliciesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListTlsInspectionPoliciesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListTlsInspectionPoliciesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.networksecurity.v1.ListTlsInspectionPoliciesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.networksecurity.v1.ListTlsInspectionPoliciesRequest} ListTlsInspectionPoliciesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListTlsInspectionPoliciesRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networksecurity.v1.ListTlsInspectionPoliciesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListTlsInspectionPoliciesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.networksecurity.v1.ListTlsInspectionPoliciesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.networksecurity.v1.ListTlsInspectionPoliciesRequest} ListTlsInspectionPoliciesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListTlsInspectionPoliciesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListTlsInspectionPoliciesRequest message. + * @function verify + * @memberof google.cloud.networksecurity.v1.ListTlsInspectionPoliciesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListTlsInspectionPoliciesRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + return null; + }; + + /** + * Creates a ListTlsInspectionPoliciesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.networksecurity.v1.ListTlsInspectionPoliciesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.networksecurity.v1.ListTlsInspectionPoliciesRequest} ListTlsInspectionPoliciesRequest + */ + ListTlsInspectionPoliciesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networksecurity.v1.ListTlsInspectionPoliciesRequest) + return object; + var message = new $root.google.cloud.networksecurity.v1.ListTlsInspectionPoliciesRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + return message; + }; + + /** + * Creates a plain object from a ListTlsInspectionPoliciesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.networksecurity.v1.ListTlsInspectionPoliciesRequest + * @static + * @param {google.cloud.networksecurity.v1.ListTlsInspectionPoliciesRequest} message ListTlsInspectionPoliciesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListTlsInspectionPoliciesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + return object; + }; + + /** + * Converts this ListTlsInspectionPoliciesRequest to JSON. + * @function toJSON + * @memberof google.cloud.networksecurity.v1.ListTlsInspectionPoliciesRequest + * @instance + * @returns {Object.} JSON object + */ + ListTlsInspectionPoliciesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListTlsInspectionPoliciesRequest + * @function getTypeUrl + * @memberof google.cloud.networksecurity.v1.ListTlsInspectionPoliciesRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListTlsInspectionPoliciesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.networksecurity.v1.ListTlsInspectionPoliciesRequest"; + }; + + return ListTlsInspectionPoliciesRequest; + })(); + + v1.ListTlsInspectionPoliciesResponse = (function() { + + /** + * Properties of a ListTlsInspectionPoliciesResponse. + * @memberof google.cloud.networksecurity.v1 + * @interface IListTlsInspectionPoliciesResponse + * @property {Array.|null} [tlsInspectionPolicies] ListTlsInspectionPoliciesResponse tlsInspectionPolicies + * @property {string|null} [nextPageToken] ListTlsInspectionPoliciesResponse nextPageToken + * @property {Array.|null} [unreachable] ListTlsInspectionPoliciesResponse unreachable + */ + + /** + * Constructs a new ListTlsInspectionPoliciesResponse. + * @memberof google.cloud.networksecurity.v1 + * @classdesc Represents a ListTlsInspectionPoliciesResponse. + * @implements IListTlsInspectionPoliciesResponse + * @constructor + * @param {google.cloud.networksecurity.v1.IListTlsInspectionPoliciesResponse=} [properties] Properties to set + */ + function ListTlsInspectionPoliciesResponse(properties) { + this.tlsInspectionPolicies = []; + this.unreachable = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListTlsInspectionPoliciesResponse tlsInspectionPolicies. + * @member {Array.} tlsInspectionPolicies + * @memberof google.cloud.networksecurity.v1.ListTlsInspectionPoliciesResponse + * @instance + */ + ListTlsInspectionPoliciesResponse.prototype.tlsInspectionPolicies = $util.emptyArray; + + /** + * ListTlsInspectionPoliciesResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.networksecurity.v1.ListTlsInspectionPoliciesResponse + * @instance + */ + ListTlsInspectionPoliciesResponse.prototype.nextPageToken = ""; + + /** + * ListTlsInspectionPoliciesResponse unreachable. + * @member {Array.} unreachable + * @memberof google.cloud.networksecurity.v1.ListTlsInspectionPoliciesResponse + * @instance + */ + ListTlsInspectionPoliciesResponse.prototype.unreachable = $util.emptyArray; + + /** + * Creates a new ListTlsInspectionPoliciesResponse instance using the specified properties. + * @function create + * @memberof google.cloud.networksecurity.v1.ListTlsInspectionPoliciesResponse + * @static + * @param {google.cloud.networksecurity.v1.IListTlsInspectionPoliciesResponse=} [properties] Properties to set + * @returns {google.cloud.networksecurity.v1.ListTlsInspectionPoliciesResponse} ListTlsInspectionPoliciesResponse instance + */ + ListTlsInspectionPoliciesResponse.create = function create(properties) { + return new ListTlsInspectionPoliciesResponse(properties); + }; + + /** + * Encodes the specified ListTlsInspectionPoliciesResponse message. Does not implicitly {@link google.cloud.networksecurity.v1.ListTlsInspectionPoliciesResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.networksecurity.v1.ListTlsInspectionPoliciesResponse + * @static + * @param {google.cloud.networksecurity.v1.IListTlsInspectionPoliciesResponse} message ListTlsInspectionPoliciesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListTlsInspectionPoliciesResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.tlsInspectionPolicies != null && message.tlsInspectionPolicies.length) + for (var i = 0; i < message.tlsInspectionPolicies.length; ++i) + $root.google.cloud.networksecurity.v1.TlsInspectionPolicy.encode(message.tlsInspectionPolicies[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + if (message.unreachable != null && message.unreachable.length) + for (var i = 0; i < message.unreachable.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.unreachable[i]); + return writer; + }; + + /** + * Encodes the specified ListTlsInspectionPoliciesResponse message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.ListTlsInspectionPoliciesResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.networksecurity.v1.ListTlsInspectionPoliciesResponse + * @static + * @param {google.cloud.networksecurity.v1.IListTlsInspectionPoliciesResponse} message ListTlsInspectionPoliciesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListTlsInspectionPoliciesResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListTlsInspectionPoliciesResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.networksecurity.v1.ListTlsInspectionPoliciesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.networksecurity.v1.ListTlsInspectionPoliciesResponse} ListTlsInspectionPoliciesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListTlsInspectionPoliciesResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networksecurity.v1.ListTlsInspectionPoliciesResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.tlsInspectionPolicies && message.tlsInspectionPolicies.length)) + message.tlsInspectionPolicies = []; + message.tlsInspectionPolicies.push($root.google.cloud.networksecurity.v1.TlsInspectionPolicy.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + case 3: { + if (!(message.unreachable && message.unreachable.length)) + message.unreachable = []; + message.unreachable.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListTlsInspectionPoliciesResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.networksecurity.v1.ListTlsInspectionPoliciesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.networksecurity.v1.ListTlsInspectionPoliciesResponse} ListTlsInspectionPoliciesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListTlsInspectionPoliciesResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListTlsInspectionPoliciesResponse message. + * @function verify + * @memberof google.cloud.networksecurity.v1.ListTlsInspectionPoliciesResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListTlsInspectionPoliciesResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.tlsInspectionPolicies != null && message.hasOwnProperty("tlsInspectionPolicies")) { + if (!Array.isArray(message.tlsInspectionPolicies)) + return "tlsInspectionPolicies: array expected"; + for (var i = 0; i < message.tlsInspectionPolicies.length; ++i) { + var error = $root.google.cloud.networksecurity.v1.TlsInspectionPolicy.verify(message.tlsInspectionPolicies[i]); + if (error) + return "tlsInspectionPolicies." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + if (message.unreachable != null && message.hasOwnProperty("unreachable")) { + if (!Array.isArray(message.unreachable)) + return "unreachable: array expected"; + for (var i = 0; i < message.unreachable.length; ++i) + if (!$util.isString(message.unreachable[i])) + return "unreachable: string[] expected"; + } + return null; + }; + + /** + * Creates a ListTlsInspectionPoliciesResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.networksecurity.v1.ListTlsInspectionPoliciesResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.networksecurity.v1.ListTlsInspectionPoliciesResponse} ListTlsInspectionPoliciesResponse + */ + ListTlsInspectionPoliciesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networksecurity.v1.ListTlsInspectionPoliciesResponse) + return object; + var message = new $root.google.cloud.networksecurity.v1.ListTlsInspectionPoliciesResponse(); + if (object.tlsInspectionPolicies) { + if (!Array.isArray(object.tlsInspectionPolicies)) + throw TypeError(".google.cloud.networksecurity.v1.ListTlsInspectionPoliciesResponse.tlsInspectionPolicies: array expected"); + message.tlsInspectionPolicies = []; + for (var i = 0; i < object.tlsInspectionPolicies.length; ++i) { + if (typeof object.tlsInspectionPolicies[i] !== "object") + throw TypeError(".google.cloud.networksecurity.v1.ListTlsInspectionPoliciesResponse.tlsInspectionPolicies: object expected"); + message.tlsInspectionPolicies[i] = $root.google.cloud.networksecurity.v1.TlsInspectionPolicy.fromObject(object.tlsInspectionPolicies[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.unreachable) { + if (!Array.isArray(object.unreachable)) + throw TypeError(".google.cloud.networksecurity.v1.ListTlsInspectionPoliciesResponse.unreachable: array expected"); + message.unreachable = []; + for (var i = 0; i < object.unreachable.length; ++i) + message.unreachable[i] = String(object.unreachable[i]); + } + return message; + }; + + /** + * Creates a plain object from a ListTlsInspectionPoliciesResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.networksecurity.v1.ListTlsInspectionPoliciesResponse + * @static + * @param {google.cloud.networksecurity.v1.ListTlsInspectionPoliciesResponse} message ListTlsInspectionPoliciesResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListTlsInspectionPoliciesResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.tlsInspectionPolicies = []; + object.unreachable = []; + } + if (options.defaults) + object.nextPageToken = ""; + if (message.tlsInspectionPolicies && message.tlsInspectionPolicies.length) { + object.tlsInspectionPolicies = []; + for (var j = 0; j < message.tlsInspectionPolicies.length; ++j) + object.tlsInspectionPolicies[j] = $root.google.cloud.networksecurity.v1.TlsInspectionPolicy.toObject(message.tlsInspectionPolicies[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + if (message.unreachable && message.unreachable.length) { + object.unreachable = []; + for (var j = 0; j < message.unreachable.length; ++j) + object.unreachable[j] = message.unreachable[j]; + } + return object; + }; + + /** + * Converts this ListTlsInspectionPoliciesResponse to JSON. + * @function toJSON + * @memberof google.cloud.networksecurity.v1.ListTlsInspectionPoliciesResponse + * @instance + * @returns {Object.} JSON object + */ + ListTlsInspectionPoliciesResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListTlsInspectionPoliciesResponse + * @function getTypeUrl + * @memberof google.cloud.networksecurity.v1.ListTlsInspectionPoliciesResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListTlsInspectionPoliciesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.networksecurity.v1.ListTlsInspectionPoliciesResponse"; + }; + + return ListTlsInspectionPoliciesResponse; + })(); + + v1.GetTlsInspectionPolicyRequest = (function() { + + /** + * Properties of a GetTlsInspectionPolicyRequest. + * @memberof google.cloud.networksecurity.v1 + * @interface IGetTlsInspectionPolicyRequest + * @property {string|null} [name] GetTlsInspectionPolicyRequest name + */ + + /** + * Constructs a new GetTlsInspectionPolicyRequest. + * @memberof google.cloud.networksecurity.v1 + * @classdesc Represents a GetTlsInspectionPolicyRequest. + * @implements IGetTlsInspectionPolicyRequest + * @constructor + * @param {google.cloud.networksecurity.v1.IGetTlsInspectionPolicyRequest=} [properties] Properties to set + */ + function GetTlsInspectionPolicyRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetTlsInspectionPolicyRequest name. + * @member {string} name + * @memberof google.cloud.networksecurity.v1.GetTlsInspectionPolicyRequest + * @instance + */ + GetTlsInspectionPolicyRequest.prototype.name = ""; + + /** + * Creates a new GetTlsInspectionPolicyRequest instance using the specified properties. + * @function create + * @memberof google.cloud.networksecurity.v1.GetTlsInspectionPolicyRequest + * @static + * @param {google.cloud.networksecurity.v1.IGetTlsInspectionPolicyRequest=} [properties] Properties to set + * @returns {google.cloud.networksecurity.v1.GetTlsInspectionPolicyRequest} GetTlsInspectionPolicyRequest instance + */ + GetTlsInspectionPolicyRequest.create = function create(properties) { + return new GetTlsInspectionPolicyRequest(properties); + }; + + /** + * Encodes the specified GetTlsInspectionPolicyRequest message. Does not implicitly {@link google.cloud.networksecurity.v1.GetTlsInspectionPolicyRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.networksecurity.v1.GetTlsInspectionPolicyRequest + * @static + * @param {google.cloud.networksecurity.v1.IGetTlsInspectionPolicyRequest} message GetTlsInspectionPolicyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetTlsInspectionPolicyRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified GetTlsInspectionPolicyRequest message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.GetTlsInspectionPolicyRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.networksecurity.v1.GetTlsInspectionPolicyRequest + * @static + * @param {google.cloud.networksecurity.v1.IGetTlsInspectionPolicyRequest} message GetTlsInspectionPolicyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetTlsInspectionPolicyRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetTlsInspectionPolicyRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.networksecurity.v1.GetTlsInspectionPolicyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.networksecurity.v1.GetTlsInspectionPolicyRequest} GetTlsInspectionPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetTlsInspectionPolicyRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networksecurity.v1.GetTlsInspectionPolicyRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetTlsInspectionPolicyRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.networksecurity.v1.GetTlsInspectionPolicyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.networksecurity.v1.GetTlsInspectionPolicyRequest} GetTlsInspectionPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetTlsInspectionPolicyRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetTlsInspectionPolicyRequest message. + * @function verify + * @memberof google.cloud.networksecurity.v1.GetTlsInspectionPolicyRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetTlsInspectionPolicyRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a GetTlsInspectionPolicyRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.networksecurity.v1.GetTlsInspectionPolicyRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.networksecurity.v1.GetTlsInspectionPolicyRequest} GetTlsInspectionPolicyRequest + */ + GetTlsInspectionPolicyRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networksecurity.v1.GetTlsInspectionPolicyRequest) + return object; + var message = new $root.google.cloud.networksecurity.v1.GetTlsInspectionPolicyRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetTlsInspectionPolicyRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.networksecurity.v1.GetTlsInspectionPolicyRequest + * @static + * @param {google.cloud.networksecurity.v1.GetTlsInspectionPolicyRequest} message GetTlsInspectionPolicyRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetTlsInspectionPolicyRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this GetTlsInspectionPolicyRequest to JSON. + * @function toJSON + * @memberof google.cloud.networksecurity.v1.GetTlsInspectionPolicyRequest + * @instance + * @returns {Object.} JSON object + */ + GetTlsInspectionPolicyRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetTlsInspectionPolicyRequest + * @function getTypeUrl + * @memberof google.cloud.networksecurity.v1.GetTlsInspectionPolicyRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetTlsInspectionPolicyRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.networksecurity.v1.GetTlsInspectionPolicyRequest"; + }; + + return GetTlsInspectionPolicyRequest; + })(); + + v1.DeleteTlsInspectionPolicyRequest = (function() { + + /** + * Properties of a DeleteTlsInspectionPolicyRequest. + * @memberof google.cloud.networksecurity.v1 + * @interface IDeleteTlsInspectionPolicyRequest + * @property {string|null} [name] DeleteTlsInspectionPolicyRequest name + * @property {boolean|null} [force] DeleteTlsInspectionPolicyRequest force + */ + + /** + * Constructs a new DeleteTlsInspectionPolicyRequest. + * @memberof google.cloud.networksecurity.v1 + * @classdesc Represents a DeleteTlsInspectionPolicyRequest. + * @implements IDeleteTlsInspectionPolicyRequest + * @constructor + * @param {google.cloud.networksecurity.v1.IDeleteTlsInspectionPolicyRequest=} [properties] Properties to set + */ + function DeleteTlsInspectionPolicyRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteTlsInspectionPolicyRequest name. + * @member {string} name + * @memberof google.cloud.networksecurity.v1.DeleteTlsInspectionPolicyRequest + * @instance + */ + DeleteTlsInspectionPolicyRequest.prototype.name = ""; + + /** + * DeleteTlsInspectionPolicyRequest force. + * @member {boolean} force + * @memberof google.cloud.networksecurity.v1.DeleteTlsInspectionPolicyRequest + * @instance + */ + DeleteTlsInspectionPolicyRequest.prototype.force = false; + + /** + * Creates a new DeleteTlsInspectionPolicyRequest instance using the specified properties. + * @function create + * @memberof google.cloud.networksecurity.v1.DeleteTlsInspectionPolicyRequest + * @static + * @param {google.cloud.networksecurity.v1.IDeleteTlsInspectionPolicyRequest=} [properties] Properties to set + * @returns {google.cloud.networksecurity.v1.DeleteTlsInspectionPolicyRequest} DeleteTlsInspectionPolicyRequest instance + */ + DeleteTlsInspectionPolicyRequest.create = function create(properties) { + return new DeleteTlsInspectionPolicyRequest(properties); + }; + + /** + * Encodes the specified DeleteTlsInspectionPolicyRequest message. Does not implicitly {@link google.cloud.networksecurity.v1.DeleteTlsInspectionPolicyRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.networksecurity.v1.DeleteTlsInspectionPolicyRequest + * @static + * @param {google.cloud.networksecurity.v1.IDeleteTlsInspectionPolicyRequest} message DeleteTlsInspectionPolicyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteTlsInspectionPolicyRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.force != null && Object.hasOwnProperty.call(message, "force")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.force); + return writer; + }; + + /** + * Encodes the specified DeleteTlsInspectionPolicyRequest message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.DeleteTlsInspectionPolicyRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.networksecurity.v1.DeleteTlsInspectionPolicyRequest + * @static + * @param {google.cloud.networksecurity.v1.IDeleteTlsInspectionPolicyRequest} message DeleteTlsInspectionPolicyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteTlsInspectionPolicyRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteTlsInspectionPolicyRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.networksecurity.v1.DeleteTlsInspectionPolicyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.networksecurity.v1.DeleteTlsInspectionPolicyRequest} DeleteTlsInspectionPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteTlsInspectionPolicyRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networksecurity.v1.DeleteTlsInspectionPolicyRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.force = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteTlsInspectionPolicyRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.networksecurity.v1.DeleteTlsInspectionPolicyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.networksecurity.v1.DeleteTlsInspectionPolicyRequest} DeleteTlsInspectionPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteTlsInspectionPolicyRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteTlsInspectionPolicyRequest message. + * @function verify + * @memberof google.cloud.networksecurity.v1.DeleteTlsInspectionPolicyRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteTlsInspectionPolicyRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.force != null && message.hasOwnProperty("force")) + if (typeof message.force !== "boolean") + return "force: boolean expected"; + return null; + }; + + /** + * Creates a DeleteTlsInspectionPolicyRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.networksecurity.v1.DeleteTlsInspectionPolicyRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.networksecurity.v1.DeleteTlsInspectionPolicyRequest} DeleteTlsInspectionPolicyRequest + */ + DeleteTlsInspectionPolicyRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networksecurity.v1.DeleteTlsInspectionPolicyRequest) + return object; + var message = new $root.google.cloud.networksecurity.v1.DeleteTlsInspectionPolicyRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.force != null) + message.force = Boolean(object.force); + return message; + }; + + /** + * Creates a plain object from a DeleteTlsInspectionPolicyRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.networksecurity.v1.DeleteTlsInspectionPolicyRequest + * @static + * @param {google.cloud.networksecurity.v1.DeleteTlsInspectionPolicyRequest} message DeleteTlsInspectionPolicyRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteTlsInspectionPolicyRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.force = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.force != null && message.hasOwnProperty("force")) + object.force = message.force; + return object; + }; + + /** + * Converts this DeleteTlsInspectionPolicyRequest to JSON. + * @function toJSON + * @memberof google.cloud.networksecurity.v1.DeleteTlsInspectionPolicyRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteTlsInspectionPolicyRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteTlsInspectionPolicyRequest + * @function getTypeUrl + * @memberof google.cloud.networksecurity.v1.DeleteTlsInspectionPolicyRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteTlsInspectionPolicyRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.networksecurity.v1.DeleteTlsInspectionPolicyRequest"; + }; + + return DeleteTlsInspectionPolicyRequest; + })(); + + v1.UpdateTlsInspectionPolicyRequest = (function() { + + /** + * Properties of an UpdateTlsInspectionPolicyRequest. + * @memberof google.cloud.networksecurity.v1 + * @interface IUpdateTlsInspectionPolicyRequest + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateTlsInspectionPolicyRequest updateMask + * @property {google.cloud.networksecurity.v1.ITlsInspectionPolicy|null} [tlsInspectionPolicy] UpdateTlsInspectionPolicyRequest tlsInspectionPolicy + */ + + /** + * Constructs a new UpdateTlsInspectionPolicyRequest. + * @memberof google.cloud.networksecurity.v1 + * @classdesc Represents an UpdateTlsInspectionPolicyRequest. + * @implements IUpdateTlsInspectionPolicyRequest + * @constructor + * @param {google.cloud.networksecurity.v1.IUpdateTlsInspectionPolicyRequest=} [properties] Properties to set + */ + function UpdateTlsInspectionPolicyRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateTlsInspectionPolicyRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.networksecurity.v1.UpdateTlsInspectionPolicyRequest + * @instance + */ + UpdateTlsInspectionPolicyRequest.prototype.updateMask = null; + + /** + * UpdateTlsInspectionPolicyRequest tlsInspectionPolicy. + * @member {google.cloud.networksecurity.v1.ITlsInspectionPolicy|null|undefined} tlsInspectionPolicy + * @memberof google.cloud.networksecurity.v1.UpdateTlsInspectionPolicyRequest + * @instance + */ + UpdateTlsInspectionPolicyRequest.prototype.tlsInspectionPolicy = null; + + /** + * Creates a new UpdateTlsInspectionPolicyRequest instance using the specified properties. + * @function create + * @memberof google.cloud.networksecurity.v1.UpdateTlsInspectionPolicyRequest + * @static + * @param {google.cloud.networksecurity.v1.IUpdateTlsInspectionPolicyRequest=} [properties] Properties to set + * @returns {google.cloud.networksecurity.v1.UpdateTlsInspectionPolicyRequest} UpdateTlsInspectionPolicyRequest instance + */ + UpdateTlsInspectionPolicyRequest.create = function create(properties) { + return new UpdateTlsInspectionPolicyRequest(properties); + }; + + /** + * Encodes the specified UpdateTlsInspectionPolicyRequest message. Does not implicitly {@link google.cloud.networksecurity.v1.UpdateTlsInspectionPolicyRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.networksecurity.v1.UpdateTlsInspectionPolicyRequest + * @static + * @param {google.cloud.networksecurity.v1.IUpdateTlsInspectionPolicyRequest} message UpdateTlsInspectionPolicyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateTlsInspectionPolicyRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.tlsInspectionPolicy != null && Object.hasOwnProperty.call(message, "tlsInspectionPolicy")) + $root.google.cloud.networksecurity.v1.TlsInspectionPolicy.encode(message.tlsInspectionPolicy, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified UpdateTlsInspectionPolicyRequest message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.UpdateTlsInspectionPolicyRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.networksecurity.v1.UpdateTlsInspectionPolicyRequest + * @static + * @param {google.cloud.networksecurity.v1.IUpdateTlsInspectionPolicyRequest} message UpdateTlsInspectionPolicyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateTlsInspectionPolicyRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateTlsInspectionPolicyRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.networksecurity.v1.UpdateTlsInspectionPolicyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.networksecurity.v1.UpdateTlsInspectionPolicyRequest} UpdateTlsInspectionPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateTlsInspectionPolicyRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networksecurity.v1.UpdateTlsInspectionPolicyRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + case 2: { + message.tlsInspectionPolicy = $root.google.cloud.networksecurity.v1.TlsInspectionPolicy.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateTlsInspectionPolicyRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.networksecurity.v1.UpdateTlsInspectionPolicyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.networksecurity.v1.UpdateTlsInspectionPolicyRequest} UpdateTlsInspectionPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateTlsInspectionPolicyRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateTlsInspectionPolicyRequest message. + * @function verify + * @memberof google.cloud.networksecurity.v1.UpdateTlsInspectionPolicyRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateTlsInspectionPolicyRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + if (message.tlsInspectionPolicy != null && message.hasOwnProperty("tlsInspectionPolicy")) { + var error = $root.google.cloud.networksecurity.v1.TlsInspectionPolicy.verify(message.tlsInspectionPolicy); + if (error) + return "tlsInspectionPolicy." + error; + } + return null; + }; + + /** + * Creates an UpdateTlsInspectionPolicyRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.networksecurity.v1.UpdateTlsInspectionPolicyRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.networksecurity.v1.UpdateTlsInspectionPolicyRequest} UpdateTlsInspectionPolicyRequest + */ + UpdateTlsInspectionPolicyRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networksecurity.v1.UpdateTlsInspectionPolicyRequest) + return object; + var message = new $root.google.cloud.networksecurity.v1.UpdateTlsInspectionPolicyRequest(); + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.networksecurity.v1.UpdateTlsInspectionPolicyRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + if (object.tlsInspectionPolicy != null) { + if (typeof object.tlsInspectionPolicy !== "object") + throw TypeError(".google.cloud.networksecurity.v1.UpdateTlsInspectionPolicyRequest.tlsInspectionPolicy: object expected"); + message.tlsInspectionPolicy = $root.google.cloud.networksecurity.v1.TlsInspectionPolicy.fromObject(object.tlsInspectionPolicy); + } + return message; + }; + + /** + * Creates a plain object from an UpdateTlsInspectionPolicyRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.networksecurity.v1.UpdateTlsInspectionPolicyRequest + * @static + * @param {google.cloud.networksecurity.v1.UpdateTlsInspectionPolicyRequest} message UpdateTlsInspectionPolicyRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateTlsInspectionPolicyRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.updateMask = null; + object.tlsInspectionPolicy = null; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + if (message.tlsInspectionPolicy != null && message.hasOwnProperty("tlsInspectionPolicy")) + object.tlsInspectionPolicy = $root.google.cloud.networksecurity.v1.TlsInspectionPolicy.toObject(message.tlsInspectionPolicy, options); + return object; + }; + + /** + * Converts this UpdateTlsInspectionPolicyRequest to JSON. + * @function toJSON + * @memberof google.cloud.networksecurity.v1.UpdateTlsInspectionPolicyRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateTlsInspectionPolicyRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateTlsInspectionPolicyRequest + * @function getTypeUrl + * @memberof google.cloud.networksecurity.v1.UpdateTlsInspectionPolicyRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateTlsInspectionPolicyRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.networksecurity.v1.UpdateTlsInspectionPolicyRequest"; + }; + + return UpdateTlsInspectionPolicyRequest; + })(); + + v1.UrlList = (function() { + + /** + * Properties of an UrlList. + * @memberof google.cloud.networksecurity.v1 + * @interface IUrlList + * @property {string|null} [name] UrlList name + * @property {google.protobuf.ITimestamp|null} [createTime] UrlList createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] UrlList updateTime + * @property {string|null} [description] UrlList description + * @property {Array.|null} [values] UrlList values + */ + + /** + * Constructs a new UrlList. + * @memberof google.cloud.networksecurity.v1 + * @classdesc Represents an UrlList. + * @implements IUrlList + * @constructor + * @param {google.cloud.networksecurity.v1.IUrlList=} [properties] Properties to set + */ + function UrlList(properties) { + this.values = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UrlList name. + * @member {string} name + * @memberof google.cloud.networksecurity.v1.UrlList + * @instance + */ + UrlList.prototype.name = ""; + + /** + * UrlList createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.networksecurity.v1.UrlList + * @instance + */ + UrlList.prototype.createTime = null; + + /** + * UrlList updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.networksecurity.v1.UrlList + * @instance + */ + UrlList.prototype.updateTime = null; + + /** + * UrlList description. + * @member {string} description + * @memberof google.cloud.networksecurity.v1.UrlList + * @instance + */ + UrlList.prototype.description = ""; + + /** + * UrlList values. + * @member {Array.} values + * @memberof google.cloud.networksecurity.v1.UrlList + * @instance + */ + UrlList.prototype.values = $util.emptyArray; + + /** + * Creates a new UrlList instance using the specified properties. + * @function create + * @memberof google.cloud.networksecurity.v1.UrlList + * @static + * @param {google.cloud.networksecurity.v1.IUrlList=} [properties] Properties to set + * @returns {google.cloud.networksecurity.v1.UrlList} UrlList instance + */ + UrlList.create = function create(properties) { + return new UrlList(properties); + }; + + /** + * Encodes the specified UrlList message. Does not implicitly {@link google.cloud.networksecurity.v1.UrlList.verify|verify} messages. + * @function encode + * @memberof google.cloud.networksecurity.v1.UrlList + * @static + * @param {google.cloud.networksecurity.v1.IUrlList} message UrlList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UrlList.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.description); + if (message.values != null && message.values.length) + for (var i = 0; i < message.values.length; ++i) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.values[i]); + return writer; + }; + + /** + * Encodes the specified UrlList message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.UrlList.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.networksecurity.v1.UrlList + * @static + * @param {google.cloud.networksecurity.v1.IUrlList} message UrlList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UrlList.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UrlList message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.networksecurity.v1.UrlList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.networksecurity.v1.UrlList} UrlList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UrlList.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networksecurity.v1.UrlList(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 3: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 4: { + message.description = reader.string(); + break; + } + case 5: { + if (!(message.values && message.values.length)) + message.values = []; + message.values.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UrlList message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.networksecurity.v1.UrlList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.networksecurity.v1.UrlList} UrlList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UrlList.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UrlList message. + * @function verify + * @memberof google.cloud.networksecurity.v1.UrlList + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UrlList.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime); + if (error) + return "updateTime." + error; + } + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.values != null && message.hasOwnProperty("values")) { + if (!Array.isArray(message.values)) + return "values: array expected"; + for (var i = 0; i < message.values.length; ++i) + if (!$util.isString(message.values[i])) + return "values: string[] expected"; + } + return null; + }; + + /** + * Creates an UrlList message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.networksecurity.v1.UrlList + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.networksecurity.v1.UrlList} UrlList + */ + UrlList.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networksecurity.v1.UrlList) + return object; + var message = new $root.google.cloud.networksecurity.v1.UrlList(); + if (object.name != null) + message.name = String(object.name); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.networksecurity.v1.UrlList.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.updateTime != null) { + if (typeof object.updateTime !== "object") + throw TypeError(".google.cloud.networksecurity.v1.UrlList.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + if (object.description != null) + message.description = String(object.description); + if (object.values) { + if (!Array.isArray(object.values)) + throw TypeError(".google.cloud.networksecurity.v1.UrlList.values: array expected"); + message.values = []; + for (var i = 0; i < object.values.length; ++i) + message.values[i] = String(object.values[i]); + } + return message; + }; + + /** + * Creates a plain object from an UrlList message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.networksecurity.v1.UrlList + * @static + * @param {google.cloud.networksecurity.v1.UrlList} message UrlList + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UrlList.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.values = []; + if (options.defaults) { + object.name = ""; + object.createTime = null; + object.updateTime = null; + object.description = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.updateTime != null && message.hasOwnProperty("updateTime")) + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.values && message.values.length) { + object.values = []; + for (var j = 0; j < message.values.length; ++j) + object.values[j] = message.values[j]; + } + return object; + }; + + /** + * Converts this UrlList to JSON. + * @function toJSON + * @memberof google.cloud.networksecurity.v1.UrlList + * @instance + * @returns {Object.} JSON object + */ + UrlList.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UrlList + * @function getTypeUrl + * @memberof google.cloud.networksecurity.v1.UrlList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UrlList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.networksecurity.v1.UrlList"; + }; + + return UrlList; + })(); + + v1.ListUrlListsRequest = (function() { + + /** + * Properties of a ListUrlListsRequest. + * @memberof google.cloud.networksecurity.v1 + * @interface IListUrlListsRequest + * @property {string|null} [parent] ListUrlListsRequest parent + * @property {number|null} [pageSize] ListUrlListsRequest pageSize + * @property {string|null} [pageToken] ListUrlListsRequest pageToken + */ + + /** + * Constructs a new ListUrlListsRequest. + * @memberof google.cloud.networksecurity.v1 + * @classdesc Represents a ListUrlListsRequest. + * @implements IListUrlListsRequest + * @constructor + * @param {google.cloud.networksecurity.v1.IListUrlListsRequest=} [properties] Properties to set + */ + function ListUrlListsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListUrlListsRequest parent. + * @member {string} parent + * @memberof google.cloud.networksecurity.v1.ListUrlListsRequest + * @instance + */ + ListUrlListsRequest.prototype.parent = ""; + + /** + * ListUrlListsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.networksecurity.v1.ListUrlListsRequest + * @instance + */ + ListUrlListsRequest.prototype.pageSize = 0; + + /** + * ListUrlListsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.networksecurity.v1.ListUrlListsRequest + * @instance + */ + ListUrlListsRequest.prototype.pageToken = ""; + + /** + * Creates a new ListUrlListsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.networksecurity.v1.ListUrlListsRequest + * @static + * @param {google.cloud.networksecurity.v1.IListUrlListsRequest=} [properties] Properties to set + * @returns {google.cloud.networksecurity.v1.ListUrlListsRequest} ListUrlListsRequest instance + */ + ListUrlListsRequest.create = function create(properties) { + return new ListUrlListsRequest(properties); + }; + + /** + * Encodes the specified ListUrlListsRequest message. Does not implicitly {@link google.cloud.networksecurity.v1.ListUrlListsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.networksecurity.v1.ListUrlListsRequest + * @static + * @param {google.cloud.networksecurity.v1.IListUrlListsRequest} message ListUrlListsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListUrlListsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + return writer; + }; + + /** + * Encodes the specified ListUrlListsRequest message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.ListUrlListsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.networksecurity.v1.ListUrlListsRequest + * @static + * @param {google.cloud.networksecurity.v1.IListUrlListsRequest} message ListUrlListsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListUrlListsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListUrlListsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.networksecurity.v1.ListUrlListsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.networksecurity.v1.ListUrlListsRequest} ListUrlListsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListUrlListsRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networksecurity.v1.ListUrlListsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListUrlListsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.networksecurity.v1.ListUrlListsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.networksecurity.v1.ListUrlListsRequest} ListUrlListsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListUrlListsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListUrlListsRequest message. + * @function verify + * @memberof google.cloud.networksecurity.v1.ListUrlListsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListUrlListsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + return null; + }; + + /** + * Creates a ListUrlListsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.networksecurity.v1.ListUrlListsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.networksecurity.v1.ListUrlListsRequest} ListUrlListsRequest + */ + ListUrlListsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networksecurity.v1.ListUrlListsRequest) + return object; + var message = new $root.google.cloud.networksecurity.v1.ListUrlListsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + return message; + }; + + /** + * Creates a plain object from a ListUrlListsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.networksecurity.v1.ListUrlListsRequest + * @static + * @param {google.cloud.networksecurity.v1.ListUrlListsRequest} message ListUrlListsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListUrlListsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + return object; + }; + + /** + * Converts this ListUrlListsRequest to JSON. + * @function toJSON + * @memberof google.cloud.networksecurity.v1.ListUrlListsRequest + * @instance + * @returns {Object.} JSON object + */ + ListUrlListsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListUrlListsRequest + * @function getTypeUrl + * @memberof google.cloud.networksecurity.v1.ListUrlListsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListUrlListsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.networksecurity.v1.ListUrlListsRequest"; + }; + + return ListUrlListsRequest; + })(); + + v1.ListUrlListsResponse = (function() { + + /** + * Properties of a ListUrlListsResponse. + * @memberof google.cloud.networksecurity.v1 + * @interface IListUrlListsResponse + * @property {Array.|null} [urlLists] ListUrlListsResponse urlLists + * @property {string|null} [nextPageToken] ListUrlListsResponse nextPageToken + * @property {Array.|null} [unreachable] ListUrlListsResponse unreachable + */ + + /** + * Constructs a new ListUrlListsResponse. + * @memberof google.cloud.networksecurity.v1 + * @classdesc Represents a ListUrlListsResponse. + * @implements IListUrlListsResponse + * @constructor + * @param {google.cloud.networksecurity.v1.IListUrlListsResponse=} [properties] Properties to set + */ + function ListUrlListsResponse(properties) { + this.urlLists = []; + this.unreachable = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListUrlListsResponse urlLists. + * @member {Array.} urlLists + * @memberof google.cloud.networksecurity.v1.ListUrlListsResponse + * @instance + */ + ListUrlListsResponse.prototype.urlLists = $util.emptyArray; + + /** + * ListUrlListsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.networksecurity.v1.ListUrlListsResponse + * @instance + */ + ListUrlListsResponse.prototype.nextPageToken = ""; + + /** + * ListUrlListsResponse unreachable. + * @member {Array.} unreachable + * @memberof google.cloud.networksecurity.v1.ListUrlListsResponse + * @instance + */ + ListUrlListsResponse.prototype.unreachable = $util.emptyArray; + + /** + * Creates a new ListUrlListsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.networksecurity.v1.ListUrlListsResponse + * @static + * @param {google.cloud.networksecurity.v1.IListUrlListsResponse=} [properties] Properties to set + * @returns {google.cloud.networksecurity.v1.ListUrlListsResponse} ListUrlListsResponse instance + */ + ListUrlListsResponse.create = function create(properties) { + return new ListUrlListsResponse(properties); + }; + + /** + * Encodes the specified ListUrlListsResponse message. Does not implicitly {@link google.cloud.networksecurity.v1.ListUrlListsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.networksecurity.v1.ListUrlListsResponse + * @static + * @param {google.cloud.networksecurity.v1.IListUrlListsResponse} message ListUrlListsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListUrlListsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.urlLists != null && message.urlLists.length) + for (var i = 0; i < message.urlLists.length; ++i) + $root.google.cloud.networksecurity.v1.UrlList.encode(message.urlLists[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + if (message.unreachable != null && message.unreachable.length) + for (var i = 0; i < message.unreachable.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.unreachable[i]); + return writer; + }; + + /** + * Encodes the specified ListUrlListsResponse message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.ListUrlListsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.networksecurity.v1.ListUrlListsResponse + * @static + * @param {google.cloud.networksecurity.v1.IListUrlListsResponse} message ListUrlListsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListUrlListsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListUrlListsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.networksecurity.v1.ListUrlListsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.networksecurity.v1.ListUrlListsResponse} ListUrlListsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListUrlListsResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networksecurity.v1.ListUrlListsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.urlLists && message.urlLists.length)) + message.urlLists = []; + message.urlLists.push($root.google.cloud.networksecurity.v1.UrlList.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + case 3: { + if (!(message.unreachable && message.unreachable.length)) + message.unreachable = []; + message.unreachable.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListUrlListsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.networksecurity.v1.ListUrlListsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.networksecurity.v1.ListUrlListsResponse} ListUrlListsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListUrlListsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListUrlListsResponse message. + * @function verify + * @memberof google.cloud.networksecurity.v1.ListUrlListsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListUrlListsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.urlLists != null && message.hasOwnProperty("urlLists")) { + if (!Array.isArray(message.urlLists)) + return "urlLists: array expected"; + for (var i = 0; i < message.urlLists.length; ++i) { + var error = $root.google.cloud.networksecurity.v1.UrlList.verify(message.urlLists[i]); + if (error) + return "urlLists." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + if (message.unreachable != null && message.hasOwnProperty("unreachable")) { + if (!Array.isArray(message.unreachable)) + return "unreachable: array expected"; + for (var i = 0; i < message.unreachable.length; ++i) + if (!$util.isString(message.unreachable[i])) + return "unreachable: string[] expected"; + } + return null; + }; + + /** + * Creates a ListUrlListsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.networksecurity.v1.ListUrlListsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.networksecurity.v1.ListUrlListsResponse} ListUrlListsResponse + */ + ListUrlListsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networksecurity.v1.ListUrlListsResponse) + return object; + var message = new $root.google.cloud.networksecurity.v1.ListUrlListsResponse(); + if (object.urlLists) { + if (!Array.isArray(object.urlLists)) + throw TypeError(".google.cloud.networksecurity.v1.ListUrlListsResponse.urlLists: array expected"); + message.urlLists = []; + for (var i = 0; i < object.urlLists.length; ++i) { + if (typeof object.urlLists[i] !== "object") + throw TypeError(".google.cloud.networksecurity.v1.ListUrlListsResponse.urlLists: object expected"); + message.urlLists[i] = $root.google.cloud.networksecurity.v1.UrlList.fromObject(object.urlLists[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.unreachable) { + if (!Array.isArray(object.unreachable)) + throw TypeError(".google.cloud.networksecurity.v1.ListUrlListsResponse.unreachable: array expected"); + message.unreachable = []; + for (var i = 0; i < object.unreachable.length; ++i) + message.unreachable[i] = String(object.unreachable[i]); + } + return message; + }; + + /** + * Creates a plain object from a ListUrlListsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.networksecurity.v1.ListUrlListsResponse + * @static + * @param {google.cloud.networksecurity.v1.ListUrlListsResponse} message ListUrlListsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListUrlListsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.urlLists = []; + object.unreachable = []; + } + if (options.defaults) + object.nextPageToken = ""; + if (message.urlLists && message.urlLists.length) { + object.urlLists = []; + for (var j = 0; j < message.urlLists.length; ++j) + object.urlLists[j] = $root.google.cloud.networksecurity.v1.UrlList.toObject(message.urlLists[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + if (message.unreachable && message.unreachable.length) { + object.unreachable = []; + for (var j = 0; j < message.unreachable.length; ++j) + object.unreachable[j] = message.unreachable[j]; + } + return object; + }; + + /** + * Converts this ListUrlListsResponse to JSON. + * @function toJSON + * @memberof google.cloud.networksecurity.v1.ListUrlListsResponse + * @instance + * @returns {Object.} JSON object + */ + ListUrlListsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListUrlListsResponse + * @function getTypeUrl + * @memberof google.cloud.networksecurity.v1.ListUrlListsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListUrlListsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.networksecurity.v1.ListUrlListsResponse"; + }; + + return ListUrlListsResponse; + })(); + + v1.GetUrlListRequest = (function() { + + /** + * Properties of a GetUrlListRequest. + * @memberof google.cloud.networksecurity.v1 + * @interface IGetUrlListRequest + * @property {string|null} [name] GetUrlListRequest name + */ + + /** + * Constructs a new GetUrlListRequest. + * @memberof google.cloud.networksecurity.v1 + * @classdesc Represents a GetUrlListRequest. + * @implements IGetUrlListRequest + * @constructor + * @param {google.cloud.networksecurity.v1.IGetUrlListRequest=} [properties] Properties to set + */ + function GetUrlListRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetUrlListRequest name. + * @member {string} name + * @memberof google.cloud.networksecurity.v1.GetUrlListRequest + * @instance + */ + GetUrlListRequest.prototype.name = ""; + + /** + * Creates a new GetUrlListRequest instance using the specified properties. + * @function create + * @memberof google.cloud.networksecurity.v1.GetUrlListRequest + * @static + * @param {google.cloud.networksecurity.v1.IGetUrlListRequest=} [properties] Properties to set + * @returns {google.cloud.networksecurity.v1.GetUrlListRequest} GetUrlListRequest instance + */ + GetUrlListRequest.create = function create(properties) { + return new GetUrlListRequest(properties); + }; + + /** + * Encodes the specified GetUrlListRequest message. Does not implicitly {@link google.cloud.networksecurity.v1.GetUrlListRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.networksecurity.v1.GetUrlListRequest + * @static + * @param {google.cloud.networksecurity.v1.IGetUrlListRequest} message GetUrlListRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetUrlListRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified GetUrlListRequest message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.GetUrlListRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.networksecurity.v1.GetUrlListRequest + * @static + * @param {google.cloud.networksecurity.v1.IGetUrlListRequest} message GetUrlListRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetUrlListRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetUrlListRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.networksecurity.v1.GetUrlListRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.networksecurity.v1.GetUrlListRequest} GetUrlListRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetUrlListRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networksecurity.v1.GetUrlListRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetUrlListRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.networksecurity.v1.GetUrlListRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.networksecurity.v1.GetUrlListRequest} GetUrlListRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetUrlListRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetUrlListRequest message. + * @function verify + * @memberof google.cloud.networksecurity.v1.GetUrlListRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetUrlListRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a GetUrlListRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.networksecurity.v1.GetUrlListRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.networksecurity.v1.GetUrlListRequest} GetUrlListRequest + */ + GetUrlListRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networksecurity.v1.GetUrlListRequest) + return object; + var message = new $root.google.cloud.networksecurity.v1.GetUrlListRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetUrlListRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.networksecurity.v1.GetUrlListRequest + * @static + * @param {google.cloud.networksecurity.v1.GetUrlListRequest} message GetUrlListRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetUrlListRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this GetUrlListRequest to JSON. + * @function toJSON + * @memberof google.cloud.networksecurity.v1.GetUrlListRequest + * @instance + * @returns {Object.} JSON object + */ + GetUrlListRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetUrlListRequest + * @function getTypeUrl + * @memberof google.cloud.networksecurity.v1.GetUrlListRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetUrlListRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.networksecurity.v1.GetUrlListRequest"; + }; + + return GetUrlListRequest; + })(); + + v1.CreateUrlListRequest = (function() { + + /** + * Properties of a CreateUrlListRequest. + * @memberof google.cloud.networksecurity.v1 + * @interface ICreateUrlListRequest + * @property {string|null} [parent] CreateUrlListRequest parent + * @property {string|null} [urlListId] CreateUrlListRequest urlListId + * @property {google.cloud.networksecurity.v1.IUrlList|null} [urlList] CreateUrlListRequest urlList + */ + + /** + * Constructs a new CreateUrlListRequest. + * @memberof google.cloud.networksecurity.v1 + * @classdesc Represents a CreateUrlListRequest. + * @implements ICreateUrlListRequest + * @constructor + * @param {google.cloud.networksecurity.v1.ICreateUrlListRequest=} [properties] Properties to set + */ + function CreateUrlListRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateUrlListRequest parent. + * @member {string} parent + * @memberof google.cloud.networksecurity.v1.CreateUrlListRequest + * @instance + */ + CreateUrlListRequest.prototype.parent = ""; + + /** + * CreateUrlListRequest urlListId. + * @member {string} urlListId + * @memberof google.cloud.networksecurity.v1.CreateUrlListRequest + * @instance + */ + CreateUrlListRequest.prototype.urlListId = ""; + + /** + * CreateUrlListRequest urlList. + * @member {google.cloud.networksecurity.v1.IUrlList|null|undefined} urlList + * @memberof google.cloud.networksecurity.v1.CreateUrlListRequest + * @instance + */ + CreateUrlListRequest.prototype.urlList = null; + + /** + * Creates a new CreateUrlListRequest instance using the specified properties. + * @function create + * @memberof google.cloud.networksecurity.v1.CreateUrlListRequest + * @static + * @param {google.cloud.networksecurity.v1.ICreateUrlListRequest=} [properties] Properties to set + * @returns {google.cloud.networksecurity.v1.CreateUrlListRequest} CreateUrlListRequest instance + */ + CreateUrlListRequest.create = function create(properties) { + return new CreateUrlListRequest(properties); + }; + + /** + * Encodes the specified CreateUrlListRequest message. Does not implicitly {@link google.cloud.networksecurity.v1.CreateUrlListRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.networksecurity.v1.CreateUrlListRequest + * @static + * @param {google.cloud.networksecurity.v1.ICreateUrlListRequest} message CreateUrlListRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateUrlListRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.urlListId != null && Object.hasOwnProperty.call(message, "urlListId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.urlListId); + if (message.urlList != null && Object.hasOwnProperty.call(message, "urlList")) + $root.google.cloud.networksecurity.v1.UrlList.encode(message.urlList, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreateUrlListRequest message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.CreateUrlListRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.networksecurity.v1.CreateUrlListRequest + * @static + * @param {google.cloud.networksecurity.v1.ICreateUrlListRequest} message CreateUrlListRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateUrlListRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateUrlListRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.networksecurity.v1.CreateUrlListRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.networksecurity.v1.CreateUrlListRequest} CreateUrlListRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateUrlListRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networksecurity.v1.CreateUrlListRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.urlListId = reader.string(); + break; + } + case 3: { + message.urlList = $root.google.cloud.networksecurity.v1.UrlList.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateUrlListRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.networksecurity.v1.CreateUrlListRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.networksecurity.v1.CreateUrlListRequest} CreateUrlListRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateUrlListRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateUrlListRequest message. + * @function verify + * @memberof google.cloud.networksecurity.v1.CreateUrlListRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateUrlListRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.urlListId != null && message.hasOwnProperty("urlListId")) + if (!$util.isString(message.urlListId)) + return "urlListId: string expected"; + if (message.urlList != null && message.hasOwnProperty("urlList")) { + var error = $root.google.cloud.networksecurity.v1.UrlList.verify(message.urlList); + if (error) + return "urlList." + error; + } + return null; + }; + + /** + * Creates a CreateUrlListRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.networksecurity.v1.CreateUrlListRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.networksecurity.v1.CreateUrlListRequest} CreateUrlListRequest + */ + CreateUrlListRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networksecurity.v1.CreateUrlListRequest) + return object; + var message = new $root.google.cloud.networksecurity.v1.CreateUrlListRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.urlListId != null) + message.urlListId = String(object.urlListId); + if (object.urlList != null) { + if (typeof object.urlList !== "object") + throw TypeError(".google.cloud.networksecurity.v1.CreateUrlListRequest.urlList: object expected"); + message.urlList = $root.google.cloud.networksecurity.v1.UrlList.fromObject(object.urlList); + } + return message; + }; + + /** + * Creates a plain object from a CreateUrlListRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.networksecurity.v1.CreateUrlListRequest + * @static + * @param {google.cloud.networksecurity.v1.CreateUrlListRequest} message CreateUrlListRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateUrlListRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.urlListId = ""; + object.urlList = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.urlListId != null && message.hasOwnProperty("urlListId")) + object.urlListId = message.urlListId; + if (message.urlList != null && message.hasOwnProperty("urlList")) + object.urlList = $root.google.cloud.networksecurity.v1.UrlList.toObject(message.urlList, options); + return object; + }; + + /** + * Converts this CreateUrlListRequest to JSON. + * @function toJSON + * @memberof google.cloud.networksecurity.v1.CreateUrlListRequest + * @instance + * @returns {Object.} JSON object + */ + CreateUrlListRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateUrlListRequest + * @function getTypeUrl + * @memberof google.cloud.networksecurity.v1.CreateUrlListRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateUrlListRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.networksecurity.v1.CreateUrlListRequest"; + }; + + return CreateUrlListRequest; + })(); + + v1.UpdateUrlListRequest = (function() { + + /** + * Properties of an UpdateUrlListRequest. + * @memberof google.cloud.networksecurity.v1 + * @interface IUpdateUrlListRequest + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateUrlListRequest updateMask + * @property {google.cloud.networksecurity.v1.IUrlList|null} [urlList] UpdateUrlListRequest urlList + */ + + /** + * Constructs a new UpdateUrlListRequest. + * @memberof google.cloud.networksecurity.v1 + * @classdesc Represents an UpdateUrlListRequest. + * @implements IUpdateUrlListRequest + * @constructor + * @param {google.cloud.networksecurity.v1.IUpdateUrlListRequest=} [properties] Properties to set + */ + function UpdateUrlListRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateUrlListRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.networksecurity.v1.UpdateUrlListRequest + * @instance + */ + UpdateUrlListRequest.prototype.updateMask = null; + + /** + * UpdateUrlListRequest urlList. + * @member {google.cloud.networksecurity.v1.IUrlList|null|undefined} urlList + * @memberof google.cloud.networksecurity.v1.UpdateUrlListRequest + * @instance + */ + UpdateUrlListRequest.prototype.urlList = null; + + /** + * Creates a new UpdateUrlListRequest instance using the specified properties. + * @function create + * @memberof google.cloud.networksecurity.v1.UpdateUrlListRequest + * @static + * @param {google.cloud.networksecurity.v1.IUpdateUrlListRequest=} [properties] Properties to set + * @returns {google.cloud.networksecurity.v1.UpdateUrlListRequest} UpdateUrlListRequest instance + */ + UpdateUrlListRequest.create = function create(properties) { + return new UpdateUrlListRequest(properties); + }; + + /** + * Encodes the specified UpdateUrlListRequest message. Does not implicitly {@link google.cloud.networksecurity.v1.UpdateUrlListRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.networksecurity.v1.UpdateUrlListRequest + * @static + * @param {google.cloud.networksecurity.v1.IUpdateUrlListRequest} message UpdateUrlListRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateUrlListRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.urlList != null && Object.hasOwnProperty.call(message, "urlList")) + $root.google.cloud.networksecurity.v1.UrlList.encode(message.urlList, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified UpdateUrlListRequest message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.UpdateUrlListRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.networksecurity.v1.UpdateUrlListRequest + * @static + * @param {google.cloud.networksecurity.v1.IUpdateUrlListRequest} message UpdateUrlListRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateUrlListRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateUrlListRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.networksecurity.v1.UpdateUrlListRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.networksecurity.v1.UpdateUrlListRequest} UpdateUrlListRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateUrlListRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networksecurity.v1.UpdateUrlListRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + case 2: { + message.urlList = $root.google.cloud.networksecurity.v1.UrlList.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateUrlListRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.networksecurity.v1.UpdateUrlListRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.networksecurity.v1.UpdateUrlListRequest} UpdateUrlListRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateUrlListRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateUrlListRequest message. + * @function verify + * @memberof google.cloud.networksecurity.v1.UpdateUrlListRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateUrlListRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + if (message.urlList != null && message.hasOwnProperty("urlList")) { + var error = $root.google.cloud.networksecurity.v1.UrlList.verify(message.urlList); + if (error) + return "urlList." + error; + } + return null; + }; + + /** + * Creates an UpdateUrlListRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.networksecurity.v1.UpdateUrlListRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.networksecurity.v1.UpdateUrlListRequest} UpdateUrlListRequest + */ + UpdateUrlListRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networksecurity.v1.UpdateUrlListRequest) + return object; + var message = new $root.google.cloud.networksecurity.v1.UpdateUrlListRequest(); + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.networksecurity.v1.UpdateUrlListRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + if (object.urlList != null) { + if (typeof object.urlList !== "object") + throw TypeError(".google.cloud.networksecurity.v1.UpdateUrlListRequest.urlList: object expected"); + message.urlList = $root.google.cloud.networksecurity.v1.UrlList.fromObject(object.urlList); + } + return message; + }; + + /** + * Creates a plain object from an UpdateUrlListRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.networksecurity.v1.UpdateUrlListRequest + * @static + * @param {google.cloud.networksecurity.v1.UpdateUrlListRequest} message UpdateUrlListRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateUrlListRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.updateMask = null; + object.urlList = null; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + if (message.urlList != null && message.hasOwnProperty("urlList")) + object.urlList = $root.google.cloud.networksecurity.v1.UrlList.toObject(message.urlList, options); + return object; + }; + + /** + * Converts this UpdateUrlListRequest to JSON. + * @function toJSON + * @memberof google.cloud.networksecurity.v1.UpdateUrlListRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateUrlListRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateUrlListRequest + * @function getTypeUrl + * @memberof google.cloud.networksecurity.v1.UpdateUrlListRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateUrlListRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.networksecurity.v1.UpdateUrlListRequest"; + }; + + return UpdateUrlListRequest; + })(); + + v1.DeleteUrlListRequest = (function() { + + /** + * Properties of a DeleteUrlListRequest. + * @memberof google.cloud.networksecurity.v1 + * @interface IDeleteUrlListRequest + * @property {string|null} [name] DeleteUrlListRequest name + */ + + /** + * Constructs a new DeleteUrlListRequest. + * @memberof google.cloud.networksecurity.v1 + * @classdesc Represents a DeleteUrlListRequest. + * @implements IDeleteUrlListRequest + * @constructor + * @param {google.cloud.networksecurity.v1.IDeleteUrlListRequest=} [properties] Properties to set + */ + function DeleteUrlListRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteUrlListRequest name. + * @member {string} name + * @memberof google.cloud.networksecurity.v1.DeleteUrlListRequest + * @instance + */ + DeleteUrlListRequest.prototype.name = ""; + + /** + * Creates a new DeleteUrlListRequest instance using the specified properties. + * @function create + * @memberof google.cloud.networksecurity.v1.DeleteUrlListRequest + * @static + * @param {google.cloud.networksecurity.v1.IDeleteUrlListRequest=} [properties] Properties to set + * @returns {google.cloud.networksecurity.v1.DeleteUrlListRequest} DeleteUrlListRequest instance + */ + DeleteUrlListRequest.create = function create(properties) { + return new DeleteUrlListRequest(properties); + }; + + /** + * Encodes the specified DeleteUrlListRequest message. Does not implicitly {@link google.cloud.networksecurity.v1.DeleteUrlListRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.networksecurity.v1.DeleteUrlListRequest + * @static + * @param {google.cloud.networksecurity.v1.IDeleteUrlListRequest} message DeleteUrlListRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteUrlListRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified DeleteUrlListRequest message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.DeleteUrlListRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.networksecurity.v1.DeleteUrlListRequest + * @static + * @param {google.cloud.networksecurity.v1.IDeleteUrlListRequest} message DeleteUrlListRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteUrlListRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteUrlListRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.networksecurity.v1.DeleteUrlListRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.networksecurity.v1.DeleteUrlListRequest} DeleteUrlListRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteUrlListRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networksecurity.v1.DeleteUrlListRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteUrlListRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.networksecurity.v1.DeleteUrlListRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.networksecurity.v1.DeleteUrlListRequest} DeleteUrlListRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteUrlListRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteUrlListRequest message. + * @function verify + * @memberof google.cloud.networksecurity.v1.DeleteUrlListRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteUrlListRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a DeleteUrlListRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.networksecurity.v1.DeleteUrlListRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.networksecurity.v1.DeleteUrlListRequest} DeleteUrlListRequest + */ + DeleteUrlListRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networksecurity.v1.DeleteUrlListRequest) + return object; + var message = new $root.google.cloud.networksecurity.v1.DeleteUrlListRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a DeleteUrlListRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.networksecurity.v1.DeleteUrlListRequest + * @static + * @param {google.cloud.networksecurity.v1.DeleteUrlListRequest} message DeleteUrlListRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteUrlListRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this DeleteUrlListRequest to JSON. + * @function toJSON + * @memberof google.cloud.networksecurity.v1.DeleteUrlListRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteUrlListRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteUrlListRequest + * @function getTypeUrl + * @memberof google.cloud.networksecurity.v1.DeleteUrlListRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteUrlListRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.networksecurity.v1.DeleteUrlListRequest"; + }; + + return DeleteUrlListRequest; + })(); + + v1.SecurityProfileGroup = (function() { + + /** + * Properties of a SecurityProfileGroup. + * @memberof google.cloud.networksecurity.v1 + * @interface ISecurityProfileGroup + * @property {string|null} [name] SecurityProfileGroup name + * @property {string|null} [description] SecurityProfileGroup description + * @property {google.protobuf.ITimestamp|null} [createTime] SecurityProfileGroup createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] SecurityProfileGroup updateTime + * @property {string|null} [etag] SecurityProfileGroup etag + * @property {number|Long|null} [dataPathId] SecurityProfileGroup dataPathId + * @property {Object.|null} [labels] SecurityProfileGroup labels + * @property {string|null} [threatPreventionProfile] SecurityProfileGroup threatPreventionProfile + * @property {string|null} [customMirroringProfile] SecurityProfileGroup customMirroringProfile + * @property {string|null} [customInterceptProfile] SecurityProfileGroup customInterceptProfile + * @property {string|null} [urlFilteringProfile] SecurityProfileGroup urlFilteringProfile + */ + + /** + * Constructs a new SecurityProfileGroup. + * @memberof google.cloud.networksecurity.v1 + * @classdesc Represents a SecurityProfileGroup. + * @implements ISecurityProfileGroup + * @constructor + * @param {google.cloud.networksecurity.v1.ISecurityProfileGroup=} [properties] Properties to set + */ + function SecurityProfileGroup(properties) { + this.labels = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SecurityProfileGroup name. + * @member {string} name + * @memberof google.cloud.networksecurity.v1.SecurityProfileGroup + * @instance + */ + SecurityProfileGroup.prototype.name = ""; + + /** + * SecurityProfileGroup description. + * @member {string} description + * @memberof google.cloud.networksecurity.v1.SecurityProfileGroup + * @instance + */ + SecurityProfileGroup.prototype.description = ""; + + /** + * SecurityProfileGroup createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.networksecurity.v1.SecurityProfileGroup + * @instance + */ + SecurityProfileGroup.prototype.createTime = null; + + /** + * SecurityProfileGroup updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.networksecurity.v1.SecurityProfileGroup + * @instance + */ + SecurityProfileGroup.prototype.updateTime = null; + + /** + * SecurityProfileGroup etag. + * @member {string} etag + * @memberof google.cloud.networksecurity.v1.SecurityProfileGroup + * @instance + */ + SecurityProfileGroup.prototype.etag = ""; + + /** + * SecurityProfileGroup dataPathId. + * @member {number|Long} dataPathId + * @memberof google.cloud.networksecurity.v1.SecurityProfileGroup + * @instance + */ + SecurityProfileGroup.prototype.dataPathId = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * SecurityProfileGroup labels. + * @member {Object.} labels + * @memberof google.cloud.networksecurity.v1.SecurityProfileGroup + * @instance + */ + SecurityProfileGroup.prototype.labels = $util.emptyObject; + + /** + * SecurityProfileGroup threatPreventionProfile. + * @member {string} threatPreventionProfile + * @memberof google.cloud.networksecurity.v1.SecurityProfileGroup + * @instance + */ + SecurityProfileGroup.prototype.threatPreventionProfile = ""; + + /** + * SecurityProfileGroup customMirroringProfile. + * @member {string} customMirroringProfile + * @memberof google.cloud.networksecurity.v1.SecurityProfileGroup + * @instance + */ + SecurityProfileGroup.prototype.customMirroringProfile = ""; + + /** + * SecurityProfileGroup customInterceptProfile. + * @member {string} customInterceptProfile + * @memberof google.cloud.networksecurity.v1.SecurityProfileGroup + * @instance + */ + SecurityProfileGroup.prototype.customInterceptProfile = ""; + + /** + * SecurityProfileGroup urlFilteringProfile. + * @member {string} urlFilteringProfile + * @memberof google.cloud.networksecurity.v1.SecurityProfileGroup + * @instance + */ + SecurityProfileGroup.prototype.urlFilteringProfile = ""; + + /** + * Creates a new SecurityProfileGroup instance using the specified properties. + * @function create + * @memberof google.cloud.networksecurity.v1.SecurityProfileGroup + * @static + * @param {google.cloud.networksecurity.v1.ISecurityProfileGroup=} [properties] Properties to set + * @returns {google.cloud.networksecurity.v1.SecurityProfileGroup} SecurityProfileGroup instance + */ + SecurityProfileGroup.create = function create(properties) { + return new SecurityProfileGroup(properties); + }; + + /** + * Encodes the specified SecurityProfileGroup message. Does not implicitly {@link google.cloud.networksecurity.v1.SecurityProfileGroup.verify|verify} messages. + * @function encode + * @memberof google.cloud.networksecurity.v1.SecurityProfileGroup + * @static + * @param {google.cloud.networksecurity.v1.ISecurityProfileGroup} message SecurityProfileGroup message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SecurityProfileGroup.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.description); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.etag); + if (message.threatPreventionProfile != null && Object.hasOwnProperty.call(message, "threatPreventionProfile")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.threatPreventionProfile); + if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) + for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) + writer.uint32(/* id 7, wireType 2 =*/58).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); + if (message.customMirroringProfile != null && Object.hasOwnProperty.call(message, "customMirroringProfile")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.customMirroringProfile); + if (message.customInterceptProfile != null && Object.hasOwnProperty.call(message, "customInterceptProfile")) + writer.uint32(/* id 9, wireType 2 =*/74).string(message.customInterceptProfile); + if (message.urlFilteringProfile != null && Object.hasOwnProperty.call(message, "urlFilteringProfile")) + writer.uint32(/* id 11, wireType 2 =*/90).string(message.urlFilteringProfile); + if (message.dataPathId != null && Object.hasOwnProperty.call(message, "dataPathId")) + writer.uint32(/* id 12, wireType 0 =*/96).uint64(message.dataPathId); + return writer; + }; + + /** + * Encodes the specified SecurityProfileGroup message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.SecurityProfileGroup.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.networksecurity.v1.SecurityProfileGroup + * @static + * @param {google.cloud.networksecurity.v1.ISecurityProfileGroup} message SecurityProfileGroup message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SecurityProfileGroup.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SecurityProfileGroup message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.networksecurity.v1.SecurityProfileGroup + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.networksecurity.v1.SecurityProfileGroup} SecurityProfileGroup + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SecurityProfileGroup.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networksecurity.v1.SecurityProfileGroup(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.description = reader.string(); + break; + } + case 3: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 4: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 5: { + message.etag = reader.string(); + break; + } + case 12: { + message.dataPathId = reader.uint64(); + break; + } + case 7: { + if (message.labels === $util.emptyObject) + message.labels = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.labels[key] = value; + break; + } + case 6: { + message.threatPreventionProfile = reader.string(); + break; + } + case 8: { + message.customMirroringProfile = reader.string(); + break; + } + case 9: { + message.customInterceptProfile = reader.string(); + break; + } + case 11: { + message.urlFilteringProfile = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SecurityProfileGroup message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.networksecurity.v1.SecurityProfileGroup + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.networksecurity.v1.SecurityProfileGroup} SecurityProfileGroup + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SecurityProfileGroup.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SecurityProfileGroup message. + * @function verify + * @memberof google.cloud.networksecurity.v1.SecurityProfileGroup + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SecurityProfileGroup.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime); + if (error) + return "updateTime." + error; + } + if (message.etag != null && message.hasOwnProperty("etag")) + if (!$util.isString(message.etag)) + return "etag: string expected"; + if (message.dataPathId != null && message.hasOwnProperty("dataPathId")) + if (!$util.isInteger(message.dataPathId) && !(message.dataPathId && $util.isInteger(message.dataPathId.low) && $util.isInteger(message.dataPathId.high))) + return "dataPathId: integer|Long expected"; + if (message.labels != null && message.hasOwnProperty("labels")) { + if (!$util.isObject(message.labels)) + return "labels: object expected"; + var key = Object.keys(message.labels); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.labels[key[i]])) + return "labels: string{k:string} expected"; + } + if (message.threatPreventionProfile != null && message.hasOwnProperty("threatPreventionProfile")) + if (!$util.isString(message.threatPreventionProfile)) + return "threatPreventionProfile: string expected"; + if (message.customMirroringProfile != null && message.hasOwnProperty("customMirroringProfile")) + if (!$util.isString(message.customMirroringProfile)) + return "customMirroringProfile: string expected"; + if (message.customInterceptProfile != null && message.hasOwnProperty("customInterceptProfile")) + if (!$util.isString(message.customInterceptProfile)) + return "customInterceptProfile: string expected"; + if (message.urlFilteringProfile != null && message.hasOwnProperty("urlFilteringProfile")) + if (!$util.isString(message.urlFilteringProfile)) + return "urlFilteringProfile: string expected"; + return null; + }; + + /** + * Creates a SecurityProfileGroup message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.networksecurity.v1.SecurityProfileGroup + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.networksecurity.v1.SecurityProfileGroup} SecurityProfileGroup + */ + SecurityProfileGroup.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networksecurity.v1.SecurityProfileGroup) + return object; + var message = new $root.google.cloud.networksecurity.v1.SecurityProfileGroup(); + if (object.name != null) + message.name = String(object.name); + if (object.description != null) + message.description = String(object.description); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.networksecurity.v1.SecurityProfileGroup.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.updateTime != null) { + if (typeof object.updateTime !== "object") + throw TypeError(".google.cloud.networksecurity.v1.SecurityProfileGroup.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + if (object.etag != null) + message.etag = String(object.etag); + if (object.dataPathId != null) + if ($util.Long) + (message.dataPathId = $util.Long.fromValue(object.dataPathId)).unsigned = true; + else if (typeof object.dataPathId === "string") + message.dataPathId = parseInt(object.dataPathId, 10); + else if (typeof object.dataPathId === "number") + message.dataPathId = object.dataPathId; + else if (typeof object.dataPathId === "object") + message.dataPathId = new $util.LongBits(object.dataPathId.low >>> 0, object.dataPathId.high >>> 0).toNumber(true); + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.cloud.networksecurity.v1.SecurityProfileGroup.labels: object expected"); + message.labels = {}; + for (var keys = Object.keys(object.labels), i = 0; i < keys.length; ++i) + message.labels[keys[i]] = String(object.labels[keys[i]]); + } + if (object.threatPreventionProfile != null) + message.threatPreventionProfile = String(object.threatPreventionProfile); + if (object.customMirroringProfile != null) + message.customMirroringProfile = String(object.customMirroringProfile); + if (object.customInterceptProfile != null) + message.customInterceptProfile = String(object.customInterceptProfile); + if (object.urlFilteringProfile != null) + message.urlFilteringProfile = String(object.urlFilteringProfile); + return message; + }; + + /** + * Creates a plain object from a SecurityProfileGroup message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.networksecurity.v1.SecurityProfileGroup + * @static + * @param {google.cloud.networksecurity.v1.SecurityProfileGroup} message SecurityProfileGroup + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SecurityProfileGroup.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.labels = {}; + if (options.defaults) { + object.name = ""; + object.description = ""; + object.createTime = null; + object.updateTime = null; + object.etag = ""; + object.threatPreventionProfile = ""; + object.customMirroringProfile = ""; + object.customInterceptProfile = ""; + object.urlFilteringProfile = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.dataPathId = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.dataPathId = options.longs === String ? "0" : 0; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.updateTime != null && message.hasOwnProperty("updateTime")) + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); + if (message.etag != null && message.hasOwnProperty("etag")) + object.etag = message.etag; + if (message.threatPreventionProfile != null && message.hasOwnProperty("threatPreventionProfile")) + object.threatPreventionProfile = message.threatPreventionProfile; + var keys2; + if (message.labels && (keys2 = Object.keys(message.labels)).length) { + object.labels = {}; + for (var j = 0; j < keys2.length; ++j) + object.labels[keys2[j]] = message.labels[keys2[j]]; + } + if (message.customMirroringProfile != null && message.hasOwnProperty("customMirroringProfile")) + object.customMirroringProfile = message.customMirroringProfile; + if (message.customInterceptProfile != null && message.hasOwnProperty("customInterceptProfile")) + object.customInterceptProfile = message.customInterceptProfile; + if (message.urlFilteringProfile != null && message.hasOwnProperty("urlFilteringProfile")) + object.urlFilteringProfile = message.urlFilteringProfile; + if (message.dataPathId != null && message.hasOwnProperty("dataPathId")) + if (typeof message.dataPathId === "number") + object.dataPathId = options.longs === String ? String(message.dataPathId) : message.dataPathId; + else + object.dataPathId = options.longs === String ? $util.Long.prototype.toString.call(message.dataPathId) : options.longs === Number ? new $util.LongBits(message.dataPathId.low >>> 0, message.dataPathId.high >>> 0).toNumber(true) : message.dataPathId; + return object; + }; + + /** + * Converts this SecurityProfileGroup to JSON. + * @function toJSON + * @memberof google.cloud.networksecurity.v1.SecurityProfileGroup + * @instance + * @returns {Object.} JSON object + */ + SecurityProfileGroup.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SecurityProfileGroup + * @function getTypeUrl + * @memberof google.cloud.networksecurity.v1.SecurityProfileGroup + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SecurityProfileGroup.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.networksecurity.v1.SecurityProfileGroup"; + }; + + return SecurityProfileGroup; + })(); + + v1.SecurityProfile = (function() { + + /** + * Properties of a SecurityProfile. + * @memberof google.cloud.networksecurity.v1 + * @interface ISecurityProfile + * @property {google.cloud.networksecurity.v1.IThreatPreventionProfile|null} [threatPreventionProfile] SecurityProfile threatPreventionProfile + * @property {google.cloud.networksecurity.v1.ICustomMirroringProfile|null} [customMirroringProfile] SecurityProfile customMirroringProfile + * @property {google.cloud.networksecurity.v1.ICustomInterceptProfile|null} [customInterceptProfile] SecurityProfile customInterceptProfile + * @property {google.cloud.networksecurity.v1.IUrlFilteringProfile|null} [urlFilteringProfile] SecurityProfile urlFilteringProfile + * @property {string|null} [name] SecurityProfile name + * @property {string|null} [description] SecurityProfile description + * @property {google.protobuf.ITimestamp|null} [createTime] SecurityProfile createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] SecurityProfile updateTime + * @property {string|null} [etag] SecurityProfile etag + * @property {Object.|null} [labels] SecurityProfile labels + * @property {google.cloud.networksecurity.v1.SecurityProfile.ProfileType|null} [type] SecurityProfile type + */ + + /** + * Constructs a new SecurityProfile. + * @memberof google.cloud.networksecurity.v1 + * @classdesc Represents a SecurityProfile. + * @implements ISecurityProfile + * @constructor + * @param {google.cloud.networksecurity.v1.ISecurityProfile=} [properties] Properties to set + */ + function SecurityProfile(properties) { + this.labels = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SecurityProfile threatPreventionProfile. + * @member {google.cloud.networksecurity.v1.IThreatPreventionProfile|null|undefined} threatPreventionProfile + * @memberof google.cloud.networksecurity.v1.SecurityProfile + * @instance + */ + SecurityProfile.prototype.threatPreventionProfile = null; + + /** + * SecurityProfile customMirroringProfile. + * @member {google.cloud.networksecurity.v1.ICustomMirroringProfile|null|undefined} customMirroringProfile + * @memberof google.cloud.networksecurity.v1.SecurityProfile + * @instance + */ + SecurityProfile.prototype.customMirroringProfile = null; + + /** + * SecurityProfile customInterceptProfile. + * @member {google.cloud.networksecurity.v1.ICustomInterceptProfile|null|undefined} customInterceptProfile + * @memberof google.cloud.networksecurity.v1.SecurityProfile + * @instance + */ + SecurityProfile.prototype.customInterceptProfile = null; + + /** + * SecurityProfile urlFilteringProfile. + * @member {google.cloud.networksecurity.v1.IUrlFilteringProfile|null|undefined} urlFilteringProfile + * @memberof google.cloud.networksecurity.v1.SecurityProfile + * @instance + */ + SecurityProfile.prototype.urlFilteringProfile = null; + + /** + * SecurityProfile name. + * @member {string} name + * @memberof google.cloud.networksecurity.v1.SecurityProfile + * @instance + */ + SecurityProfile.prototype.name = ""; + + /** + * SecurityProfile description. + * @member {string} description + * @memberof google.cloud.networksecurity.v1.SecurityProfile + * @instance + */ + SecurityProfile.prototype.description = ""; + + /** + * SecurityProfile createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.networksecurity.v1.SecurityProfile + * @instance + */ + SecurityProfile.prototype.createTime = null; + + /** + * SecurityProfile updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.networksecurity.v1.SecurityProfile + * @instance + */ + SecurityProfile.prototype.updateTime = null; + + /** + * SecurityProfile etag. + * @member {string} etag + * @memberof google.cloud.networksecurity.v1.SecurityProfile + * @instance + */ + SecurityProfile.prototype.etag = ""; + + /** + * SecurityProfile labels. + * @member {Object.} labels + * @memberof google.cloud.networksecurity.v1.SecurityProfile + * @instance + */ + SecurityProfile.prototype.labels = $util.emptyObject; + + /** + * SecurityProfile type. + * @member {google.cloud.networksecurity.v1.SecurityProfile.ProfileType} type + * @memberof google.cloud.networksecurity.v1.SecurityProfile + * @instance + */ + SecurityProfile.prototype.type = 0; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * SecurityProfile profile. + * @member {"threatPreventionProfile"|"customMirroringProfile"|"customInterceptProfile"|"urlFilteringProfile"|undefined} profile + * @memberof google.cloud.networksecurity.v1.SecurityProfile + * @instance + */ + Object.defineProperty(SecurityProfile.prototype, "profile", { + get: $util.oneOfGetter($oneOfFields = ["threatPreventionProfile", "customMirroringProfile", "customInterceptProfile", "urlFilteringProfile"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new SecurityProfile instance using the specified properties. + * @function create + * @memberof google.cloud.networksecurity.v1.SecurityProfile + * @static + * @param {google.cloud.networksecurity.v1.ISecurityProfile=} [properties] Properties to set + * @returns {google.cloud.networksecurity.v1.SecurityProfile} SecurityProfile instance + */ + SecurityProfile.create = function create(properties) { + return new SecurityProfile(properties); + }; + + /** + * Encodes the specified SecurityProfile message. Does not implicitly {@link google.cloud.networksecurity.v1.SecurityProfile.verify|verify} messages. + * @function encode + * @memberof google.cloud.networksecurity.v1.SecurityProfile + * @static + * @param {google.cloud.networksecurity.v1.ISecurityProfile} message SecurityProfile message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SecurityProfile.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.description); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.etag); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.type); + if (message.threatPreventionProfile != null && Object.hasOwnProperty.call(message, "threatPreventionProfile")) + $root.google.cloud.networksecurity.v1.ThreatPreventionProfile.encode(message.threatPreventionProfile, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) + for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) + writer.uint32(/* id 8, wireType 2 =*/66).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); + if (message.customMirroringProfile != null && Object.hasOwnProperty.call(message, "customMirroringProfile")) + $root.google.cloud.networksecurity.v1.CustomMirroringProfile.encode(message.customMirroringProfile, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.customInterceptProfile != null && Object.hasOwnProperty.call(message, "customInterceptProfile")) + $root.google.cloud.networksecurity.v1.CustomInterceptProfile.encode(message.customInterceptProfile, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + if (message.urlFilteringProfile != null && Object.hasOwnProperty.call(message, "urlFilteringProfile")) + $root.google.cloud.networksecurity.v1.UrlFilteringProfile.encode(message.urlFilteringProfile, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SecurityProfile message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.SecurityProfile.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.networksecurity.v1.SecurityProfile + * @static + * @param {google.cloud.networksecurity.v1.ISecurityProfile} message SecurityProfile message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SecurityProfile.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SecurityProfile message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.networksecurity.v1.SecurityProfile + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.networksecurity.v1.SecurityProfile} SecurityProfile + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SecurityProfile.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networksecurity.v1.SecurityProfile(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 7: { + message.threatPreventionProfile = $root.google.cloud.networksecurity.v1.ThreatPreventionProfile.decode(reader, reader.uint32()); + break; + } + case 9: { + message.customMirroringProfile = $root.google.cloud.networksecurity.v1.CustomMirroringProfile.decode(reader, reader.uint32()); + break; + } + case 10: { + message.customInterceptProfile = $root.google.cloud.networksecurity.v1.CustomInterceptProfile.decode(reader, reader.uint32()); + break; + } + case 12: { + message.urlFilteringProfile = $root.google.cloud.networksecurity.v1.UrlFilteringProfile.decode(reader, reader.uint32()); + break; + } + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.description = reader.string(); + break; + } + case 3: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 4: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 5: { + message.etag = reader.string(); + break; + } + case 8: { + if (message.labels === $util.emptyObject) + message.labels = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.labels[key] = value; + break; + } + case 6: { + message.type = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SecurityProfile message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.networksecurity.v1.SecurityProfile + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.networksecurity.v1.SecurityProfile} SecurityProfile + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SecurityProfile.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SecurityProfile message. + * @function verify + * @memberof google.cloud.networksecurity.v1.SecurityProfile + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SecurityProfile.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.threatPreventionProfile != null && message.hasOwnProperty("threatPreventionProfile")) { + properties.profile = 1; + { + var error = $root.google.cloud.networksecurity.v1.ThreatPreventionProfile.verify(message.threatPreventionProfile); + if (error) + return "threatPreventionProfile." + error; + } + } + if (message.customMirroringProfile != null && message.hasOwnProperty("customMirroringProfile")) { + if (properties.profile === 1) + return "profile: multiple values"; + properties.profile = 1; + { + var error = $root.google.cloud.networksecurity.v1.CustomMirroringProfile.verify(message.customMirroringProfile); + if (error) + return "customMirroringProfile." + error; + } + } + if (message.customInterceptProfile != null && message.hasOwnProperty("customInterceptProfile")) { + if (properties.profile === 1) + return "profile: multiple values"; + properties.profile = 1; + { + var error = $root.google.cloud.networksecurity.v1.CustomInterceptProfile.verify(message.customInterceptProfile); + if (error) + return "customInterceptProfile." + error; + } + } + if (message.urlFilteringProfile != null && message.hasOwnProperty("urlFilteringProfile")) { + if (properties.profile === 1) + return "profile: multiple values"; + properties.profile = 1; + { + var error = $root.google.cloud.networksecurity.v1.UrlFilteringProfile.verify(message.urlFilteringProfile); + if (error) + return "urlFilteringProfile." + error; + } + } + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime); + if (error) + return "updateTime." + error; + } + if (message.etag != null && message.hasOwnProperty("etag")) + if (!$util.isString(message.etag)) + return "etag: string expected"; + if (message.labels != null && message.hasOwnProperty("labels")) { + if (!$util.isObject(message.labels)) + return "labels: object expected"; + var key = Object.keys(message.labels); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.labels[key[i]])) + return "labels: string{k:string} expected"; + } + if (message.type != null && message.hasOwnProperty("type")) + switch (message.type) { + default: + return "type: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 5: + break; + } + return null; + }; + + /** + * Creates a SecurityProfile message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.networksecurity.v1.SecurityProfile + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.networksecurity.v1.SecurityProfile} SecurityProfile + */ + SecurityProfile.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networksecurity.v1.SecurityProfile) + return object; + var message = new $root.google.cloud.networksecurity.v1.SecurityProfile(); + if (object.threatPreventionProfile != null) { + if (typeof object.threatPreventionProfile !== "object") + throw TypeError(".google.cloud.networksecurity.v1.SecurityProfile.threatPreventionProfile: object expected"); + message.threatPreventionProfile = $root.google.cloud.networksecurity.v1.ThreatPreventionProfile.fromObject(object.threatPreventionProfile); + } + if (object.customMirroringProfile != null) { + if (typeof object.customMirroringProfile !== "object") + throw TypeError(".google.cloud.networksecurity.v1.SecurityProfile.customMirroringProfile: object expected"); + message.customMirroringProfile = $root.google.cloud.networksecurity.v1.CustomMirroringProfile.fromObject(object.customMirroringProfile); + } + if (object.customInterceptProfile != null) { + if (typeof object.customInterceptProfile !== "object") + throw TypeError(".google.cloud.networksecurity.v1.SecurityProfile.customInterceptProfile: object expected"); + message.customInterceptProfile = $root.google.cloud.networksecurity.v1.CustomInterceptProfile.fromObject(object.customInterceptProfile); + } + if (object.urlFilteringProfile != null) { + if (typeof object.urlFilteringProfile !== "object") + throw TypeError(".google.cloud.networksecurity.v1.SecurityProfile.urlFilteringProfile: object expected"); + message.urlFilteringProfile = $root.google.cloud.networksecurity.v1.UrlFilteringProfile.fromObject(object.urlFilteringProfile); + } + if (object.name != null) + message.name = String(object.name); + if (object.description != null) + message.description = String(object.description); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.networksecurity.v1.SecurityProfile.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.updateTime != null) { + if (typeof object.updateTime !== "object") + throw TypeError(".google.cloud.networksecurity.v1.SecurityProfile.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + if (object.etag != null) + message.etag = String(object.etag); + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.cloud.networksecurity.v1.SecurityProfile.labels: object expected"); + message.labels = {}; + for (var keys = Object.keys(object.labels), i = 0; i < keys.length; ++i) + message.labels[keys[i]] = String(object.labels[keys[i]]); + } + switch (object.type) { + default: + if (typeof object.type === "number") { + message.type = object.type; + break; + } + break; + case "PROFILE_TYPE_UNSPECIFIED": + case 0: + message.type = 0; + break; + case "THREAT_PREVENTION": + case 1: + message.type = 1; + break; + case "CUSTOM_MIRRORING": + case 2: + message.type = 2; + break; + case "CUSTOM_INTERCEPT": + case 3: + message.type = 3; + break; + case "URL_FILTERING": + case 5: + message.type = 5; + break; + } + return message; + }; + + /** + * Creates a plain object from a SecurityProfile message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.networksecurity.v1.SecurityProfile + * @static + * @param {google.cloud.networksecurity.v1.SecurityProfile} message SecurityProfile + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SecurityProfile.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.labels = {}; + if (options.defaults) { + object.name = ""; + object.description = ""; + object.createTime = null; + object.updateTime = null; + object.etag = ""; + object.type = options.enums === String ? "PROFILE_TYPE_UNSPECIFIED" : 0; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.updateTime != null && message.hasOwnProperty("updateTime")) + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); + if (message.etag != null && message.hasOwnProperty("etag")) + object.etag = message.etag; + if (message.type != null && message.hasOwnProperty("type")) + object.type = options.enums === String ? $root.google.cloud.networksecurity.v1.SecurityProfile.ProfileType[message.type] === undefined ? message.type : $root.google.cloud.networksecurity.v1.SecurityProfile.ProfileType[message.type] : message.type; + if (message.threatPreventionProfile != null && message.hasOwnProperty("threatPreventionProfile")) { + object.threatPreventionProfile = $root.google.cloud.networksecurity.v1.ThreatPreventionProfile.toObject(message.threatPreventionProfile, options); + if (options.oneofs) + object.profile = "threatPreventionProfile"; + } + var keys2; + if (message.labels && (keys2 = Object.keys(message.labels)).length) { + object.labels = {}; + for (var j = 0; j < keys2.length; ++j) + object.labels[keys2[j]] = message.labels[keys2[j]]; + } + if (message.customMirroringProfile != null && message.hasOwnProperty("customMirroringProfile")) { + object.customMirroringProfile = $root.google.cloud.networksecurity.v1.CustomMirroringProfile.toObject(message.customMirroringProfile, options); + if (options.oneofs) + object.profile = "customMirroringProfile"; + } + if (message.customInterceptProfile != null && message.hasOwnProperty("customInterceptProfile")) { + object.customInterceptProfile = $root.google.cloud.networksecurity.v1.CustomInterceptProfile.toObject(message.customInterceptProfile, options); + if (options.oneofs) + object.profile = "customInterceptProfile"; + } + if (message.urlFilteringProfile != null && message.hasOwnProperty("urlFilteringProfile")) { + object.urlFilteringProfile = $root.google.cloud.networksecurity.v1.UrlFilteringProfile.toObject(message.urlFilteringProfile, options); + if (options.oneofs) + object.profile = "urlFilteringProfile"; + } + return object; + }; + + /** + * Converts this SecurityProfile to JSON. + * @function toJSON + * @memberof google.cloud.networksecurity.v1.SecurityProfile + * @instance + * @returns {Object.} JSON object + */ + SecurityProfile.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SecurityProfile + * @function getTypeUrl + * @memberof google.cloud.networksecurity.v1.SecurityProfile + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SecurityProfile.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.networksecurity.v1.SecurityProfile"; + }; + + /** + * ProfileType enum. + * @name google.cloud.networksecurity.v1.SecurityProfile.ProfileType + * @enum {number} + * @property {number} PROFILE_TYPE_UNSPECIFIED=0 PROFILE_TYPE_UNSPECIFIED value + * @property {number} THREAT_PREVENTION=1 THREAT_PREVENTION value + * @property {number} CUSTOM_MIRRORING=2 CUSTOM_MIRRORING value + * @property {number} CUSTOM_INTERCEPT=3 CUSTOM_INTERCEPT value + * @property {number} URL_FILTERING=5 URL_FILTERING value + */ + SecurityProfile.ProfileType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "PROFILE_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "THREAT_PREVENTION"] = 1; + values[valuesById[2] = "CUSTOM_MIRRORING"] = 2; + values[valuesById[3] = "CUSTOM_INTERCEPT"] = 3; + values[valuesById[5] = "URL_FILTERING"] = 5; + return values; + })(); + + return SecurityProfile; + })(); + + v1.CustomInterceptProfile = (function() { + + /** + * Properties of a CustomInterceptProfile. + * @memberof google.cloud.networksecurity.v1 + * @interface ICustomInterceptProfile + * @property {string|null} [interceptEndpointGroup] CustomInterceptProfile interceptEndpointGroup + */ + + /** + * Constructs a new CustomInterceptProfile. + * @memberof google.cloud.networksecurity.v1 + * @classdesc Represents a CustomInterceptProfile. + * @implements ICustomInterceptProfile + * @constructor + * @param {google.cloud.networksecurity.v1.ICustomInterceptProfile=} [properties] Properties to set + */ + function CustomInterceptProfile(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CustomInterceptProfile interceptEndpointGroup. + * @member {string} interceptEndpointGroup + * @memberof google.cloud.networksecurity.v1.CustomInterceptProfile + * @instance + */ + CustomInterceptProfile.prototype.interceptEndpointGroup = ""; + + /** + * Creates a new CustomInterceptProfile instance using the specified properties. + * @function create + * @memberof google.cloud.networksecurity.v1.CustomInterceptProfile + * @static + * @param {google.cloud.networksecurity.v1.ICustomInterceptProfile=} [properties] Properties to set + * @returns {google.cloud.networksecurity.v1.CustomInterceptProfile} CustomInterceptProfile instance + */ + CustomInterceptProfile.create = function create(properties) { + return new CustomInterceptProfile(properties); + }; + + /** + * Encodes the specified CustomInterceptProfile message. Does not implicitly {@link google.cloud.networksecurity.v1.CustomInterceptProfile.verify|verify} messages. + * @function encode + * @memberof google.cloud.networksecurity.v1.CustomInterceptProfile + * @static + * @param {google.cloud.networksecurity.v1.ICustomInterceptProfile} message CustomInterceptProfile message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomInterceptProfile.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.interceptEndpointGroup != null && Object.hasOwnProperty.call(message, "interceptEndpointGroup")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.interceptEndpointGroup); + return writer; + }; + + /** + * Encodes the specified CustomInterceptProfile message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.CustomInterceptProfile.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.networksecurity.v1.CustomInterceptProfile + * @static + * @param {google.cloud.networksecurity.v1.ICustomInterceptProfile} message CustomInterceptProfile message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomInterceptProfile.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CustomInterceptProfile message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.networksecurity.v1.CustomInterceptProfile + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.networksecurity.v1.CustomInterceptProfile} CustomInterceptProfile + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CustomInterceptProfile.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networksecurity.v1.CustomInterceptProfile(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.interceptEndpointGroup = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CustomInterceptProfile message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.networksecurity.v1.CustomInterceptProfile + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.networksecurity.v1.CustomInterceptProfile} CustomInterceptProfile + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CustomInterceptProfile.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CustomInterceptProfile message. + * @function verify + * @memberof google.cloud.networksecurity.v1.CustomInterceptProfile + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CustomInterceptProfile.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.interceptEndpointGroup != null && message.hasOwnProperty("interceptEndpointGroup")) + if (!$util.isString(message.interceptEndpointGroup)) + return "interceptEndpointGroup: string expected"; + return null; + }; + + /** + * Creates a CustomInterceptProfile message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.networksecurity.v1.CustomInterceptProfile + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.networksecurity.v1.CustomInterceptProfile} CustomInterceptProfile + */ + CustomInterceptProfile.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networksecurity.v1.CustomInterceptProfile) + return object; + var message = new $root.google.cloud.networksecurity.v1.CustomInterceptProfile(); + if (object.interceptEndpointGroup != null) + message.interceptEndpointGroup = String(object.interceptEndpointGroup); + return message; + }; + + /** + * Creates a plain object from a CustomInterceptProfile message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.networksecurity.v1.CustomInterceptProfile + * @static + * @param {google.cloud.networksecurity.v1.CustomInterceptProfile} message CustomInterceptProfile + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CustomInterceptProfile.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.interceptEndpointGroup = ""; + if (message.interceptEndpointGroup != null && message.hasOwnProperty("interceptEndpointGroup")) + object.interceptEndpointGroup = message.interceptEndpointGroup; + return object; + }; + + /** + * Converts this CustomInterceptProfile to JSON. + * @function toJSON + * @memberof google.cloud.networksecurity.v1.CustomInterceptProfile + * @instance + * @returns {Object.} JSON object + */ + CustomInterceptProfile.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CustomInterceptProfile + * @function getTypeUrl + * @memberof google.cloud.networksecurity.v1.CustomInterceptProfile + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CustomInterceptProfile.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.networksecurity.v1.CustomInterceptProfile"; + }; + + return CustomInterceptProfile; + })(); + + v1.CustomMirroringProfile = (function() { + + /** + * Properties of a CustomMirroringProfile. + * @memberof google.cloud.networksecurity.v1 + * @interface ICustomMirroringProfile + * @property {string|null} [mirroringEndpointGroup] CustomMirroringProfile mirroringEndpointGroup + */ + + /** + * Constructs a new CustomMirroringProfile. + * @memberof google.cloud.networksecurity.v1 + * @classdesc Represents a CustomMirroringProfile. + * @implements ICustomMirroringProfile + * @constructor + * @param {google.cloud.networksecurity.v1.ICustomMirroringProfile=} [properties] Properties to set + */ + function CustomMirroringProfile(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CustomMirroringProfile mirroringEndpointGroup. + * @member {string} mirroringEndpointGroup + * @memberof google.cloud.networksecurity.v1.CustomMirroringProfile + * @instance + */ + CustomMirroringProfile.prototype.mirroringEndpointGroup = ""; + + /** + * Creates a new CustomMirroringProfile instance using the specified properties. + * @function create + * @memberof google.cloud.networksecurity.v1.CustomMirroringProfile + * @static + * @param {google.cloud.networksecurity.v1.ICustomMirroringProfile=} [properties] Properties to set + * @returns {google.cloud.networksecurity.v1.CustomMirroringProfile} CustomMirroringProfile instance + */ + CustomMirroringProfile.create = function create(properties) { + return new CustomMirroringProfile(properties); + }; + + /** + * Encodes the specified CustomMirroringProfile message. Does not implicitly {@link google.cloud.networksecurity.v1.CustomMirroringProfile.verify|verify} messages. + * @function encode + * @memberof google.cloud.networksecurity.v1.CustomMirroringProfile + * @static + * @param {google.cloud.networksecurity.v1.ICustomMirroringProfile} message CustomMirroringProfile message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomMirroringProfile.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.mirroringEndpointGroup != null && Object.hasOwnProperty.call(message, "mirroringEndpointGroup")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.mirroringEndpointGroup); + return writer; + }; + + /** + * Encodes the specified CustomMirroringProfile message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.CustomMirroringProfile.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.networksecurity.v1.CustomMirroringProfile + * @static + * @param {google.cloud.networksecurity.v1.ICustomMirroringProfile} message CustomMirroringProfile message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomMirroringProfile.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CustomMirroringProfile message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.networksecurity.v1.CustomMirroringProfile + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.networksecurity.v1.CustomMirroringProfile} CustomMirroringProfile + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CustomMirroringProfile.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networksecurity.v1.CustomMirroringProfile(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.mirroringEndpointGroup = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CustomMirroringProfile message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.networksecurity.v1.CustomMirroringProfile + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.networksecurity.v1.CustomMirroringProfile} CustomMirroringProfile + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CustomMirroringProfile.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CustomMirroringProfile message. + * @function verify + * @memberof google.cloud.networksecurity.v1.CustomMirroringProfile + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CustomMirroringProfile.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.mirroringEndpointGroup != null && message.hasOwnProperty("mirroringEndpointGroup")) + if (!$util.isString(message.mirroringEndpointGroup)) + return "mirroringEndpointGroup: string expected"; + return null; + }; + + /** + * Creates a CustomMirroringProfile message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.networksecurity.v1.CustomMirroringProfile + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.networksecurity.v1.CustomMirroringProfile} CustomMirroringProfile + */ + CustomMirroringProfile.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networksecurity.v1.CustomMirroringProfile) + return object; + var message = new $root.google.cloud.networksecurity.v1.CustomMirroringProfile(); + if (object.mirroringEndpointGroup != null) + message.mirroringEndpointGroup = String(object.mirroringEndpointGroup); + return message; + }; + + /** + * Creates a plain object from a CustomMirroringProfile message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.networksecurity.v1.CustomMirroringProfile + * @static + * @param {google.cloud.networksecurity.v1.CustomMirroringProfile} message CustomMirroringProfile + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CustomMirroringProfile.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.mirroringEndpointGroup = ""; + if (message.mirroringEndpointGroup != null && message.hasOwnProperty("mirroringEndpointGroup")) + object.mirroringEndpointGroup = message.mirroringEndpointGroup; + return object; + }; + + /** + * Converts this CustomMirroringProfile to JSON. + * @function toJSON + * @memberof google.cloud.networksecurity.v1.CustomMirroringProfile + * @instance + * @returns {Object.} JSON object + */ + CustomMirroringProfile.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CustomMirroringProfile + * @function getTypeUrl + * @memberof google.cloud.networksecurity.v1.CustomMirroringProfile + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CustomMirroringProfile.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.networksecurity.v1.CustomMirroringProfile"; + }; + + return CustomMirroringProfile; + })(); + + /** + * Severity enum. + * @name google.cloud.networksecurity.v1.Severity + * @enum {number} + * @property {number} SEVERITY_UNSPECIFIED=0 SEVERITY_UNSPECIFIED value + * @property {number} INFORMATIONAL=1 INFORMATIONAL value + * @property {number} LOW=2 LOW value + * @property {number} MEDIUM=3 MEDIUM value + * @property {number} HIGH=4 HIGH value + * @property {number} CRITICAL=5 CRITICAL value + */ + v1.Severity = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "SEVERITY_UNSPECIFIED"] = 0; + values[valuesById[1] = "INFORMATIONAL"] = 1; + values[valuesById[2] = "LOW"] = 2; + values[valuesById[3] = "MEDIUM"] = 3; + values[valuesById[4] = "HIGH"] = 4; + values[valuesById[5] = "CRITICAL"] = 5; + return values; + })(); + + /** + * ThreatType enum. + * @name google.cloud.networksecurity.v1.ThreatType + * @enum {number} + * @property {number} THREAT_TYPE_UNSPECIFIED=0 THREAT_TYPE_UNSPECIFIED value + * @property {number} UNKNOWN=1 UNKNOWN value + * @property {number} VULNERABILITY=2 VULNERABILITY value + * @property {number} ANTIVIRUS=3 ANTIVIRUS value + * @property {number} SPYWARE=4 SPYWARE value + * @property {number} DNS=5 DNS value + */ + v1.ThreatType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "THREAT_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "UNKNOWN"] = 1; + values[valuesById[2] = "VULNERABILITY"] = 2; + values[valuesById[3] = "ANTIVIRUS"] = 3; + values[valuesById[4] = "SPYWARE"] = 4; + values[valuesById[5] = "DNS"] = 5; + return values; + })(); + + /** + * ThreatAction enum. + * @name google.cloud.networksecurity.v1.ThreatAction + * @enum {number} + * @property {number} THREAT_ACTION_UNSPECIFIED=0 THREAT_ACTION_UNSPECIFIED value + * @property {number} DEFAULT_ACTION=4 DEFAULT_ACTION value + * @property {number} ALLOW=1 ALLOW value + * @property {number} ALERT=2 ALERT value + * @property {number} DENY=3 DENY value + */ + v1.ThreatAction = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "THREAT_ACTION_UNSPECIFIED"] = 0; + values[valuesById[4] = "DEFAULT_ACTION"] = 4; + values[valuesById[1] = "ALLOW"] = 1; + values[valuesById[2] = "ALERT"] = 2; + values[valuesById[3] = "DENY"] = 3; + return values; + })(); + + /** + * Protocol enum. + * @name google.cloud.networksecurity.v1.Protocol + * @enum {number} + * @property {number} PROTOCOL_UNSPECIFIED=0 PROTOCOL_UNSPECIFIED value + * @property {number} SMTP=1 SMTP value + * @property {number} SMB=2 SMB value + * @property {number} POP3=3 POP3 value + * @property {number} IMAP=4 IMAP value + * @property {number} HTTP2=5 HTTP2 value + * @property {number} HTTP=6 HTTP value + * @property {number} FTP=7 FTP value + */ + v1.Protocol = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "PROTOCOL_UNSPECIFIED"] = 0; + values[valuesById[1] = "SMTP"] = 1; + values[valuesById[2] = "SMB"] = 2; + values[valuesById[3] = "POP3"] = 3; + values[valuesById[4] = "IMAP"] = 4; + values[valuesById[5] = "HTTP2"] = 5; + values[valuesById[6] = "HTTP"] = 6; + values[valuesById[7] = "FTP"] = 7; + return values; + })(); + + v1.ThreatPreventionProfile = (function() { + + /** + * Properties of a ThreatPreventionProfile. + * @memberof google.cloud.networksecurity.v1 + * @interface IThreatPreventionProfile + * @property {Array.|null} [severityOverrides] ThreatPreventionProfile severityOverrides + * @property {Array.|null} [threatOverrides] ThreatPreventionProfile threatOverrides + * @property {Array.|null} [antivirusOverrides] ThreatPreventionProfile antivirusOverrides + */ + + /** + * Constructs a new ThreatPreventionProfile. + * @memberof google.cloud.networksecurity.v1 + * @classdesc Represents a ThreatPreventionProfile. + * @implements IThreatPreventionProfile + * @constructor + * @param {google.cloud.networksecurity.v1.IThreatPreventionProfile=} [properties] Properties to set + */ + function ThreatPreventionProfile(properties) { + this.severityOverrides = []; + this.threatOverrides = []; + this.antivirusOverrides = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ThreatPreventionProfile severityOverrides. + * @member {Array.} severityOverrides + * @memberof google.cloud.networksecurity.v1.ThreatPreventionProfile + * @instance + */ + ThreatPreventionProfile.prototype.severityOverrides = $util.emptyArray; + + /** + * ThreatPreventionProfile threatOverrides. + * @member {Array.} threatOverrides + * @memberof google.cloud.networksecurity.v1.ThreatPreventionProfile + * @instance + */ + ThreatPreventionProfile.prototype.threatOverrides = $util.emptyArray; + + /** + * ThreatPreventionProfile antivirusOverrides. + * @member {Array.} antivirusOverrides + * @memberof google.cloud.networksecurity.v1.ThreatPreventionProfile + * @instance + */ + ThreatPreventionProfile.prototype.antivirusOverrides = $util.emptyArray; + + /** + * Creates a new ThreatPreventionProfile instance using the specified properties. + * @function create + * @memberof google.cloud.networksecurity.v1.ThreatPreventionProfile + * @static + * @param {google.cloud.networksecurity.v1.IThreatPreventionProfile=} [properties] Properties to set + * @returns {google.cloud.networksecurity.v1.ThreatPreventionProfile} ThreatPreventionProfile instance + */ + ThreatPreventionProfile.create = function create(properties) { + return new ThreatPreventionProfile(properties); + }; + + /** + * Encodes the specified ThreatPreventionProfile message. Does not implicitly {@link google.cloud.networksecurity.v1.ThreatPreventionProfile.verify|verify} messages. + * @function encode + * @memberof google.cloud.networksecurity.v1.ThreatPreventionProfile + * @static + * @param {google.cloud.networksecurity.v1.IThreatPreventionProfile} message ThreatPreventionProfile message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ThreatPreventionProfile.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.severityOverrides != null && message.severityOverrides.length) + for (var i = 0; i < message.severityOverrides.length; ++i) + $root.google.cloud.networksecurity.v1.SeverityOverride.encode(message.severityOverrides[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.threatOverrides != null && message.threatOverrides.length) + for (var i = 0; i < message.threatOverrides.length; ++i) + $root.google.cloud.networksecurity.v1.ThreatOverride.encode(message.threatOverrides[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.antivirusOverrides != null && message.antivirusOverrides.length) + for (var i = 0; i < message.antivirusOverrides.length; ++i) + $root.google.cloud.networksecurity.v1.AntivirusOverride.encode(message.antivirusOverrides[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ThreatPreventionProfile message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.ThreatPreventionProfile.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.networksecurity.v1.ThreatPreventionProfile + * @static + * @param {google.cloud.networksecurity.v1.IThreatPreventionProfile} message ThreatPreventionProfile message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ThreatPreventionProfile.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ThreatPreventionProfile message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.networksecurity.v1.ThreatPreventionProfile + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.networksecurity.v1.ThreatPreventionProfile} ThreatPreventionProfile + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ThreatPreventionProfile.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networksecurity.v1.ThreatPreventionProfile(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.severityOverrides && message.severityOverrides.length)) + message.severityOverrides = []; + message.severityOverrides.push($root.google.cloud.networksecurity.v1.SeverityOverride.decode(reader, reader.uint32())); + break; + } + case 2: { + if (!(message.threatOverrides && message.threatOverrides.length)) + message.threatOverrides = []; + message.threatOverrides.push($root.google.cloud.networksecurity.v1.ThreatOverride.decode(reader, reader.uint32())); + break; + } + case 4: { + if (!(message.antivirusOverrides && message.antivirusOverrides.length)) + message.antivirusOverrides = []; + message.antivirusOverrides.push($root.google.cloud.networksecurity.v1.AntivirusOverride.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ThreatPreventionProfile message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.networksecurity.v1.ThreatPreventionProfile + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.networksecurity.v1.ThreatPreventionProfile} ThreatPreventionProfile + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ThreatPreventionProfile.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ThreatPreventionProfile message. + * @function verify + * @memberof google.cloud.networksecurity.v1.ThreatPreventionProfile + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ThreatPreventionProfile.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.severityOverrides != null && message.hasOwnProperty("severityOverrides")) { + if (!Array.isArray(message.severityOverrides)) + return "severityOverrides: array expected"; + for (var i = 0; i < message.severityOverrides.length; ++i) { + var error = $root.google.cloud.networksecurity.v1.SeverityOverride.verify(message.severityOverrides[i]); + if (error) + return "severityOverrides." + error; + } + } + if (message.threatOverrides != null && message.hasOwnProperty("threatOverrides")) { + if (!Array.isArray(message.threatOverrides)) + return "threatOverrides: array expected"; + for (var i = 0; i < message.threatOverrides.length; ++i) { + var error = $root.google.cloud.networksecurity.v1.ThreatOverride.verify(message.threatOverrides[i]); + if (error) + return "threatOverrides." + error; + } + } + if (message.antivirusOverrides != null && message.hasOwnProperty("antivirusOverrides")) { + if (!Array.isArray(message.antivirusOverrides)) + return "antivirusOverrides: array expected"; + for (var i = 0; i < message.antivirusOverrides.length; ++i) { + var error = $root.google.cloud.networksecurity.v1.AntivirusOverride.verify(message.antivirusOverrides[i]); + if (error) + return "antivirusOverrides." + error; + } + } + return null; + }; + + /** + * Creates a ThreatPreventionProfile message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.networksecurity.v1.ThreatPreventionProfile + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.networksecurity.v1.ThreatPreventionProfile} ThreatPreventionProfile + */ + ThreatPreventionProfile.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networksecurity.v1.ThreatPreventionProfile) + return object; + var message = new $root.google.cloud.networksecurity.v1.ThreatPreventionProfile(); + if (object.severityOverrides) { + if (!Array.isArray(object.severityOverrides)) + throw TypeError(".google.cloud.networksecurity.v1.ThreatPreventionProfile.severityOverrides: array expected"); + message.severityOverrides = []; + for (var i = 0; i < object.severityOverrides.length; ++i) { + if (typeof object.severityOverrides[i] !== "object") + throw TypeError(".google.cloud.networksecurity.v1.ThreatPreventionProfile.severityOverrides: object expected"); + message.severityOverrides[i] = $root.google.cloud.networksecurity.v1.SeverityOverride.fromObject(object.severityOverrides[i]); + } + } + if (object.threatOverrides) { + if (!Array.isArray(object.threatOverrides)) + throw TypeError(".google.cloud.networksecurity.v1.ThreatPreventionProfile.threatOverrides: array expected"); + message.threatOverrides = []; + for (var i = 0; i < object.threatOverrides.length; ++i) { + if (typeof object.threatOverrides[i] !== "object") + throw TypeError(".google.cloud.networksecurity.v1.ThreatPreventionProfile.threatOverrides: object expected"); + message.threatOverrides[i] = $root.google.cloud.networksecurity.v1.ThreatOverride.fromObject(object.threatOverrides[i]); + } + } + if (object.antivirusOverrides) { + if (!Array.isArray(object.antivirusOverrides)) + throw TypeError(".google.cloud.networksecurity.v1.ThreatPreventionProfile.antivirusOverrides: array expected"); + message.antivirusOverrides = []; + for (var i = 0; i < object.antivirusOverrides.length; ++i) { + if (typeof object.antivirusOverrides[i] !== "object") + throw TypeError(".google.cloud.networksecurity.v1.ThreatPreventionProfile.antivirusOverrides: object expected"); + message.antivirusOverrides[i] = $root.google.cloud.networksecurity.v1.AntivirusOverride.fromObject(object.antivirusOverrides[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a ThreatPreventionProfile message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.networksecurity.v1.ThreatPreventionProfile + * @static + * @param {google.cloud.networksecurity.v1.ThreatPreventionProfile} message ThreatPreventionProfile + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ThreatPreventionProfile.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.severityOverrides = []; + object.threatOverrides = []; + object.antivirusOverrides = []; + } + if (message.severityOverrides && message.severityOverrides.length) { + object.severityOverrides = []; + for (var j = 0; j < message.severityOverrides.length; ++j) + object.severityOverrides[j] = $root.google.cloud.networksecurity.v1.SeverityOverride.toObject(message.severityOverrides[j], options); + } + if (message.threatOverrides && message.threatOverrides.length) { + object.threatOverrides = []; + for (var j = 0; j < message.threatOverrides.length; ++j) + object.threatOverrides[j] = $root.google.cloud.networksecurity.v1.ThreatOverride.toObject(message.threatOverrides[j], options); + } + if (message.antivirusOverrides && message.antivirusOverrides.length) { + object.antivirusOverrides = []; + for (var j = 0; j < message.antivirusOverrides.length; ++j) + object.antivirusOverrides[j] = $root.google.cloud.networksecurity.v1.AntivirusOverride.toObject(message.antivirusOverrides[j], options); + } + return object; + }; + + /** + * Converts this ThreatPreventionProfile to JSON. + * @function toJSON + * @memberof google.cloud.networksecurity.v1.ThreatPreventionProfile + * @instance + * @returns {Object.} JSON object + */ + ThreatPreventionProfile.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ThreatPreventionProfile + * @function getTypeUrl + * @memberof google.cloud.networksecurity.v1.ThreatPreventionProfile + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ThreatPreventionProfile.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.networksecurity.v1.ThreatPreventionProfile"; + }; + + return ThreatPreventionProfile; + })(); + + v1.SeverityOverride = (function() { + + /** + * Properties of a SeverityOverride. + * @memberof google.cloud.networksecurity.v1 + * @interface ISeverityOverride + * @property {google.cloud.networksecurity.v1.Severity|null} [severity] SeverityOverride severity + * @property {google.cloud.networksecurity.v1.ThreatAction|null} [action] SeverityOverride action + */ + + /** + * Constructs a new SeverityOverride. + * @memberof google.cloud.networksecurity.v1 + * @classdesc Represents a SeverityOverride. + * @implements ISeverityOverride + * @constructor + * @param {google.cloud.networksecurity.v1.ISeverityOverride=} [properties] Properties to set + */ + function SeverityOverride(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SeverityOverride severity. + * @member {google.cloud.networksecurity.v1.Severity} severity + * @memberof google.cloud.networksecurity.v1.SeverityOverride + * @instance + */ + SeverityOverride.prototype.severity = 0; + + /** + * SeverityOverride action. + * @member {google.cloud.networksecurity.v1.ThreatAction} action + * @memberof google.cloud.networksecurity.v1.SeverityOverride + * @instance + */ + SeverityOverride.prototype.action = 0; + + /** + * Creates a new SeverityOverride instance using the specified properties. + * @function create + * @memberof google.cloud.networksecurity.v1.SeverityOverride + * @static + * @param {google.cloud.networksecurity.v1.ISeverityOverride=} [properties] Properties to set + * @returns {google.cloud.networksecurity.v1.SeverityOverride} SeverityOverride instance + */ + SeverityOverride.create = function create(properties) { + return new SeverityOverride(properties); + }; + + /** + * Encodes the specified SeverityOverride message. Does not implicitly {@link google.cloud.networksecurity.v1.SeverityOverride.verify|verify} messages. + * @function encode + * @memberof google.cloud.networksecurity.v1.SeverityOverride + * @static + * @param {google.cloud.networksecurity.v1.ISeverityOverride} message SeverityOverride message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SeverityOverride.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.severity != null && Object.hasOwnProperty.call(message, "severity")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.severity); + if (message.action != null && Object.hasOwnProperty.call(message, "action")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.action); + return writer; + }; + + /** + * Encodes the specified SeverityOverride message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.SeverityOverride.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.networksecurity.v1.SeverityOverride + * @static + * @param {google.cloud.networksecurity.v1.ISeverityOverride} message SeverityOverride message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SeverityOverride.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SeverityOverride message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.networksecurity.v1.SeverityOverride + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.networksecurity.v1.SeverityOverride} SeverityOverride + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SeverityOverride.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networksecurity.v1.SeverityOverride(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.severity = reader.int32(); + break; + } + case 2: { + message.action = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SeverityOverride message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.networksecurity.v1.SeverityOverride + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.networksecurity.v1.SeverityOverride} SeverityOverride + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SeverityOverride.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SeverityOverride message. + * @function verify + * @memberof google.cloud.networksecurity.v1.SeverityOverride + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SeverityOverride.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.severity != null && message.hasOwnProperty("severity")) + switch (message.severity) { + default: + return "severity: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + break; + } + if (message.action != null && message.hasOwnProperty("action")) + switch (message.action) { + default: + return "action: enum value expected"; + case 0: + case 4: + case 1: + case 2: + case 3: + break; + } + return null; + }; + + /** + * Creates a SeverityOverride message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.networksecurity.v1.SeverityOverride + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.networksecurity.v1.SeverityOverride} SeverityOverride + */ + SeverityOverride.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networksecurity.v1.SeverityOverride) + return object; + var message = new $root.google.cloud.networksecurity.v1.SeverityOverride(); + switch (object.severity) { + default: + if (typeof object.severity === "number") { + message.severity = object.severity; + break; + } + break; + case "SEVERITY_UNSPECIFIED": + case 0: + message.severity = 0; + break; + case "INFORMATIONAL": + case 1: + message.severity = 1; + break; + case "LOW": + case 2: + message.severity = 2; + break; + case "MEDIUM": + case 3: + message.severity = 3; + break; + case "HIGH": + case 4: + message.severity = 4; + break; + case "CRITICAL": + case 5: + message.severity = 5; + break; + } + switch (object.action) { + default: + if (typeof object.action === "number") { + message.action = object.action; + break; + } + break; + case "THREAT_ACTION_UNSPECIFIED": + case 0: + message.action = 0; + break; + case "DEFAULT_ACTION": + case 4: + message.action = 4; + break; + case "ALLOW": + case 1: + message.action = 1; + break; + case "ALERT": + case 2: + message.action = 2; + break; + case "DENY": + case 3: + message.action = 3; + break; + } + return message; + }; + + /** + * Creates a plain object from a SeverityOverride message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.networksecurity.v1.SeverityOverride + * @static + * @param {google.cloud.networksecurity.v1.SeverityOverride} message SeverityOverride + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SeverityOverride.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.severity = options.enums === String ? "SEVERITY_UNSPECIFIED" : 0; + object.action = options.enums === String ? "THREAT_ACTION_UNSPECIFIED" : 0; + } + if (message.severity != null && message.hasOwnProperty("severity")) + object.severity = options.enums === String ? $root.google.cloud.networksecurity.v1.Severity[message.severity] === undefined ? message.severity : $root.google.cloud.networksecurity.v1.Severity[message.severity] : message.severity; + if (message.action != null && message.hasOwnProperty("action")) + object.action = options.enums === String ? $root.google.cloud.networksecurity.v1.ThreatAction[message.action] === undefined ? message.action : $root.google.cloud.networksecurity.v1.ThreatAction[message.action] : message.action; + return object; + }; + + /** + * Converts this SeverityOverride to JSON. + * @function toJSON + * @memberof google.cloud.networksecurity.v1.SeverityOverride + * @instance + * @returns {Object.} JSON object + */ + SeverityOverride.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SeverityOverride + * @function getTypeUrl + * @memberof google.cloud.networksecurity.v1.SeverityOverride + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SeverityOverride.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.networksecurity.v1.SeverityOverride"; + }; + + return SeverityOverride; + })(); + + v1.ThreatOverride = (function() { + + /** + * Properties of a ThreatOverride. + * @memberof google.cloud.networksecurity.v1 + * @interface IThreatOverride + * @property {string|null} [threatId] ThreatOverride threatId + * @property {google.cloud.networksecurity.v1.ThreatType|null} [type] ThreatOverride type + * @property {google.cloud.networksecurity.v1.ThreatAction|null} [action] ThreatOverride action + */ + + /** + * Constructs a new ThreatOverride. + * @memberof google.cloud.networksecurity.v1 + * @classdesc Represents a ThreatOverride. + * @implements IThreatOverride + * @constructor + * @param {google.cloud.networksecurity.v1.IThreatOverride=} [properties] Properties to set + */ + function ThreatOverride(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ThreatOverride threatId. + * @member {string} threatId + * @memberof google.cloud.networksecurity.v1.ThreatOverride + * @instance + */ + ThreatOverride.prototype.threatId = ""; + + /** + * ThreatOverride type. + * @member {google.cloud.networksecurity.v1.ThreatType} type + * @memberof google.cloud.networksecurity.v1.ThreatOverride + * @instance + */ + ThreatOverride.prototype.type = 0; + + /** + * ThreatOverride action. + * @member {google.cloud.networksecurity.v1.ThreatAction} action + * @memberof google.cloud.networksecurity.v1.ThreatOverride + * @instance + */ + ThreatOverride.prototype.action = 0; + + /** + * Creates a new ThreatOverride instance using the specified properties. + * @function create + * @memberof google.cloud.networksecurity.v1.ThreatOverride + * @static + * @param {google.cloud.networksecurity.v1.IThreatOverride=} [properties] Properties to set + * @returns {google.cloud.networksecurity.v1.ThreatOverride} ThreatOverride instance + */ + ThreatOverride.create = function create(properties) { + return new ThreatOverride(properties); + }; + + /** + * Encodes the specified ThreatOverride message. Does not implicitly {@link google.cloud.networksecurity.v1.ThreatOverride.verify|verify} messages. + * @function encode + * @memberof google.cloud.networksecurity.v1.ThreatOverride + * @static + * @param {google.cloud.networksecurity.v1.IThreatOverride} message ThreatOverride message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ThreatOverride.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.threatId != null && Object.hasOwnProperty.call(message, "threatId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.threatId); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.type); + if (message.action != null && Object.hasOwnProperty.call(message, "action")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.action); + return writer; + }; + + /** + * Encodes the specified ThreatOverride message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.ThreatOverride.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.networksecurity.v1.ThreatOverride + * @static + * @param {google.cloud.networksecurity.v1.IThreatOverride} message ThreatOverride message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ThreatOverride.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ThreatOverride message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.networksecurity.v1.ThreatOverride + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.networksecurity.v1.ThreatOverride} ThreatOverride + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ThreatOverride.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networksecurity.v1.ThreatOverride(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.threatId = reader.string(); + break; + } + case 2: { + message.type = reader.int32(); + break; + } + case 3: { + message.action = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ThreatOverride message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.networksecurity.v1.ThreatOverride + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.networksecurity.v1.ThreatOverride} ThreatOverride + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ThreatOverride.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ThreatOverride message. + * @function verify + * @memberof google.cloud.networksecurity.v1.ThreatOverride + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ThreatOverride.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.threatId != null && message.hasOwnProperty("threatId")) + if (!$util.isString(message.threatId)) + return "threatId: string expected"; + if (message.type != null && message.hasOwnProperty("type")) + switch (message.type) { + default: + return "type: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + break; + } + if (message.action != null && message.hasOwnProperty("action")) + switch (message.action) { + default: + return "action: enum value expected"; + case 0: + case 4: + case 1: + case 2: + case 3: + break; } - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - if (!$util.isString(message.nextPageToken)) - return "nextPageToken: string expected"; return null; }; /** - * Creates a ListClientTlsPoliciesResponse message from a plain object. Also converts values to their respective internal types. + * Creates a ThreatOverride message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.networksecurity.v1.ListClientTlsPoliciesResponse + * @memberof google.cloud.networksecurity.v1.ThreatOverride * @static * @param {Object.} object Plain object - * @returns {google.cloud.networksecurity.v1.ListClientTlsPoliciesResponse} ListClientTlsPoliciesResponse + * @returns {google.cloud.networksecurity.v1.ThreatOverride} ThreatOverride */ - ListClientTlsPoliciesResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.networksecurity.v1.ListClientTlsPoliciesResponse) + ThreatOverride.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networksecurity.v1.ThreatOverride) return object; - var message = new $root.google.cloud.networksecurity.v1.ListClientTlsPoliciesResponse(); - if (object.clientTlsPolicies) { - if (!Array.isArray(object.clientTlsPolicies)) - throw TypeError(".google.cloud.networksecurity.v1.ListClientTlsPoliciesResponse.clientTlsPolicies: array expected"); - message.clientTlsPolicies = []; - for (var i = 0; i < object.clientTlsPolicies.length; ++i) { - if (typeof object.clientTlsPolicies[i] !== "object") - throw TypeError(".google.cloud.networksecurity.v1.ListClientTlsPoliciesResponse.clientTlsPolicies: object expected"); - message.clientTlsPolicies[i] = $root.google.cloud.networksecurity.v1.ClientTlsPolicy.fromObject(object.clientTlsPolicies[i]); + var message = new $root.google.cloud.networksecurity.v1.ThreatOverride(); + if (object.threatId != null) + message.threatId = String(object.threatId); + switch (object.type) { + default: + if (typeof object.type === "number") { + message.type = object.type; + break; + } + break; + case "THREAT_TYPE_UNSPECIFIED": + case 0: + message.type = 0; + break; + case "UNKNOWN": + case 1: + message.type = 1; + break; + case "VULNERABILITY": + case 2: + message.type = 2; + break; + case "ANTIVIRUS": + case 3: + message.type = 3; + break; + case "SPYWARE": + case 4: + message.type = 4; + break; + case "DNS": + case 5: + message.type = 5; + break; + } + switch (object.action) { + default: + if (typeof object.action === "number") { + message.action = object.action; + break; } + break; + case "THREAT_ACTION_UNSPECIFIED": + case 0: + message.action = 0; + break; + case "DEFAULT_ACTION": + case 4: + message.action = 4; + break; + case "ALLOW": + case 1: + message.action = 1; + break; + case "ALERT": + case 2: + message.action = 2; + break; + case "DENY": + case 3: + message.action = 3; + break; } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); return message; }; /** - * Creates a plain object from a ListClientTlsPoliciesResponse message. Also converts values to other types if specified. + * Creates a plain object from a ThreatOverride message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.networksecurity.v1.ListClientTlsPoliciesResponse + * @memberof google.cloud.networksecurity.v1.ThreatOverride * @static - * @param {google.cloud.networksecurity.v1.ListClientTlsPoliciesResponse} message ListClientTlsPoliciesResponse + * @param {google.cloud.networksecurity.v1.ThreatOverride} message ThreatOverride * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ListClientTlsPoliciesResponse.toObject = function toObject(message, options) { + ThreatOverride.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) - object.clientTlsPolicies = []; - if (options.defaults) - object.nextPageToken = ""; - if (message.clientTlsPolicies && message.clientTlsPolicies.length) { - object.clientTlsPolicies = []; - for (var j = 0; j < message.clientTlsPolicies.length; ++j) - object.clientTlsPolicies[j] = $root.google.cloud.networksecurity.v1.ClientTlsPolicy.toObject(message.clientTlsPolicies[j], options); + if (options.defaults) { + object.threatId = ""; + object.type = options.enums === String ? "THREAT_TYPE_UNSPECIFIED" : 0; + object.action = options.enums === String ? "THREAT_ACTION_UNSPECIFIED" : 0; } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; + if (message.threatId != null && message.hasOwnProperty("threatId")) + object.threatId = message.threatId; + if (message.type != null && message.hasOwnProperty("type")) + object.type = options.enums === String ? $root.google.cloud.networksecurity.v1.ThreatType[message.type] === undefined ? message.type : $root.google.cloud.networksecurity.v1.ThreatType[message.type] : message.type; + if (message.action != null && message.hasOwnProperty("action")) + object.action = options.enums === String ? $root.google.cloud.networksecurity.v1.ThreatAction[message.action] === undefined ? message.action : $root.google.cloud.networksecurity.v1.ThreatAction[message.action] : message.action; return object; }; /** - * Converts this ListClientTlsPoliciesResponse to JSON. + * Converts this ThreatOverride to JSON. * @function toJSON - * @memberof google.cloud.networksecurity.v1.ListClientTlsPoliciesResponse + * @memberof google.cloud.networksecurity.v1.ThreatOverride * @instance * @returns {Object.} JSON object */ - ListClientTlsPoliciesResponse.prototype.toJSON = function toJSON() { + ThreatOverride.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for ListClientTlsPoliciesResponse + * Gets the default type url for ThreatOverride * @function getTypeUrl - * @memberof google.cloud.networksecurity.v1.ListClientTlsPoliciesResponse + * @memberof google.cloud.networksecurity.v1.ThreatOverride * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - ListClientTlsPoliciesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + ThreatOverride.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.networksecurity.v1.ListClientTlsPoliciesResponse"; + return typeUrlPrefix + "/google.cloud.networksecurity.v1.ThreatOverride"; }; - return ListClientTlsPoliciesResponse; + return ThreatOverride; })(); - v1.GetClientTlsPolicyRequest = (function() { + v1.AntivirusOverride = (function() { /** - * Properties of a GetClientTlsPolicyRequest. + * Properties of an AntivirusOverride. * @memberof google.cloud.networksecurity.v1 - * @interface IGetClientTlsPolicyRequest - * @property {string|null} [name] GetClientTlsPolicyRequest name + * @interface IAntivirusOverride + * @property {google.cloud.networksecurity.v1.Protocol|null} [protocol] AntivirusOverride protocol + * @property {google.cloud.networksecurity.v1.ThreatAction|null} [action] AntivirusOverride action */ /** - * Constructs a new GetClientTlsPolicyRequest. + * Constructs a new AntivirusOverride. * @memberof google.cloud.networksecurity.v1 - * @classdesc Represents a GetClientTlsPolicyRequest. - * @implements IGetClientTlsPolicyRequest + * @classdesc Represents an AntivirusOverride. + * @implements IAntivirusOverride * @constructor - * @param {google.cloud.networksecurity.v1.IGetClientTlsPolicyRequest=} [properties] Properties to set + * @param {google.cloud.networksecurity.v1.IAntivirusOverride=} [properties] Properties to set */ - function GetClientTlsPolicyRequest(properties) { + function AntivirusOverride(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -8339,77 +61595,91 @@ } /** - * GetClientTlsPolicyRequest name. - * @member {string} name - * @memberof google.cloud.networksecurity.v1.GetClientTlsPolicyRequest + * AntivirusOverride protocol. + * @member {google.cloud.networksecurity.v1.Protocol} protocol + * @memberof google.cloud.networksecurity.v1.AntivirusOverride * @instance */ - GetClientTlsPolicyRequest.prototype.name = ""; + AntivirusOverride.prototype.protocol = 0; /** - * Creates a new GetClientTlsPolicyRequest instance using the specified properties. + * AntivirusOverride action. + * @member {google.cloud.networksecurity.v1.ThreatAction} action + * @memberof google.cloud.networksecurity.v1.AntivirusOverride + * @instance + */ + AntivirusOverride.prototype.action = 0; + + /** + * Creates a new AntivirusOverride instance using the specified properties. * @function create - * @memberof google.cloud.networksecurity.v1.GetClientTlsPolicyRequest + * @memberof google.cloud.networksecurity.v1.AntivirusOverride * @static - * @param {google.cloud.networksecurity.v1.IGetClientTlsPolicyRequest=} [properties] Properties to set - * @returns {google.cloud.networksecurity.v1.GetClientTlsPolicyRequest} GetClientTlsPolicyRequest instance + * @param {google.cloud.networksecurity.v1.IAntivirusOverride=} [properties] Properties to set + * @returns {google.cloud.networksecurity.v1.AntivirusOverride} AntivirusOverride instance */ - GetClientTlsPolicyRequest.create = function create(properties) { - return new GetClientTlsPolicyRequest(properties); + AntivirusOverride.create = function create(properties) { + return new AntivirusOverride(properties); }; /** - * Encodes the specified GetClientTlsPolicyRequest message. Does not implicitly {@link google.cloud.networksecurity.v1.GetClientTlsPolicyRequest.verify|verify} messages. + * Encodes the specified AntivirusOverride message. Does not implicitly {@link google.cloud.networksecurity.v1.AntivirusOverride.verify|verify} messages. * @function encode - * @memberof google.cloud.networksecurity.v1.GetClientTlsPolicyRequest + * @memberof google.cloud.networksecurity.v1.AntivirusOverride * @static - * @param {google.cloud.networksecurity.v1.IGetClientTlsPolicyRequest} message GetClientTlsPolicyRequest message or plain object to encode + * @param {google.cloud.networksecurity.v1.IAntivirusOverride} message AntivirusOverride message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GetClientTlsPolicyRequest.encode = function encode(message, writer) { + AntivirusOverride.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.protocol != null && Object.hasOwnProperty.call(message, "protocol")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.protocol); + if (message.action != null && Object.hasOwnProperty.call(message, "action")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.action); return writer; }; /** - * Encodes the specified GetClientTlsPolicyRequest message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.GetClientTlsPolicyRequest.verify|verify} messages. + * Encodes the specified AntivirusOverride message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.AntivirusOverride.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.networksecurity.v1.GetClientTlsPolicyRequest + * @memberof google.cloud.networksecurity.v1.AntivirusOverride * @static - * @param {google.cloud.networksecurity.v1.IGetClientTlsPolicyRequest} message GetClientTlsPolicyRequest message or plain object to encode + * @param {google.cloud.networksecurity.v1.IAntivirusOverride} message AntivirusOverride message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GetClientTlsPolicyRequest.encodeDelimited = function encodeDelimited(message, writer) { + AntivirusOverride.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a GetClientTlsPolicyRequest message from the specified reader or buffer. + * Decodes an AntivirusOverride message from the specified reader or buffer. * @function decode - * @memberof google.cloud.networksecurity.v1.GetClientTlsPolicyRequest + * @memberof google.cloud.networksecurity.v1.AntivirusOverride * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.networksecurity.v1.GetClientTlsPolicyRequest} GetClientTlsPolicyRequest + * @returns {google.cloud.networksecurity.v1.AntivirusOverride} AntivirusOverride * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GetClientTlsPolicyRequest.decode = function decode(reader, length, error) { + AntivirusOverride.decode = function decode(reader, length, error) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networksecurity.v1.GetClientTlsPolicyRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networksecurity.v1.AntivirusOverride(); while (reader.pos < end) { var tag = reader.uint32(); if (tag === error) break; switch (tag >>> 3) { case 1: { - message.name = reader.string(); + message.protocol = reader.int32(); + break; + } + case 2: { + message.action = reader.int32(); break; } default: @@ -8421,124 +61691,215 @@ }; /** - * Decodes a GetClientTlsPolicyRequest message from the specified reader or buffer, length delimited. + * Decodes an AntivirusOverride message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.networksecurity.v1.GetClientTlsPolicyRequest + * @memberof google.cloud.networksecurity.v1.AntivirusOverride * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.networksecurity.v1.GetClientTlsPolicyRequest} GetClientTlsPolicyRequest + * @returns {google.cloud.networksecurity.v1.AntivirusOverride} AntivirusOverride * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GetClientTlsPolicyRequest.decodeDelimited = function decodeDelimited(reader) { + AntivirusOverride.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a GetClientTlsPolicyRequest message. + * Verifies an AntivirusOverride message. * @function verify - * @memberof google.cloud.networksecurity.v1.GetClientTlsPolicyRequest + * @memberof google.cloud.networksecurity.v1.AntivirusOverride * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - GetClientTlsPolicyRequest.verify = function verify(message) { + AntivirusOverride.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; + if (message.protocol != null && message.hasOwnProperty("protocol")) + switch (message.protocol) { + default: + return "protocol: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + break; + } + if (message.action != null && message.hasOwnProperty("action")) + switch (message.action) { + default: + return "action: enum value expected"; + case 0: + case 4: + case 1: + case 2: + case 3: + break; + } return null; }; /** - * Creates a GetClientTlsPolicyRequest message from a plain object. Also converts values to their respective internal types. + * Creates an AntivirusOverride message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.networksecurity.v1.GetClientTlsPolicyRequest + * @memberof google.cloud.networksecurity.v1.AntivirusOverride * @static * @param {Object.} object Plain object - * @returns {google.cloud.networksecurity.v1.GetClientTlsPolicyRequest} GetClientTlsPolicyRequest + * @returns {google.cloud.networksecurity.v1.AntivirusOverride} AntivirusOverride */ - GetClientTlsPolicyRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.networksecurity.v1.GetClientTlsPolicyRequest) + AntivirusOverride.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networksecurity.v1.AntivirusOverride) return object; - var message = new $root.google.cloud.networksecurity.v1.GetClientTlsPolicyRequest(); - if (object.name != null) - message.name = String(object.name); + var message = new $root.google.cloud.networksecurity.v1.AntivirusOverride(); + switch (object.protocol) { + default: + if (typeof object.protocol === "number") { + message.protocol = object.protocol; + break; + } + break; + case "PROTOCOL_UNSPECIFIED": + case 0: + message.protocol = 0; + break; + case "SMTP": + case 1: + message.protocol = 1; + break; + case "SMB": + case 2: + message.protocol = 2; + break; + case "POP3": + case 3: + message.protocol = 3; + break; + case "IMAP": + case 4: + message.protocol = 4; + break; + case "HTTP2": + case 5: + message.protocol = 5; + break; + case "HTTP": + case 6: + message.protocol = 6; + break; + case "FTP": + case 7: + message.protocol = 7; + break; + } + switch (object.action) { + default: + if (typeof object.action === "number") { + message.action = object.action; + break; + } + break; + case "THREAT_ACTION_UNSPECIFIED": + case 0: + message.action = 0; + break; + case "DEFAULT_ACTION": + case 4: + message.action = 4; + break; + case "ALLOW": + case 1: + message.action = 1; + break; + case "ALERT": + case 2: + message.action = 2; + break; + case "DENY": + case 3: + message.action = 3; + break; + } return message; }; /** - * Creates a plain object from a GetClientTlsPolicyRequest message. Also converts values to other types if specified. + * Creates a plain object from an AntivirusOverride message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.networksecurity.v1.GetClientTlsPolicyRequest + * @memberof google.cloud.networksecurity.v1.AntivirusOverride * @static - * @param {google.cloud.networksecurity.v1.GetClientTlsPolicyRequest} message GetClientTlsPolicyRequest + * @param {google.cloud.networksecurity.v1.AntivirusOverride} message AntivirusOverride * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - GetClientTlsPolicyRequest.toObject = function toObject(message, options) { + AntivirusOverride.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) - object.name = ""; - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; + if (options.defaults) { + object.protocol = options.enums === String ? "PROTOCOL_UNSPECIFIED" : 0; + object.action = options.enums === String ? "THREAT_ACTION_UNSPECIFIED" : 0; + } + if (message.protocol != null && message.hasOwnProperty("protocol")) + object.protocol = options.enums === String ? $root.google.cloud.networksecurity.v1.Protocol[message.protocol] === undefined ? message.protocol : $root.google.cloud.networksecurity.v1.Protocol[message.protocol] : message.protocol; + if (message.action != null && message.hasOwnProperty("action")) + object.action = options.enums === String ? $root.google.cloud.networksecurity.v1.ThreatAction[message.action] === undefined ? message.action : $root.google.cloud.networksecurity.v1.ThreatAction[message.action] : message.action; return object; }; /** - * Converts this GetClientTlsPolicyRequest to JSON. + * Converts this AntivirusOverride to JSON. * @function toJSON - * @memberof google.cloud.networksecurity.v1.GetClientTlsPolicyRequest + * @memberof google.cloud.networksecurity.v1.AntivirusOverride * @instance * @returns {Object.} JSON object */ - GetClientTlsPolicyRequest.prototype.toJSON = function toJSON() { + AntivirusOverride.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for GetClientTlsPolicyRequest + * Gets the default type url for AntivirusOverride * @function getTypeUrl - * @memberof google.cloud.networksecurity.v1.GetClientTlsPolicyRequest + * @memberof google.cloud.networksecurity.v1.AntivirusOverride * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - GetClientTlsPolicyRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + AntivirusOverride.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.networksecurity.v1.GetClientTlsPolicyRequest"; + return typeUrlPrefix + "/google.cloud.networksecurity.v1.AntivirusOverride"; }; - return GetClientTlsPolicyRequest; + return AntivirusOverride; })(); - v1.CreateClientTlsPolicyRequest = (function() { + v1.UrlFilteringProfile = (function() { /** - * Properties of a CreateClientTlsPolicyRequest. + * Properties of an UrlFilteringProfile. * @memberof google.cloud.networksecurity.v1 - * @interface ICreateClientTlsPolicyRequest - * @property {string|null} [parent] CreateClientTlsPolicyRequest parent - * @property {string|null} [clientTlsPolicyId] CreateClientTlsPolicyRequest clientTlsPolicyId - * @property {google.cloud.networksecurity.v1.IClientTlsPolicy|null} [clientTlsPolicy] CreateClientTlsPolicyRequest clientTlsPolicy + * @interface IUrlFilteringProfile + * @property {Array.|null} [urlFilters] UrlFilteringProfile urlFilters */ /** - * Constructs a new CreateClientTlsPolicyRequest. + * Constructs a new UrlFilteringProfile. * @memberof google.cloud.networksecurity.v1 - * @classdesc Represents a CreateClientTlsPolicyRequest. - * @implements ICreateClientTlsPolicyRequest + * @classdesc Represents an UrlFilteringProfile. + * @implements IUrlFilteringProfile * @constructor - * @param {google.cloud.networksecurity.v1.ICreateClientTlsPolicyRequest=} [properties] Properties to set + * @param {google.cloud.networksecurity.v1.IUrlFilteringProfile=} [properties] Properties to set */ - function CreateClientTlsPolicyRequest(properties) { + function UrlFilteringProfile(properties) { + this.urlFilters = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -8546,105 +61907,80 @@ } /** - * CreateClientTlsPolicyRequest parent. - * @member {string} parent - * @memberof google.cloud.networksecurity.v1.CreateClientTlsPolicyRequest - * @instance - */ - CreateClientTlsPolicyRequest.prototype.parent = ""; - - /** - * CreateClientTlsPolicyRequest clientTlsPolicyId. - * @member {string} clientTlsPolicyId - * @memberof google.cloud.networksecurity.v1.CreateClientTlsPolicyRequest - * @instance - */ - CreateClientTlsPolicyRequest.prototype.clientTlsPolicyId = ""; - - /** - * CreateClientTlsPolicyRequest clientTlsPolicy. - * @member {google.cloud.networksecurity.v1.IClientTlsPolicy|null|undefined} clientTlsPolicy - * @memberof google.cloud.networksecurity.v1.CreateClientTlsPolicyRequest + * UrlFilteringProfile urlFilters. + * @member {Array.} urlFilters + * @memberof google.cloud.networksecurity.v1.UrlFilteringProfile * @instance */ - CreateClientTlsPolicyRequest.prototype.clientTlsPolicy = null; + UrlFilteringProfile.prototype.urlFilters = $util.emptyArray; /** - * Creates a new CreateClientTlsPolicyRequest instance using the specified properties. + * Creates a new UrlFilteringProfile instance using the specified properties. * @function create - * @memberof google.cloud.networksecurity.v1.CreateClientTlsPolicyRequest + * @memberof google.cloud.networksecurity.v1.UrlFilteringProfile * @static - * @param {google.cloud.networksecurity.v1.ICreateClientTlsPolicyRequest=} [properties] Properties to set - * @returns {google.cloud.networksecurity.v1.CreateClientTlsPolicyRequest} CreateClientTlsPolicyRequest instance + * @param {google.cloud.networksecurity.v1.IUrlFilteringProfile=} [properties] Properties to set + * @returns {google.cloud.networksecurity.v1.UrlFilteringProfile} UrlFilteringProfile instance */ - CreateClientTlsPolicyRequest.create = function create(properties) { - return new CreateClientTlsPolicyRequest(properties); + UrlFilteringProfile.create = function create(properties) { + return new UrlFilteringProfile(properties); }; /** - * Encodes the specified CreateClientTlsPolicyRequest message. Does not implicitly {@link google.cloud.networksecurity.v1.CreateClientTlsPolicyRequest.verify|verify} messages. + * Encodes the specified UrlFilteringProfile message. Does not implicitly {@link google.cloud.networksecurity.v1.UrlFilteringProfile.verify|verify} messages. * @function encode - * @memberof google.cloud.networksecurity.v1.CreateClientTlsPolicyRequest + * @memberof google.cloud.networksecurity.v1.UrlFilteringProfile * @static - * @param {google.cloud.networksecurity.v1.ICreateClientTlsPolicyRequest} message CreateClientTlsPolicyRequest message or plain object to encode + * @param {google.cloud.networksecurity.v1.IUrlFilteringProfile} message UrlFilteringProfile message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CreateClientTlsPolicyRequest.encode = function encode(message, writer) { + UrlFilteringProfile.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.clientTlsPolicyId != null && Object.hasOwnProperty.call(message, "clientTlsPolicyId")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.clientTlsPolicyId); - if (message.clientTlsPolicy != null && Object.hasOwnProperty.call(message, "clientTlsPolicy")) - $root.google.cloud.networksecurity.v1.ClientTlsPolicy.encode(message.clientTlsPolicy, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.urlFilters != null && message.urlFilters.length) + for (var i = 0; i < message.urlFilters.length; ++i) + $root.google.cloud.networksecurity.v1.UrlFilter.encode(message.urlFilters[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); return writer; }; /** - * Encodes the specified CreateClientTlsPolicyRequest message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.CreateClientTlsPolicyRequest.verify|verify} messages. + * Encodes the specified UrlFilteringProfile message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.UrlFilteringProfile.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.networksecurity.v1.CreateClientTlsPolicyRequest + * @memberof google.cloud.networksecurity.v1.UrlFilteringProfile * @static - * @param {google.cloud.networksecurity.v1.ICreateClientTlsPolicyRequest} message CreateClientTlsPolicyRequest message or plain object to encode + * @param {google.cloud.networksecurity.v1.IUrlFilteringProfile} message UrlFilteringProfile message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CreateClientTlsPolicyRequest.encodeDelimited = function encodeDelimited(message, writer) { + UrlFilteringProfile.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a CreateClientTlsPolicyRequest message from the specified reader or buffer. + * Decodes an UrlFilteringProfile message from the specified reader or buffer. * @function decode - * @memberof google.cloud.networksecurity.v1.CreateClientTlsPolicyRequest + * @memberof google.cloud.networksecurity.v1.UrlFilteringProfile * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.networksecurity.v1.CreateClientTlsPolicyRequest} CreateClientTlsPolicyRequest + * @returns {google.cloud.networksecurity.v1.UrlFilteringProfile} UrlFilteringProfile * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - CreateClientTlsPolicyRequest.decode = function decode(reader, length, error) { + UrlFilteringProfile.decode = function decode(reader, length, error) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networksecurity.v1.CreateClientTlsPolicyRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networksecurity.v1.UrlFilteringProfile(); while (reader.pos < end) { var tag = reader.uint32(); if (tag === error) break; switch (tag >>> 3) { case 1: { - message.parent = reader.string(); - break; - } - case 2: { - message.clientTlsPolicyId = reader.string(); - break; - } - case 3: { - message.clientTlsPolicy = $root.google.cloud.networksecurity.v1.ClientTlsPolicy.decode(reader, reader.uint32()); + if (!(message.urlFilters && message.urlFilters.length)) + message.urlFilters = []; + message.urlFilters.push($root.google.cloud.networksecurity.v1.UrlFilter.decode(reader, reader.uint32())); break; } default: @@ -8656,145 +61992,142 @@ }; /** - * Decodes a CreateClientTlsPolicyRequest message from the specified reader or buffer, length delimited. + * Decodes an UrlFilteringProfile message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.networksecurity.v1.CreateClientTlsPolicyRequest + * @memberof google.cloud.networksecurity.v1.UrlFilteringProfile * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.networksecurity.v1.CreateClientTlsPolicyRequest} CreateClientTlsPolicyRequest + * @returns {google.cloud.networksecurity.v1.UrlFilteringProfile} UrlFilteringProfile * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - CreateClientTlsPolicyRequest.decodeDelimited = function decodeDelimited(reader) { + UrlFilteringProfile.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a CreateClientTlsPolicyRequest message. + * Verifies an UrlFilteringProfile message. * @function verify - * @memberof google.cloud.networksecurity.v1.CreateClientTlsPolicyRequest + * @memberof google.cloud.networksecurity.v1.UrlFilteringProfile * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - CreateClientTlsPolicyRequest.verify = function verify(message) { + UrlFilteringProfile.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; - if (message.clientTlsPolicyId != null && message.hasOwnProperty("clientTlsPolicyId")) - if (!$util.isString(message.clientTlsPolicyId)) - return "clientTlsPolicyId: string expected"; - if (message.clientTlsPolicy != null && message.hasOwnProperty("clientTlsPolicy")) { - var error = $root.google.cloud.networksecurity.v1.ClientTlsPolicy.verify(message.clientTlsPolicy); - if (error) - return "clientTlsPolicy." + error; + if (message.urlFilters != null && message.hasOwnProperty("urlFilters")) { + if (!Array.isArray(message.urlFilters)) + return "urlFilters: array expected"; + for (var i = 0; i < message.urlFilters.length; ++i) { + var error = $root.google.cloud.networksecurity.v1.UrlFilter.verify(message.urlFilters[i]); + if (error) + return "urlFilters." + error; + } } return null; }; /** - * Creates a CreateClientTlsPolicyRequest message from a plain object. Also converts values to their respective internal types. + * Creates an UrlFilteringProfile message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.networksecurity.v1.CreateClientTlsPolicyRequest + * @memberof google.cloud.networksecurity.v1.UrlFilteringProfile * @static * @param {Object.} object Plain object - * @returns {google.cloud.networksecurity.v1.CreateClientTlsPolicyRequest} CreateClientTlsPolicyRequest + * @returns {google.cloud.networksecurity.v1.UrlFilteringProfile} UrlFilteringProfile */ - CreateClientTlsPolicyRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.networksecurity.v1.CreateClientTlsPolicyRequest) + UrlFilteringProfile.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networksecurity.v1.UrlFilteringProfile) return object; - var message = new $root.google.cloud.networksecurity.v1.CreateClientTlsPolicyRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.clientTlsPolicyId != null) - message.clientTlsPolicyId = String(object.clientTlsPolicyId); - if (object.clientTlsPolicy != null) { - if (typeof object.clientTlsPolicy !== "object") - throw TypeError(".google.cloud.networksecurity.v1.CreateClientTlsPolicyRequest.clientTlsPolicy: object expected"); - message.clientTlsPolicy = $root.google.cloud.networksecurity.v1.ClientTlsPolicy.fromObject(object.clientTlsPolicy); + var message = new $root.google.cloud.networksecurity.v1.UrlFilteringProfile(); + if (object.urlFilters) { + if (!Array.isArray(object.urlFilters)) + throw TypeError(".google.cloud.networksecurity.v1.UrlFilteringProfile.urlFilters: array expected"); + message.urlFilters = []; + for (var i = 0; i < object.urlFilters.length; ++i) { + if (typeof object.urlFilters[i] !== "object") + throw TypeError(".google.cloud.networksecurity.v1.UrlFilteringProfile.urlFilters: object expected"); + message.urlFilters[i] = $root.google.cloud.networksecurity.v1.UrlFilter.fromObject(object.urlFilters[i]); + } } return message; }; /** - * Creates a plain object from a CreateClientTlsPolicyRequest message. Also converts values to other types if specified. + * Creates a plain object from an UrlFilteringProfile message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.networksecurity.v1.CreateClientTlsPolicyRequest + * @memberof google.cloud.networksecurity.v1.UrlFilteringProfile * @static - * @param {google.cloud.networksecurity.v1.CreateClientTlsPolicyRequest} message CreateClientTlsPolicyRequest + * @param {google.cloud.networksecurity.v1.UrlFilteringProfile} message UrlFilteringProfile * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - CreateClientTlsPolicyRequest.toObject = function toObject(message, options) { + UrlFilteringProfile.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) { - object.parent = ""; - object.clientTlsPolicyId = ""; - object.clientTlsPolicy = null; + if (options.arrays || options.defaults) + object.urlFilters = []; + if (message.urlFilters && message.urlFilters.length) { + object.urlFilters = []; + for (var j = 0; j < message.urlFilters.length; ++j) + object.urlFilters[j] = $root.google.cloud.networksecurity.v1.UrlFilter.toObject(message.urlFilters[j], options); } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.clientTlsPolicyId != null && message.hasOwnProperty("clientTlsPolicyId")) - object.clientTlsPolicyId = message.clientTlsPolicyId; - if (message.clientTlsPolicy != null && message.hasOwnProperty("clientTlsPolicy")) - object.clientTlsPolicy = $root.google.cloud.networksecurity.v1.ClientTlsPolicy.toObject(message.clientTlsPolicy, options); return object; }; /** - * Converts this CreateClientTlsPolicyRequest to JSON. + * Converts this UrlFilteringProfile to JSON. * @function toJSON - * @memberof google.cloud.networksecurity.v1.CreateClientTlsPolicyRequest + * @memberof google.cloud.networksecurity.v1.UrlFilteringProfile * @instance * @returns {Object.} JSON object */ - CreateClientTlsPolicyRequest.prototype.toJSON = function toJSON() { + UrlFilteringProfile.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for CreateClientTlsPolicyRequest + * Gets the default type url for UrlFilteringProfile * @function getTypeUrl - * @memberof google.cloud.networksecurity.v1.CreateClientTlsPolicyRequest + * @memberof google.cloud.networksecurity.v1.UrlFilteringProfile * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - CreateClientTlsPolicyRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + UrlFilteringProfile.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.networksecurity.v1.CreateClientTlsPolicyRequest"; + return typeUrlPrefix + "/google.cloud.networksecurity.v1.UrlFilteringProfile"; }; - return CreateClientTlsPolicyRequest; + return UrlFilteringProfile; })(); - v1.UpdateClientTlsPolicyRequest = (function() { + v1.UrlFilter = (function() { /** - * Properties of an UpdateClientTlsPolicyRequest. + * Properties of an UrlFilter. * @memberof google.cloud.networksecurity.v1 - * @interface IUpdateClientTlsPolicyRequest - * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateClientTlsPolicyRequest updateMask - * @property {google.cloud.networksecurity.v1.IClientTlsPolicy|null} [clientTlsPolicy] UpdateClientTlsPolicyRequest clientTlsPolicy + * @interface IUrlFilter + * @property {google.cloud.networksecurity.v1.UrlFilter.UrlFilteringAction|null} [filteringAction] UrlFilter filteringAction + * @property {Array.|null} [urls] UrlFilter urls + * @property {number|null} [priority] UrlFilter priority */ /** - * Constructs a new UpdateClientTlsPolicyRequest. + * Constructs a new UrlFilter. * @memberof google.cloud.networksecurity.v1 - * @classdesc Represents an UpdateClientTlsPolicyRequest. - * @implements IUpdateClientTlsPolicyRequest + * @classdesc Represents an UrlFilter. + * @implements IUrlFilter * @constructor - * @param {google.cloud.networksecurity.v1.IUpdateClientTlsPolicyRequest=} [properties] Properties to set + * @param {google.cloud.networksecurity.v1.IUrlFilter=} [properties] Properties to set */ - function UpdateClientTlsPolicyRequest(properties) { + function UrlFilter(properties) { + this.urls = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -8802,442 +62135,685 @@ } /** - * UpdateClientTlsPolicyRequest updateMask. - * @member {google.protobuf.IFieldMask|null|undefined} updateMask - * @memberof google.cloud.networksecurity.v1.UpdateClientTlsPolicyRequest + * UrlFilter filteringAction. + * @member {google.cloud.networksecurity.v1.UrlFilter.UrlFilteringAction} filteringAction + * @memberof google.cloud.networksecurity.v1.UrlFilter * @instance */ - UpdateClientTlsPolicyRequest.prototype.updateMask = null; + UrlFilter.prototype.filteringAction = 0; /** - * UpdateClientTlsPolicyRequest clientTlsPolicy. - * @member {google.cloud.networksecurity.v1.IClientTlsPolicy|null|undefined} clientTlsPolicy - * @memberof google.cloud.networksecurity.v1.UpdateClientTlsPolicyRequest + * UrlFilter urls. + * @member {Array.} urls + * @memberof google.cloud.networksecurity.v1.UrlFilter * @instance */ - UpdateClientTlsPolicyRequest.prototype.clientTlsPolicy = null; + UrlFilter.prototype.urls = $util.emptyArray; /** - * Creates a new UpdateClientTlsPolicyRequest instance using the specified properties. + * UrlFilter priority. + * @member {number|null|undefined} priority + * @memberof google.cloud.networksecurity.v1.UrlFilter + * @instance + */ + UrlFilter.prototype.priority = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(UrlFilter.prototype, "_priority", { + get: $util.oneOfGetter($oneOfFields = ["priority"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new UrlFilter instance using the specified properties. * @function create - * @memberof google.cloud.networksecurity.v1.UpdateClientTlsPolicyRequest + * @memberof google.cloud.networksecurity.v1.UrlFilter * @static - * @param {google.cloud.networksecurity.v1.IUpdateClientTlsPolicyRequest=} [properties] Properties to set - * @returns {google.cloud.networksecurity.v1.UpdateClientTlsPolicyRequest} UpdateClientTlsPolicyRequest instance + * @param {google.cloud.networksecurity.v1.IUrlFilter=} [properties] Properties to set + * @returns {google.cloud.networksecurity.v1.UrlFilter} UrlFilter instance */ - UpdateClientTlsPolicyRequest.create = function create(properties) { - return new UpdateClientTlsPolicyRequest(properties); + UrlFilter.create = function create(properties) { + return new UrlFilter(properties); }; /** - * Encodes the specified UpdateClientTlsPolicyRequest message. Does not implicitly {@link google.cloud.networksecurity.v1.UpdateClientTlsPolicyRequest.verify|verify} messages. + * Encodes the specified UrlFilter message. Does not implicitly {@link google.cloud.networksecurity.v1.UrlFilter.verify|verify} messages. * @function encode - * @memberof google.cloud.networksecurity.v1.UpdateClientTlsPolicyRequest + * @memberof google.cloud.networksecurity.v1.UrlFilter * @static - * @param {google.cloud.networksecurity.v1.IUpdateClientTlsPolicyRequest} message UpdateClientTlsPolicyRequest message or plain object to encode + * @param {google.cloud.networksecurity.v1.IUrlFilter} message UrlFilter message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - UpdateClientTlsPolicyRequest.encode = function encode(message, writer) { + UrlFilter.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) - $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.clientTlsPolicy != null && Object.hasOwnProperty.call(message, "clientTlsPolicy")) - $root.google.cloud.networksecurity.v1.ClientTlsPolicy.encode(message.clientTlsPolicy, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.filteringAction != null && Object.hasOwnProperty.call(message, "filteringAction")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.filteringAction); + if (message.urls != null && message.urls.length) + for (var i = 0; i < message.urls.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.urls[i]); + if (message.priority != null && Object.hasOwnProperty.call(message, "priority")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.priority); return writer; }; /** - * Encodes the specified UpdateClientTlsPolicyRequest message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.UpdateClientTlsPolicyRequest.verify|verify} messages. + * Encodes the specified UrlFilter message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.UrlFilter.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.networksecurity.v1.UpdateClientTlsPolicyRequest + * @memberof google.cloud.networksecurity.v1.UrlFilter * @static - * @param {google.cloud.networksecurity.v1.IUpdateClientTlsPolicyRequest} message UpdateClientTlsPolicyRequest message or plain object to encode + * @param {google.cloud.networksecurity.v1.IUrlFilter} message UrlFilter message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - UpdateClientTlsPolicyRequest.encodeDelimited = function encodeDelimited(message, writer) { + UrlFilter.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an UpdateClientTlsPolicyRequest message from the specified reader or buffer. + * Decodes an UrlFilter message from the specified reader or buffer. * @function decode - * @memberof google.cloud.networksecurity.v1.UpdateClientTlsPolicyRequest + * @memberof google.cloud.networksecurity.v1.UrlFilter * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.networksecurity.v1.UpdateClientTlsPolicyRequest} UpdateClientTlsPolicyRequest + * @returns {google.cloud.networksecurity.v1.UrlFilter} UrlFilter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UrlFilter.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networksecurity.v1.UrlFilter(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.filteringAction = reader.int32(); + break; + } + case 2: { + if (!(message.urls && message.urls.length)) + message.urls = []; + message.urls.push(reader.string()); + break; + } + case 3: { + message.priority = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UrlFilter message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.networksecurity.v1.UrlFilter + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.networksecurity.v1.UrlFilter} UrlFilter * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - UpdateClientTlsPolicyRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networksecurity.v1.UpdateClientTlsPolicyRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); - break; - } - case 2: { - message.clientTlsPolicy = $root.google.cloud.networksecurity.v1.ClientTlsPolicy.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + UrlFilter.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UrlFilter message. + * @function verify + * @memberof google.cloud.networksecurity.v1.UrlFilter + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UrlFilter.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.filteringAction != null && message.hasOwnProperty("filteringAction")) + switch (message.filteringAction) { + default: + return "filteringAction: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.urls != null && message.hasOwnProperty("urls")) { + if (!Array.isArray(message.urls)) + return "urls: array expected"; + for (var i = 0; i < message.urls.length; ++i) + if (!$util.isString(message.urls[i])) + return "urls: string[] expected"; + } + if (message.priority != null && message.hasOwnProperty("priority")) { + properties._priority = 1; + if (!$util.isInteger(message.priority)) + return "priority: integer expected"; + } + return null; + }; + + /** + * Creates an UrlFilter message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.networksecurity.v1.UrlFilter + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.networksecurity.v1.UrlFilter} UrlFilter + */ + UrlFilter.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networksecurity.v1.UrlFilter) + return object; + var message = new $root.google.cloud.networksecurity.v1.UrlFilter(); + switch (object.filteringAction) { + default: + if (typeof object.filteringAction === "number") { + message.filteringAction = object.filteringAction; + break; + } + break; + case "URL_FILTERING_ACTION_UNSPECIFIED": + case 0: + message.filteringAction = 0; + break; + case "ALLOW": + case 1: + message.filteringAction = 1; + break; + case "DENY": + case 2: + message.filteringAction = 2; + break; + } + if (object.urls) { + if (!Array.isArray(object.urls)) + throw TypeError(".google.cloud.networksecurity.v1.UrlFilter.urls: array expected"); + message.urls = []; + for (var i = 0; i < object.urls.length; ++i) + message.urls[i] = String(object.urls[i]); + } + if (object.priority != null) + message.priority = object.priority | 0; + return message; + }; + + /** + * Creates a plain object from an UrlFilter message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.networksecurity.v1.UrlFilter + * @static + * @param {google.cloud.networksecurity.v1.UrlFilter} message UrlFilter + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UrlFilter.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.urls = []; + if (options.defaults) + object.filteringAction = options.enums === String ? "URL_FILTERING_ACTION_UNSPECIFIED" : 0; + if (message.filteringAction != null && message.hasOwnProperty("filteringAction")) + object.filteringAction = options.enums === String ? $root.google.cloud.networksecurity.v1.UrlFilter.UrlFilteringAction[message.filteringAction] === undefined ? message.filteringAction : $root.google.cloud.networksecurity.v1.UrlFilter.UrlFilteringAction[message.filteringAction] : message.filteringAction; + if (message.urls && message.urls.length) { + object.urls = []; + for (var j = 0; j < message.urls.length; ++j) + object.urls[j] = message.urls[j]; + } + if (message.priority != null && message.hasOwnProperty("priority")) { + object.priority = message.priority; + if (options.oneofs) + object._priority = "priority"; + } + return object; + }; + + /** + * Converts this UrlFilter to JSON. + * @function toJSON + * @memberof google.cloud.networksecurity.v1.UrlFilter + * @instance + * @returns {Object.} JSON object + */ + UrlFilter.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UrlFilter + * @function getTypeUrl + * @memberof google.cloud.networksecurity.v1.UrlFilter + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UrlFilter.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.networksecurity.v1.UrlFilter"; + }; + + /** + * UrlFilteringAction enum. + * @name google.cloud.networksecurity.v1.UrlFilter.UrlFilteringAction + * @enum {number} + * @property {number} URL_FILTERING_ACTION_UNSPECIFIED=0 URL_FILTERING_ACTION_UNSPECIFIED value + * @property {number} ALLOW=1 ALLOW value + * @property {number} DENY=2 DENY value + */ + UrlFilter.UrlFilteringAction = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "URL_FILTERING_ACTION_UNSPECIFIED"] = 0; + values[valuesById[1] = "ALLOW"] = 1; + values[valuesById[2] = "DENY"] = 2; + return values; + })(); + + return UrlFilter; + })(); + + v1.OrganizationSecurityProfileGroupService = (function() { + + /** + * Constructs a new OrganizationSecurityProfileGroupService service. + * @memberof google.cloud.networksecurity.v1 + * @classdesc Represents an OrganizationSecurityProfileGroupService + * @extends $protobuf.rpc.Service + * @constructor + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + */ + function OrganizationSecurityProfileGroupService(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (OrganizationSecurityProfileGroupService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = OrganizationSecurityProfileGroupService; + + /** + * Creates new OrganizationSecurityProfileGroupService service using the specified rpc implementation. + * @function create + * @memberof google.cloud.networksecurity.v1.OrganizationSecurityProfileGroupService + * @static + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + * @returns {OrganizationSecurityProfileGroupService} RPC service. Useful where requests and/or responses are streamed. + */ + OrganizationSecurityProfileGroupService.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.networksecurity.v1.OrganizationSecurityProfileGroupService|listSecurityProfileGroups}. + * @memberof google.cloud.networksecurity.v1.OrganizationSecurityProfileGroupService + * @typedef ListSecurityProfileGroupsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.networksecurity.v1.ListSecurityProfileGroupsResponse} [response] ListSecurityProfileGroupsResponse + */ + + /** + * Calls ListSecurityProfileGroups. + * @function listSecurityProfileGroups + * @memberof google.cloud.networksecurity.v1.OrganizationSecurityProfileGroupService + * @instance + * @param {google.cloud.networksecurity.v1.IListSecurityProfileGroupsRequest} request ListSecurityProfileGroupsRequest message or plain object + * @param {google.cloud.networksecurity.v1.OrganizationSecurityProfileGroupService.ListSecurityProfileGroupsCallback} callback Node-style callback called with the error, if any, and ListSecurityProfileGroupsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(OrganizationSecurityProfileGroupService.prototype.listSecurityProfileGroups = function listSecurityProfileGroups(request, callback) { + return this.rpcCall(listSecurityProfileGroups, $root.google.cloud.networksecurity.v1.ListSecurityProfileGroupsRequest, $root.google.cloud.networksecurity.v1.ListSecurityProfileGroupsResponse, request, callback); + }, "name", { value: "ListSecurityProfileGroups" }); + + /** + * Calls ListSecurityProfileGroups. + * @function listSecurityProfileGroups + * @memberof google.cloud.networksecurity.v1.OrganizationSecurityProfileGroupService + * @instance + * @param {google.cloud.networksecurity.v1.IListSecurityProfileGroupsRequest} request ListSecurityProfileGroupsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.networksecurity.v1.OrganizationSecurityProfileGroupService|getSecurityProfileGroup}. + * @memberof google.cloud.networksecurity.v1.OrganizationSecurityProfileGroupService + * @typedef GetSecurityProfileGroupCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.networksecurity.v1.SecurityProfileGroup} [response] SecurityProfileGroup + */ + + /** + * Calls GetSecurityProfileGroup. + * @function getSecurityProfileGroup + * @memberof google.cloud.networksecurity.v1.OrganizationSecurityProfileGroupService + * @instance + * @param {google.cloud.networksecurity.v1.IGetSecurityProfileGroupRequest} request GetSecurityProfileGroupRequest message or plain object + * @param {google.cloud.networksecurity.v1.OrganizationSecurityProfileGroupService.GetSecurityProfileGroupCallback} callback Node-style callback called with the error, if any, and SecurityProfileGroup + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(OrganizationSecurityProfileGroupService.prototype.getSecurityProfileGroup = function getSecurityProfileGroup(request, callback) { + return this.rpcCall(getSecurityProfileGroup, $root.google.cloud.networksecurity.v1.GetSecurityProfileGroupRequest, $root.google.cloud.networksecurity.v1.SecurityProfileGroup, request, callback); + }, "name", { value: "GetSecurityProfileGroup" }); + + /** + * Calls GetSecurityProfileGroup. + * @function getSecurityProfileGroup + * @memberof google.cloud.networksecurity.v1.OrganizationSecurityProfileGroupService + * @instance + * @param {google.cloud.networksecurity.v1.IGetSecurityProfileGroupRequest} request GetSecurityProfileGroupRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.networksecurity.v1.OrganizationSecurityProfileGroupService|createSecurityProfileGroup}. + * @memberof google.cloud.networksecurity.v1.OrganizationSecurityProfileGroupService + * @typedef CreateSecurityProfileGroupCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls CreateSecurityProfileGroup. + * @function createSecurityProfileGroup + * @memberof google.cloud.networksecurity.v1.OrganizationSecurityProfileGroupService + * @instance + * @param {google.cloud.networksecurity.v1.ICreateSecurityProfileGroupRequest} request CreateSecurityProfileGroupRequest message or plain object + * @param {google.cloud.networksecurity.v1.OrganizationSecurityProfileGroupService.CreateSecurityProfileGroupCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(OrganizationSecurityProfileGroupService.prototype.createSecurityProfileGroup = function createSecurityProfileGroup(request, callback) { + return this.rpcCall(createSecurityProfileGroup, $root.google.cloud.networksecurity.v1.CreateSecurityProfileGroupRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "CreateSecurityProfileGroup" }); + + /** + * Calls CreateSecurityProfileGroup. + * @function createSecurityProfileGroup + * @memberof google.cloud.networksecurity.v1.OrganizationSecurityProfileGroupService + * @instance + * @param {google.cloud.networksecurity.v1.ICreateSecurityProfileGroupRequest} request CreateSecurityProfileGroupRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ /** - * Decodes an UpdateClientTlsPolicyRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.networksecurity.v1.UpdateClientTlsPolicyRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.networksecurity.v1.UpdateClientTlsPolicyRequest} UpdateClientTlsPolicyRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing + * Callback as used by {@link google.cloud.networksecurity.v1.OrganizationSecurityProfileGroupService|updateSecurityProfileGroup}. + * @memberof google.cloud.networksecurity.v1.OrganizationSecurityProfileGroupService + * @typedef UpdateSecurityProfileGroupCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation */ - UpdateClientTlsPolicyRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; /** - * Verifies an UpdateClientTlsPolicyRequest message. - * @function verify - * @memberof google.cloud.networksecurity.v1.UpdateClientTlsPolicyRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not + * Calls UpdateSecurityProfileGroup. + * @function updateSecurityProfileGroup + * @memberof google.cloud.networksecurity.v1.OrganizationSecurityProfileGroupService + * @instance + * @param {google.cloud.networksecurity.v1.IUpdateSecurityProfileGroupRequest} request UpdateSecurityProfileGroupRequest message or plain object + * @param {google.cloud.networksecurity.v1.OrganizationSecurityProfileGroupService.UpdateSecurityProfileGroupCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 */ - UpdateClientTlsPolicyRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.updateMask != null && message.hasOwnProperty("updateMask")) { - var error = $root.google.protobuf.FieldMask.verify(message.updateMask); - if (error) - return "updateMask." + error; - } - if (message.clientTlsPolicy != null && message.hasOwnProperty("clientTlsPolicy")) { - var error = $root.google.cloud.networksecurity.v1.ClientTlsPolicy.verify(message.clientTlsPolicy); - if (error) - return "clientTlsPolicy." + error; - } - return null; - }; + Object.defineProperty(OrganizationSecurityProfileGroupService.prototype.updateSecurityProfileGroup = function updateSecurityProfileGroup(request, callback) { + return this.rpcCall(updateSecurityProfileGroup, $root.google.cloud.networksecurity.v1.UpdateSecurityProfileGroupRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "UpdateSecurityProfileGroup" }); /** - * Creates an UpdateClientTlsPolicyRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.networksecurity.v1.UpdateClientTlsPolicyRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.networksecurity.v1.UpdateClientTlsPolicyRequest} UpdateClientTlsPolicyRequest + * Calls UpdateSecurityProfileGroup. + * @function updateSecurityProfileGroup + * @memberof google.cloud.networksecurity.v1.OrganizationSecurityProfileGroupService + * @instance + * @param {google.cloud.networksecurity.v1.IUpdateSecurityProfileGroupRequest} request UpdateSecurityProfileGroupRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - UpdateClientTlsPolicyRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.networksecurity.v1.UpdateClientTlsPolicyRequest) - return object; - var message = new $root.google.cloud.networksecurity.v1.UpdateClientTlsPolicyRequest(); - if (object.updateMask != null) { - if (typeof object.updateMask !== "object") - throw TypeError(".google.cloud.networksecurity.v1.UpdateClientTlsPolicyRequest.updateMask: object expected"); - message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); - } - if (object.clientTlsPolicy != null) { - if (typeof object.clientTlsPolicy !== "object") - throw TypeError(".google.cloud.networksecurity.v1.UpdateClientTlsPolicyRequest.clientTlsPolicy: object expected"); - message.clientTlsPolicy = $root.google.cloud.networksecurity.v1.ClientTlsPolicy.fromObject(object.clientTlsPolicy); - } - return message; - }; /** - * Creates a plain object from an UpdateClientTlsPolicyRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.networksecurity.v1.UpdateClientTlsPolicyRequest - * @static - * @param {google.cloud.networksecurity.v1.UpdateClientTlsPolicyRequest} message UpdateClientTlsPolicyRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object + * Callback as used by {@link google.cloud.networksecurity.v1.OrganizationSecurityProfileGroupService|deleteSecurityProfileGroup}. + * @memberof google.cloud.networksecurity.v1.OrganizationSecurityProfileGroupService + * @typedef DeleteSecurityProfileGroupCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation */ - UpdateClientTlsPolicyRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.updateMask = null; - object.clientTlsPolicy = null; - } - if (message.updateMask != null && message.hasOwnProperty("updateMask")) - object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); - if (message.clientTlsPolicy != null && message.hasOwnProperty("clientTlsPolicy")) - object.clientTlsPolicy = $root.google.cloud.networksecurity.v1.ClientTlsPolicy.toObject(message.clientTlsPolicy, options); - return object; - }; /** - * Converts this UpdateClientTlsPolicyRequest to JSON. - * @function toJSON - * @memberof google.cloud.networksecurity.v1.UpdateClientTlsPolicyRequest + * Calls DeleteSecurityProfileGroup. + * @function deleteSecurityProfileGroup + * @memberof google.cloud.networksecurity.v1.OrganizationSecurityProfileGroupService * @instance - * @returns {Object.} JSON object + * @param {google.cloud.networksecurity.v1.IDeleteSecurityProfileGroupRequest} request DeleteSecurityProfileGroupRequest message or plain object + * @param {google.cloud.networksecurity.v1.OrganizationSecurityProfileGroupService.DeleteSecurityProfileGroupCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 */ - UpdateClientTlsPolicyRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + Object.defineProperty(OrganizationSecurityProfileGroupService.prototype.deleteSecurityProfileGroup = function deleteSecurityProfileGroup(request, callback) { + return this.rpcCall(deleteSecurityProfileGroup, $root.google.cloud.networksecurity.v1.DeleteSecurityProfileGroupRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "DeleteSecurityProfileGroup" }); /** - * Gets the default type url for UpdateClientTlsPolicyRequest - * @function getTypeUrl - * @memberof google.cloud.networksecurity.v1.UpdateClientTlsPolicyRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url + * Calls DeleteSecurityProfileGroup. + * @function deleteSecurityProfileGroup + * @memberof google.cloud.networksecurity.v1.OrganizationSecurityProfileGroupService + * @instance + * @param {google.cloud.networksecurity.v1.IDeleteSecurityProfileGroupRequest} request DeleteSecurityProfileGroupRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - UpdateClientTlsPolicyRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.networksecurity.v1.UpdateClientTlsPolicyRequest"; - }; - return UpdateClientTlsPolicyRequest; - })(); + /** + * Callback as used by {@link google.cloud.networksecurity.v1.OrganizationSecurityProfileGroupService|listSecurityProfiles}. + * @memberof google.cloud.networksecurity.v1.OrganizationSecurityProfileGroupService + * @typedef ListSecurityProfilesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.networksecurity.v1.ListSecurityProfilesResponse} [response] ListSecurityProfilesResponse + */ - v1.DeleteClientTlsPolicyRequest = (function() { + /** + * Calls ListSecurityProfiles. + * @function listSecurityProfiles + * @memberof google.cloud.networksecurity.v1.OrganizationSecurityProfileGroupService + * @instance + * @param {google.cloud.networksecurity.v1.IListSecurityProfilesRequest} request ListSecurityProfilesRequest message or plain object + * @param {google.cloud.networksecurity.v1.OrganizationSecurityProfileGroupService.ListSecurityProfilesCallback} callback Node-style callback called with the error, if any, and ListSecurityProfilesResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(OrganizationSecurityProfileGroupService.prototype.listSecurityProfiles = function listSecurityProfiles(request, callback) { + return this.rpcCall(listSecurityProfiles, $root.google.cloud.networksecurity.v1.ListSecurityProfilesRequest, $root.google.cloud.networksecurity.v1.ListSecurityProfilesResponse, request, callback); + }, "name", { value: "ListSecurityProfiles" }); /** - * Properties of a DeleteClientTlsPolicyRequest. - * @memberof google.cloud.networksecurity.v1 - * @interface IDeleteClientTlsPolicyRequest - * @property {string|null} [name] DeleteClientTlsPolicyRequest name + * Calls ListSecurityProfiles. + * @function listSecurityProfiles + * @memberof google.cloud.networksecurity.v1.OrganizationSecurityProfileGroupService + * @instance + * @param {google.cloud.networksecurity.v1.IListSecurityProfilesRequest} request ListSecurityProfilesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ /** - * Constructs a new DeleteClientTlsPolicyRequest. - * @memberof google.cloud.networksecurity.v1 - * @classdesc Represents a DeleteClientTlsPolicyRequest. - * @implements IDeleteClientTlsPolicyRequest - * @constructor - * @param {google.cloud.networksecurity.v1.IDeleteClientTlsPolicyRequest=} [properties] Properties to set + * Callback as used by {@link google.cloud.networksecurity.v1.OrganizationSecurityProfileGroupService|getSecurityProfile}. + * @memberof google.cloud.networksecurity.v1.OrganizationSecurityProfileGroupService + * @typedef GetSecurityProfileCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.networksecurity.v1.SecurityProfile} [response] SecurityProfile */ - function DeleteClientTlsPolicyRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } /** - * DeleteClientTlsPolicyRequest name. - * @member {string} name - * @memberof google.cloud.networksecurity.v1.DeleteClientTlsPolicyRequest + * Calls GetSecurityProfile. + * @function getSecurityProfile + * @memberof google.cloud.networksecurity.v1.OrganizationSecurityProfileGroupService * @instance + * @param {google.cloud.networksecurity.v1.IGetSecurityProfileRequest} request GetSecurityProfileRequest message or plain object + * @param {google.cloud.networksecurity.v1.OrganizationSecurityProfileGroupService.GetSecurityProfileCallback} callback Node-style callback called with the error, if any, and SecurityProfile + * @returns {undefined} + * @variation 1 */ - DeleteClientTlsPolicyRequest.prototype.name = ""; + Object.defineProperty(OrganizationSecurityProfileGroupService.prototype.getSecurityProfile = function getSecurityProfile(request, callback) { + return this.rpcCall(getSecurityProfile, $root.google.cloud.networksecurity.v1.GetSecurityProfileRequest, $root.google.cloud.networksecurity.v1.SecurityProfile, request, callback); + }, "name", { value: "GetSecurityProfile" }); /** - * Creates a new DeleteClientTlsPolicyRequest instance using the specified properties. - * @function create - * @memberof google.cloud.networksecurity.v1.DeleteClientTlsPolicyRequest - * @static - * @param {google.cloud.networksecurity.v1.IDeleteClientTlsPolicyRequest=} [properties] Properties to set - * @returns {google.cloud.networksecurity.v1.DeleteClientTlsPolicyRequest} DeleteClientTlsPolicyRequest instance + * Calls GetSecurityProfile. + * @function getSecurityProfile + * @memberof google.cloud.networksecurity.v1.OrganizationSecurityProfileGroupService + * @instance + * @param {google.cloud.networksecurity.v1.IGetSecurityProfileRequest} request GetSecurityProfileRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - DeleteClientTlsPolicyRequest.create = function create(properties) { - return new DeleteClientTlsPolicyRequest(properties); - }; /** - * Encodes the specified DeleteClientTlsPolicyRequest message. Does not implicitly {@link google.cloud.networksecurity.v1.DeleteClientTlsPolicyRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.networksecurity.v1.DeleteClientTlsPolicyRequest - * @static - * @param {google.cloud.networksecurity.v1.IDeleteClientTlsPolicyRequest} message DeleteClientTlsPolicyRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer + * Callback as used by {@link google.cloud.networksecurity.v1.OrganizationSecurityProfileGroupService|createSecurityProfile}. + * @memberof google.cloud.networksecurity.v1.OrganizationSecurityProfileGroupService + * @typedef CreateSecurityProfileCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation */ - DeleteClientTlsPolicyRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - return writer; - }; /** - * Encodes the specified DeleteClientTlsPolicyRequest message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.DeleteClientTlsPolicyRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.networksecurity.v1.DeleteClientTlsPolicyRequest - * @static - * @param {google.cloud.networksecurity.v1.IDeleteClientTlsPolicyRequest} message DeleteClientTlsPolicyRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer + * Calls CreateSecurityProfile. + * @function createSecurityProfile + * @memberof google.cloud.networksecurity.v1.OrganizationSecurityProfileGroupService + * @instance + * @param {google.cloud.networksecurity.v1.ICreateSecurityProfileRequest} request CreateSecurityProfileRequest message or plain object + * @param {google.cloud.networksecurity.v1.OrganizationSecurityProfileGroupService.CreateSecurityProfileCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 */ - DeleteClientTlsPolicyRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + Object.defineProperty(OrganizationSecurityProfileGroupService.prototype.createSecurityProfile = function createSecurityProfile(request, callback) { + return this.rpcCall(createSecurityProfile, $root.google.cloud.networksecurity.v1.CreateSecurityProfileRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "CreateSecurityProfile" }); /** - * Decodes a DeleteClientTlsPolicyRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.networksecurity.v1.DeleteClientTlsPolicyRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.networksecurity.v1.DeleteClientTlsPolicyRequest} DeleteClientTlsPolicyRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing + * Calls CreateSecurityProfile. + * @function createSecurityProfile + * @memberof google.cloud.networksecurity.v1.OrganizationSecurityProfileGroupService + * @instance + * @param {google.cloud.networksecurity.v1.ICreateSecurityProfileRequest} request CreateSecurityProfileRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - DeleteClientTlsPolicyRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networksecurity.v1.DeleteClientTlsPolicyRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; /** - * Decodes a DeleteClientTlsPolicyRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.networksecurity.v1.DeleteClientTlsPolicyRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.networksecurity.v1.DeleteClientTlsPolicyRequest} DeleteClientTlsPolicyRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing + * Callback as used by {@link google.cloud.networksecurity.v1.OrganizationSecurityProfileGroupService|updateSecurityProfile}. + * @memberof google.cloud.networksecurity.v1.OrganizationSecurityProfileGroupService + * @typedef UpdateSecurityProfileCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation */ - DeleteClientTlsPolicyRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; /** - * Verifies a DeleteClientTlsPolicyRequest message. - * @function verify - * @memberof google.cloud.networksecurity.v1.DeleteClientTlsPolicyRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not + * Calls UpdateSecurityProfile. + * @function updateSecurityProfile + * @memberof google.cloud.networksecurity.v1.OrganizationSecurityProfileGroupService + * @instance + * @param {google.cloud.networksecurity.v1.IUpdateSecurityProfileRequest} request UpdateSecurityProfileRequest message or plain object + * @param {google.cloud.networksecurity.v1.OrganizationSecurityProfileGroupService.UpdateSecurityProfileCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 */ - DeleteClientTlsPolicyRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - return null; - }; + Object.defineProperty(OrganizationSecurityProfileGroupService.prototype.updateSecurityProfile = function updateSecurityProfile(request, callback) { + return this.rpcCall(updateSecurityProfile, $root.google.cloud.networksecurity.v1.UpdateSecurityProfileRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "UpdateSecurityProfile" }); /** - * Creates a DeleteClientTlsPolicyRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.networksecurity.v1.DeleteClientTlsPolicyRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.networksecurity.v1.DeleteClientTlsPolicyRequest} DeleteClientTlsPolicyRequest + * Calls UpdateSecurityProfile. + * @function updateSecurityProfile + * @memberof google.cloud.networksecurity.v1.OrganizationSecurityProfileGroupService + * @instance + * @param {google.cloud.networksecurity.v1.IUpdateSecurityProfileRequest} request UpdateSecurityProfileRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - DeleteClientTlsPolicyRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.networksecurity.v1.DeleteClientTlsPolicyRequest) - return object; - var message = new $root.google.cloud.networksecurity.v1.DeleteClientTlsPolicyRequest(); - if (object.name != null) - message.name = String(object.name); - return message; - }; /** - * Creates a plain object from a DeleteClientTlsPolicyRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.networksecurity.v1.DeleteClientTlsPolicyRequest - * @static - * @param {google.cloud.networksecurity.v1.DeleteClientTlsPolicyRequest} message DeleteClientTlsPolicyRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object + * Callback as used by {@link google.cloud.networksecurity.v1.OrganizationSecurityProfileGroupService|deleteSecurityProfile}. + * @memberof google.cloud.networksecurity.v1.OrganizationSecurityProfileGroupService + * @typedef DeleteSecurityProfileCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation */ - DeleteClientTlsPolicyRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.name = ""; - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - return object; - }; /** - * Converts this DeleteClientTlsPolicyRequest to JSON. - * @function toJSON - * @memberof google.cloud.networksecurity.v1.DeleteClientTlsPolicyRequest + * Calls DeleteSecurityProfile. + * @function deleteSecurityProfile + * @memberof google.cloud.networksecurity.v1.OrganizationSecurityProfileGroupService * @instance - * @returns {Object.} JSON object + * @param {google.cloud.networksecurity.v1.IDeleteSecurityProfileRequest} request DeleteSecurityProfileRequest message or plain object + * @param {google.cloud.networksecurity.v1.OrganizationSecurityProfileGroupService.DeleteSecurityProfileCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 */ - DeleteClientTlsPolicyRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + Object.defineProperty(OrganizationSecurityProfileGroupService.prototype.deleteSecurityProfile = function deleteSecurityProfile(request, callback) { + return this.rpcCall(deleteSecurityProfile, $root.google.cloud.networksecurity.v1.DeleteSecurityProfileRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "DeleteSecurityProfile" }); /** - * Gets the default type url for DeleteClientTlsPolicyRequest - * @function getTypeUrl - * @memberof google.cloud.networksecurity.v1.DeleteClientTlsPolicyRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url + * Calls DeleteSecurityProfile. + * @function deleteSecurityProfile + * @memberof google.cloud.networksecurity.v1.OrganizationSecurityProfileGroupService + * @instance + * @param {google.cloud.networksecurity.v1.IDeleteSecurityProfileRequest} request DeleteSecurityProfileRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - DeleteClientTlsPolicyRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.networksecurity.v1.DeleteClientTlsPolicyRequest"; - }; - return DeleteClientTlsPolicyRequest; + return OrganizationSecurityProfileGroupService; })(); - v1.GrpcEndpoint = (function() { + v1.ListSecurityProfileGroupsRequest = (function() { /** - * Properties of a GrpcEndpoint. + * Properties of a ListSecurityProfileGroupsRequest. * @memberof google.cloud.networksecurity.v1 - * @interface IGrpcEndpoint - * @property {string|null} [targetUri] GrpcEndpoint targetUri + * @interface IListSecurityProfileGroupsRequest + * @property {string|null} [parent] ListSecurityProfileGroupsRequest parent + * @property {number|null} [pageSize] ListSecurityProfileGroupsRequest pageSize + * @property {string|null} [pageToken] ListSecurityProfileGroupsRequest pageToken */ /** - * Constructs a new GrpcEndpoint. + * Constructs a new ListSecurityProfileGroupsRequest. * @memberof google.cloud.networksecurity.v1 - * @classdesc Represents a GrpcEndpoint. - * @implements IGrpcEndpoint + * @classdesc Represents a ListSecurityProfileGroupsRequest. + * @implements IListSecurityProfileGroupsRequest * @constructor - * @param {google.cloud.networksecurity.v1.IGrpcEndpoint=} [properties] Properties to set + * @param {google.cloud.networksecurity.v1.IListSecurityProfileGroupsRequest=} [properties] Properties to set */ - function GrpcEndpoint(properties) { + function ListSecurityProfileGroupsRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -9245,77 +62821,105 @@ } /** - * GrpcEndpoint targetUri. - * @member {string} targetUri - * @memberof google.cloud.networksecurity.v1.GrpcEndpoint + * ListSecurityProfileGroupsRequest parent. + * @member {string} parent + * @memberof google.cloud.networksecurity.v1.ListSecurityProfileGroupsRequest * @instance */ - GrpcEndpoint.prototype.targetUri = ""; + ListSecurityProfileGroupsRequest.prototype.parent = ""; /** - * Creates a new GrpcEndpoint instance using the specified properties. + * ListSecurityProfileGroupsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.networksecurity.v1.ListSecurityProfileGroupsRequest + * @instance + */ + ListSecurityProfileGroupsRequest.prototype.pageSize = 0; + + /** + * ListSecurityProfileGroupsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.networksecurity.v1.ListSecurityProfileGroupsRequest + * @instance + */ + ListSecurityProfileGroupsRequest.prototype.pageToken = ""; + + /** + * Creates a new ListSecurityProfileGroupsRequest instance using the specified properties. * @function create - * @memberof google.cloud.networksecurity.v1.GrpcEndpoint + * @memberof google.cloud.networksecurity.v1.ListSecurityProfileGroupsRequest * @static - * @param {google.cloud.networksecurity.v1.IGrpcEndpoint=} [properties] Properties to set - * @returns {google.cloud.networksecurity.v1.GrpcEndpoint} GrpcEndpoint instance + * @param {google.cloud.networksecurity.v1.IListSecurityProfileGroupsRequest=} [properties] Properties to set + * @returns {google.cloud.networksecurity.v1.ListSecurityProfileGroupsRequest} ListSecurityProfileGroupsRequest instance */ - GrpcEndpoint.create = function create(properties) { - return new GrpcEndpoint(properties); + ListSecurityProfileGroupsRequest.create = function create(properties) { + return new ListSecurityProfileGroupsRequest(properties); }; /** - * Encodes the specified GrpcEndpoint message. Does not implicitly {@link google.cloud.networksecurity.v1.GrpcEndpoint.verify|verify} messages. + * Encodes the specified ListSecurityProfileGroupsRequest message. Does not implicitly {@link google.cloud.networksecurity.v1.ListSecurityProfileGroupsRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.networksecurity.v1.GrpcEndpoint + * @memberof google.cloud.networksecurity.v1.ListSecurityProfileGroupsRequest * @static - * @param {google.cloud.networksecurity.v1.IGrpcEndpoint} message GrpcEndpoint message or plain object to encode + * @param {google.cloud.networksecurity.v1.IListSecurityProfileGroupsRequest} message ListSecurityProfileGroupsRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GrpcEndpoint.encode = function encode(message, writer) { + ListSecurityProfileGroupsRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.targetUri != null && Object.hasOwnProperty.call(message, "targetUri")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.targetUri); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); return writer; }; /** - * Encodes the specified GrpcEndpoint message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.GrpcEndpoint.verify|verify} messages. + * Encodes the specified ListSecurityProfileGroupsRequest message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.ListSecurityProfileGroupsRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.networksecurity.v1.GrpcEndpoint + * @memberof google.cloud.networksecurity.v1.ListSecurityProfileGroupsRequest * @static - * @param {google.cloud.networksecurity.v1.IGrpcEndpoint} message GrpcEndpoint message or plain object to encode + * @param {google.cloud.networksecurity.v1.IListSecurityProfileGroupsRequest} message ListSecurityProfileGroupsRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GrpcEndpoint.encodeDelimited = function encodeDelimited(message, writer) { + ListSecurityProfileGroupsRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a GrpcEndpoint message from the specified reader or buffer. + * Decodes a ListSecurityProfileGroupsRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.networksecurity.v1.GrpcEndpoint + * @memberof google.cloud.networksecurity.v1.ListSecurityProfileGroupsRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.networksecurity.v1.GrpcEndpoint} GrpcEndpoint + * @returns {google.cloud.networksecurity.v1.ListSecurityProfileGroupsRequest} ListSecurityProfileGroupsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GrpcEndpoint.decode = function decode(reader, length, error) { + ListSecurityProfileGroupsRequest.decode = function decode(reader, length, error) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networksecurity.v1.GrpcEndpoint(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networksecurity.v1.ListSecurityProfileGroupsRequest(); while (reader.pos < end) { var tag = reader.uint32(); if (tag === error) break; switch (tag >>> 3) { case 1: { - message.targetUri = reader.string(); + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); break; } default: @@ -9327,123 +62931,141 @@ }; /** - * Decodes a GrpcEndpoint message from the specified reader or buffer, length delimited. + * Decodes a ListSecurityProfileGroupsRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.networksecurity.v1.GrpcEndpoint + * @memberof google.cloud.networksecurity.v1.ListSecurityProfileGroupsRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.networksecurity.v1.GrpcEndpoint} GrpcEndpoint + * @returns {google.cloud.networksecurity.v1.ListSecurityProfileGroupsRequest} ListSecurityProfileGroupsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GrpcEndpoint.decodeDelimited = function decodeDelimited(reader) { + ListSecurityProfileGroupsRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a GrpcEndpoint message. + * Verifies a ListSecurityProfileGroupsRequest message. * @function verify - * @memberof google.cloud.networksecurity.v1.GrpcEndpoint + * @memberof google.cloud.networksecurity.v1.ListSecurityProfileGroupsRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - GrpcEndpoint.verify = function verify(message) { + ListSecurityProfileGroupsRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.targetUri != null && message.hasOwnProperty("targetUri")) - if (!$util.isString(message.targetUri)) - return "targetUri: string expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; return null; }; /** - * Creates a GrpcEndpoint message from a plain object. Also converts values to their respective internal types. + * Creates a ListSecurityProfileGroupsRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.networksecurity.v1.GrpcEndpoint + * @memberof google.cloud.networksecurity.v1.ListSecurityProfileGroupsRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.networksecurity.v1.GrpcEndpoint} GrpcEndpoint + * @returns {google.cloud.networksecurity.v1.ListSecurityProfileGroupsRequest} ListSecurityProfileGroupsRequest */ - GrpcEndpoint.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.networksecurity.v1.GrpcEndpoint) + ListSecurityProfileGroupsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networksecurity.v1.ListSecurityProfileGroupsRequest) return object; - var message = new $root.google.cloud.networksecurity.v1.GrpcEndpoint(); - if (object.targetUri != null) - message.targetUri = String(object.targetUri); + var message = new $root.google.cloud.networksecurity.v1.ListSecurityProfileGroupsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); return message; }; /** - * Creates a plain object from a GrpcEndpoint message. Also converts values to other types if specified. + * Creates a plain object from a ListSecurityProfileGroupsRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.networksecurity.v1.GrpcEndpoint + * @memberof google.cloud.networksecurity.v1.ListSecurityProfileGroupsRequest * @static - * @param {google.cloud.networksecurity.v1.GrpcEndpoint} message GrpcEndpoint + * @param {google.cloud.networksecurity.v1.ListSecurityProfileGroupsRequest} message ListSecurityProfileGroupsRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - GrpcEndpoint.toObject = function toObject(message, options) { + ListSecurityProfileGroupsRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) - object.targetUri = ""; - if (message.targetUri != null && message.hasOwnProperty("targetUri")) - object.targetUri = message.targetUri; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; return object; }; /** - * Converts this GrpcEndpoint to JSON. + * Converts this ListSecurityProfileGroupsRequest to JSON. * @function toJSON - * @memberof google.cloud.networksecurity.v1.GrpcEndpoint + * @memberof google.cloud.networksecurity.v1.ListSecurityProfileGroupsRequest * @instance * @returns {Object.} JSON object */ - GrpcEndpoint.prototype.toJSON = function toJSON() { + ListSecurityProfileGroupsRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for GrpcEndpoint + * Gets the default type url for ListSecurityProfileGroupsRequest * @function getTypeUrl - * @memberof google.cloud.networksecurity.v1.GrpcEndpoint + * @memberof google.cloud.networksecurity.v1.ListSecurityProfileGroupsRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - GrpcEndpoint.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + ListSecurityProfileGroupsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.networksecurity.v1.GrpcEndpoint"; + return typeUrlPrefix + "/google.cloud.networksecurity.v1.ListSecurityProfileGroupsRequest"; }; - return GrpcEndpoint; + return ListSecurityProfileGroupsRequest; })(); - v1.ValidationCA = (function() { + v1.ListSecurityProfileGroupsResponse = (function() { /** - * Properties of a ValidationCA. + * Properties of a ListSecurityProfileGroupsResponse. * @memberof google.cloud.networksecurity.v1 - * @interface IValidationCA - * @property {google.cloud.networksecurity.v1.IGrpcEndpoint|null} [grpcEndpoint] ValidationCA grpcEndpoint - * @property {google.cloud.networksecurity.v1.ICertificateProviderInstance|null} [certificateProviderInstance] ValidationCA certificateProviderInstance + * @interface IListSecurityProfileGroupsResponse + * @property {Array.|null} [securityProfileGroups] ListSecurityProfileGroupsResponse securityProfileGroups + * @property {string|null} [nextPageToken] ListSecurityProfileGroupsResponse nextPageToken */ /** - * Constructs a new ValidationCA. + * Constructs a new ListSecurityProfileGroupsResponse. * @memberof google.cloud.networksecurity.v1 - * @classdesc Represents a ValidationCA. - * @implements IValidationCA + * @classdesc Represents a ListSecurityProfileGroupsResponse. + * @implements IListSecurityProfileGroupsResponse * @constructor - * @param {google.cloud.networksecurity.v1.IValidationCA=} [properties] Properties to set + * @param {google.cloud.networksecurity.v1.IListSecurityProfileGroupsResponse=} [properties] Properties to set */ - function ValidationCA(properties) { + function ListSecurityProfileGroupsResponse(properties) { + this.securityProfileGroups = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -9451,105 +63073,94 @@ } /** - * ValidationCA grpcEndpoint. - * @member {google.cloud.networksecurity.v1.IGrpcEndpoint|null|undefined} grpcEndpoint - * @memberof google.cloud.networksecurity.v1.ValidationCA - * @instance - */ - ValidationCA.prototype.grpcEndpoint = null; - - /** - * ValidationCA certificateProviderInstance. - * @member {google.cloud.networksecurity.v1.ICertificateProviderInstance|null|undefined} certificateProviderInstance - * @memberof google.cloud.networksecurity.v1.ValidationCA + * ListSecurityProfileGroupsResponse securityProfileGroups. + * @member {Array.} securityProfileGroups + * @memberof google.cloud.networksecurity.v1.ListSecurityProfileGroupsResponse * @instance */ - ValidationCA.prototype.certificateProviderInstance = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; + ListSecurityProfileGroupsResponse.prototype.securityProfileGroups = $util.emptyArray; /** - * ValidationCA type. - * @member {"grpcEndpoint"|"certificateProviderInstance"|undefined} type - * @memberof google.cloud.networksecurity.v1.ValidationCA + * ListSecurityProfileGroupsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.networksecurity.v1.ListSecurityProfileGroupsResponse * @instance */ - Object.defineProperty(ValidationCA.prototype, "type", { - get: $util.oneOfGetter($oneOfFields = ["grpcEndpoint", "certificateProviderInstance"]), - set: $util.oneOfSetter($oneOfFields) - }); + ListSecurityProfileGroupsResponse.prototype.nextPageToken = ""; /** - * Creates a new ValidationCA instance using the specified properties. + * Creates a new ListSecurityProfileGroupsResponse instance using the specified properties. * @function create - * @memberof google.cloud.networksecurity.v1.ValidationCA + * @memberof google.cloud.networksecurity.v1.ListSecurityProfileGroupsResponse * @static - * @param {google.cloud.networksecurity.v1.IValidationCA=} [properties] Properties to set - * @returns {google.cloud.networksecurity.v1.ValidationCA} ValidationCA instance + * @param {google.cloud.networksecurity.v1.IListSecurityProfileGroupsResponse=} [properties] Properties to set + * @returns {google.cloud.networksecurity.v1.ListSecurityProfileGroupsResponse} ListSecurityProfileGroupsResponse instance */ - ValidationCA.create = function create(properties) { - return new ValidationCA(properties); + ListSecurityProfileGroupsResponse.create = function create(properties) { + return new ListSecurityProfileGroupsResponse(properties); }; /** - * Encodes the specified ValidationCA message. Does not implicitly {@link google.cloud.networksecurity.v1.ValidationCA.verify|verify} messages. + * Encodes the specified ListSecurityProfileGroupsResponse message. Does not implicitly {@link google.cloud.networksecurity.v1.ListSecurityProfileGroupsResponse.verify|verify} messages. * @function encode - * @memberof google.cloud.networksecurity.v1.ValidationCA + * @memberof google.cloud.networksecurity.v1.ListSecurityProfileGroupsResponse * @static - * @param {google.cloud.networksecurity.v1.IValidationCA} message ValidationCA message or plain object to encode + * @param {google.cloud.networksecurity.v1.IListSecurityProfileGroupsResponse} message ListSecurityProfileGroupsResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ValidationCA.encode = function encode(message, writer) { + ListSecurityProfileGroupsResponse.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.grpcEndpoint != null && Object.hasOwnProperty.call(message, "grpcEndpoint")) - $root.google.cloud.networksecurity.v1.GrpcEndpoint.encode(message.grpcEndpoint, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.certificateProviderInstance != null && Object.hasOwnProperty.call(message, "certificateProviderInstance")) - $root.google.cloud.networksecurity.v1.CertificateProviderInstance.encode(message.certificateProviderInstance, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.securityProfileGroups != null && message.securityProfileGroups.length) + for (var i = 0; i < message.securityProfileGroups.length; ++i) + $root.google.cloud.networksecurity.v1.SecurityProfileGroup.encode(message.securityProfileGroups[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); return writer; }; /** - * Encodes the specified ValidationCA message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.ValidationCA.verify|verify} messages. + * Encodes the specified ListSecurityProfileGroupsResponse message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.ListSecurityProfileGroupsResponse.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.networksecurity.v1.ValidationCA + * @memberof google.cloud.networksecurity.v1.ListSecurityProfileGroupsResponse * @static - * @param {google.cloud.networksecurity.v1.IValidationCA} message ValidationCA message or plain object to encode + * @param {google.cloud.networksecurity.v1.IListSecurityProfileGroupsResponse} message ListSecurityProfileGroupsResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ValidationCA.encodeDelimited = function encodeDelimited(message, writer) { + ListSecurityProfileGroupsResponse.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ValidationCA message from the specified reader or buffer. + * Decodes a ListSecurityProfileGroupsResponse message from the specified reader or buffer. * @function decode - * @memberof google.cloud.networksecurity.v1.ValidationCA + * @memberof google.cloud.networksecurity.v1.ListSecurityProfileGroupsResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.networksecurity.v1.ValidationCA} ValidationCA + * @returns {google.cloud.networksecurity.v1.ListSecurityProfileGroupsResponse} ListSecurityProfileGroupsResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ValidationCA.decode = function decode(reader, length, error) { + ListSecurityProfileGroupsResponse.decode = function decode(reader, length, error) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networksecurity.v1.ValidationCA(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networksecurity.v1.ListSecurityProfileGroupsResponse(); while (reader.pos < end) { var tag = reader.uint32(); if (tag === error) break; switch (tag >>> 3) { - case 2: { - message.grpcEndpoint = $root.google.cloud.networksecurity.v1.GrpcEndpoint.decode(reader, reader.uint32()); + case 1: { + if (!(message.securityProfileGroups && message.securityProfileGroups.length)) + message.securityProfileGroups = []; + message.securityProfileGroups.push($root.google.cloud.networksecurity.v1.SecurityProfileGroup.decode(reader, reader.uint32())); break; } - case 3: { - message.certificateProviderInstance = $root.google.cloud.networksecurity.v1.CertificateProviderInstance.decode(reader, reader.uint32()); + case 2: { + message.nextPageToken = reader.string(); break; } default: @@ -9561,152 +63172,148 @@ }; /** - * Decodes a ValidationCA message from the specified reader or buffer, length delimited. + * Decodes a ListSecurityProfileGroupsResponse message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.networksecurity.v1.ValidationCA + * @memberof google.cloud.networksecurity.v1.ListSecurityProfileGroupsResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.networksecurity.v1.ValidationCA} ValidationCA + * @returns {google.cloud.networksecurity.v1.ListSecurityProfileGroupsResponse} ListSecurityProfileGroupsResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ValidationCA.decodeDelimited = function decodeDelimited(reader) { + ListSecurityProfileGroupsResponse.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ValidationCA message. + * Verifies a ListSecurityProfileGroupsResponse message. * @function verify - * @memberof google.cloud.networksecurity.v1.ValidationCA + * @memberof google.cloud.networksecurity.v1.ListSecurityProfileGroupsResponse * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ValidationCA.verify = function verify(message) { + ListSecurityProfileGroupsResponse.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - var properties = {}; - if (message.grpcEndpoint != null && message.hasOwnProperty("grpcEndpoint")) { - properties.type = 1; - { - var error = $root.google.cloud.networksecurity.v1.GrpcEndpoint.verify(message.grpcEndpoint); - if (error) - return "grpcEndpoint." + error; - } - } - if (message.certificateProviderInstance != null && message.hasOwnProperty("certificateProviderInstance")) { - if (properties.type === 1) - return "type: multiple values"; - properties.type = 1; - { - var error = $root.google.cloud.networksecurity.v1.CertificateProviderInstance.verify(message.certificateProviderInstance); + if (message.securityProfileGroups != null && message.hasOwnProperty("securityProfileGroups")) { + if (!Array.isArray(message.securityProfileGroups)) + return "securityProfileGroups: array expected"; + for (var i = 0; i < message.securityProfileGroups.length; ++i) { + var error = $root.google.cloud.networksecurity.v1.SecurityProfileGroup.verify(message.securityProfileGroups[i]); if (error) - return "certificateProviderInstance." + error; + return "securityProfileGroups." + error; } } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; return null; }; /** - * Creates a ValidationCA message from a plain object. Also converts values to their respective internal types. + * Creates a ListSecurityProfileGroupsResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.networksecurity.v1.ValidationCA + * @memberof google.cloud.networksecurity.v1.ListSecurityProfileGroupsResponse * @static * @param {Object.} object Plain object - * @returns {google.cloud.networksecurity.v1.ValidationCA} ValidationCA + * @returns {google.cloud.networksecurity.v1.ListSecurityProfileGroupsResponse} ListSecurityProfileGroupsResponse */ - ValidationCA.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.networksecurity.v1.ValidationCA) + ListSecurityProfileGroupsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networksecurity.v1.ListSecurityProfileGroupsResponse) return object; - var message = new $root.google.cloud.networksecurity.v1.ValidationCA(); - if (object.grpcEndpoint != null) { - if (typeof object.grpcEndpoint !== "object") - throw TypeError(".google.cloud.networksecurity.v1.ValidationCA.grpcEndpoint: object expected"); - message.grpcEndpoint = $root.google.cloud.networksecurity.v1.GrpcEndpoint.fromObject(object.grpcEndpoint); - } - if (object.certificateProviderInstance != null) { - if (typeof object.certificateProviderInstance !== "object") - throw TypeError(".google.cloud.networksecurity.v1.ValidationCA.certificateProviderInstance: object expected"); - message.certificateProviderInstance = $root.google.cloud.networksecurity.v1.CertificateProviderInstance.fromObject(object.certificateProviderInstance); + var message = new $root.google.cloud.networksecurity.v1.ListSecurityProfileGroupsResponse(); + if (object.securityProfileGroups) { + if (!Array.isArray(object.securityProfileGroups)) + throw TypeError(".google.cloud.networksecurity.v1.ListSecurityProfileGroupsResponse.securityProfileGroups: array expected"); + message.securityProfileGroups = []; + for (var i = 0; i < object.securityProfileGroups.length; ++i) { + if (typeof object.securityProfileGroups[i] !== "object") + throw TypeError(".google.cloud.networksecurity.v1.ListSecurityProfileGroupsResponse.securityProfileGroups: object expected"); + message.securityProfileGroups[i] = $root.google.cloud.networksecurity.v1.SecurityProfileGroup.fromObject(object.securityProfileGroups[i]); + } } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); return message; }; /** - * Creates a plain object from a ValidationCA message. Also converts values to other types if specified. + * Creates a plain object from a ListSecurityProfileGroupsResponse message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.networksecurity.v1.ValidationCA + * @memberof google.cloud.networksecurity.v1.ListSecurityProfileGroupsResponse * @static - * @param {google.cloud.networksecurity.v1.ValidationCA} message ValidationCA + * @param {google.cloud.networksecurity.v1.ListSecurityProfileGroupsResponse} message ListSecurityProfileGroupsResponse * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ValidationCA.toObject = function toObject(message, options) { + ListSecurityProfileGroupsResponse.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (message.grpcEndpoint != null && message.hasOwnProperty("grpcEndpoint")) { - object.grpcEndpoint = $root.google.cloud.networksecurity.v1.GrpcEndpoint.toObject(message.grpcEndpoint, options); - if (options.oneofs) - object.type = "grpcEndpoint"; - } - if (message.certificateProviderInstance != null && message.hasOwnProperty("certificateProviderInstance")) { - object.certificateProviderInstance = $root.google.cloud.networksecurity.v1.CertificateProviderInstance.toObject(message.certificateProviderInstance, options); - if (options.oneofs) - object.type = "certificateProviderInstance"; + if (options.arrays || options.defaults) + object.securityProfileGroups = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.securityProfileGroups && message.securityProfileGroups.length) { + object.securityProfileGroups = []; + for (var j = 0; j < message.securityProfileGroups.length; ++j) + object.securityProfileGroups[j] = $root.google.cloud.networksecurity.v1.SecurityProfileGroup.toObject(message.securityProfileGroups[j], options); } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; return object; }; /** - * Converts this ValidationCA to JSON. + * Converts this ListSecurityProfileGroupsResponse to JSON. * @function toJSON - * @memberof google.cloud.networksecurity.v1.ValidationCA + * @memberof google.cloud.networksecurity.v1.ListSecurityProfileGroupsResponse * @instance * @returns {Object.} JSON object */ - ValidationCA.prototype.toJSON = function toJSON() { + ListSecurityProfileGroupsResponse.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for ValidationCA + * Gets the default type url for ListSecurityProfileGroupsResponse * @function getTypeUrl - * @memberof google.cloud.networksecurity.v1.ValidationCA + * @memberof google.cloud.networksecurity.v1.ListSecurityProfileGroupsResponse * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - ValidationCA.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + ListSecurityProfileGroupsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.networksecurity.v1.ValidationCA"; + return typeUrlPrefix + "/google.cloud.networksecurity.v1.ListSecurityProfileGroupsResponse"; }; - return ValidationCA; + return ListSecurityProfileGroupsResponse; })(); - v1.CertificateProviderInstance = (function() { + v1.GetSecurityProfileGroupRequest = (function() { /** - * Properties of a CertificateProviderInstance. + * Properties of a GetSecurityProfileGroupRequest. * @memberof google.cloud.networksecurity.v1 - * @interface ICertificateProviderInstance - * @property {string|null} [pluginInstance] CertificateProviderInstance pluginInstance + * @interface IGetSecurityProfileGroupRequest + * @property {string|null} [name] GetSecurityProfileGroupRequest name */ /** - * Constructs a new CertificateProviderInstance. + * Constructs a new GetSecurityProfileGroupRequest. * @memberof google.cloud.networksecurity.v1 - * @classdesc Represents a CertificateProviderInstance. - * @implements ICertificateProviderInstance + * @classdesc Represents a GetSecurityProfileGroupRequest. + * @implements IGetSecurityProfileGroupRequest * @constructor - * @param {google.cloud.networksecurity.v1.ICertificateProviderInstance=} [properties] Properties to set + * @param {google.cloud.networksecurity.v1.IGetSecurityProfileGroupRequest=} [properties] Properties to set */ - function CertificateProviderInstance(properties) { + function GetSecurityProfileGroupRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -9714,77 +63321,77 @@ } /** - * CertificateProviderInstance pluginInstance. - * @member {string} pluginInstance - * @memberof google.cloud.networksecurity.v1.CertificateProviderInstance + * GetSecurityProfileGroupRequest name. + * @member {string} name + * @memberof google.cloud.networksecurity.v1.GetSecurityProfileGroupRequest * @instance */ - CertificateProviderInstance.prototype.pluginInstance = ""; + GetSecurityProfileGroupRequest.prototype.name = ""; /** - * Creates a new CertificateProviderInstance instance using the specified properties. + * Creates a new GetSecurityProfileGroupRequest instance using the specified properties. * @function create - * @memberof google.cloud.networksecurity.v1.CertificateProviderInstance + * @memberof google.cloud.networksecurity.v1.GetSecurityProfileGroupRequest * @static - * @param {google.cloud.networksecurity.v1.ICertificateProviderInstance=} [properties] Properties to set - * @returns {google.cloud.networksecurity.v1.CertificateProviderInstance} CertificateProviderInstance instance + * @param {google.cloud.networksecurity.v1.IGetSecurityProfileGroupRequest=} [properties] Properties to set + * @returns {google.cloud.networksecurity.v1.GetSecurityProfileGroupRequest} GetSecurityProfileGroupRequest instance */ - CertificateProviderInstance.create = function create(properties) { - return new CertificateProviderInstance(properties); + GetSecurityProfileGroupRequest.create = function create(properties) { + return new GetSecurityProfileGroupRequest(properties); }; /** - * Encodes the specified CertificateProviderInstance message. Does not implicitly {@link google.cloud.networksecurity.v1.CertificateProviderInstance.verify|verify} messages. + * Encodes the specified GetSecurityProfileGroupRequest message. Does not implicitly {@link google.cloud.networksecurity.v1.GetSecurityProfileGroupRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.networksecurity.v1.CertificateProviderInstance + * @memberof google.cloud.networksecurity.v1.GetSecurityProfileGroupRequest * @static - * @param {google.cloud.networksecurity.v1.ICertificateProviderInstance} message CertificateProviderInstance message or plain object to encode + * @param {google.cloud.networksecurity.v1.IGetSecurityProfileGroupRequest} message GetSecurityProfileGroupRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CertificateProviderInstance.encode = function encode(message, writer) { + GetSecurityProfileGroupRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.pluginInstance != null && Object.hasOwnProperty.call(message, "pluginInstance")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.pluginInstance); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); return writer; }; /** - * Encodes the specified CertificateProviderInstance message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.CertificateProviderInstance.verify|verify} messages. + * Encodes the specified GetSecurityProfileGroupRequest message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.GetSecurityProfileGroupRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.networksecurity.v1.CertificateProviderInstance + * @memberof google.cloud.networksecurity.v1.GetSecurityProfileGroupRequest * @static - * @param {google.cloud.networksecurity.v1.ICertificateProviderInstance} message CertificateProviderInstance message or plain object to encode + * @param {google.cloud.networksecurity.v1.IGetSecurityProfileGroupRequest} message GetSecurityProfileGroupRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CertificateProviderInstance.encodeDelimited = function encodeDelimited(message, writer) { + GetSecurityProfileGroupRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a CertificateProviderInstance message from the specified reader or buffer. + * Decodes a GetSecurityProfileGroupRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.networksecurity.v1.CertificateProviderInstance + * @memberof google.cloud.networksecurity.v1.GetSecurityProfileGroupRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.networksecurity.v1.CertificateProviderInstance} CertificateProviderInstance + * @returns {google.cloud.networksecurity.v1.GetSecurityProfileGroupRequest} GetSecurityProfileGroupRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - CertificateProviderInstance.decode = function decode(reader, length, error) { + GetSecurityProfileGroupRequest.decode = function decode(reader, length, error) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networksecurity.v1.CertificateProviderInstance(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networksecurity.v1.GetSecurityProfileGroupRequest(); while (reader.pos < end) { var tag = reader.uint32(); if (tag === error) break; switch (tag >>> 3) { case 1: { - message.pluginInstance = reader.string(); + message.name = reader.string(); break; } default: @@ -9796,123 +63403,124 @@ }; /** - * Decodes a CertificateProviderInstance message from the specified reader or buffer, length delimited. + * Decodes a GetSecurityProfileGroupRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.networksecurity.v1.CertificateProviderInstance + * @memberof google.cloud.networksecurity.v1.GetSecurityProfileGroupRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.networksecurity.v1.CertificateProviderInstance} CertificateProviderInstance + * @returns {google.cloud.networksecurity.v1.GetSecurityProfileGroupRequest} GetSecurityProfileGroupRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - CertificateProviderInstance.decodeDelimited = function decodeDelimited(reader) { + GetSecurityProfileGroupRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a CertificateProviderInstance message. + * Verifies a GetSecurityProfileGroupRequest message. * @function verify - * @memberof google.cloud.networksecurity.v1.CertificateProviderInstance + * @memberof google.cloud.networksecurity.v1.GetSecurityProfileGroupRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - CertificateProviderInstance.verify = function verify(message) { + GetSecurityProfileGroupRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.pluginInstance != null && message.hasOwnProperty("pluginInstance")) - if (!$util.isString(message.pluginInstance)) - return "pluginInstance: string expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; return null; }; /** - * Creates a CertificateProviderInstance message from a plain object. Also converts values to their respective internal types. + * Creates a GetSecurityProfileGroupRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.networksecurity.v1.CertificateProviderInstance + * @memberof google.cloud.networksecurity.v1.GetSecurityProfileGroupRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.networksecurity.v1.CertificateProviderInstance} CertificateProviderInstance + * @returns {google.cloud.networksecurity.v1.GetSecurityProfileGroupRequest} GetSecurityProfileGroupRequest */ - CertificateProviderInstance.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.networksecurity.v1.CertificateProviderInstance) + GetSecurityProfileGroupRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networksecurity.v1.GetSecurityProfileGroupRequest) return object; - var message = new $root.google.cloud.networksecurity.v1.CertificateProviderInstance(); - if (object.pluginInstance != null) - message.pluginInstance = String(object.pluginInstance); + var message = new $root.google.cloud.networksecurity.v1.GetSecurityProfileGroupRequest(); + if (object.name != null) + message.name = String(object.name); return message; }; /** - * Creates a plain object from a CertificateProviderInstance message. Also converts values to other types if specified. + * Creates a plain object from a GetSecurityProfileGroupRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.networksecurity.v1.CertificateProviderInstance + * @memberof google.cloud.networksecurity.v1.GetSecurityProfileGroupRequest * @static - * @param {google.cloud.networksecurity.v1.CertificateProviderInstance} message CertificateProviderInstance + * @param {google.cloud.networksecurity.v1.GetSecurityProfileGroupRequest} message GetSecurityProfileGroupRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - CertificateProviderInstance.toObject = function toObject(message, options) { + GetSecurityProfileGroupRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) - object.pluginInstance = ""; - if (message.pluginInstance != null && message.hasOwnProperty("pluginInstance")) - object.pluginInstance = message.pluginInstance; + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; return object; }; /** - * Converts this CertificateProviderInstance to JSON. + * Converts this GetSecurityProfileGroupRequest to JSON. * @function toJSON - * @memberof google.cloud.networksecurity.v1.CertificateProviderInstance + * @memberof google.cloud.networksecurity.v1.GetSecurityProfileGroupRequest * @instance * @returns {Object.} JSON object */ - CertificateProviderInstance.prototype.toJSON = function toJSON() { + GetSecurityProfileGroupRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for CertificateProviderInstance + * Gets the default type url for GetSecurityProfileGroupRequest * @function getTypeUrl - * @memberof google.cloud.networksecurity.v1.CertificateProviderInstance + * @memberof google.cloud.networksecurity.v1.GetSecurityProfileGroupRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - CertificateProviderInstance.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + GetSecurityProfileGroupRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.networksecurity.v1.CertificateProviderInstance"; + return typeUrlPrefix + "/google.cloud.networksecurity.v1.GetSecurityProfileGroupRequest"; }; - return CertificateProviderInstance; + return GetSecurityProfileGroupRequest; })(); - v1.CertificateProvider = (function() { + v1.CreateSecurityProfileGroupRequest = (function() { /** - * Properties of a CertificateProvider. + * Properties of a CreateSecurityProfileGroupRequest. * @memberof google.cloud.networksecurity.v1 - * @interface ICertificateProvider - * @property {google.cloud.networksecurity.v1.IGrpcEndpoint|null} [grpcEndpoint] CertificateProvider grpcEndpoint - * @property {google.cloud.networksecurity.v1.ICertificateProviderInstance|null} [certificateProviderInstance] CertificateProvider certificateProviderInstance + * @interface ICreateSecurityProfileGroupRequest + * @property {string|null} [parent] CreateSecurityProfileGroupRequest parent + * @property {string|null} [securityProfileGroupId] CreateSecurityProfileGroupRequest securityProfileGroupId + * @property {google.cloud.networksecurity.v1.ISecurityProfileGroup|null} [securityProfileGroup] CreateSecurityProfileGroupRequest securityProfileGroup */ /** - * Constructs a new CertificateProvider. + * Constructs a new CreateSecurityProfileGroupRequest. * @memberof google.cloud.networksecurity.v1 - * @classdesc Represents a CertificateProvider. - * @implements ICertificateProvider + * @classdesc Represents a CreateSecurityProfileGroupRequest. + * @implements ICreateSecurityProfileGroupRequest * @constructor - * @param {google.cloud.networksecurity.v1.ICertificateProvider=} [properties] Properties to set + * @param {google.cloud.networksecurity.v1.ICreateSecurityProfileGroupRequest=} [properties] Properties to set */ - function CertificateProvider(properties) { + function CreateSecurityProfileGroupRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -9920,105 +63528,105 @@ } /** - * CertificateProvider grpcEndpoint. - * @member {google.cloud.networksecurity.v1.IGrpcEndpoint|null|undefined} grpcEndpoint - * @memberof google.cloud.networksecurity.v1.CertificateProvider + * CreateSecurityProfileGroupRequest parent. + * @member {string} parent + * @memberof google.cloud.networksecurity.v1.CreateSecurityProfileGroupRequest * @instance */ - CertificateProvider.prototype.grpcEndpoint = null; + CreateSecurityProfileGroupRequest.prototype.parent = ""; /** - * CertificateProvider certificateProviderInstance. - * @member {google.cloud.networksecurity.v1.ICertificateProviderInstance|null|undefined} certificateProviderInstance - * @memberof google.cloud.networksecurity.v1.CertificateProvider + * CreateSecurityProfileGroupRequest securityProfileGroupId. + * @member {string} securityProfileGroupId + * @memberof google.cloud.networksecurity.v1.CreateSecurityProfileGroupRequest * @instance */ - CertificateProvider.prototype.certificateProviderInstance = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; + CreateSecurityProfileGroupRequest.prototype.securityProfileGroupId = ""; /** - * CertificateProvider type. - * @member {"grpcEndpoint"|"certificateProviderInstance"|undefined} type - * @memberof google.cloud.networksecurity.v1.CertificateProvider + * CreateSecurityProfileGroupRequest securityProfileGroup. + * @member {google.cloud.networksecurity.v1.ISecurityProfileGroup|null|undefined} securityProfileGroup + * @memberof google.cloud.networksecurity.v1.CreateSecurityProfileGroupRequest * @instance */ - Object.defineProperty(CertificateProvider.prototype, "type", { - get: $util.oneOfGetter($oneOfFields = ["grpcEndpoint", "certificateProviderInstance"]), - set: $util.oneOfSetter($oneOfFields) - }); + CreateSecurityProfileGroupRequest.prototype.securityProfileGroup = null; /** - * Creates a new CertificateProvider instance using the specified properties. + * Creates a new CreateSecurityProfileGroupRequest instance using the specified properties. * @function create - * @memberof google.cloud.networksecurity.v1.CertificateProvider + * @memberof google.cloud.networksecurity.v1.CreateSecurityProfileGroupRequest * @static - * @param {google.cloud.networksecurity.v1.ICertificateProvider=} [properties] Properties to set - * @returns {google.cloud.networksecurity.v1.CertificateProvider} CertificateProvider instance + * @param {google.cloud.networksecurity.v1.ICreateSecurityProfileGroupRequest=} [properties] Properties to set + * @returns {google.cloud.networksecurity.v1.CreateSecurityProfileGroupRequest} CreateSecurityProfileGroupRequest instance */ - CertificateProvider.create = function create(properties) { - return new CertificateProvider(properties); + CreateSecurityProfileGroupRequest.create = function create(properties) { + return new CreateSecurityProfileGroupRequest(properties); }; /** - * Encodes the specified CertificateProvider message. Does not implicitly {@link google.cloud.networksecurity.v1.CertificateProvider.verify|verify} messages. + * Encodes the specified CreateSecurityProfileGroupRequest message. Does not implicitly {@link google.cloud.networksecurity.v1.CreateSecurityProfileGroupRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.networksecurity.v1.CertificateProvider + * @memberof google.cloud.networksecurity.v1.CreateSecurityProfileGroupRequest * @static - * @param {google.cloud.networksecurity.v1.ICertificateProvider} message CertificateProvider message or plain object to encode + * @param {google.cloud.networksecurity.v1.ICreateSecurityProfileGroupRequest} message CreateSecurityProfileGroupRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CertificateProvider.encode = function encode(message, writer) { + CreateSecurityProfileGroupRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.grpcEndpoint != null && Object.hasOwnProperty.call(message, "grpcEndpoint")) - $root.google.cloud.networksecurity.v1.GrpcEndpoint.encode(message.grpcEndpoint, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.certificateProviderInstance != null && Object.hasOwnProperty.call(message, "certificateProviderInstance")) - $root.google.cloud.networksecurity.v1.CertificateProviderInstance.encode(message.certificateProviderInstance, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.securityProfileGroupId != null && Object.hasOwnProperty.call(message, "securityProfileGroupId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.securityProfileGroupId); + if (message.securityProfileGroup != null && Object.hasOwnProperty.call(message, "securityProfileGroup")) + $root.google.cloud.networksecurity.v1.SecurityProfileGroup.encode(message.securityProfileGroup, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); return writer; }; /** - * Encodes the specified CertificateProvider message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.CertificateProvider.verify|verify} messages. + * Encodes the specified CreateSecurityProfileGroupRequest message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.CreateSecurityProfileGroupRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.networksecurity.v1.CertificateProvider + * @memberof google.cloud.networksecurity.v1.CreateSecurityProfileGroupRequest * @static - * @param {google.cloud.networksecurity.v1.ICertificateProvider} message CertificateProvider message or plain object to encode + * @param {google.cloud.networksecurity.v1.ICreateSecurityProfileGroupRequest} message CreateSecurityProfileGroupRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CertificateProvider.encodeDelimited = function encodeDelimited(message, writer) { + CreateSecurityProfileGroupRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a CertificateProvider message from the specified reader or buffer. + * Decodes a CreateSecurityProfileGroupRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.networksecurity.v1.CertificateProvider + * @memberof google.cloud.networksecurity.v1.CreateSecurityProfileGroupRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.networksecurity.v1.CertificateProvider} CertificateProvider + * @returns {google.cloud.networksecurity.v1.CreateSecurityProfileGroupRequest} CreateSecurityProfileGroupRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - CertificateProvider.decode = function decode(reader, length, error) { + CreateSecurityProfileGroupRequest.decode = function decode(reader, length, error) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networksecurity.v1.CertificateProvider(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networksecurity.v1.CreateSecurityProfileGroupRequest(); while (reader.pos < end) { var tag = reader.uint32(); if (tag === error) break; switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } case 2: { - message.grpcEndpoint = $root.google.cloud.networksecurity.v1.GrpcEndpoint.decode(reader, reader.uint32()); + message.securityProfileGroupId = reader.string(); break; } case 3: { - message.certificateProviderInstance = $root.google.cloud.networksecurity.v1.CertificateProviderInstance.decode(reader, reader.uint32()); + message.securityProfileGroup = $root.google.cloud.networksecurity.v1.SecurityProfileGroup.decode(reader, reader.uint32()); break; } default: @@ -10030,158 +63638,145 @@ }; /** - * Decodes a CertificateProvider message from the specified reader or buffer, length delimited. + * Decodes a CreateSecurityProfileGroupRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.networksecurity.v1.CertificateProvider + * @memberof google.cloud.networksecurity.v1.CreateSecurityProfileGroupRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.networksecurity.v1.CertificateProvider} CertificateProvider + * @returns {google.cloud.networksecurity.v1.CreateSecurityProfileGroupRequest} CreateSecurityProfileGroupRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - CertificateProvider.decodeDelimited = function decodeDelimited(reader) { + CreateSecurityProfileGroupRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a CertificateProvider message. + * Verifies a CreateSecurityProfileGroupRequest message. * @function verify - * @memberof google.cloud.networksecurity.v1.CertificateProvider + * @memberof google.cloud.networksecurity.v1.CreateSecurityProfileGroupRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - CertificateProvider.verify = function verify(message) { + CreateSecurityProfileGroupRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - var properties = {}; - if (message.grpcEndpoint != null && message.hasOwnProperty("grpcEndpoint")) { - properties.type = 1; - { - var error = $root.google.cloud.networksecurity.v1.GrpcEndpoint.verify(message.grpcEndpoint); - if (error) - return "grpcEndpoint." + error; - } - } - if (message.certificateProviderInstance != null && message.hasOwnProperty("certificateProviderInstance")) { - if (properties.type === 1) - return "type: multiple values"; - properties.type = 1; - { - var error = $root.google.cloud.networksecurity.v1.CertificateProviderInstance.verify(message.certificateProviderInstance); - if (error) - return "certificateProviderInstance." + error; - } + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.securityProfileGroupId != null && message.hasOwnProperty("securityProfileGroupId")) + if (!$util.isString(message.securityProfileGroupId)) + return "securityProfileGroupId: string expected"; + if (message.securityProfileGroup != null && message.hasOwnProperty("securityProfileGroup")) { + var error = $root.google.cloud.networksecurity.v1.SecurityProfileGroup.verify(message.securityProfileGroup); + if (error) + return "securityProfileGroup." + error; } return null; }; /** - * Creates a CertificateProvider message from a plain object. Also converts values to their respective internal types. + * Creates a CreateSecurityProfileGroupRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.networksecurity.v1.CertificateProvider + * @memberof google.cloud.networksecurity.v1.CreateSecurityProfileGroupRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.networksecurity.v1.CertificateProvider} CertificateProvider + * @returns {google.cloud.networksecurity.v1.CreateSecurityProfileGroupRequest} CreateSecurityProfileGroupRequest */ - CertificateProvider.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.networksecurity.v1.CertificateProvider) + CreateSecurityProfileGroupRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networksecurity.v1.CreateSecurityProfileGroupRequest) return object; - var message = new $root.google.cloud.networksecurity.v1.CertificateProvider(); - if (object.grpcEndpoint != null) { - if (typeof object.grpcEndpoint !== "object") - throw TypeError(".google.cloud.networksecurity.v1.CertificateProvider.grpcEndpoint: object expected"); - message.grpcEndpoint = $root.google.cloud.networksecurity.v1.GrpcEndpoint.fromObject(object.grpcEndpoint); - } - if (object.certificateProviderInstance != null) { - if (typeof object.certificateProviderInstance !== "object") - throw TypeError(".google.cloud.networksecurity.v1.CertificateProvider.certificateProviderInstance: object expected"); - message.certificateProviderInstance = $root.google.cloud.networksecurity.v1.CertificateProviderInstance.fromObject(object.certificateProviderInstance); + var message = new $root.google.cloud.networksecurity.v1.CreateSecurityProfileGroupRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.securityProfileGroupId != null) + message.securityProfileGroupId = String(object.securityProfileGroupId); + if (object.securityProfileGroup != null) { + if (typeof object.securityProfileGroup !== "object") + throw TypeError(".google.cloud.networksecurity.v1.CreateSecurityProfileGroupRequest.securityProfileGroup: object expected"); + message.securityProfileGroup = $root.google.cloud.networksecurity.v1.SecurityProfileGroup.fromObject(object.securityProfileGroup); } return message; }; /** - * Creates a plain object from a CertificateProvider message. Also converts values to other types if specified. + * Creates a plain object from a CreateSecurityProfileGroupRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.networksecurity.v1.CertificateProvider + * @memberof google.cloud.networksecurity.v1.CreateSecurityProfileGroupRequest * @static - * @param {google.cloud.networksecurity.v1.CertificateProvider} message CertificateProvider + * @param {google.cloud.networksecurity.v1.CreateSecurityProfileGroupRequest} message CreateSecurityProfileGroupRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - CertificateProvider.toObject = function toObject(message, options) { + CreateSecurityProfileGroupRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (message.grpcEndpoint != null && message.hasOwnProperty("grpcEndpoint")) { - object.grpcEndpoint = $root.google.cloud.networksecurity.v1.GrpcEndpoint.toObject(message.grpcEndpoint, options); - if (options.oneofs) - object.type = "grpcEndpoint"; - } - if (message.certificateProviderInstance != null && message.hasOwnProperty("certificateProviderInstance")) { - object.certificateProviderInstance = $root.google.cloud.networksecurity.v1.CertificateProviderInstance.toObject(message.certificateProviderInstance, options); - if (options.oneofs) - object.type = "certificateProviderInstance"; + if (options.defaults) { + object.parent = ""; + object.securityProfileGroupId = ""; + object.securityProfileGroup = null; } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.securityProfileGroupId != null && message.hasOwnProperty("securityProfileGroupId")) + object.securityProfileGroupId = message.securityProfileGroupId; + if (message.securityProfileGroup != null && message.hasOwnProperty("securityProfileGroup")) + object.securityProfileGroup = $root.google.cloud.networksecurity.v1.SecurityProfileGroup.toObject(message.securityProfileGroup, options); return object; }; /** - * Converts this CertificateProvider to JSON. + * Converts this CreateSecurityProfileGroupRequest to JSON. * @function toJSON - * @memberof google.cloud.networksecurity.v1.CertificateProvider + * @memberof google.cloud.networksecurity.v1.CreateSecurityProfileGroupRequest * @instance * @returns {Object.} JSON object */ - CertificateProvider.prototype.toJSON = function toJSON() { + CreateSecurityProfileGroupRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for CertificateProvider + * Gets the default type url for CreateSecurityProfileGroupRequest * @function getTypeUrl - * @memberof google.cloud.networksecurity.v1.CertificateProvider + * @memberof google.cloud.networksecurity.v1.CreateSecurityProfileGroupRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - CertificateProvider.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + CreateSecurityProfileGroupRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.networksecurity.v1.CertificateProvider"; + return typeUrlPrefix + "/google.cloud.networksecurity.v1.CreateSecurityProfileGroupRequest"; }; - return CertificateProvider; + return CreateSecurityProfileGroupRequest; })(); - v1.OperationMetadata = (function() { + v1.UpdateSecurityProfileGroupRequest = (function() { /** - * Properties of an OperationMetadata. + * Properties of an UpdateSecurityProfileGroupRequest. * @memberof google.cloud.networksecurity.v1 - * @interface IOperationMetadata - * @property {google.protobuf.ITimestamp|null} [createTime] OperationMetadata createTime - * @property {google.protobuf.ITimestamp|null} [endTime] OperationMetadata endTime - * @property {string|null} [target] OperationMetadata target - * @property {string|null} [verb] OperationMetadata verb - * @property {string|null} [statusMessage] OperationMetadata statusMessage - * @property {boolean|null} [requestedCancellation] OperationMetadata requestedCancellation - * @property {string|null} [apiVersion] OperationMetadata apiVersion + * @interface IUpdateSecurityProfileGroupRequest + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateSecurityProfileGroupRequest updateMask + * @property {google.cloud.networksecurity.v1.ISecurityProfileGroup|null} [securityProfileGroup] UpdateSecurityProfileGroupRequest securityProfileGroup */ /** - * Constructs a new OperationMetadata. + * Constructs a new UpdateSecurityProfileGroupRequest. * @memberof google.cloud.networksecurity.v1 - * @classdesc Represents an OperationMetadata. - * @implements IOperationMetadata + * @classdesc Represents an UpdateSecurityProfileGroupRequest. + * @implements IUpdateSecurityProfileGroupRequest * @constructor - * @param {google.cloud.networksecurity.v1.IOperationMetadata=} [properties] Properties to set + * @param {google.cloud.networksecurity.v1.IUpdateSecurityProfileGroupRequest=} [properties] Properties to set */ - function OperationMetadata(properties) { + function UpdateSecurityProfileGroupRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -10189,161 +63784,91 @@ } /** - * OperationMetadata createTime. - * @member {google.protobuf.ITimestamp|null|undefined} createTime - * @memberof google.cloud.networksecurity.v1.OperationMetadata - * @instance - */ - OperationMetadata.prototype.createTime = null; - - /** - * OperationMetadata endTime. - * @member {google.protobuf.ITimestamp|null|undefined} endTime - * @memberof google.cloud.networksecurity.v1.OperationMetadata - * @instance - */ - OperationMetadata.prototype.endTime = null; - - /** - * OperationMetadata target. - * @member {string} target - * @memberof google.cloud.networksecurity.v1.OperationMetadata - * @instance - */ - OperationMetadata.prototype.target = ""; - - /** - * OperationMetadata verb. - * @member {string} verb - * @memberof google.cloud.networksecurity.v1.OperationMetadata - * @instance - */ - OperationMetadata.prototype.verb = ""; - - /** - * OperationMetadata statusMessage. - * @member {string} statusMessage - * @memberof google.cloud.networksecurity.v1.OperationMetadata - * @instance - */ - OperationMetadata.prototype.statusMessage = ""; - - /** - * OperationMetadata requestedCancellation. - * @member {boolean} requestedCancellation - * @memberof google.cloud.networksecurity.v1.OperationMetadata + * UpdateSecurityProfileGroupRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.networksecurity.v1.UpdateSecurityProfileGroupRequest * @instance */ - OperationMetadata.prototype.requestedCancellation = false; + UpdateSecurityProfileGroupRequest.prototype.updateMask = null; /** - * OperationMetadata apiVersion. - * @member {string} apiVersion - * @memberof google.cloud.networksecurity.v1.OperationMetadata + * UpdateSecurityProfileGroupRequest securityProfileGroup. + * @member {google.cloud.networksecurity.v1.ISecurityProfileGroup|null|undefined} securityProfileGroup + * @memberof google.cloud.networksecurity.v1.UpdateSecurityProfileGroupRequest * @instance */ - OperationMetadata.prototype.apiVersion = ""; + UpdateSecurityProfileGroupRequest.prototype.securityProfileGroup = null; /** - * Creates a new OperationMetadata instance using the specified properties. + * Creates a new UpdateSecurityProfileGroupRequest instance using the specified properties. * @function create - * @memberof google.cloud.networksecurity.v1.OperationMetadata + * @memberof google.cloud.networksecurity.v1.UpdateSecurityProfileGroupRequest * @static - * @param {google.cloud.networksecurity.v1.IOperationMetadata=} [properties] Properties to set - * @returns {google.cloud.networksecurity.v1.OperationMetadata} OperationMetadata instance + * @param {google.cloud.networksecurity.v1.IUpdateSecurityProfileGroupRequest=} [properties] Properties to set + * @returns {google.cloud.networksecurity.v1.UpdateSecurityProfileGroupRequest} UpdateSecurityProfileGroupRequest instance */ - OperationMetadata.create = function create(properties) { - return new OperationMetadata(properties); + UpdateSecurityProfileGroupRequest.create = function create(properties) { + return new UpdateSecurityProfileGroupRequest(properties); }; /** - * Encodes the specified OperationMetadata message. Does not implicitly {@link google.cloud.networksecurity.v1.OperationMetadata.verify|verify} messages. + * Encodes the specified UpdateSecurityProfileGroupRequest message. Does not implicitly {@link google.cloud.networksecurity.v1.UpdateSecurityProfileGroupRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.networksecurity.v1.OperationMetadata + * @memberof google.cloud.networksecurity.v1.UpdateSecurityProfileGroupRequest * @static - * @param {google.cloud.networksecurity.v1.IOperationMetadata} message OperationMetadata message or plain object to encode + * @param {google.cloud.networksecurity.v1.IUpdateSecurityProfileGroupRequest} message UpdateSecurityProfileGroupRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - OperationMetadata.encode = function encode(message, writer) { + UpdateSecurityProfileGroupRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) - $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.endTime != null && Object.hasOwnProperty.call(message, "endTime")) - $root.google.protobuf.Timestamp.encode(message.endTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.target != null && Object.hasOwnProperty.call(message, "target")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.target); - if (message.verb != null && Object.hasOwnProperty.call(message, "verb")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.verb); - if (message.statusMessage != null && Object.hasOwnProperty.call(message, "statusMessage")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.statusMessage); - if (message.requestedCancellation != null && Object.hasOwnProperty.call(message, "requestedCancellation")) - writer.uint32(/* id 6, wireType 0 =*/48).bool(message.requestedCancellation); - if (message.apiVersion != null && Object.hasOwnProperty.call(message, "apiVersion")) - writer.uint32(/* id 7, wireType 2 =*/58).string(message.apiVersion); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.securityProfileGroup != null && Object.hasOwnProperty.call(message, "securityProfileGroup")) + $root.google.cloud.networksecurity.v1.SecurityProfileGroup.encode(message.securityProfileGroup, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); return writer; }; /** - * Encodes the specified OperationMetadata message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.OperationMetadata.verify|verify} messages. + * Encodes the specified UpdateSecurityProfileGroupRequest message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.UpdateSecurityProfileGroupRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.networksecurity.v1.OperationMetadata + * @memberof google.cloud.networksecurity.v1.UpdateSecurityProfileGroupRequest * @static - * @param {google.cloud.networksecurity.v1.IOperationMetadata} message OperationMetadata message or plain object to encode + * @param {google.cloud.networksecurity.v1.IUpdateSecurityProfileGroupRequest} message UpdateSecurityProfileGroupRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - OperationMetadata.encodeDelimited = function encodeDelimited(message, writer) { + UpdateSecurityProfileGroupRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an OperationMetadata message from the specified reader or buffer. + * Decodes an UpdateSecurityProfileGroupRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.networksecurity.v1.OperationMetadata + * @memberof google.cloud.networksecurity.v1.UpdateSecurityProfileGroupRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.networksecurity.v1.OperationMetadata} OperationMetadata + * @returns {google.cloud.networksecurity.v1.UpdateSecurityProfileGroupRequest} UpdateSecurityProfileGroupRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - OperationMetadata.decode = function decode(reader, length, error) { + UpdateSecurityProfileGroupRequest.decode = function decode(reader, length, error) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networksecurity.v1.OperationMetadata(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networksecurity.v1.UpdateSecurityProfileGroupRequest(); while (reader.pos < end) { var tag = reader.uint32(); if (tag === error) break; switch (tag >>> 3) { case 1: { - message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); break; } case 2: { - message.endTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 3: { - message.target = reader.string(); - break; - } - case 4: { - message.verb = reader.string(); - break; - } - case 5: { - message.statusMessage = reader.string(); - break; - } - case 6: { - message.requestedCancellation = reader.bool(); - break; - } - case 7: { - message.apiVersion = reader.string(); + message.securityProfileGroup = $root.google.cloud.networksecurity.v1.SecurityProfileGroup.decode(reader, reader.uint32()); break; } default: @@ -10355,719 +63880,142 @@ }; /** - * Decodes an OperationMetadata message from the specified reader or buffer, length delimited. + * Decodes an UpdateSecurityProfileGroupRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.networksecurity.v1.OperationMetadata + * @memberof google.cloud.networksecurity.v1.UpdateSecurityProfileGroupRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.networksecurity.v1.OperationMetadata} OperationMetadata + * @returns {google.cloud.networksecurity.v1.UpdateSecurityProfileGroupRequest} UpdateSecurityProfileGroupRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - OperationMetadata.decodeDelimited = function decodeDelimited(reader) { + UpdateSecurityProfileGroupRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an OperationMetadata message. + * Verifies an UpdateSecurityProfileGroupRequest message. * @function verify - * @memberof google.cloud.networksecurity.v1.OperationMetadata + * @memberof google.cloud.networksecurity.v1.UpdateSecurityProfileGroupRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - OperationMetadata.verify = function verify(message) { + UpdateSecurityProfileGroupRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.createTime != null && message.hasOwnProperty("createTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); if (error) - return "createTime." + error; + return "updateMask." + error; } - if (message.endTime != null && message.hasOwnProperty("endTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.endTime); + if (message.securityProfileGroup != null && message.hasOwnProperty("securityProfileGroup")) { + var error = $root.google.cloud.networksecurity.v1.SecurityProfileGroup.verify(message.securityProfileGroup); if (error) - return "endTime." + error; + return "securityProfileGroup." + error; } - if (message.target != null && message.hasOwnProperty("target")) - if (!$util.isString(message.target)) - return "target: string expected"; - if (message.verb != null && message.hasOwnProperty("verb")) - if (!$util.isString(message.verb)) - return "verb: string expected"; - if (message.statusMessage != null && message.hasOwnProperty("statusMessage")) - if (!$util.isString(message.statusMessage)) - return "statusMessage: string expected"; - if (message.requestedCancellation != null && message.hasOwnProperty("requestedCancellation")) - if (typeof message.requestedCancellation !== "boolean") - return "requestedCancellation: boolean expected"; - if (message.apiVersion != null && message.hasOwnProperty("apiVersion")) - if (!$util.isString(message.apiVersion)) - return "apiVersion: string expected"; return null; }; /** - * Creates an OperationMetadata message from a plain object. Also converts values to their respective internal types. + * Creates an UpdateSecurityProfileGroupRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.networksecurity.v1.OperationMetadata + * @memberof google.cloud.networksecurity.v1.UpdateSecurityProfileGroupRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.networksecurity.v1.OperationMetadata} OperationMetadata + * @returns {google.cloud.networksecurity.v1.UpdateSecurityProfileGroupRequest} UpdateSecurityProfileGroupRequest */ - OperationMetadata.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.networksecurity.v1.OperationMetadata) + UpdateSecurityProfileGroupRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networksecurity.v1.UpdateSecurityProfileGroupRequest) return object; - var message = new $root.google.cloud.networksecurity.v1.OperationMetadata(); - if (object.createTime != null) { - if (typeof object.createTime !== "object") - throw TypeError(".google.cloud.networksecurity.v1.OperationMetadata.createTime: object expected"); - message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + var message = new $root.google.cloud.networksecurity.v1.UpdateSecurityProfileGroupRequest(); + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.networksecurity.v1.UpdateSecurityProfileGroupRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); } - if (object.endTime != null) { - if (typeof object.endTime !== "object") - throw TypeError(".google.cloud.networksecurity.v1.OperationMetadata.endTime: object expected"); - message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime); + if (object.securityProfileGroup != null) { + if (typeof object.securityProfileGroup !== "object") + throw TypeError(".google.cloud.networksecurity.v1.UpdateSecurityProfileGroupRequest.securityProfileGroup: object expected"); + message.securityProfileGroup = $root.google.cloud.networksecurity.v1.SecurityProfileGroup.fromObject(object.securityProfileGroup); } - if (object.target != null) - message.target = String(object.target); - if (object.verb != null) - message.verb = String(object.verb); - if (object.statusMessage != null) - message.statusMessage = String(object.statusMessage); - if (object.requestedCancellation != null) - message.requestedCancellation = Boolean(object.requestedCancellation); - if (object.apiVersion != null) - message.apiVersion = String(object.apiVersion); return message; }; /** - * Creates a plain object from an OperationMetadata message. Also converts values to other types if specified. + * Creates a plain object from an UpdateSecurityProfileGroupRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.networksecurity.v1.OperationMetadata + * @memberof google.cloud.networksecurity.v1.UpdateSecurityProfileGroupRequest * @static - * @param {google.cloud.networksecurity.v1.OperationMetadata} message OperationMetadata + * @param {google.cloud.networksecurity.v1.UpdateSecurityProfileGroupRequest} message UpdateSecurityProfileGroupRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - OperationMetadata.toObject = function toObject(message, options) { + UpdateSecurityProfileGroupRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.createTime = null; - object.endTime = null; - object.target = ""; - object.verb = ""; - object.statusMessage = ""; - object.requestedCancellation = false; - object.apiVersion = ""; + object.updateMask = null; + object.securityProfileGroup = null; } - if (message.createTime != null && message.hasOwnProperty("createTime")) - object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); - if (message.endTime != null && message.hasOwnProperty("endTime")) - object.endTime = $root.google.protobuf.Timestamp.toObject(message.endTime, options); - if (message.target != null && message.hasOwnProperty("target")) - object.target = message.target; - if (message.verb != null && message.hasOwnProperty("verb")) - object.verb = message.verb; - if (message.statusMessage != null && message.hasOwnProperty("statusMessage")) - object.statusMessage = message.statusMessage; - if (message.requestedCancellation != null && message.hasOwnProperty("requestedCancellation")) - object.requestedCancellation = message.requestedCancellation; - if (message.apiVersion != null && message.hasOwnProperty("apiVersion")) - object.apiVersion = message.apiVersion; + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + if (message.securityProfileGroup != null && message.hasOwnProperty("securityProfileGroup")) + object.securityProfileGroup = $root.google.cloud.networksecurity.v1.SecurityProfileGroup.toObject(message.securityProfileGroup, options); return object; }; /** - * Converts this OperationMetadata to JSON. + * Converts this UpdateSecurityProfileGroupRequest to JSON. * @function toJSON - * @memberof google.cloud.networksecurity.v1.OperationMetadata + * @memberof google.cloud.networksecurity.v1.UpdateSecurityProfileGroupRequest * @instance * @returns {Object.} JSON object */ - OperationMetadata.prototype.toJSON = function toJSON() { + UpdateSecurityProfileGroupRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for OperationMetadata + * Gets the default type url for UpdateSecurityProfileGroupRequest * @function getTypeUrl - * @memberof google.cloud.networksecurity.v1.OperationMetadata + * @memberof google.cloud.networksecurity.v1.UpdateSecurityProfileGroupRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - OperationMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + UpdateSecurityProfileGroupRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.networksecurity.v1.OperationMetadata"; - }; - - return OperationMetadata; - })(); - - v1.NetworkSecurity = (function() { - - /** - * Constructs a new NetworkSecurity service. - * @memberof google.cloud.networksecurity.v1 - * @classdesc Represents a NetworkSecurity - * @extends $protobuf.rpc.Service - * @constructor - * @param {$protobuf.RPCImpl} rpcImpl RPC implementation - * @param {boolean} [requestDelimited=false] Whether requests are length-delimited - * @param {boolean} [responseDelimited=false] Whether responses are length-delimited - */ - function NetworkSecurity(rpcImpl, requestDelimited, responseDelimited) { - $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); - } - - (NetworkSecurity.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = NetworkSecurity; - - /** - * Creates new NetworkSecurity service using the specified rpc implementation. - * @function create - * @memberof google.cloud.networksecurity.v1.NetworkSecurity - * @static - * @param {$protobuf.RPCImpl} rpcImpl RPC implementation - * @param {boolean} [requestDelimited=false] Whether requests are length-delimited - * @param {boolean} [responseDelimited=false] Whether responses are length-delimited - * @returns {NetworkSecurity} RPC service. Useful where requests and/or responses are streamed. - */ - NetworkSecurity.create = function create(rpcImpl, requestDelimited, responseDelimited) { - return new this(rpcImpl, requestDelimited, responseDelimited); + return typeUrlPrefix + "/google.cloud.networksecurity.v1.UpdateSecurityProfileGroupRequest"; }; - /** - * Callback as used by {@link google.cloud.networksecurity.v1.NetworkSecurity|listAuthorizationPolicies}. - * @memberof google.cloud.networksecurity.v1.NetworkSecurity - * @typedef ListAuthorizationPoliciesCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.networksecurity.v1.ListAuthorizationPoliciesResponse} [response] ListAuthorizationPoliciesResponse - */ - - /** - * Calls ListAuthorizationPolicies. - * @function listAuthorizationPolicies - * @memberof google.cloud.networksecurity.v1.NetworkSecurity - * @instance - * @param {google.cloud.networksecurity.v1.IListAuthorizationPoliciesRequest} request ListAuthorizationPoliciesRequest message or plain object - * @param {google.cloud.networksecurity.v1.NetworkSecurity.ListAuthorizationPoliciesCallback} callback Node-style callback called with the error, if any, and ListAuthorizationPoliciesResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(NetworkSecurity.prototype.listAuthorizationPolicies = function listAuthorizationPolicies(request, callback) { - return this.rpcCall(listAuthorizationPolicies, $root.google.cloud.networksecurity.v1.ListAuthorizationPoliciesRequest, $root.google.cloud.networksecurity.v1.ListAuthorizationPoliciesResponse, request, callback); - }, "name", { value: "ListAuthorizationPolicies" }); - - /** - * Calls ListAuthorizationPolicies. - * @function listAuthorizationPolicies - * @memberof google.cloud.networksecurity.v1.NetworkSecurity - * @instance - * @param {google.cloud.networksecurity.v1.IListAuthorizationPoliciesRequest} request ListAuthorizationPoliciesRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.networksecurity.v1.NetworkSecurity|getAuthorizationPolicy}. - * @memberof google.cloud.networksecurity.v1.NetworkSecurity - * @typedef GetAuthorizationPolicyCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.networksecurity.v1.AuthorizationPolicy} [response] AuthorizationPolicy - */ - - /** - * Calls GetAuthorizationPolicy. - * @function getAuthorizationPolicy - * @memberof google.cloud.networksecurity.v1.NetworkSecurity - * @instance - * @param {google.cloud.networksecurity.v1.IGetAuthorizationPolicyRequest} request GetAuthorizationPolicyRequest message or plain object - * @param {google.cloud.networksecurity.v1.NetworkSecurity.GetAuthorizationPolicyCallback} callback Node-style callback called with the error, if any, and AuthorizationPolicy - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(NetworkSecurity.prototype.getAuthorizationPolicy = function getAuthorizationPolicy(request, callback) { - return this.rpcCall(getAuthorizationPolicy, $root.google.cloud.networksecurity.v1.GetAuthorizationPolicyRequest, $root.google.cloud.networksecurity.v1.AuthorizationPolicy, request, callback); - }, "name", { value: "GetAuthorizationPolicy" }); - - /** - * Calls GetAuthorizationPolicy. - * @function getAuthorizationPolicy - * @memberof google.cloud.networksecurity.v1.NetworkSecurity - * @instance - * @param {google.cloud.networksecurity.v1.IGetAuthorizationPolicyRequest} request GetAuthorizationPolicyRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.networksecurity.v1.NetworkSecurity|createAuthorizationPolicy}. - * @memberof google.cloud.networksecurity.v1.NetworkSecurity - * @typedef CreateAuthorizationPolicyCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ - - /** - * Calls CreateAuthorizationPolicy. - * @function createAuthorizationPolicy - * @memberof google.cloud.networksecurity.v1.NetworkSecurity - * @instance - * @param {google.cloud.networksecurity.v1.ICreateAuthorizationPolicyRequest} request CreateAuthorizationPolicyRequest message or plain object - * @param {google.cloud.networksecurity.v1.NetworkSecurity.CreateAuthorizationPolicyCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(NetworkSecurity.prototype.createAuthorizationPolicy = function createAuthorizationPolicy(request, callback) { - return this.rpcCall(createAuthorizationPolicy, $root.google.cloud.networksecurity.v1.CreateAuthorizationPolicyRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "CreateAuthorizationPolicy" }); - - /** - * Calls CreateAuthorizationPolicy. - * @function createAuthorizationPolicy - * @memberof google.cloud.networksecurity.v1.NetworkSecurity - * @instance - * @param {google.cloud.networksecurity.v1.ICreateAuthorizationPolicyRequest} request CreateAuthorizationPolicyRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.networksecurity.v1.NetworkSecurity|updateAuthorizationPolicy}. - * @memberof google.cloud.networksecurity.v1.NetworkSecurity - * @typedef UpdateAuthorizationPolicyCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ - - /** - * Calls UpdateAuthorizationPolicy. - * @function updateAuthorizationPolicy - * @memberof google.cloud.networksecurity.v1.NetworkSecurity - * @instance - * @param {google.cloud.networksecurity.v1.IUpdateAuthorizationPolicyRequest} request UpdateAuthorizationPolicyRequest message or plain object - * @param {google.cloud.networksecurity.v1.NetworkSecurity.UpdateAuthorizationPolicyCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(NetworkSecurity.prototype.updateAuthorizationPolicy = function updateAuthorizationPolicy(request, callback) { - return this.rpcCall(updateAuthorizationPolicy, $root.google.cloud.networksecurity.v1.UpdateAuthorizationPolicyRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "UpdateAuthorizationPolicy" }); - - /** - * Calls UpdateAuthorizationPolicy. - * @function updateAuthorizationPolicy - * @memberof google.cloud.networksecurity.v1.NetworkSecurity - * @instance - * @param {google.cloud.networksecurity.v1.IUpdateAuthorizationPolicyRequest} request UpdateAuthorizationPolicyRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.networksecurity.v1.NetworkSecurity|deleteAuthorizationPolicy}. - * @memberof google.cloud.networksecurity.v1.NetworkSecurity - * @typedef DeleteAuthorizationPolicyCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ - - /** - * Calls DeleteAuthorizationPolicy. - * @function deleteAuthorizationPolicy - * @memberof google.cloud.networksecurity.v1.NetworkSecurity - * @instance - * @param {google.cloud.networksecurity.v1.IDeleteAuthorizationPolicyRequest} request DeleteAuthorizationPolicyRequest message or plain object - * @param {google.cloud.networksecurity.v1.NetworkSecurity.DeleteAuthorizationPolicyCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(NetworkSecurity.prototype.deleteAuthorizationPolicy = function deleteAuthorizationPolicy(request, callback) { - return this.rpcCall(deleteAuthorizationPolicy, $root.google.cloud.networksecurity.v1.DeleteAuthorizationPolicyRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "DeleteAuthorizationPolicy" }); - - /** - * Calls DeleteAuthorizationPolicy. - * @function deleteAuthorizationPolicy - * @memberof google.cloud.networksecurity.v1.NetworkSecurity - * @instance - * @param {google.cloud.networksecurity.v1.IDeleteAuthorizationPolicyRequest} request DeleteAuthorizationPolicyRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.networksecurity.v1.NetworkSecurity|listServerTlsPolicies}. - * @memberof google.cloud.networksecurity.v1.NetworkSecurity - * @typedef ListServerTlsPoliciesCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.networksecurity.v1.ListServerTlsPoliciesResponse} [response] ListServerTlsPoliciesResponse - */ - - /** - * Calls ListServerTlsPolicies. - * @function listServerTlsPolicies - * @memberof google.cloud.networksecurity.v1.NetworkSecurity - * @instance - * @param {google.cloud.networksecurity.v1.IListServerTlsPoliciesRequest} request ListServerTlsPoliciesRequest message or plain object - * @param {google.cloud.networksecurity.v1.NetworkSecurity.ListServerTlsPoliciesCallback} callback Node-style callback called with the error, if any, and ListServerTlsPoliciesResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(NetworkSecurity.prototype.listServerTlsPolicies = function listServerTlsPolicies(request, callback) { - return this.rpcCall(listServerTlsPolicies, $root.google.cloud.networksecurity.v1.ListServerTlsPoliciesRequest, $root.google.cloud.networksecurity.v1.ListServerTlsPoliciesResponse, request, callback); - }, "name", { value: "ListServerTlsPolicies" }); - - /** - * Calls ListServerTlsPolicies. - * @function listServerTlsPolicies - * @memberof google.cloud.networksecurity.v1.NetworkSecurity - * @instance - * @param {google.cloud.networksecurity.v1.IListServerTlsPoliciesRequest} request ListServerTlsPoliciesRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.networksecurity.v1.NetworkSecurity|getServerTlsPolicy}. - * @memberof google.cloud.networksecurity.v1.NetworkSecurity - * @typedef GetServerTlsPolicyCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.networksecurity.v1.ServerTlsPolicy} [response] ServerTlsPolicy - */ - - /** - * Calls GetServerTlsPolicy. - * @function getServerTlsPolicy - * @memberof google.cloud.networksecurity.v1.NetworkSecurity - * @instance - * @param {google.cloud.networksecurity.v1.IGetServerTlsPolicyRequest} request GetServerTlsPolicyRequest message or plain object - * @param {google.cloud.networksecurity.v1.NetworkSecurity.GetServerTlsPolicyCallback} callback Node-style callback called with the error, if any, and ServerTlsPolicy - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(NetworkSecurity.prototype.getServerTlsPolicy = function getServerTlsPolicy(request, callback) { - return this.rpcCall(getServerTlsPolicy, $root.google.cloud.networksecurity.v1.GetServerTlsPolicyRequest, $root.google.cloud.networksecurity.v1.ServerTlsPolicy, request, callback); - }, "name", { value: "GetServerTlsPolicy" }); - - /** - * Calls GetServerTlsPolicy. - * @function getServerTlsPolicy - * @memberof google.cloud.networksecurity.v1.NetworkSecurity - * @instance - * @param {google.cloud.networksecurity.v1.IGetServerTlsPolicyRequest} request GetServerTlsPolicyRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.networksecurity.v1.NetworkSecurity|createServerTlsPolicy}. - * @memberof google.cloud.networksecurity.v1.NetworkSecurity - * @typedef CreateServerTlsPolicyCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ - - /** - * Calls CreateServerTlsPolicy. - * @function createServerTlsPolicy - * @memberof google.cloud.networksecurity.v1.NetworkSecurity - * @instance - * @param {google.cloud.networksecurity.v1.ICreateServerTlsPolicyRequest} request CreateServerTlsPolicyRequest message or plain object - * @param {google.cloud.networksecurity.v1.NetworkSecurity.CreateServerTlsPolicyCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(NetworkSecurity.prototype.createServerTlsPolicy = function createServerTlsPolicy(request, callback) { - return this.rpcCall(createServerTlsPolicy, $root.google.cloud.networksecurity.v1.CreateServerTlsPolicyRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "CreateServerTlsPolicy" }); - - /** - * Calls CreateServerTlsPolicy. - * @function createServerTlsPolicy - * @memberof google.cloud.networksecurity.v1.NetworkSecurity - * @instance - * @param {google.cloud.networksecurity.v1.ICreateServerTlsPolicyRequest} request CreateServerTlsPolicyRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.networksecurity.v1.NetworkSecurity|updateServerTlsPolicy}. - * @memberof google.cloud.networksecurity.v1.NetworkSecurity - * @typedef UpdateServerTlsPolicyCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ - - /** - * Calls UpdateServerTlsPolicy. - * @function updateServerTlsPolicy - * @memberof google.cloud.networksecurity.v1.NetworkSecurity - * @instance - * @param {google.cloud.networksecurity.v1.IUpdateServerTlsPolicyRequest} request UpdateServerTlsPolicyRequest message or plain object - * @param {google.cloud.networksecurity.v1.NetworkSecurity.UpdateServerTlsPolicyCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(NetworkSecurity.prototype.updateServerTlsPolicy = function updateServerTlsPolicy(request, callback) { - return this.rpcCall(updateServerTlsPolicy, $root.google.cloud.networksecurity.v1.UpdateServerTlsPolicyRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "UpdateServerTlsPolicy" }); - - /** - * Calls UpdateServerTlsPolicy. - * @function updateServerTlsPolicy - * @memberof google.cloud.networksecurity.v1.NetworkSecurity - * @instance - * @param {google.cloud.networksecurity.v1.IUpdateServerTlsPolicyRequest} request UpdateServerTlsPolicyRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.networksecurity.v1.NetworkSecurity|deleteServerTlsPolicy}. - * @memberof google.cloud.networksecurity.v1.NetworkSecurity - * @typedef DeleteServerTlsPolicyCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ - - /** - * Calls DeleteServerTlsPolicy. - * @function deleteServerTlsPolicy - * @memberof google.cloud.networksecurity.v1.NetworkSecurity - * @instance - * @param {google.cloud.networksecurity.v1.IDeleteServerTlsPolicyRequest} request DeleteServerTlsPolicyRequest message or plain object - * @param {google.cloud.networksecurity.v1.NetworkSecurity.DeleteServerTlsPolicyCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(NetworkSecurity.prototype.deleteServerTlsPolicy = function deleteServerTlsPolicy(request, callback) { - return this.rpcCall(deleteServerTlsPolicy, $root.google.cloud.networksecurity.v1.DeleteServerTlsPolicyRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "DeleteServerTlsPolicy" }); - - /** - * Calls DeleteServerTlsPolicy. - * @function deleteServerTlsPolicy - * @memberof google.cloud.networksecurity.v1.NetworkSecurity - * @instance - * @param {google.cloud.networksecurity.v1.IDeleteServerTlsPolicyRequest} request DeleteServerTlsPolicyRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.networksecurity.v1.NetworkSecurity|listClientTlsPolicies}. - * @memberof google.cloud.networksecurity.v1.NetworkSecurity - * @typedef ListClientTlsPoliciesCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.networksecurity.v1.ListClientTlsPoliciesResponse} [response] ListClientTlsPoliciesResponse - */ - - /** - * Calls ListClientTlsPolicies. - * @function listClientTlsPolicies - * @memberof google.cloud.networksecurity.v1.NetworkSecurity - * @instance - * @param {google.cloud.networksecurity.v1.IListClientTlsPoliciesRequest} request ListClientTlsPoliciesRequest message or plain object - * @param {google.cloud.networksecurity.v1.NetworkSecurity.ListClientTlsPoliciesCallback} callback Node-style callback called with the error, if any, and ListClientTlsPoliciesResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(NetworkSecurity.prototype.listClientTlsPolicies = function listClientTlsPolicies(request, callback) { - return this.rpcCall(listClientTlsPolicies, $root.google.cloud.networksecurity.v1.ListClientTlsPoliciesRequest, $root.google.cloud.networksecurity.v1.ListClientTlsPoliciesResponse, request, callback); - }, "name", { value: "ListClientTlsPolicies" }); - - /** - * Calls ListClientTlsPolicies. - * @function listClientTlsPolicies - * @memberof google.cloud.networksecurity.v1.NetworkSecurity - * @instance - * @param {google.cloud.networksecurity.v1.IListClientTlsPoliciesRequest} request ListClientTlsPoliciesRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.networksecurity.v1.NetworkSecurity|getClientTlsPolicy}. - * @memberof google.cloud.networksecurity.v1.NetworkSecurity - * @typedef GetClientTlsPolicyCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.networksecurity.v1.ClientTlsPolicy} [response] ClientTlsPolicy - */ - - /** - * Calls GetClientTlsPolicy. - * @function getClientTlsPolicy - * @memberof google.cloud.networksecurity.v1.NetworkSecurity - * @instance - * @param {google.cloud.networksecurity.v1.IGetClientTlsPolicyRequest} request GetClientTlsPolicyRequest message or plain object - * @param {google.cloud.networksecurity.v1.NetworkSecurity.GetClientTlsPolicyCallback} callback Node-style callback called with the error, if any, and ClientTlsPolicy - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(NetworkSecurity.prototype.getClientTlsPolicy = function getClientTlsPolicy(request, callback) { - return this.rpcCall(getClientTlsPolicy, $root.google.cloud.networksecurity.v1.GetClientTlsPolicyRequest, $root.google.cloud.networksecurity.v1.ClientTlsPolicy, request, callback); - }, "name", { value: "GetClientTlsPolicy" }); - - /** - * Calls GetClientTlsPolicy. - * @function getClientTlsPolicy - * @memberof google.cloud.networksecurity.v1.NetworkSecurity - * @instance - * @param {google.cloud.networksecurity.v1.IGetClientTlsPolicyRequest} request GetClientTlsPolicyRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.networksecurity.v1.NetworkSecurity|createClientTlsPolicy}. - * @memberof google.cloud.networksecurity.v1.NetworkSecurity - * @typedef CreateClientTlsPolicyCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ - - /** - * Calls CreateClientTlsPolicy. - * @function createClientTlsPolicy - * @memberof google.cloud.networksecurity.v1.NetworkSecurity - * @instance - * @param {google.cloud.networksecurity.v1.ICreateClientTlsPolicyRequest} request CreateClientTlsPolicyRequest message or plain object - * @param {google.cloud.networksecurity.v1.NetworkSecurity.CreateClientTlsPolicyCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(NetworkSecurity.prototype.createClientTlsPolicy = function createClientTlsPolicy(request, callback) { - return this.rpcCall(createClientTlsPolicy, $root.google.cloud.networksecurity.v1.CreateClientTlsPolicyRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "CreateClientTlsPolicy" }); - - /** - * Calls CreateClientTlsPolicy. - * @function createClientTlsPolicy - * @memberof google.cloud.networksecurity.v1.NetworkSecurity - * @instance - * @param {google.cloud.networksecurity.v1.ICreateClientTlsPolicyRequest} request CreateClientTlsPolicyRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.networksecurity.v1.NetworkSecurity|updateClientTlsPolicy}. - * @memberof google.cloud.networksecurity.v1.NetworkSecurity - * @typedef UpdateClientTlsPolicyCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ - - /** - * Calls UpdateClientTlsPolicy. - * @function updateClientTlsPolicy - * @memberof google.cloud.networksecurity.v1.NetworkSecurity - * @instance - * @param {google.cloud.networksecurity.v1.IUpdateClientTlsPolicyRequest} request UpdateClientTlsPolicyRequest message or plain object - * @param {google.cloud.networksecurity.v1.NetworkSecurity.UpdateClientTlsPolicyCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(NetworkSecurity.prototype.updateClientTlsPolicy = function updateClientTlsPolicy(request, callback) { - return this.rpcCall(updateClientTlsPolicy, $root.google.cloud.networksecurity.v1.UpdateClientTlsPolicyRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "UpdateClientTlsPolicy" }); - - /** - * Calls UpdateClientTlsPolicy. - * @function updateClientTlsPolicy - * @memberof google.cloud.networksecurity.v1.NetworkSecurity - * @instance - * @param {google.cloud.networksecurity.v1.IUpdateClientTlsPolicyRequest} request UpdateClientTlsPolicyRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.networksecurity.v1.NetworkSecurity|deleteClientTlsPolicy}. - * @memberof google.cloud.networksecurity.v1.NetworkSecurity - * @typedef DeleteClientTlsPolicyCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ - - /** - * Calls DeleteClientTlsPolicy. - * @function deleteClientTlsPolicy - * @memberof google.cloud.networksecurity.v1.NetworkSecurity - * @instance - * @param {google.cloud.networksecurity.v1.IDeleteClientTlsPolicyRequest} request DeleteClientTlsPolicyRequest message or plain object - * @param {google.cloud.networksecurity.v1.NetworkSecurity.DeleteClientTlsPolicyCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(NetworkSecurity.prototype.deleteClientTlsPolicy = function deleteClientTlsPolicy(request, callback) { - return this.rpcCall(deleteClientTlsPolicy, $root.google.cloud.networksecurity.v1.DeleteClientTlsPolicyRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "DeleteClientTlsPolicy" }); - - /** - * Calls DeleteClientTlsPolicy. - * @function deleteClientTlsPolicy - * @memberof google.cloud.networksecurity.v1.NetworkSecurity - * @instance - * @param {google.cloud.networksecurity.v1.IDeleteClientTlsPolicyRequest} request DeleteClientTlsPolicyRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - return NetworkSecurity; + return UpdateSecurityProfileGroupRequest; })(); - v1.ServerTlsPolicy = (function() { + v1.DeleteSecurityProfileGroupRequest = (function() { /** - * Properties of a ServerTlsPolicy. + * Properties of a DeleteSecurityProfileGroupRequest. * @memberof google.cloud.networksecurity.v1 - * @interface IServerTlsPolicy - * @property {string|null} [name] ServerTlsPolicy name - * @property {string|null} [description] ServerTlsPolicy description - * @property {google.protobuf.ITimestamp|null} [createTime] ServerTlsPolicy createTime - * @property {google.protobuf.ITimestamp|null} [updateTime] ServerTlsPolicy updateTime - * @property {Object.|null} [labels] ServerTlsPolicy labels - * @property {boolean|null} [allowOpen] ServerTlsPolicy allowOpen - * @property {google.cloud.networksecurity.v1.ICertificateProvider|null} [serverCertificate] ServerTlsPolicy serverCertificate - * @property {google.cloud.networksecurity.v1.ServerTlsPolicy.IMTLSPolicy|null} [mtlsPolicy] ServerTlsPolicy mtlsPolicy + * @interface IDeleteSecurityProfileGroupRequest + * @property {string|null} [name] DeleteSecurityProfileGroupRequest name + * @property {string|null} [etag] DeleteSecurityProfileGroupRequest etag */ /** - * Constructs a new ServerTlsPolicy. + * Constructs a new DeleteSecurityProfileGroupRequest. * @memberof google.cloud.networksecurity.v1 - * @classdesc Represents a ServerTlsPolicy. - * @implements IServerTlsPolicy + * @classdesc Represents a DeleteSecurityProfileGroupRequest. + * @implements IDeleteSecurityProfileGroupRequest * @constructor - * @param {google.cloud.networksecurity.v1.IServerTlsPolicy=} [properties] Properties to set + * @param {google.cloud.networksecurity.v1.IDeleteSecurityProfileGroupRequest=} [properties] Properties to set */ - function ServerTlsPolicy(properties) { - this.labels = {}; + function DeleteSecurityProfileGroupRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -11075,141 +64023,80 @@ } /** - * ServerTlsPolicy name. + * DeleteSecurityProfileGroupRequest name. * @member {string} name - * @memberof google.cloud.networksecurity.v1.ServerTlsPolicy - * @instance - */ - ServerTlsPolicy.prototype.name = ""; - - /** - * ServerTlsPolicy description. - * @member {string} description - * @memberof google.cloud.networksecurity.v1.ServerTlsPolicy - * @instance - */ - ServerTlsPolicy.prototype.description = ""; - - /** - * ServerTlsPolicy createTime. - * @member {google.protobuf.ITimestamp|null|undefined} createTime - * @memberof google.cloud.networksecurity.v1.ServerTlsPolicy - * @instance - */ - ServerTlsPolicy.prototype.createTime = null; - - /** - * ServerTlsPolicy updateTime. - * @member {google.protobuf.ITimestamp|null|undefined} updateTime - * @memberof google.cloud.networksecurity.v1.ServerTlsPolicy - * @instance - */ - ServerTlsPolicy.prototype.updateTime = null; - - /** - * ServerTlsPolicy labels. - * @member {Object.} labels - * @memberof google.cloud.networksecurity.v1.ServerTlsPolicy - * @instance - */ - ServerTlsPolicy.prototype.labels = $util.emptyObject; - - /** - * ServerTlsPolicy allowOpen. - * @member {boolean} allowOpen - * @memberof google.cloud.networksecurity.v1.ServerTlsPolicy - * @instance - */ - ServerTlsPolicy.prototype.allowOpen = false; - - /** - * ServerTlsPolicy serverCertificate. - * @member {google.cloud.networksecurity.v1.ICertificateProvider|null|undefined} serverCertificate - * @memberof google.cloud.networksecurity.v1.ServerTlsPolicy + * @memberof google.cloud.networksecurity.v1.DeleteSecurityProfileGroupRequest * @instance */ - ServerTlsPolicy.prototype.serverCertificate = null; + DeleteSecurityProfileGroupRequest.prototype.name = ""; /** - * ServerTlsPolicy mtlsPolicy. - * @member {google.cloud.networksecurity.v1.ServerTlsPolicy.IMTLSPolicy|null|undefined} mtlsPolicy - * @memberof google.cloud.networksecurity.v1.ServerTlsPolicy + * DeleteSecurityProfileGroupRequest etag. + * @member {string} etag + * @memberof google.cloud.networksecurity.v1.DeleteSecurityProfileGroupRequest * @instance */ - ServerTlsPolicy.prototype.mtlsPolicy = null; + DeleteSecurityProfileGroupRequest.prototype.etag = ""; /** - * Creates a new ServerTlsPolicy instance using the specified properties. + * Creates a new DeleteSecurityProfileGroupRequest instance using the specified properties. * @function create - * @memberof google.cloud.networksecurity.v1.ServerTlsPolicy + * @memberof google.cloud.networksecurity.v1.DeleteSecurityProfileGroupRequest * @static - * @param {google.cloud.networksecurity.v1.IServerTlsPolicy=} [properties] Properties to set - * @returns {google.cloud.networksecurity.v1.ServerTlsPolicy} ServerTlsPolicy instance + * @param {google.cloud.networksecurity.v1.IDeleteSecurityProfileGroupRequest=} [properties] Properties to set + * @returns {google.cloud.networksecurity.v1.DeleteSecurityProfileGroupRequest} DeleteSecurityProfileGroupRequest instance */ - ServerTlsPolicy.create = function create(properties) { - return new ServerTlsPolicy(properties); + DeleteSecurityProfileGroupRequest.create = function create(properties) { + return new DeleteSecurityProfileGroupRequest(properties); }; /** - * Encodes the specified ServerTlsPolicy message. Does not implicitly {@link google.cloud.networksecurity.v1.ServerTlsPolicy.verify|verify} messages. + * Encodes the specified DeleteSecurityProfileGroupRequest message. Does not implicitly {@link google.cloud.networksecurity.v1.DeleteSecurityProfileGroupRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.networksecurity.v1.ServerTlsPolicy + * @memberof google.cloud.networksecurity.v1.DeleteSecurityProfileGroupRequest * @static - * @param {google.cloud.networksecurity.v1.IServerTlsPolicy} message ServerTlsPolicy message or plain object to encode + * @param {google.cloud.networksecurity.v1.IDeleteSecurityProfileGroupRequest} message DeleteSecurityProfileGroupRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ServerTlsPolicy.encode = function encode(message, writer) { + DeleteSecurityProfileGroupRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.description != null && Object.hasOwnProperty.call(message, "description")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.description); - if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) - $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) - $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) - for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) - writer.uint32(/* id 5, wireType 2 =*/42).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); - if (message.allowOpen != null && Object.hasOwnProperty.call(message, "allowOpen")) - writer.uint32(/* id 6, wireType 0 =*/48).bool(message.allowOpen); - if (message.serverCertificate != null && Object.hasOwnProperty.call(message, "serverCertificate")) - $root.google.cloud.networksecurity.v1.CertificateProvider.encode(message.serverCertificate, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - if (message.mtlsPolicy != null && Object.hasOwnProperty.call(message, "mtlsPolicy")) - $root.google.cloud.networksecurity.v1.ServerTlsPolicy.MTLSPolicy.encode(message.mtlsPolicy, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.etag); return writer; }; /** - * Encodes the specified ServerTlsPolicy message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.ServerTlsPolicy.verify|verify} messages. + * Encodes the specified DeleteSecurityProfileGroupRequest message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.DeleteSecurityProfileGroupRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.networksecurity.v1.ServerTlsPolicy + * @memberof google.cloud.networksecurity.v1.DeleteSecurityProfileGroupRequest * @static - * @param {google.cloud.networksecurity.v1.IServerTlsPolicy} message ServerTlsPolicy message or plain object to encode + * @param {google.cloud.networksecurity.v1.IDeleteSecurityProfileGroupRequest} message DeleteSecurityProfileGroupRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ServerTlsPolicy.encodeDelimited = function encodeDelimited(message, writer) { + DeleteSecurityProfileGroupRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ServerTlsPolicy message from the specified reader or buffer. + * Decodes a DeleteSecurityProfileGroupRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.networksecurity.v1.ServerTlsPolicy + * @memberof google.cloud.networksecurity.v1.DeleteSecurityProfileGroupRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.networksecurity.v1.ServerTlsPolicy} ServerTlsPolicy + * @returns {google.cloud.networksecurity.v1.DeleteSecurityProfileGroupRequest} DeleteSecurityProfileGroupRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ServerTlsPolicy.decode = function decode(reader, length, error) { + DeleteSecurityProfileGroupRequest.decode = function decode(reader, length, error) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networksecurity.v1.ServerTlsPolicy(), key, value; + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networksecurity.v1.DeleteSecurityProfileGroupRequest(); while (reader.pos < end) { var tag = reader.uint32(); if (tag === error) @@ -11220,50 +64107,7 @@ break; } case 2: { - message.description = reader.string(); - break; - } - case 3: { - message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 4: { - message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 5: { - if (message.labels === $util.emptyObject) - message.labels = {}; - var end2 = reader.uint32() + reader.pos; - key = ""; - value = ""; - while (reader.pos < end2) { - var tag2 = reader.uint32(); - switch (tag2 >>> 3) { - case 1: - key = reader.string(); - break; - case 2: - value = reader.string(); - break; - default: - reader.skipType(tag2 & 7); - break; - } - } - message.labels[key] = value; - break; - } - case 6: { - message.allowOpen = reader.bool(); - break; - } - case 7: { - message.serverCertificate = $root.google.cloud.networksecurity.v1.CertificateProvider.decode(reader, reader.uint32()); - break; - } - case 8: { - message.mtlsPolicy = $root.google.cloud.networksecurity.v1.ServerTlsPolicy.MTLSPolicy.decode(reader, reader.uint32()); + message.etag = reader.string(); break; } default: @@ -11275,442 +64119,133 @@ }; /** - * Decodes a ServerTlsPolicy message from the specified reader or buffer, length delimited. + * Decodes a DeleteSecurityProfileGroupRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.networksecurity.v1.ServerTlsPolicy + * @memberof google.cloud.networksecurity.v1.DeleteSecurityProfileGroupRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.networksecurity.v1.ServerTlsPolicy} ServerTlsPolicy + * @returns {google.cloud.networksecurity.v1.DeleteSecurityProfileGroupRequest} DeleteSecurityProfileGroupRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ServerTlsPolicy.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ServerTlsPolicy message. - * @function verify - * @memberof google.cloud.networksecurity.v1.ServerTlsPolicy - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ServerTlsPolicy.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.description != null && message.hasOwnProperty("description")) - if (!$util.isString(message.description)) - return "description: string expected"; - if (message.createTime != null && message.hasOwnProperty("createTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.createTime); - if (error) - return "createTime." + error; - } - if (message.updateTime != null && message.hasOwnProperty("updateTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.updateTime); - if (error) - return "updateTime." + error; - } - if (message.labels != null && message.hasOwnProperty("labels")) { - if (!$util.isObject(message.labels)) - return "labels: object expected"; - var key = Object.keys(message.labels); - for (var i = 0; i < key.length; ++i) - if (!$util.isString(message.labels[key[i]])) - return "labels: string{k:string} expected"; - } - if (message.allowOpen != null && message.hasOwnProperty("allowOpen")) - if (typeof message.allowOpen !== "boolean") - return "allowOpen: boolean expected"; - if (message.serverCertificate != null && message.hasOwnProperty("serverCertificate")) { - var error = $root.google.cloud.networksecurity.v1.CertificateProvider.verify(message.serverCertificate); - if (error) - return "serverCertificate." + error; - } - if (message.mtlsPolicy != null && message.hasOwnProperty("mtlsPolicy")) { - var error = $root.google.cloud.networksecurity.v1.ServerTlsPolicy.MTLSPolicy.verify(message.mtlsPolicy); - if (error) - return "mtlsPolicy." + error; - } + DeleteSecurityProfileGroupRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteSecurityProfileGroupRequest message. + * @function verify + * @memberof google.cloud.networksecurity.v1.DeleteSecurityProfileGroupRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteSecurityProfileGroupRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.etag != null && message.hasOwnProperty("etag")) + if (!$util.isString(message.etag)) + return "etag: string expected"; return null; }; /** - * Creates a ServerTlsPolicy message from a plain object. Also converts values to their respective internal types. + * Creates a DeleteSecurityProfileGroupRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.networksecurity.v1.ServerTlsPolicy + * @memberof google.cloud.networksecurity.v1.DeleteSecurityProfileGroupRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.networksecurity.v1.ServerTlsPolicy} ServerTlsPolicy + * @returns {google.cloud.networksecurity.v1.DeleteSecurityProfileGroupRequest} DeleteSecurityProfileGroupRequest */ - ServerTlsPolicy.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.networksecurity.v1.ServerTlsPolicy) + DeleteSecurityProfileGroupRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networksecurity.v1.DeleteSecurityProfileGroupRequest) return object; - var message = new $root.google.cloud.networksecurity.v1.ServerTlsPolicy(); + var message = new $root.google.cloud.networksecurity.v1.DeleteSecurityProfileGroupRequest(); if (object.name != null) message.name = String(object.name); - if (object.description != null) - message.description = String(object.description); - if (object.createTime != null) { - if (typeof object.createTime !== "object") - throw TypeError(".google.cloud.networksecurity.v1.ServerTlsPolicy.createTime: object expected"); - message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); - } - if (object.updateTime != null) { - if (typeof object.updateTime !== "object") - throw TypeError(".google.cloud.networksecurity.v1.ServerTlsPolicy.updateTime: object expected"); - message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); - } - if (object.labels) { - if (typeof object.labels !== "object") - throw TypeError(".google.cloud.networksecurity.v1.ServerTlsPolicy.labels: object expected"); - message.labels = {}; - for (var keys = Object.keys(object.labels), i = 0; i < keys.length; ++i) - message.labels[keys[i]] = String(object.labels[keys[i]]); - } - if (object.allowOpen != null) - message.allowOpen = Boolean(object.allowOpen); - if (object.serverCertificate != null) { - if (typeof object.serverCertificate !== "object") - throw TypeError(".google.cloud.networksecurity.v1.ServerTlsPolicy.serverCertificate: object expected"); - message.serverCertificate = $root.google.cloud.networksecurity.v1.CertificateProvider.fromObject(object.serverCertificate); - } - if (object.mtlsPolicy != null) { - if (typeof object.mtlsPolicy !== "object") - throw TypeError(".google.cloud.networksecurity.v1.ServerTlsPolicy.mtlsPolicy: object expected"); - message.mtlsPolicy = $root.google.cloud.networksecurity.v1.ServerTlsPolicy.MTLSPolicy.fromObject(object.mtlsPolicy); - } + if (object.etag != null) + message.etag = String(object.etag); return message; }; /** - * Creates a plain object from a ServerTlsPolicy message. Also converts values to other types if specified. + * Creates a plain object from a DeleteSecurityProfileGroupRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.networksecurity.v1.ServerTlsPolicy + * @memberof google.cloud.networksecurity.v1.DeleteSecurityProfileGroupRequest * @static - * @param {google.cloud.networksecurity.v1.ServerTlsPolicy} message ServerTlsPolicy + * @param {google.cloud.networksecurity.v1.DeleteSecurityProfileGroupRequest} message DeleteSecurityProfileGroupRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ServerTlsPolicy.toObject = function toObject(message, options) { + DeleteSecurityProfileGroupRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.objects || options.defaults) - object.labels = {}; if (options.defaults) { object.name = ""; - object.description = ""; - object.createTime = null; - object.updateTime = null; - object.allowOpen = false; - object.serverCertificate = null; - object.mtlsPolicy = null; + object.etag = ""; } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; - if (message.description != null && message.hasOwnProperty("description")) - object.description = message.description; - if (message.createTime != null && message.hasOwnProperty("createTime")) - object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); - if (message.updateTime != null && message.hasOwnProperty("updateTime")) - object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); - var keys2; - if (message.labels && (keys2 = Object.keys(message.labels)).length) { - object.labels = {}; - for (var j = 0; j < keys2.length; ++j) - object.labels[keys2[j]] = message.labels[keys2[j]]; - } - if (message.allowOpen != null && message.hasOwnProperty("allowOpen")) - object.allowOpen = message.allowOpen; - if (message.serverCertificate != null && message.hasOwnProperty("serverCertificate")) - object.serverCertificate = $root.google.cloud.networksecurity.v1.CertificateProvider.toObject(message.serverCertificate, options); - if (message.mtlsPolicy != null && message.hasOwnProperty("mtlsPolicy")) - object.mtlsPolicy = $root.google.cloud.networksecurity.v1.ServerTlsPolicy.MTLSPolicy.toObject(message.mtlsPolicy, options); + if (message.etag != null && message.hasOwnProperty("etag")) + object.etag = message.etag; return object; }; /** - * Converts this ServerTlsPolicy to JSON. + * Converts this DeleteSecurityProfileGroupRequest to JSON. * @function toJSON - * @memberof google.cloud.networksecurity.v1.ServerTlsPolicy + * @memberof google.cloud.networksecurity.v1.DeleteSecurityProfileGroupRequest * @instance * @returns {Object.} JSON object */ - ServerTlsPolicy.prototype.toJSON = function toJSON() { + DeleteSecurityProfileGroupRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for ServerTlsPolicy + * Gets the default type url for DeleteSecurityProfileGroupRequest * @function getTypeUrl - * @memberof google.cloud.networksecurity.v1.ServerTlsPolicy + * @memberof google.cloud.networksecurity.v1.DeleteSecurityProfileGroupRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - ServerTlsPolicy.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + DeleteSecurityProfileGroupRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.networksecurity.v1.ServerTlsPolicy"; + return typeUrlPrefix + "/google.cloud.networksecurity.v1.DeleteSecurityProfileGroupRequest"; }; - ServerTlsPolicy.MTLSPolicy = (function() { - - /** - * Properties of a MTLSPolicy. - * @memberof google.cloud.networksecurity.v1.ServerTlsPolicy - * @interface IMTLSPolicy - * @property {Array.|null} [clientValidationCa] MTLSPolicy clientValidationCa - */ - - /** - * Constructs a new MTLSPolicy. - * @memberof google.cloud.networksecurity.v1.ServerTlsPolicy - * @classdesc Represents a MTLSPolicy. - * @implements IMTLSPolicy - * @constructor - * @param {google.cloud.networksecurity.v1.ServerTlsPolicy.IMTLSPolicy=} [properties] Properties to set - */ - function MTLSPolicy(properties) { - this.clientValidationCa = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * MTLSPolicy clientValidationCa. - * @member {Array.} clientValidationCa - * @memberof google.cloud.networksecurity.v1.ServerTlsPolicy.MTLSPolicy - * @instance - */ - MTLSPolicy.prototype.clientValidationCa = $util.emptyArray; - - /** - * Creates a new MTLSPolicy instance using the specified properties. - * @function create - * @memberof google.cloud.networksecurity.v1.ServerTlsPolicy.MTLSPolicy - * @static - * @param {google.cloud.networksecurity.v1.ServerTlsPolicy.IMTLSPolicy=} [properties] Properties to set - * @returns {google.cloud.networksecurity.v1.ServerTlsPolicy.MTLSPolicy} MTLSPolicy instance - */ - MTLSPolicy.create = function create(properties) { - return new MTLSPolicy(properties); - }; - - /** - * Encodes the specified MTLSPolicy message. Does not implicitly {@link google.cloud.networksecurity.v1.ServerTlsPolicy.MTLSPolicy.verify|verify} messages. - * @function encode - * @memberof google.cloud.networksecurity.v1.ServerTlsPolicy.MTLSPolicy - * @static - * @param {google.cloud.networksecurity.v1.ServerTlsPolicy.IMTLSPolicy} message MTLSPolicy message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MTLSPolicy.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.clientValidationCa != null && message.clientValidationCa.length) - for (var i = 0; i < message.clientValidationCa.length; ++i) - $root.google.cloud.networksecurity.v1.ValidationCA.encode(message.clientValidationCa[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified MTLSPolicy message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.ServerTlsPolicy.MTLSPolicy.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.networksecurity.v1.ServerTlsPolicy.MTLSPolicy - * @static - * @param {google.cloud.networksecurity.v1.ServerTlsPolicy.IMTLSPolicy} message MTLSPolicy message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MTLSPolicy.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a MTLSPolicy message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.networksecurity.v1.ServerTlsPolicy.MTLSPolicy - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.networksecurity.v1.ServerTlsPolicy.MTLSPolicy} MTLSPolicy - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MTLSPolicy.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networksecurity.v1.ServerTlsPolicy.MTLSPolicy(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.clientValidationCa && message.clientValidationCa.length)) - message.clientValidationCa = []; - message.clientValidationCa.push($root.google.cloud.networksecurity.v1.ValidationCA.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a MTLSPolicy message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.networksecurity.v1.ServerTlsPolicy.MTLSPolicy - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.networksecurity.v1.ServerTlsPolicy.MTLSPolicy} MTLSPolicy - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MTLSPolicy.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a MTLSPolicy message. - * @function verify - * @memberof google.cloud.networksecurity.v1.ServerTlsPolicy.MTLSPolicy - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - MTLSPolicy.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.clientValidationCa != null && message.hasOwnProperty("clientValidationCa")) { - if (!Array.isArray(message.clientValidationCa)) - return "clientValidationCa: array expected"; - for (var i = 0; i < message.clientValidationCa.length; ++i) { - var error = $root.google.cloud.networksecurity.v1.ValidationCA.verify(message.clientValidationCa[i]); - if (error) - return "clientValidationCa." + error; - } - } - return null; - }; - - /** - * Creates a MTLSPolicy message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.networksecurity.v1.ServerTlsPolicy.MTLSPolicy - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.networksecurity.v1.ServerTlsPolicy.MTLSPolicy} MTLSPolicy - */ - MTLSPolicy.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.networksecurity.v1.ServerTlsPolicy.MTLSPolicy) - return object; - var message = new $root.google.cloud.networksecurity.v1.ServerTlsPolicy.MTLSPolicy(); - if (object.clientValidationCa) { - if (!Array.isArray(object.clientValidationCa)) - throw TypeError(".google.cloud.networksecurity.v1.ServerTlsPolicy.MTLSPolicy.clientValidationCa: array expected"); - message.clientValidationCa = []; - for (var i = 0; i < object.clientValidationCa.length; ++i) { - if (typeof object.clientValidationCa[i] !== "object") - throw TypeError(".google.cloud.networksecurity.v1.ServerTlsPolicy.MTLSPolicy.clientValidationCa: object expected"); - message.clientValidationCa[i] = $root.google.cloud.networksecurity.v1.ValidationCA.fromObject(object.clientValidationCa[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a MTLSPolicy message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.networksecurity.v1.ServerTlsPolicy.MTLSPolicy - * @static - * @param {google.cloud.networksecurity.v1.ServerTlsPolicy.MTLSPolicy} message MTLSPolicy - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - MTLSPolicy.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.clientValidationCa = []; - if (message.clientValidationCa && message.clientValidationCa.length) { - object.clientValidationCa = []; - for (var j = 0; j < message.clientValidationCa.length; ++j) - object.clientValidationCa[j] = $root.google.cloud.networksecurity.v1.ValidationCA.toObject(message.clientValidationCa[j], options); - } - return object; - }; - - /** - * Converts this MTLSPolicy to JSON. - * @function toJSON - * @memberof google.cloud.networksecurity.v1.ServerTlsPolicy.MTLSPolicy - * @instance - * @returns {Object.} JSON object - */ - MTLSPolicy.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for MTLSPolicy - * @function getTypeUrl - * @memberof google.cloud.networksecurity.v1.ServerTlsPolicy.MTLSPolicy - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - MTLSPolicy.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.networksecurity.v1.ServerTlsPolicy.MTLSPolicy"; - }; - - return MTLSPolicy; - })(); - - return ServerTlsPolicy; + return DeleteSecurityProfileGroupRequest; })(); - v1.ListServerTlsPoliciesRequest = (function() { + v1.ListSecurityProfilesRequest = (function() { /** - * Properties of a ListServerTlsPoliciesRequest. + * Properties of a ListSecurityProfilesRequest. * @memberof google.cloud.networksecurity.v1 - * @interface IListServerTlsPoliciesRequest - * @property {string|null} [parent] ListServerTlsPoliciesRequest parent - * @property {number|null} [pageSize] ListServerTlsPoliciesRequest pageSize - * @property {string|null} [pageToken] ListServerTlsPoliciesRequest pageToken + * @interface IListSecurityProfilesRequest + * @property {string|null} [parent] ListSecurityProfilesRequest parent + * @property {number|null} [pageSize] ListSecurityProfilesRequest pageSize + * @property {string|null} [pageToken] ListSecurityProfilesRequest pageToken */ /** - * Constructs a new ListServerTlsPoliciesRequest. + * Constructs a new ListSecurityProfilesRequest. * @memberof google.cloud.networksecurity.v1 - * @classdesc Represents a ListServerTlsPoliciesRequest. - * @implements IListServerTlsPoliciesRequest + * @classdesc Represents a ListSecurityProfilesRequest. + * @implements IListSecurityProfilesRequest * @constructor - * @param {google.cloud.networksecurity.v1.IListServerTlsPoliciesRequest=} [properties] Properties to set + * @param {google.cloud.networksecurity.v1.IListSecurityProfilesRequest=} [properties] Properties to set */ - function ListServerTlsPoliciesRequest(properties) { + function ListSecurityProfilesRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -11718,51 +64253,51 @@ } /** - * ListServerTlsPoliciesRequest parent. + * ListSecurityProfilesRequest parent. * @member {string} parent - * @memberof google.cloud.networksecurity.v1.ListServerTlsPoliciesRequest + * @memberof google.cloud.networksecurity.v1.ListSecurityProfilesRequest * @instance */ - ListServerTlsPoliciesRequest.prototype.parent = ""; + ListSecurityProfilesRequest.prototype.parent = ""; /** - * ListServerTlsPoliciesRequest pageSize. + * ListSecurityProfilesRequest pageSize. * @member {number} pageSize - * @memberof google.cloud.networksecurity.v1.ListServerTlsPoliciesRequest + * @memberof google.cloud.networksecurity.v1.ListSecurityProfilesRequest * @instance */ - ListServerTlsPoliciesRequest.prototype.pageSize = 0; + ListSecurityProfilesRequest.prototype.pageSize = 0; /** - * ListServerTlsPoliciesRequest pageToken. + * ListSecurityProfilesRequest pageToken. * @member {string} pageToken - * @memberof google.cloud.networksecurity.v1.ListServerTlsPoliciesRequest + * @memberof google.cloud.networksecurity.v1.ListSecurityProfilesRequest * @instance */ - ListServerTlsPoliciesRequest.prototype.pageToken = ""; + ListSecurityProfilesRequest.prototype.pageToken = ""; /** - * Creates a new ListServerTlsPoliciesRequest instance using the specified properties. + * Creates a new ListSecurityProfilesRequest instance using the specified properties. * @function create - * @memberof google.cloud.networksecurity.v1.ListServerTlsPoliciesRequest + * @memberof google.cloud.networksecurity.v1.ListSecurityProfilesRequest * @static - * @param {google.cloud.networksecurity.v1.IListServerTlsPoliciesRequest=} [properties] Properties to set - * @returns {google.cloud.networksecurity.v1.ListServerTlsPoliciesRequest} ListServerTlsPoliciesRequest instance + * @param {google.cloud.networksecurity.v1.IListSecurityProfilesRequest=} [properties] Properties to set + * @returns {google.cloud.networksecurity.v1.ListSecurityProfilesRequest} ListSecurityProfilesRequest instance */ - ListServerTlsPoliciesRequest.create = function create(properties) { - return new ListServerTlsPoliciesRequest(properties); + ListSecurityProfilesRequest.create = function create(properties) { + return new ListSecurityProfilesRequest(properties); }; /** - * Encodes the specified ListServerTlsPoliciesRequest message. Does not implicitly {@link google.cloud.networksecurity.v1.ListServerTlsPoliciesRequest.verify|verify} messages. + * Encodes the specified ListSecurityProfilesRequest message. Does not implicitly {@link google.cloud.networksecurity.v1.ListSecurityProfilesRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.networksecurity.v1.ListServerTlsPoliciesRequest + * @memberof google.cloud.networksecurity.v1.ListSecurityProfilesRequest * @static - * @param {google.cloud.networksecurity.v1.IListServerTlsPoliciesRequest} message ListServerTlsPoliciesRequest message or plain object to encode + * @param {google.cloud.networksecurity.v1.IListSecurityProfilesRequest} message ListSecurityProfilesRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListServerTlsPoliciesRequest.encode = function encode(message, writer) { + ListSecurityProfilesRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) @@ -11775,33 +64310,33 @@ }; /** - * Encodes the specified ListServerTlsPoliciesRequest message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.ListServerTlsPoliciesRequest.verify|verify} messages. + * Encodes the specified ListSecurityProfilesRequest message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.ListSecurityProfilesRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.networksecurity.v1.ListServerTlsPoliciesRequest + * @memberof google.cloud.networksecurity.v1.ListSecurityProfilesRequest * @static - * @param {google.cloud.networksecurity.v1.IListServerTlsPoliciesRequest} message ListServerTlsPoliciesRequest message or plain object to encode + * @param {google.cloud.networksecurity.v1.IListSecurityProfilesRequest} message ListSecurityProfilesRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListServerTlsPoliciesRequest.encodeDelimited = function encodeDelimited(message, writer) { + ListSecurityProfilesRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ListServerTlsPoliciesRequest message from the specified reader or buffer. + * Decodes a ListSecurityProfilesRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.networksecurity.v1.ListServerTlsPoliciesRequest + * @memberof google.cloud.networksecurity.v1.ListSecurityProfilesRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.networksecurity.v1.ListServerTlsPoliciesRequest} ListServerTlsPoliciesRequest + * @returns {google.cloud.networksecurity.v1.ListSecurityProfilesRequest} ListSecurityProfilesRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListServerTlsPoliciesRequest.decode = function decode(reader, length, error) { + ListSecurityProfilesRequest.decode = function decode(reader, length, error) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networksecurity.v1.ListServerTlsPoliciesRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networksecurity.v1.ListSecurityProfilesRequest(); while (reader.pos < end) { var tag = reader.uint32(); if (tag === error) @@ -11828,30 +64363,30 @@ }; /** - * Decodes a ListServerTlsPoliciesRequest message from the specified reader or buffer, length delimited. + * Decodes a ListSecurityProfilesRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.networksecurity.v1.ListServerTlsPoliciesRequest + * @memberof google.cloud.networksecurity.v1.ListSecurityProfilesRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.networksecurity.v1.ListServerTlsPoliciesRequest} ListServerTlsPoliciesRequest + * @returns {google.cloud.networksecurity.v1.ListSecurityProfilesRequest} ListSecurityProfilesRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListServerTlsPoliciesRequest.decodeDelimited = function decodeDelimited(reader) { + ListSecurityProfilesRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ListServerTlsPoliciesRequest message. + * Verifies a ListSecurityProfilesRequest message. * @function verify - * @memberof google.cloud.networksecurity.v1.ListServerTlsPoliciesRequest + * @memberof google.cloud.networksecurity.v1.ListSecurityProfilesRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ListServerTlsPoliciesRequest.verify = function verify(message) { + ListSecurityProfilesRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.parent != null && message.hasOwnProperty("parent")) @@ -11867,17 +64402,17 @@ }; /** - * Creates a ListServerTlsPoliciesRequest message from a plain object. Also converts values to their respective internal types. + * Creates a ListSecurityProfilesRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.networksecurity.v1.ListServerTlsPoliciesRequest + * @memberof google.cloud.networksecurity.v1.ListSecurityProfilesRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.networksecurity.v1.ListServerTlsPoliciesRequest} ListServerTlsPoliciesRequest + * @returns {google.cloud.networksecurity.v1.ListSecurityProfilesRequest} ListSecurityProfilesRequest */ - ListServerTlsPoliciesRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.networksecurity.v1.ListServerTlsPoliciesRequest) + ListSecurityProfilesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networksecurity.v1.ListSecurityProfilesRequest) return object; - var message = new $root.google.cloud.networksecurity.v1.ListServerTlsPoliciesRequest(); + var message = new $root.google.cloud.networksecurity.v1.ListSecurityProfilesRequest(); if (object.parent != null) message.parent = String(object.parent); if (object.pageSize != null) @@ -11888,15 +64423,15 @@ }; /** - * Creates a plain object from a ListServerTlsPoliciesRequest message. Also converts values to other types if specified. + * Creates a plain object from a ListSecurityProfilesRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.networksecurity.v1.ListServerTlsPoliciesRequest + * @memberof google.cloud.networksecurity.v1.ListSecurityProfilesRequest * @static - * @param {google.cloud.networksecurity.v1.ListServerTlsPoliciesRequest} message ListServerTlsPoliciesRequest + * @param {google.cloud.networksecurity.v1.ListSecurityProfilesRequest} message ListSecurityProfilesRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ListServerTlsPoliciesRequest.toObject = function toObject(message, options) { + ListSecurityProfilesRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; @@ -11915,54 +64450,54 @@ }; /** - * Converts this ListServerTlsPoliciesRequest to JSON. + * Converts this ListSecurityProfilesRequest to JSON. * @function toJSON - * @memberof google.cloud.networksecurity.v1.ListServerTlsPoliciesRequest + * @memberof google.cloud.networksecurity.v1.ListSecurityProfilesRequest * @instance * @returns {Object.} JSON object */ - ListServerTlsPoliciesRequest.prototype.toJSON = function toJSON() { + ListSecurityProfilesRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for ListServerTlsPoliciesRequest + * Gets the default type url for ListSecurityProfilesRequest * @function getTypeUrl - * @memberof google.cloud.networksecurity.v1.ListServerTlsPoliciesRequest + * @memberof google.cloud.networksecurity.v1.ListSecurityProfilesRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - ListServerTlsPoliciesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + ListSecurityProfilesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.networksecurity.v1.ListServerTlsPoliciesRequest"; + return typeUrlPrefix + "/google.cloud.networksecurity.v1.ListSecurityProfilesRequest"; }; - return ListServerTlsPoliciesRequest; + return ListSecurityProfilesRequest; })(); - v1.ListServerTlsPoliciesResponse = (function() { + v1.ListSecurityProfilesResponse = (function() { /** - * Properties of a ListServerTlsPoliciesResponse. + * Properties of a ListSecurityProfilesResponse. * @memberof google.cloud.networksecurity.v1 - * @interface IListServerTlsPoliciesResponse - * @property {Array.|null} [serverTlsPolicies] ListServerTlsPoliciesResponse serverTlsPolicies - * @property {string|null} [nextPageToken] ListServerTlsPoliciesResponse nextPageToken + * @interface IListSecurityProfilesResponse + * @property {Array.|null} [securityProfiles] ListSecurityProfilesResponse securityProfiles + * @property {string|null} [nextPageToken] ListSecurityProfilesResponse nextPageToken */ /** - * Constructs a new ListServerTlsPoliciesResponse. + * Constructs a new ListSecurityProfilesResponse. * @memberof google.cloud.networksecurity.v1 - * @classdesc Represents a ListServerTlsPoliciesResponse. - * @implements IListServerTlsPoliciesResponse + * @classdesc Represents a ListSecurityProfilesResponse. + * @implements IListSecurityProfilesResponse * @constructor - * @param {google.cloud.networksecurity.v1.IListServerTlsPoliciesResponse=} [properties] Properties to set + * @param {google.cloud.networksecurity.v1.IListSecurityProfilesResponse=} [properties] Properties to set */ - function ListServerTlsPoliciesResponse(properties) { - this.serverTlsPolicies = []; + function ListSecurityProfilesResponse(properties) { + this.securityProfiles = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -11970,90 +64505,90 @@ } /** - * ListServerTlsPoliciesResponse serverTlsPolicies. - * @member {Array.} serverTlsPolicies - * @memberof google.cloud.networksecurity.v1.ListServerTlsPoliciesResponse + * ListSecurityProfilesResponse securityProfiles. + * @member {Array.} securityProfiles + * @memberof google.cloud.networksecurity.v1.ListSecurityProfilesResponse * @instance */ - ListServerTlsPoliciesResponse.prototype.serverTlsPolicies = $util.emptyArray; + ListSecurityProfilesResponse.prototype.securityProfiles = $util.emptyArray; /** - * ListServerTlsPoliciesResponse nextPageToken. + * ListSecurityProfilesResponse nextPageToken. * @member {string} nextPageToken - * @memberof google.cloud.networksecurity.v1.ListServerTlsPoliciesResponse + * @memberof google.cloud.networksecurity.v1.ListSecurityProfilesResponse * @instance */ - ListServerTlsPoliciesResponse.prototype.nextPageToken = ""; + ListSecurityProfilesResponse.prototype.nextPageToken = ""; /** - * Creates a new ListServerTlsPoliciesResponse instance using the specified properties. + * Creates a new ListSecurityProfilesResponse instance using the specified properties. * @function create - * @memberof google.cloud.networksecurity.v1.ListServerTlsPoliciesResponse + * @memberof google.cloud.networksecurity.v1.ListSecurityProfilesResponse * @static - * @param {google.cloud.networksecurity.v1.IListServerTlsPoliciesResponse=} [properties] Properties to set - * @returns {google.cloud.networksecurity.v1.ListServerTlsPoliciesResponse} ListServerTlsPoliciesResponse instance + * @param {google.cloud.networksecurity.v1.IListSecurityProfilesResponse=} [properties] Properties to set + * @returns {google.cloud.networksecurity.v1.ListSecurityProfilesResponse} ListSecurityProfilesResponse instance */ - ListServerTlsPoliciesResponse.create = function create(properties) { - return new ListServerTlsPoliciesResponse(properties); + ListSecurityProfilesResponse.create = function create(properties) { + return new ListSecurityProfilesResponse(properties); }; /** - * Encodes the specified ListServerTlsPoliciesResponse message. Does not implicitly {@link google.cloud.networksecurity.v1.ListServerTlsPoliciesResponse.verify|verify} messages. + * Encodes the specified ListSecurityProfilesResponse message. Does not implicitly {@link google.cloud.networksecurity.v1.ListSecurityProfilesResponse.verify|verify} messages. * @function encode - * @memberof google.cloud.networksecurity.v1.ListServerTlsPoliciesResponse + * @memberof google.cloud.networksecurity.v1.ListSecurityProfilesResponse * @static - * @param {google.cloud.networksecurity.v1.IListServerTlsPoliciesResponse} message ListServerTlsPoliciesResponse message or plain object to encode + * @param {google.cloud.networksecurity.v1.IListSecurityProfilesResponse} message ListSecurityProfilesResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListServerTlsPoliciesResponse.encode = function encode(message, writer) { + ListSecurityProfilesResponse.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.serverTlsPolicies != null && message.serverTlsPolicies.length) - for (var i = 0; i < message.serverTlsPolicies.length; ++i) - $root.google.cloud.networksecurity.v1.ServerTlsPolicy.encode(message.serverTlsPolicies[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.securityProfiles != null && message.securityProfiles.length) + for (var i = 0; i < message.securityProfiles.length; ++i) + $root.google.cloud.networksecurity.v1.SecurityProfile.encode(message.securityProfiles[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); return writer; }; /** - * Encodes the specified ListServerTlsPoliciesResponse message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.ListServerTlsPoliciesResponse.verify|verify} messages. + * Encodes the specified ListSecurityProfilesResponse message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.ListSecurityProfilesResponse.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.networksecurity.v1.ListServerTlsPoliciesResponse + * @memberof google.cloud.networksecurity.v1.ListSecurityProfilesResponse * @static - * @param {google.cloud.networksecurity.v1.IListServerTlsPoliciesResponse} message ListServerTlsPoliciesResponse message or plain object to encode + * @param {google.cloud.networksecurity.v1.IListSecurityProfilesResponse} message ListSecurityProfilesResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListServerTlsPoliciesResponse.encodeDelimited = function encodeDelimited(message, writer) { + ListSecurityProfilesResponse.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ListServerTlsPoliciesResponse message from the specified reader or buffer. + * Decodes a ListSecurityProfilesResponse message from the specified reader or buffer. * @function decode - * @memberof google.cloud.networksecurity.v1.ListServerTlsPoliciesResponse + * @memberof google.cloud.networksecurity.v1.ListSecurityProfilesResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.networksecurity.v1.ListServerTlsPoliciesResponse} ListServerTlsPoliciesResponse + * @returns {google.cloud.networksecurity.v1.ListSecurityProfilesResponse} ListSecurityProfilesResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListServerTlsPoliciesResponse.decode = function decode(reader, length, error) { + ListSecurityProfilesResponse.decode = function decode(reader, length, error) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networksecurity.v1.ListServerTlsPoliciesResponse(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networksecurity.v1.ListSecurityProfilesResponse(); while (reader.pos < end) { var tag = reader.uint32(); if (tag === error) break; switch (tag >>> 3) { case 1: { - if (!(message.serverTlsPolicies && message.serverTlsPolicies.length)) - message.serverTlsPolicies = []; - message.serverTlsPolicies.push($root.google.cloud.networksecurity.v1.ServerTlsPolicy.decode(reader, reader.uint32())); + if (!(message.securityProfiles && message.securityProfiles.length)) + message.securityProfiles = []; + message.securityProfiles.push($root.google.cloud.networksecurity.v1.SecurityProfile.decode(reader, reader.uint32())); break; } case 2: { @@ -12069,39 +64604,39 @@ }; /** - * Decodes a ListServerTlsPoliciesResponse message from the specified reader or buffer, length delimited. + * Decodes a ListSecurityProfilesResponse message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.networksecurity.v1.ListServerTlsPoliciesResponse + * @memberof google.cloud.networksecurity.v1.ListSecurityProfilesResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.networksecurity.v1.ListServerTlsPoliciesResponse} ListServerTlsPoliciesResponse + * @returns {google.cloud.networksecurity.v1.ListSecurityProfilesResponse} ListSecurityProfilesResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListServerTlsPoliciesResponse.decodeDelimited = function decodeDelimited(reader) { + ListSecurityProfilesResponse.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ListServerTlsPoliciesResponse message. + * Verifies a ListSecurityProfilesResponse message. * @function verify - * @memberof google.cloud.networksecurity.v1.ListServerTlsPoliciesResponse + * @memberof google.cloud.networksecurity.v1.ListSecurityProfilesResponse * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ListServerTlsPoliciesResponse.verify = function verify(message) { + ListSecurityProfilesResponse.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.serverTlsPolicies != null && message.hasOwnProperty("serverTlsPolicies")) { - if (!Array.isArray(message.serverTlsPolicies)) - return "serverTlsPolicies: array expected"; - for (var i = 0; i < message.serverTlsPolicies.length; ++i) { - var error = $root.google.cloud.networksecurity.v1.ServerTlsPolicy.verify(message.serverTlsPolicies[i]); + if (message.securityProfiles != null && message.hasOwnProperty("securityProfiles")) { + if (!Array.isArray(message.securityProfiles)) + return "securityProfiles: array expected"; + for (var i = 0; i < message.securityProfiles.length; ++i) { + var error = $root.google.cloud.networksecurity.v1.SecurityProfile.verify(message.securityProfiles[i]); if (error) - return "serverTlsPolicies." + error; + return "securityProfiles." + error; } } if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) @@ -12111,25 +64646,25 @@ }; /** - * Creates a ListServerTlsPoliciesResponse message from a plain object. Also converts values to their respective internal types. + * Creates a ListSecurityProfilesResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.networksecurity.v1.ListServerTlsPoliciesResponse + * @memberof google.cloud.networksecurity.v1.ListSecurityProfilesResponse * @static * @param {Object.} object Plain object - * @returns {google.cloud.networksecurity.v1.ListServerTlsPoliciesResponse} ListServerTlsPoliciesResponse + * @returns {google.cloud.networksecurity.v1.ListSecurityProfilesResponse} ListSecurityProfilesResponse */ - ListServerTlsPoliciesResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.networksecurity.v1.ListServerTlsPoliciesResponse) + ListSecurityProfilesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networksecurity.v1.ListSecurityProfilesResponse) return object; - var message = new $root.google.cloud.networksecurity.v1.ListServerTlsPoliciesResponse(); - if (object.serverTlsPolicies) { - if (!Array.isArray(object.serverTlsPolicies)) - throw TypeError(".google.cloud.networksecurity.v1.ListServerTlsPoliciesResponse.serverTlsPolicies: array expected"); - message.serverTlsPolicies = []; - for (var i = 0; i < object.serverTlsPolicies.length; ++i) { - if (typeof object.serverTlsPolicies[i] !== "object") - throw TypeError(".google.cloud.networksecurity.v1.ListServerTlsPoliciesResponse.serverTlsPolicies: object expected"); - message.serverTlsPolicies[i] = $root.google.cloud.networksecurity.v1.ServerTlsPolicy.fromObject(object.serverTlsPolicies[i]); + var message = new $root.google.cloud.networksecurity.v1.ListSecurityProfilesResponse(); + if (object.securityProfiles) { + if (!Array.isArray(object.securityProfiles)) + throw TypeError(".google.cloud.networksecurity.v1.ListSecurityProfilesResponse.securityProfiles: array expected"); + message.securityProfiles = []; + for (var i = 0; i < object.securityProfiles.length; ++i) { + if (typeof object.securityProfiles[i] !== "object") + throw TypeError(".google.cloud.networksecurity.v1.ListSecurityProfilesResponse.securityProfiles: object expected"); + message.securityProfiles[i] = $root.google.cloud.networksecurity.v1.SecurityProfile.fromObject(object.securityProfiles[i]); } } if (object.nextPageToken != null) @@ -12138,26 +64673,26 @@ }; /** - * Creates a plain object from a ListServerTlsPoliciesResponse message. Also converts values to other types if specified. + * Creates a plain object from a ListSecurityProfilesResponse message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.networksecurity.v1.ListServerTlsPoliciesResponse + * @memberof google.cloud.networksecurity.v1.ListSecurityProfilesResponse * @static - * @param {google.cloud.networksecurity.v1.ListServerTlsPoliciesResponse} message ListServerTlsPoliciesResponse + * @param {google.cloud.networksecurity.v1.ListSecurityProfilesResponse} message ListSecurityProfilesResponse * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ListServerTlsPoliciesResponse.toObject = function toObject(message, options) { + ListSecurityProfilesResponse.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.arrays || options.defaults) - object.serverTlsPolicies = []; + object.securityProfiles = []; if (options.defaults) object.nextPageToken = ""; - if (message.serverTlsPolicies && message.serverTlsPolicies.length) { - object.serverTlsPolicies = []; - for (var j = 0; j < message.serverTlsPolicies.length; ++j) - object.serverTlsPolicies[j] = $root.google.cloud.networksecurity.v1.ServerTlsPolicy.toObject(message.serverTlsPolicies[j], options); + if (message.securityProfiles && message.securityProfiles.length) { + object.securityProfiles = []; + for (var j = 0; j < message.securityProfiles.length; ++j) + object.securityProfiles[j] = $root.google.cloud.networksecurity.v1.SecurityProfile.toObject(message.securityProfiles[j], options); } if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) object.nextPageToken = message.nextPageToken; @@ -12165,52 +64700,52 @@ }; /** - * Converts this ListServerTlsPoliciesResponse to JSON. + * Converts this ListSecurityProfilesResponse to JSON. * @function toJSON - * @memberof google.cloud.networksecurity.v1.ListServerTlsPoliciesResponse + * @memberof google.cloud.networksecurity.v1.ListSecurityProfilesResponse * @instance * @returns {Object.} JSON object */ - ListServerTlsPoliciesResponse.prototype.toJSON = function toJSON() { + ListSecurityProfilesResponse.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for ListServerTlsPoliciesResponse + * Gets the default type url for ListSecurityProfilesResponse * @function getTypeUrl - * @memberof google.cloud.networksecurity.v1.ListServerTlsPoliciesResponse + * @memberof google.cloud.networksecurity.v1.ListSecurityProfilesResponse * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - ListServerTlsPoliciesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + ListSecurityProfilesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.networksecurity.v1.ListServerTlsPoliciesResponse"; + return typeUrlPrefix + "/google.cloud.networksecurity.v1.ListSecurityProfilesResponse"; }; - return ListServerTlsPoliciesResponse; + return ListSecurityProfilesResponse; })(); - v1.GetServerTlsPolicyRequest = (function() { + v1.GetSecurityProfileRequest = (function() { /** - * Properties of a GetServerTlsPolicyRequest. + * Properties of a GetSecurityProfileRequest. * @memberof google.cloud.networksecurity.v1 - * @interface IGetServerTlsPolicyRequest - * @property {string|null} [name] GetServerTlsPolicyRequest name + * @interface IGetSecurityProfileRequest + * @property {string|null} [name] GetSecurityProfileRequest name */ /** - * Constructs a new GetServerTlsPolicyRequest. + * Constructs a new GetSecurityProfileRequest. * @memberof google.cloud.networksecurity.v1 - * @classdesc Represents a GetServerTlsPolicyRequest. - * @implements IGetServerTlsPolicyRequest + * @classdesc Represents a GetSecurityProfileRequest. + * @implements IGetSecurityProfileRequest * @constructor - * @param {google.cloud.networksecurity.v1.IGetServerTlsPolicyRequest=} [properties] Properties to set + * @param {google.cloud.networksecurity.v1.IGetSecurityProfileRequest=} [properties] Properties to set */ - function GetServerTlsPolicyRequest(properties) { + function GetSecurityProfileRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -12218,35 +64753,35 @@ } /** - * GetServerTlsPolicyRequest name. + * GetSecurityProfileRequest name. * @member {string} name - * @memberof google.cloud.networksecurity.v1.GetServerTlsPolicyRequest + * @memberof google.cloud.networksecurity.v1.GetSecurityProfileRequest * @instance */ - GetServerTlsPolicyRequest.prototype.name = ""; + GetSecurityProfileRequest.prototype.name = ""; /** - * Creates a new GetServerTlsPolicyRequest instance using the specified properties. + * Creates a new GetSecurityProfileRequest instance using the specified properties. * @function create - * @memberof google.cloud.networksecurity.v1.GetServerTlsPolicyRequest + * @memberof google.cloud.networksecurity.v1.GetSecurityProfileRequest * @static - * @param {google.cloud.networksecurity.v1.IGetServerTlsPolicyRequest=} [properties] Properties to set - * @returns {google.cloud.networksecurity.v1.GetServerTlsPolicyRequest} GetServerTlsPolicyRequest instance + * @param {google.cloud.networksecurity.v1.IGetSecurityProfileRequest=} [properties] Properties to set + * @returns {google.cloud.networksecurity.v1.GetSecurityProfileRequest} GetSecurityProfileRequest instance */ - GetServerTlsPolicyRequest.create = function create(properties) { - return new GetServerTlsPolicyRequest(properties); + GetSecurityProfileRequest.create = function create(properties) { + return new GetSecurityProfileRequest(properties); }; /** - * Encodes the specified GetServerTlsPolicyRequest message. Does not implicitly {@link google.cloud.networksecurity.v1.GetServerTlsPolicyRequest.verify|verify} messages. + * Encodes the specified GetSecurityProfileRequest message. Does not implicitly {@link google.cloud.networksecurity.v1.GetSecurityProfileRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.networksecurity.v1.GetServerTlsPolicyRequest + * @memberof google.cloud.networksecurity.v1.GetSecurityProfileRequest * @static - * @param {google.cloud.networksecurity.v1.IGetServerTlsPolicyRequest} message GetServerTlsPolicyRequest message or plain object to encode + * @param {google.cloud.networksecurity.v1.IGetSecurityProfileRequest} message GetSecurityProfileRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GetServerTlsPolicyRequest.encode = function encode(message, writer) { + GetSecurityProfileRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.name != null && Object.hasOwnProperty.call(message, "name")) @@ -12255,33 +64790,33 @@ }; /** - * Encodes the specified GetServerTlsPolicyRequest message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.GetServerTlsPolicyRequest.verify|verify} messages. + * Encodes the specified GetSecurityProfileRequest message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.GetSecurityProfileRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.networksecurity.v1.GetServerTlsPolicyRequest + * @memberof google.cloud.networksecurity.v1.GetSecurityProfileRequest * @static - * @param {google.cloud.networksecurity.v1.IGetServerTlsPolicyRequest} message GetServerTlsPolicyRequest message or plain object to encode + * @param {google.cloud.networksecurity.v1.IGetSecurityProfileRequest} message GetSecurityProfileRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GetServerTlsPolicyRequest.encodeDelimited = function encodeDelimited(message, writer) { + GetSecurityProfileRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a GetServerTlsPolicyRequest message from the specified reader or buffer. + * Decodes a GetSecurityProfileRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.networksecurity.v1.GetServerTlsPolicyRequest + * @memberof google.cloud.networksecurity.v1.GetSecurityProfileRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.networksecurity.v1.GetServerTlsPolicyRequest} GetServerTlsPolicyRequest + * @returns {google.cloud.networksecurity.v1.GetSecurityProfileRequest} GetSecurityProfileRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GetServerTlsPolicyRequest.decode = function decode(reader, length, error) { + GetSecurityProfileRequest.decode = function decode(reader, length, error) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networksecurity.v1.GetServerTlsPolicyRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networksecurity.v1.GetSecurityProfileRequest(); while (reader.pos < end) { var tag = reader.uint32(); if (tag === error) @@ -12300,30 +64835,30 @@ }; /** - * Decodes a GetServerTlsPolicyRequest message from the specified reader or buffer, length delimited. + * Decodes a GetSecurityProfileRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.networksecurity.v1.GetServerTlsPolicyRequest + * @memberof google.cloud.networksecurity.v1.GetSecurityProfileRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.networksecurity.v1.GetServerTlsPolicyRequest} GetServerTlsPolicyRequest + * @returns {google.cloud.networksecurity.v1.GetSecurityProfileRequest} GetSecurityProfileRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GetServerTlsPolicyRequest.decodeDelimited = function decodeDelimited(reader) { + GetSecurityProfileRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a GetServerTlsPolicyRequest message. + * Verifies a GetSecurityProfileRequest message. * @function verify - * @memberof google.cloud.networksecurity.v1.GetServerTlsPolicyRequest + * @memberof google.cloud.networksecurity.v1.GetSecurityProfileRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - GetServerTlsPolicyRequest.verify = function verify(message) { + GetSecurityProfileRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.name != null && message.hasOwnProperty("name")) @@ -12333,32 +64868,32 @@ }; /** - * Creates a GetServerTlsPolicyRequest message from a plain object. Also converts values to their respective internal types. + * Creates a GetSecurityProfileRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.networksecurity.v1.GetServerTlsPolicyRequest + * @memberof google.cloud.networksecurity.v1.GetSecurityProfileRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.networksecurity.v1.GetServerTlsPolicyRequest} GetServerTlsPolicyRequest + * @returns {google.cloud.networksecurity.v1.GetSecurityProfileRequest} GetSecurityProfileRequest */ - GetServerTlsPolicyRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.networksecurity.v1.GetServerTlsPolicyRequest) + GetSecurityProfileRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networksecurity.v1.GetSecurityProfileRequest) return object; - var message = new $root.google.cloud.networksecurity.v1.GetServerTlsPolicyRequest(); + var message = new $root.google.cloud.networksecurity.v1.GetSecurityProfileRequest(); if (object.name != null) message.name = String(object.name); return message; }; /** - * Creates a plain object from a GetServerTlsPolicyRequest message. Also converts values to other types if specified. + * Creates a plain object from a GetSecurityProfileRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.networksecurity.v1.GetServerTlsPolicyRequest + * @memberof google.cloud.networksecurity.v1.GetSecurityProfileRequest * @static - * @param {google.cloud.networksecurity.v1.GetServerTlsPolicyRequest} message GetServerTlsPolicyRequest + * @param {google.cloud.networksecurity.v1.GetSecurityProfileRequest} message GetSecurityProfileRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - GetServerTlsPolicyRequest.toObject = function toObject(message, options) { + GetSecurityProfileRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; @@ -12370,54 +64905,54 @@ }; /** - * Converts this GetServerTlsPolicyRequest to JSON. + * Converts this GetSecurityProfileRequest to JSON. * @function toJSON - * @memberof google.cloud.networksecurity.v1.GetServerTlsPolicyRequest + * @memberof google.cloud.networksecurity.v1.GetSecurityProfileRequest * @instance * @returns {Object.} JSON object */ - GetServerTlsPolicyRequest.prototype.toJSON = function toJSON() { + GetSecurityProfileRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for GetServerTlsPolicyRequest + * Gets the default type url for GetSecurityProfileRequest * @function getTypeUrl - * @memberof google.cloud.networksecurity.v1.GetServerTlsPolicyRequest + * @memberof google.cloud.networksecurity.v1.GetSecurityProfileRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - GetServerTlsPolicyRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + GetSecurityProfileRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.networksecurity.v1.GetServerTlsPolicyRequest"; + return typeUrlPrefix + "/google.cloud.networksecurity.v1.GetSecurityProfileRequest"; }; - return GetServerTlsPolicyRequest; + return GetSecurityProfileRequest; })(); - v1.CreateServerTlsPolicyRequest = (function() { + v1.CreateSecurityProfileRequest = (function() { /** - * Properties of a CreateServerTlsPolicyRequest. + * Properties of a CreateSecurityProfileRequest. * @memberof google.cloud.networksecurity.v1 - * @interface ICreateServerTlsPolicyRequest - * @property {string|null} [parent] CreateServerTlsPolicyRequest parent - * @property {string|null} [serverTlsPolicyId] CreateServerTlsPolicyRequest serverTlsPolicyId - * @property {google.cloud.networksecurity.v1.IServerTlsPolicy|null} [serverTlsPolicy] CreateServerTlsPolicyRequest serverTlsPolicy + * @interface ICreateSecurityProfileRequest + * @property {string|null} [parent] CreateSecurityProfileRequest parent + * @property {string|null} [securityProfileId] CreateSecurityProfileRequest securityProfileId + * @property {google.cloud.networksecurity.v1.ISecurityProfile|null} [securityProfile] CreateSecurityProfileRequest securityProfile */ /** - * Constructs a new CreateServerTlsPolicyRequest. + * Constructs a new CreateSecurityProfileRequest. * @memberof google.cloud.networksecurity.v1 - * @classdesc Represents a CreateServerTlsPolicyRequest. - * @implements ICreateServerTlsPolicyRequest + * @classdesc Represents a CreateSecurityProfileRequest. + * @implements ICreateSecurityProfileRequest * @constructor - * @param {google.cloud.networksecurity.v1.ICreateServerTlsPolicyRequest=} [properties] Properties to set + * @param {google.cloud.networksecurity.v1.ICreateSecurityProfileRequest=} [properties] Properties to set */ - function CreateServerTlsPolicyRequest(properties) { + function CreateSecurityProfileRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -12425,90 +64960,90 @@ } /** - * CreateServerTlsPolicyRequest parent. + * CreateSecurityProfileRequest parent. * @member {string} parent - * @memberof google.cloud.networksecurity.v1.CreateServerTlsPolicyRequest + * @memberof google.cloud.networksecurity.v1.CreateSecurityProfileRequest * @instance */ - CreateServerTlsPolicyRequest.prototype.parent = ""; + CreateSecurityProfileRequest.prototype.parent = ""; /** - * CreateServerTlsPolicyRequest serverTlsPolicyId. - * @member {string} serverTlsPolicyId - * @memberof google.cloud.networksecurity.v1.CreateServerTlsPolicyRequest + * CreateSecurityProfileRequest securityProfileId. + * @member {string} securityProfileId + * @memberof google.cloud.networksecurity.v1.CreateSecurityProfileRequest * @instance */ - CreateServerTlsPolicyRequest.prototype.serverTlsPolicyId = ""; + CreateSecurityProfileRequest.prototype.securityProfileId = ""; /** - * CreateServerTlsPolicyRequest serverTlsPolicy. - * @member {google.cloud.networksecurity.v1.IServerTlsPolicy|null|undefined} serverTlsPolicy - * @memberof google.cloud.networksecurity.v1.CreateServerTlsPolicyRequest + * CreateSecurityProfileRequest securityProfile. + * @member {google.cloud.networksecurity.v1.ISecurityProfile|null|undefined} securityProfile + * @memberof google.cloud.networksecurity.v1.CreateSecurityProfileRequest * @instance */ - CreateServerTlsPolicyRequest.prototype.serverTlsPolicy = null; + CreateSecurityProfileRequest.prototype.securityProfile = null; /** - * Creates a new CreateServerTlsPolicyRequest instance using the specified properties. + * Creates a new CreateSecurityProfileRequest instance using the specified properties. * @function create - * @memberof google.cloud.networksecurity.v1.CreateServerTlsPolicyRequest + * @memberof google.cloud.networksecurity.v1.CreateSecurityProfileRequest * @static - * @param {google.cloud.networksecurity.v1.ICreateServerTlsPolicyRequest=} [properties] Properties to set - * @returns {google.cloud.networksecurity.v1.CreateServerTlsPolicyRequest} CreateServerTlsPolicyRequest instance + * @param {google.cloud.networksecurity.v1.ICreateSecurityProfileRequest=} [properties] Properties to set + * @returns {google.cloud.networksecurity.v1.CreateSecurityProfileRequest} CreateSecurityProfileRequest instance */ - CreateServerTlsPolicyRequest.create = function create(properties) { - return new CreateServerTlsPolicyRequest(properties); + CreateSecurityProfileRequest.create = function create(properties) { + return new CreateSecurityProfileRequest(properties); }; /** - * Encodes the specified CreateServerTlsPolicyRequest message. Does not implicitly {@link google.cloud.networksecurity.v1.CreateServerTlsPolicyRequest.verify|verify} messages. + * Encodes the specified CreateSecurityProfileRequest message. Does not implicitly {@link google.cloud.networksecurity.v1.CreateSecurityProfileRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.networksecurity.v1.CreateServerTlsPolicyRequest + * @memberof google.cloud.networksecurity.v1.CreateSecurityProfileRequest * @static - * @param {google.cloud.networksecurity.v1.ICreateServerTlsPolicyRequest} message CreateServerTlsPolicyRequest message or plain object to encode + * @param {google.cloud.networksecurity.v1.ICreateSecurityProfileRequest} message CreateSecurityProfileRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CreateServerTlsPolicyRequest.encode = function encode(message, writer) { + CreateSecurityProfileRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.serverTlsPolicyId != null && Object.hasOwnProperty.call(message, "serverTlsPolicyId")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.serverTlsPolicyId); - if (message.serverTlsPolicy != null && Object.hasOwnProperty.call(message, "serverTlsPolicy")) - $root.google.cloud.networksecurity.v1.ServerTlsPolicy.encode(message.serverTlsPolicy, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.securityProfileId != null && Object.hasOwnProperty.call(message, "securityProfileId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.securityProfileId); + if (message.securityProfile != null && Object.hasOwnProperty.call(message, "securityProfile")) + $root.google.cloud.networksecurity.v1.SecurityProfile.encode(message.securityProfile, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); return writer; }; /** - * Encodes the specified CreateServerTlsPolicyRequest message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.CreateServerTlsPolicyRequest.verify|verify} messages. + * Encodes the specified CreateSecurityProfileRequest message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.CreateSecurityProfileRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.networksecurity.v1.CreateServerTlsPolicyRequest + * @memberof google.cloud.networksecurity.v1.CreateSecurityProfileRequest * @static - * @param {google.cloud.networksecurity.v1.ICreateServerTlsPolicyRequest} message CreateServerTlsPolicyRequest message or plain object to encode + * @param {google.cloud.networksecurity.v1.ICreateSecurityProfileRequest} message CreateSecurityProfileRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CreateServerTlsPolicyRequest.encodeDelimited = function encodeDelimited(message, writer) { + CreateSecurityProfileRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a CreateServerTlsPolicyRequest message from the specified reader or buffer. + * Decodes a CreateSecurityProfileRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.networksecurity.v1.CreateServerTlsPolicyRequest + * @memberof google.cloud.networksecurity.v1.CreateSecurityProfileRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.networksecurity.v1.CreateServerTlsPolicyRequest} CreateServerTlsPolicyRequest + * @returns {google.cloud.networksecurity.v1.CreateSecurityProfileRequest} CreateSecurityProfileRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - CreateServerTlsPolicyRequest.decode = function decode(reader, length, error) { + CreateSecurityProfileRequest.decode = function decode(reader, length, error) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networksecurity.v1.CreateServerTlsPolicyRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networksecurity.v1.CreateSecurityProfileRequest(); while (reader.pos < end) { var tag = reader.uint32(); if (tag === error) @@ -12519,11 +65054,11 @@ break; } case 2: { - message.serverTlsPolicyId = reader.string(); + message.securityProfileId = reader.string(); break; } case 3: { - message.serverTlsPolicy = $root.google.cloud.networksecurity.v1.ServerTlsPolicy.decode(reader, reader.uint32()); + message.securityProfile = $root.google.cloud.networksecurity.v1.SecurityProfile.decode(reader, reader.uint32()); break; } default: @@ -12535,145 +65070,145 @@ }; /** - * Decodes a CreateServerTlsPolicyRequest message from the specified reader or buffer, length delimited. + * Decodes a CreateSecurityProfileRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.networksecurity.v1.CreateServerTlsPolicyRequest + * @memberof google.cloud.networksecurity.v1.CreateSecurityProfileRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.networksecurity.v1.CreateServerTlsPolicyRequest} CreateServerTlsPolicyRequest + * @returns {google.cloud.networksecurity.v1.CreateSecurityProfileRequest} CreateSecurityProfileRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - CreateServerTlsPolicyRequest.decodeDelimited = function decodeDelimited(reader) { + CreateSecurityProfileRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a CreateServerTlsPolicyRequest message. + * Verifies a CreateSecurityProfileRequest message. * @function verify - * @memberof google.cloud.networksecurity.v1.CreateServerTlsPolicyRequest + * @memberof google.cloud.networksecurity.v1.CreateSecurityProfileRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - CreateServerTlsPolicyRequest.verify = function verify(message) { + CreateSecurityProfileRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.parent != null && message.hasOwnProperty("parent")) if (!$util.isString(message.parent)) return "parent: string expected"; - if (message.serverTlsPolicyId != null && message.hasOwnProperty("serverTlsPolicyId")) - if (!$util.isString(message.serverTlsPolicyId)) - return "serverTlsPolicyId: string expected"; - if (message.serverTlsPolicy != null && message.hasOwnProperty("serverTlsPolicy")) { - var error = $root.google.cloud.networksecurity.v1.ServerTlsPolicy.verify(message.serverTlsPolicy); + if (message.securityProfileId != null && message.hasOwnProperty("securityProfileId")) + if (!$util.isString(message.securityProfileId)) + return "securityProfileId: string expected"; + if (message.securityProfile != null && message.hasOwnProperty("securityProfile")) { + var error = $root.google.cloud.networksecurity.v1.SecurityProfile.verify(message.securityProfile); if (error) - return "serverTlsPolicy." + error; + return "securityProfile." + error; } return null; }; /** - * Creates a CreateServerTlsPolicyRequest message from a plain object. Also converts values to their respective internal types. + * Creates a CreateSecurityProfileRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.networksecurity.v1.CreateServerTlsPolicyRequest + * @memberof google.cloud.networksecurity.v1.CreateSecurityProfileRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.networksecurity.v1.CreateServerTlsPolicyRequest} CreateServerTlsPolicyRequest + * @returns {google.cloud.networksecurity.v1.CreateSecurityProfileRequest} CreateSecurityProfileRequest */ - CreateServerTlsPolicyRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.networksecurity.v1.CreateServerTlsPolicyRequest) + CreateSecurityProfileRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networksecurity.v1.CreateSecurityProfileRequest) return object; - var message = new $root.google.cloud.networksecurity.v1.CreateServerTlsPolicyRequest(); + var message = new $root.google.cloud.networksecurity.v1.CreateSecurityProfileRequest(); if (object.parent != null) message.parent = String(object.parent); - if (object.serverTlsPolicyId != null) - message.serverTlsPolicyId = String(object.serverTlsPolicyId); - if (object.serverTlsPolicy != null) { - if (typeof object.serverTlsPolicy !== "object") - throw TypeError(".google.cloud.networksecurity.v1.CreateServerTlsPolicyRequest.serverTlsPolicy: object expected"); - message.serverTlsPolicy = $root.google.cloud.networksecurity.v1.ServerTlsPolicy.fromObject(object.serverTlsPolicy); + if (object.securityProfileId != null) + message.securityProfileId = String(object.securityProfileId); + if (object.securityProfile != null) { + if (typeof object.securityProfile !== "object") + throw TypeError(".google.cloud.networksecurity.v1.CreateSecurityProfileRequest.securityProfile: object expected"); + message.securityProfile = $root.google.cloud.networksecurity.v1.SecurityProfile.fromObject(object.securityProfile); } return message; }; /** - * Creates a plain object from a CreateServerTlsPolicyRequest message. Also converts values to other types if specified. + * Creates a plain object from a CreateSecurityProfileRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.networksecurity.v1.CreateServerTlsPolicyRequest + * @memberof google.cloud.networksecurity.v1.CreateSecurityProfileRequest * @static - * @param {google.cloud.networksecurity.v1.CreateServerTlsPolicyRequest} message CreateServerTlsPolicyRequest + * @param {google.cloud.networksecurity.v1.CreateSecurityProfileRequest} message CreateSecurityProfileRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - CreateServerTlsPolicyRequest.toObject = function toObject(message, options) { + CreateSecurityProfileRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { object.parent = ""; - object.serverTlsPolicyId = ""; - object.serverTlsPolicy = null; + object.securityProfileId = ""; + object.securityProfile = null; } if (message.parent != null && message.hasOwnProperty("parent")) object.parent = message.parent; - if (message.serverTlsPolicyId != null && message.hasOwnProperty("serverTlsPolicyId")) - object.serverTlsPolicyId = message.serverTlsPolicyId; - if (message.serverTlsPolicy != null && message.hasOwnProperty("serverTlsPolicy")) - object.serverTlsPolicy = $root.google.cloud.networksecurity.v1.ServerTlsPolicy.toObject(message.serverTlsPolicy, options); + if (message.securityProfileId != null && message.hasOwnProperty("securityProfileId")) + object.securityProfileId = message.securityProfileId; + if (message.securityProfile != null && message.hasOwnProperty("securityProfile")) + object.securityProfile = $root.google.cloud.networksecurity.v1.SecurityProfile.toObject(message.securityProfile, options); return object; }; /** - * Converts this CreateServerTlsPolicyRequest to JSON. + * Converts this CreateSecurityProfileRequest to JSON. * @function toJSON - * @memberof google.cloud.networksecurity.v1.CreateServerTlsPolicyRequest + * @memberof google.cloud.networksecurity.v1.CreateSecurityProfileRequest * @instance * @returns {Object.} JSON object */ - CreateServerTlsPolicyRequest.prototype.toJSON = function toJSON() { + CreateSecurityProfileRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for CreateServerTlsPolicyRequest + * Gets the default type url for CreateSecurityProfileRequest * @function getTypeUrl - * @memberof google.cloud.networksecurity.v1.CreateServerTlsPolicyRequest + * @memberof google.cloud.networksecurity.v1.CreateSecurityProfileRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - CreateServerTlsPolicyRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + CreateSecurityProfileRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.networksecurity.v1.CreateServerTlsPolicyRequest"; + return typeUrlPrefix + "/google.cloud.networksecurity.v1.CreateSecurityProfileRequest"; }; - return CreateServerTlsPolicyRequest; + return CreateSecurityProfileRequest; })(); - v1.UpdateServerTlsPolicyRequest = (function() { + v1.UpdateSecurityProfileRequest = (function() { /** - * Properties of an UpdateServerTlsPolicyRequest. + * Properties of an UpdateSecurityProfileRequest. * @memberof google.cloud.networksecurity.v1 - * @interface IUpdateServerTlsPolicyRequest - * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateServerTlsPolicyRequest updateMask - * @property {google.cloud.networksecurity.v1.IServerTlsPolicy|null} [serverTlsPolicy] UpdateServerTlsPolicyRequest serverTlsPolicy + * @interface IUpdateSecurityProfileRequest + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateSecurityProfileRequest updateMask + * @property {google.cloud.networksecurity.v1.ISecurityProfile|null} [securityProfile] UpdateSecurityProfileRequest securityProfile */ /** - * Constructs a new UpdateServerTlsPolicyRequest. + * Constructs a new UpdateSecurityProfileRequest. * @memberof google.cloud.networksecurity.v1 - * @classdesc Represents an UpdateServerTlsPolicyRequest. - * @implements IUpdateServerTlsPolicyRequest + * @classdesc Represents an UpdateSecurityProfileRequest. + * @implements IUpdateSecurityProfileRequest * @constructor - * @param {google.cloud.networksecurity.v1.IUpdateServerTlsPolicyRequest=} [properties] Properties to set + * @param {google.cloud.networksecurity.v1.IUpdateSecurityProfileRequest=} [properties] Properties to set */ - function UpdateServerTlsPolicyRequest(properties) { + function UpdateSecurityProfileRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -12681,80 +65216,80 @@ } /** - * UpdateServerTlsPolicyRequest updateMask. + * UpdateSecurityProfileRequest updateMask. * @member {google.protobuf.IFieldMask|null|undefined} updateMask - * @memberof google.cloud.networksecurity.v1.UpdateServerTlsPolicyRequest + * @memberof google.cloud.networksecurity.v1.UpdateSecurityProfileRequest * @instance */ - UpdateServerTlsPolicyRequest.prototype.updateMask = null; + UpdateSecurityProfileRequest.prototype.updateMask = null; /** - * UpdateServerTlsPolicyRequest serverTlsPolicy. - * @member {google.cloud.networksecurity.v1.IServerTlsPolicy|null|undefined} serverTlsPolicy - * @memberof google.cloud.networksecurity.v1.UpdateServerTlsPolicyRequest + * UpdateSecurityProfileRequest securityProfile. + * @member {google.cloud.networksecurity.v1.ISecurityProfile|null|undefined} securityProfile + * @memberof google.cloud.networksecurity.v1.UpdateSecurityProfileRequest * @instance */ - UpdateServerTlsPolicyRequest.prototype.serverTlsPolicy = null; + UpdateSecurityProfileRequest.prototype.securityProfile = null; /** - * Creates a new UpdateServerTlsPolicyRequest instance using the specified properties. + * Creates a new UpdateSecurityProfileRequest instance using the specified properties. * @function create - * @memberof google.cloud.networksecurity.v1.UpdateServerTlsPolicyRequest + * @memberof google.cloud.networksecurity.v1.UpdateSecurityProfileRequest * @static - * @param {google.cloud.networksecurity.v1.IUpdateServerTlsPolicyRequest=} [properties] Properties to set - * @returns {google.cloud.networksecurity.v1.UpdateServerTlsPolicyRequest} UpdateServerTlsPolicyRequest instance + * @param {google.cloud.networksecurity.v1.IUpdateSecurityProfileRequest=} [properties] Properties to set + * @returns {google.cloud.networksecurity.v1.UpdateSecurityProfileRequest} UpdateSecurityProfileRequest instance */ - UpdateServerTlsPolicyRequest.create = function create(properties) { - return new UpdateServerTlsPolicyRequest(properties); + UpdateSecurityProfileRequest.create = function create(properties) { + return new UpdateSecurityProfileRequest(properties); }; /** - * Encodes the specified UpdateServerTlsPolicyRequest message. Does not implicitly {@link google.cloud.networksecurity.v1.UpdateServerTlsPolicyRequest.verify|verify} messages. + * Encodes the specified UpdateSecurityProfileRequest message. Does not implicitly {@link google.cloud.networksecurity.v1.UpdateSecurityProfileRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.networksecurity.v1.UpdateServerTlsPolicyRequest + * @memberof google.cloud.networksecurity.v1.UpdateSecurityProfileRequest * @static - * @param {google.cloud.networksecurity.v1.IUpdateServerTlsPolicyRequest} message UpdateServerTlsPolicyRequest message or plain object to encode + * @param {google.cloud.networksecurity.v1.IUpdateSecurityProfileRequest} message UpdateSecurityProfileRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - UpdateServerTlsPolicyRequest.encode = function encode(message, writer) { + UpdateSecurityProfileRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.serverTlsPolicy != null && Object.hasOwnProperty.call(message, "serverTlsPolicy")) - $root.google.cloud.networksecurity.v1.ServerTlsPolicy.encode(message.serverTlsPolicy, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.securityProfile != null && Object.hasOwnProperty.call(message, "securityProfile")) + $root.google.cloud.networksecurity.v1.SecurityProfile.encode(message.securityProfile, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); return writer; }; /** - * Encodes the specified UpdateServerTlsPolicyRequest message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.UpdateServerTlsPolicyRequest.verify|verify} messages. + * Encodes the specified UpdateSecurityProfileRequest message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.UpdateSecurityProfileRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.networksecurity.v1.UpdateServerTlsPolicyRequest + * @memberof google.cloud.networksecurity.v1.UpdateSecurityProfileRequest * @static - * @param {google.cloud.networksecurity.v1.IUpdateServerTlsPolicyRequest} message UpdateServerTlsPolicyRequest message or plain object to encode + * @param {google.cloud.networksecurity.v1.IUpdateSecurityProfileRequest} message UpdateSecurityProfileRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - UpdateServerTlsPolicyRequest.encodeDelimited = function encodeDelimited(message, writer) { + UpdateSecurityProfileRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an UpdateServerTlsPolicyRequest message from the specified reader or buffer. + * Decodes an UpdateSecurityProfileRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.networksecurity.v1.UpdateServerTlsPolicyRequest + * @memberof google.cloud.networksecurity.v1.UpdateSecurityProfileRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.networksecurity.v1.UpdateServerTlsPolicyRequest} UpdateServerTlsPolicyRequest + * @returns {google.cloud.networksecurity.v1.UpdateSecurityProfileRequest} UpdateSecurityProfileRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - UpdateServerTlsPolicyRequest.decode = function decode(reader, length, error) { + UpdateSecurityProfileRequest.decode = function decode(reader, length, error) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networksecurity.v1.UpdateServerTlsPolicyRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networksecurity.v1.UpdateSecurityProfileRequest(); while (reader.pos < end) { var tag = reader.uint32(); if (tag === error) @@ -12765,7 +65300,7 @@ break; } case 2: { - message.serverTlsPolicy = $root.google.cloud.networksecurity.v1.ServerTlsPolicy.decode(reader, reader.uint32()); + message.securityProfile = $root.google.cloud.networksecurity.v1.SecurityProfile.decode(reader, reader.uint32()); break; } default: @@ -12777,30 +65312,30 @@ }; /** - * Decodes an UpdateServerTlsPolicyRequest message from the specified reader or buffer, length delimited. + * Decodes an UpdateSecurityProfileRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.networksecurity.v1.UpdateServerTlsPolicyRequest + * @memberof google.cloud.networksecurity.v1.UpdateSecurityProfileRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.networksecurity.v1.UpdateServerTlsPolicyRequest} UpdateServerTlsPolicyRequest + * @returns {google.cloud.networksecurity.v1.UpdateSecurityProfileRequest} UpdateSecurityProfileRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - UpdateServerTlsPolicyRequest.decodeDelimited = function decodeDelimited(reader) { + UpdateSecurityProfileRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an UpdateServerTlsPolicyRequest message. + * Verifies an UpdateSecurityProfileRequest message. * @function verify - * @memberof google.cloud.networksecurity.v1.UpdateServerTlsPolicyRequest + * @memberof google.cloud.networksecurity.v1.UpdateSecurityProfileRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - UpdateServerTlsPolicyRequest.verify = function verify(message) { + UpdateSecurityProfileRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.updateMask != null && message.hasOwnProperty("updateMask")) { @@ -12808,110 +65343,111 @@ if (error) return "updateMask." + error; } - if (message.serverTlsPolicy != null && message.hasOwnProperty("serverTlsPolicy")) { - var error = $root.google.cloud.networksecurity.v1.ServerTlsPolicy.verify(message.serverTlsPolicy); + if (message.securityProfile != null && message.hasOwnProperty("securityProfile")) { + var error = $root.google.cloud.networksecurity.v1.SecurityProfile.verify(message.securityProfile); if (error) - return "serverTlsPolicy." + error; + return "securityProfile." + error; } return null; }; /** - * Creates an UpdateServerTlsPolicyRequest message from a plain object. Also converts values to their respective internal types. + * Creates an UpdateSecurityProfileRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.networksecurity.v1.UpdateServerTlsPolicyRequest + * @memberof google.cloud.networksecurity.v1.UpdateSecurityProfileRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.networksecurity.v1.UpdateServerTlsPolicyRequest} UpdateServerTlsPolicyRequest + * @returns {google.cloud.networksecurity.v1.UpdateSecurityProfileRequest} UpdateSecurityProfileRequest */ - UpdateServerTlsPolicyRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.networksecurity.v1.UpdateServerTlsPolicyRequest) + UpdateSecurityProfileRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networksecurity.v1.UpdateSecurityProfileRequest) return object; - var message = new $root.google.cloud.networksecurity.v1.UpdateServerTlsPolicyRequest(); + var message = new $root.google.cloud.networksecurity.v1.UpdateSecurityProfileRequest(); if (object.updateMask != null) { if (typeof object.updateMask !== "object") - throw TypeError(".google.cloud.networksecurity.v1.UpdateServerTlsPolicyRequest.updateMask: object expected"); + throw TypeError(".google.cloud.networksecurity.v1.UpdateSecurityProfileRequest.updateMask: object expected"); message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); } - if (object.serverTlsPolicy != null) { - if (typeof object.serverTlsPolicy !== "object") - throw TypeError(".google.cloud.networksecurity.v1.UpdateServerTlsPolicyRequest.serverTlsPolicy: object expected"); - message.serverTlsPolicy = $root.google.cloud.networksecurity.v1.ServerTlsPolicy.fromObject(object.serverTlsPolicy); + if (object.securityProfile != null) { + if (typeof object.securityProfile !== "object") + throw TypeError(".google.cloud.networksecurity.v1.UpdateSecurityProfileRequest.securityProfile: object expected"); + message.securityProfile = $root.google.cloud.networksecurity.v1.SecurityProfile.fromObject(object.securityProfile); } return message; }; /** - * Creates a plain object from an UpdateServerTlsPolicyRequest message. Also converts values to other types if specified. + * Creates a plain object from an UpdateSecurityProfileRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.networksecurity.v1.UpdateServerTlsPolicyRequest + * @memberof google.cloud.networksecurity.v1.UpdateSecurityProfileRequest * @static - * @param {google.cloud.networksecurity.v1.UpdateServerTlsPolicyRequest} message UpdateServerTlsPolicyRequest + * @param {google.cloud.networksecurity.v1.UpdateSecurityProfileRequest} message UpdateSecurityProfileRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - UpdateServerTlsPolicyRequest.toObject = function toObject(message, options) { + UpdateSecurityProfileRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { object.updateMask = null; - object.serverTlsPolicy = null; + object.securityProfile = null; } if (message.updateMask != null && message.hasOwnProperty("updateMask")) object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); - if (message.serverTlsPolicy != null && message.hasOwnProperty("serverTlsPolicy")) - object.serverTlsPolicy = $root.google.cloud.networksecurity.v1.ServerTlsPolicy.toObject(message.serverTlsPolicy, options); + if (message.securityProfile != null && message.hasOwnProperty("securityProfile")) + object.securityProfile = $root.google.cloud.networksecurity.v1.SecurityProfile.toObject(message.securityProfile, options); return object; }; /** - * Converts this UpdateServerTlsPolicyRequest to JSON. + * Converts this UpdateSecurityProfileRequest to JSON. * @function toJSON - * @memberof google.cloud.networksecurity.v1.UpdateServerTlsPolicyRequest + * @memberof google.cloud.networksecurity.v1.UpdateSecurityProfileRequest * @instance * @returns {Object.} JSON object */ - UpdateServerTlsPolicyRequest.prototype.toJSON = function toJSON() { + UpdateSecurityProfileRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for UpdateServerTlsPolicyRequest + * Gets the default type url for UpdateSecurityProfileRequest * @function getTypeUrl - * @memberof google.cloud.networksecurity.v1.UpdateServerTlsPolicyRequest + * @memberof google.cloud.networksecurity.v1.UpdateSecurityProfileRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - UpdateServerTlsPolicyRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + UpdateSecurityProfileRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.networksecurity.v1.UpdateServerTlsPolicyRequest"; + return typeUrlPrefix + "/google.cloud.networksecurity.v1.UpdateSecurityProfileRequest"; }; - return UpdateServerTlsPolicyRequest; + return UpdateSecurityProfileRequest; })(); - v1.DeleteServerTlsPolicyRequest = (function() { + v1.DeleteSecurityProfileRequest = (function() { /** - * Properties of a DeleteServerTlsPolicyRequest. + * Properties of a DeleteSecurityProfileRequest. * @memberof google.cloud.networksecurity.v1 - * @interface IDeleteServerTlsPolicyRequest - * @property {string|null} [name] DeleteServerTlsPolicyRequest name + * @interface IDeleteSecurityProfileRequest + * @property {string|null} [name] DeleteSecurityProfileRequest name + * @property {string|null} [etag] DeleteSecurityProfileRequest etag */ /** - * Constructs a new DeleteServerTlsPolicyRequest. + * Constructs a new DeleteSecurityProfileRequest. * @memberof google.cloud.networksecurity.v1 - * @classdesc Represents a DeleteServerTlsPolicyRequest. - * @implements IDeleteServerTlsPolicyRequest + * @classdesc Represents a DeleteSecurityProfileRequest. + * @implements IDeleteSecurityProfileRequest * @constructor - * @param {google.cloud.networksecurity.v1.IDeleteServerTlsPolicyRequest=} [properties] Properties to set + * @param {google.cloud.networksecurity.v1.IDeleteSecurityProfileRequest=} [properties] Properties to set */ - function DeleteServerTlsPolicyRequest(properties) { + function DeleteSecurityProfileRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -12919,70 +65455,80 @@ } /** - * DeleteServerTlsPolicyRequest name. + * DeleteSecurityProfileRequest name. * @member {string} name - * @memberof google.cloud.networksecurity.v1.DeleteServerTlsPolicyRequest + * @memberof google.cloud.networksecurity.v1.DeleteSecurityProfileRequest * @instance */ - DeleteServerTlsPolicyRequest.prototype.name = ""; + DeleteSecurityProfileRequest.prototype.name = ""; /** - * Creates a new DeleteServerTlsPolicyRequest instance using the specified properties. + * DeleteSecurityProfileRequest etag. + * @member {string} etag + * @memberof google.cloud.networksecurity.v1.DeleteSecurityProfileRequest + * @instance + */ + DeleteSecurityProfileRequest.prototype.etag = ""; + + /** + * Creates a new DeleteSecurityProfileRequest instance using the specified properties. * @function create - * @memberof google.cloud.networksecurity.v1.DeleteServerTlsPolicyRequest + * @memberof google.cloud.networksecurity.v1.DeleteSecurityProfileRequest * @static - * @param {google.cloud.networksecurity.v1.IDeleteServerTlsPolicyRequest=} [properties] Properties to set - * @returns {google.cloud.networksecurity.v1.DeleteServerTlsPolicyRequest} DeleteServerTlsPolicyRequest instance + * @param {google.cloud.networksecurity.v1.IDeleteSecurityProfileRequest=} [properties] Properties to set + * @returns {google.cloud.networksecurity.v1.DeleteSecurityProfileRequest} DeleteSecurityProfileRequest instance */ - DeleteServerTlsPolicyRequest.create = function create(properties) { - return new DeleteServerTlsPolicyRequest(properties); + DeleteSecurityProfileRequest.create = function create(properties) { + return new DeleteSecurityProfileRequest(properties); }; /** - * Encodes the specified DeleteServerTlsPolicyRequest message. Does not implicitly {@link google.cloud.networksecurity.v1.DeleteServerTlsPolicyRequest.verify|verify} messages. + * Encodes the specified DeleteSecurityProfileRequest message. Does not implicitly {@link google.cloud.networksecurity.v1.DeleteSecurityProfileRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.networksecurity.v1.DeleteServerTlsPolicyRequest + * @memberof google.cloud.networksecurity.v1.DeleteSecurityProfileRequest * @static - * @param {google.cloud.networksecurity.v1.IDeleteServerTlsPolicyRequest} message DeleteServerTlsPolicyRequest message or plain object to encode + * @param {google.cloud.networksecurity.v1.IDeleteSecurityProfileRequest} message DeleteSecurityProfileRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - DeleteServerTlsPolicyRequest.encode = function encode(message, writer) { + DeleteSecurityProfileRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.etag); return writer; }; /** - * Encodes the specified DeleteServerTlsPolicyRequest message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.DeleteServerTlsPolicyRequest.verify|verify} messages. + * Encodes the specified DeleteSecurityProfileRequest message, length delimited. Does not implicitly {@link google.cloud.networksecurity.v1.DeleteSecurityProfileRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.networksecurity.v1.DeleteServerTlsPolicyRequest + * @memberof google.cloud.networksecurity.v1.DeleteSecurityProfileRequest * @static - * @param {google.cloud.networksecurity.v1.IDeleteServerTlsPolicyRequest} message DeleteServerTlsPolicyRequest message or plain object to encode + * @param {google.cloud.networksecurity.v1.IDeleteSecurityProfileRequest} message DeleteSecurityProfileRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - DeleteServerTlsPolicyRequest.encodeDelimited = function encodeDelimited(message, writer) { + DeleteSecurityProfileRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a DeleteServerTlsPolicyRequest message from the specified reader or buffer. + * Decodes a DeleteSecurityProfileRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.networksecurity.v1.DeleteServerTlsPolicyRequest + * @memberof google.cloud.networksecurity.v1.DeleteSecurityProfileRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.networksecurity.v1.DeleteServerTlsPolicyRequest} DeleteServerTlsPolicyRequest + * @returns {google.cloud.networksecurity.v1.DeleteSecurityProfileRequest} DeleteSecurityProfileRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - DeleteServerTlsPolicyRequest.decode = function decode(reader, length, error) { + DeleteSecurityProfileRequest.decode = function decode(reader, length, error) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networksecurity.v1.DeleteServerTlsPolicyRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networksecurity.v1.DeleteSecurityProfileRequest(); while (reader.pos < end) { var tag = reader.uint32(); if (tag === error) @@ -12992,6 +65538,10 @@ message.name = reader.string(); break; } + case 2: { + message.etag = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -13001,102 +65551,111 @@ }; /** - * Decodes a DeleteServerTlsPolicyRequest message from the specified reader or buffer, length delimited. + * Decodes a DeleteSecurityProfileRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.networksecurity.v1.DeleteServerTlsPolicyRequest + * @memberof google.cloud.networksecurity.v1.DeleteSecurityProfileRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.networksecurity.v1.DeleteServerTlsPolicyRequest} DeleteServerTlsPolicyRequest + * @returns {google.cloud.networksecurity.v1.DeleteSecurityProfileRequest} DeleteSecurityProfileRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - DeleteServerTlsPolicyRequest.decodeDelimited = function decodeDelimited(reader) { + DeleteSecurityProfileRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a DeleteServerTlsPolicyRequest message. + * Verifies a DeleteSecurityProfileRequest message. * @function verify - * @memberof google.cloud.networksecurity.v1.DeleteServerTlsPolicyRequest + * @memberof google.cloud.networksecurity.v1.DeleteSecurityProfileRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - DeleteServerTlsPolicyRequest.verify = function verify(message) { + DeleteSecurityProfileRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.name != null && message.hasOwnProperty("name")) if (!$util.isString(message.name)) return "name: string expected"; + if (message.etag != null && message.hasOwnProperty("etag")) + if (!$util.isString(message.etag)) + return "etag: string expected"; return null; }; /** - * Creates a DeleteServerTlsPolicyRequest message from a plain object. Also converts values to their respective internal types. + * Creates a DeleteSecurityProfileRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.networksecurity.v1.DeleteServerTlsPolicyRequest + * @memberof google.cloud.networksecurity.v1.DeleteSecurityProfileRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.networksecurity.v1.DeleteServerTlsPolicyRequest} DeleteServerTlsPolicyRequest + * @returns {google.cloud.networksecurity.v1.DeleteSecurityProfileRequest} DeleteSecurityProfileRequest */ - DeleteServerTlsPolicyRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.networksecurity.v1.DeleteServerTlsPolicyRequest) + DeleteSecurityProfileRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networksecurity.v1.DeleteSecurityProfileRequest) return object; - var message = new $root.google.cloud.networksecurity.v1.DeleteServerTlsPolicyRequest(); + var message = new $root.google.cloud.networksecurity.v1.DeleteSecurityProfileRequest(); if (object.name != null) message.name = String(object.name); + if (object.etag != null) + message.etag = String(object.etag); return message; }; /** - * Creates a plain object from a DeleteServerTlsPolicyRequest message. Also converts values to other types if specified. + * Creates a plain object from a DeleteSecurityProfileRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.networksecurity.v1.DeleteServerTlsPolicyRequest + * @memberof google.cloud.networksecurity.v1.DeleteSecurityProfileRequest * @static - * @param {google.cloud.networksecurity.v1.DeleteServerTlsPolicyRequest} message DeleteServerTlsPolicyRequest + * @param {google.cloud.networksecurity.v1.DeleteSecurityProfileRequest} message DeleteSecurityProfileRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - DeleteServerTlsPolicyRequest.toObject = function toObject(message, options) { + DeleteSecurityProfileRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) + if (options.defaults) { object.name = ""; + object.etag = ""; + } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; + if (message.etag != null && message.hasOwnProperty("etag")) + object.etag = message.etag; return object; }; /** - * Converts this DeleteServerTlsPolicyRequest to JSON. + * Converts this DeleteSecurityProfileRequest to JSON. * @function toJSON - * @memberof google.cloud.networksecurity.v1.DeleteServerTlsPolicyRequest + * @memberof google.cloud.networksecurity.v1.DeleteSecurityProfileRequest * @instance * @returns {Object.} JSON object */ - DeleteServerTlsPolicyRequest.prototype.toJSON = function toJSON() { + DeleteSecurityProfileRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for DeleteServerTlsPolicyRequest + * Gets the default type url for DeleteSecurityProfileRequest * @function getTypeUrl - * @memberof google.cloud.networksecurity.v1.DeleteServerTlsPolicyRequest + * @memberof google.cloud.networksecurity.v1.DeleteSecurityProfileRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - DeleteServerTlsPolicyRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + DeleteSecurityProfileRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.networksecurity.v1.DeleteServerTlsPolicyRequest"; + return typeUrlPrefix + "/google.cloud.networksecurity.v1.DeleteSecurityProfileRequest"; }; - return DeleteServerTlsPolicyRequest; + return DeleteSecurityProfileRequest; })(); return v1; @@ -100877,6 +153436,265 @@ return values; })(); + api.FieldInfo = (function() { + + /** + * Properties of a FieldInfo. + * @memberof google.api + * @interface IFieldInfo + * @property {google.api.FieldInfo.Format|null} [format] FieldInfo format + */ + + /** + * Constructs a new FieldInfo. + * @memberof google.api + * @classdesc Represents a FieldInfo. + * @implements IFieldInfo + * @constructor + * @param {google.api.IFieldInfo=} [properties] Properties to set + */ + function FieldInfo(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FieldInfo format. + * @member {google.api.FieldInfo.Format} format + * @memberof google.api.FieldInfo + * @instance + */ + FieldInfo.prototype.format = 0; + + /** + * Creates a new FieldInfo instance using the specified properties. + * @function create + * @memberof google.api.FieldInfo + * @static + * @param {google.api.IFieldInfo=} [properties] Properties to set + * @returns {google.api.FieldInfo} FieldInfo instance + */ + FieldInfo.create = function create(properties) { + return new FieldInfo(properties); + }; + + /** + * Encodes the specified FieldInfo message. Does not implicitly {@link google.api.FieldInfo.verify|verify} messages. + * @function encode + * @memberof google.api.FieldInfo + * @static + * @param {google.api.IFieldInfo} message FieldInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.format != null && Object.hasOwnProperty.call(message, "format")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.format); + return writer; + }; + + /** + * Encodes the specified FieldInfo message, length delimited. Does not implicitly {@link google.api.FieldInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.FieldInfo + * @static + * @param {google.api.IFieldInfo} message FieldInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FieldInfo message from the specified reader or buffer. + * @function decode + * @memberof google.api.FieldInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.FieldInfo} FieldInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldInfo.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.FieldInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.format = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FieldInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.FieldInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.FieldInfo} FieldInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FieldInfo message. + * @function verify + * @memberof google.api.FieldInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FieldInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.format != null && message.hasOwnProperty("format")) + switch (message.format) { + default: + return "format: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + break; + } + return null; + }; + + /** + * Creates a FieldInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.FieldInfo + * @static + * @param {Object.} object Plain object + * @returns {google.api.FieldInfo} FieldInfo + */ + FieldInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.FieldInfo) + return object; + var message = new $root.google.api.FieldInfo(); + switch (object.format) { + default: + if (typeof object.format === "number") { + message.format = object.format; + break; + } + break; + case "FORMAT_UNSPECIFIED": + case 0: + message.format = 0; + break; + case "UUID4": + case 1: + message.format = 1; + break; + case "IPV4": + case 2: + message.format = 2; + break; + case "IPV6": + case 3: + message.format = 3; + break; + case "IPV4_OR_IPV6": + case 4: + message.format = 4; + break; + } + return message; + }; + + /** + * Creates a plain object from a FieldInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.FieldInfo + * @static + * @param {google.api.FieldInfo} message FieldInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FieldInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.format = options.enums === String ? "FORMAT_UNSPECIFIED" : 0; + if (message.format != null && message.hasOwnProperty("format")) + object.format = options.enums === String ? $root.google.api.FieldInfo.Format[message.format] === undefined ? message.format : $root.google.api.FieldInfo.Format[message.format] : message.format; + return object; + }; + + /** + * Converts this FieldInfo to JSON. + * @function toJSON + * @memberof google.api.FieldInfo + * @instance + * @returns {Object.} JSON object + */ + FieldInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FieldInfo + * @function getTypeUrl + * @memberof google.api.FieldInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FieldInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.FieldInfo"; + }; + + /** + * Format enum. + * @name google.api.FieldInfo.Format + * @enum {number} + * @property {number} FORMAT_UNSPECIFIED=0 FORMAT_UNSPECIFIED value + * @property {number} UUID4=1 UUID4 value + * @property {number} IPV4=2 IPV4 value + * @property {number} IPV6=3 IPV6 value + * @property {number} IPV4_OR_IPV6=4 IPV4_OR_IPV6 value + */ + FieldInfo.Format = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FORMAT_UNSPECIFIED"] = 0; + values[valuesById[1] = "UUID4"] = 1; + values[valuesById[2] = "IPV4"] = 2; + values[valuesById[3] = "IPV6"] = 3; + values[valuesById[4] = "IPV4_OR_IPV6"] = 4; + return values; + })(); + + return FieldInfo; + })(); + api.ResourceDescriptor = (function() { /** @@ -101565,265 +154383,6 @@ return ResourceReference; })(); - api.FieldInfo = (function() { - - /** - * Properties of a FieldInfo. - * @memberof google.api - * @interface IFieldInfo - * @property {google.api.FieldInfo.Format|null} [format] FieldInfo format - */ - - /** - * Constructs a new FieldInfo. - * @memberof google.api - * @classdesc Represents a FieldInfo. - * @implements IFieldInfo - * @constructor - * @param {google.api.IFieldInfo=} [properties] Properties to set - */ - function FieldInfo(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * FieldInfo format. - * @member {google.api.FieldInfo.Format} format - * @memberof google.api.FieldInfo - * @instance - */ - FieldInfo.prototype.format = 0; - - /** - * Creates a new FieldInfo instance using the specified properties. - * @function create - * @memberof google.api.FieldInfo - * @static - * @param {google.api.IFieldInfo=} [properties] Properties to set - * @returns {google.api.FieldInfo} FieldInfo instance - */ - FieldInfo.create = function create(properties) { - return new FieldInfo(properties); - }; - - /** - * Encodes the specified FieldInfo message. Does not implicitly {@link google.api.FieldInfo.verify|verify} messages. - * @function encode - * @memberof google.api.FieldInfo - * @static - * @param {google.api.IFieldInfo} message FieldInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FieldInfo.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.format != null && Object.hasOwnProperty.call(message, "format")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.format); - return writer; - }; - - /** - * Encodes the specified FieldInfo message, length delimited. Does not implicitly {@link google.api.FieldInfo.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.FieldInfo - * @static - * @param {google.api.IFieldInfo} message FieldInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FieldInfo.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a FieldInfo message from the specified reader or buffer. - * @function decode - * @memberof google.api.FieldInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.FieldInfo} FieldInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FieldInfo.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.FieldInfo(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.format = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a FieldInfo message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.FieldInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.FieldInfo} FieldInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FieldInfo.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a FieldInfo message. - * @function verify - * @memberof google.api.FieldInfo - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - FieldInfo.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.format != null && message.hasOwnProperty("format")) - switch (message.format) { - default: - return "format: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - break; - } - return null; - }; - - /** - * Creates a FieldInfo message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.FieldInfo - * @static - * @param {Object.} object Plain object - * @returns {google.api.FieldInfo} FieldInfo - */ - FieldInfo.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.FieldInfo) - return object; - var message = new $root.google.api.FieldInfo(); - switch (object.format) { - default: - if (typeof object.format === "number") { - message.format = object.format; - break; - } - break; - case "FORMAT_UNSPECIFIED": - case 0: - message.format = 0; - break; - case "UUID4": - case 1: - message.format = 1; - break; - case "IPV4": - case 2: - message.format = 2; - break; - case "IPV6": - case 3: - message.format = 3; - break; - case "IPV4_OR_IPV6": - case 4: - message.format = 4; - break; - } - return message; - }; - - /** - * Creates a plain object from a FieldInfo message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.FieldInfo - * @static - * @param {google.api.FieldInfo} message FieldInfo - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - FieldInfo.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.format = options.enums === String ? "FORMAT_UNSPECIFIED" : 0; - if (message.format != null && message.hasOwnProperty("format")) - object.format = options.enums === String ? $root.google.api.FieldInfo.Format[message.format] === undefined ? message.format : $root.google.api.FieldInfo.Format[message.format] : message.format; - return object; - }; - - /** - * Converts this FieldInfo to JSON. - * @function toJSON - * @memberof google.api.FieldInfo - * @instance - * @returns {Object.} JSON object - */ - FieldInfo.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for FieldInfo - * @function getTypeUrl - * @memberof google.api.FieldInfo - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - FieldInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.FieldInfo"; - }; - - /** - * Format enum. - * @name google.api.FieldInfo.Format - * @enum {number} - * @property {number} FORMAT_UNSPECIFIED=0 FORMAT_UNSPECIFIED value - * @property {number} UUID4=1 UUID4 value - * @property {number} IPV4=2 IPV4 value - * @property {number} IPV6=3 IPV6 value - * @property {number} IPV4_OR_IPV6=4 IPV4_OR_IPV6 value - */ - FieldInfo.Format = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "FORMAT_UNSPECIFIED"] = 0; - values[valuesById[1] = "UUID4"] = 1; - values[valuesById[2] = "IPV4"] = 2; - values[valuesById[3] = "IPV6"] = 3; - values[valuesById[4] = "IPV4_OR_IPV6"] = 4; - return values; - })(); - - return FieldInfo; - })(); - return api; })(); @@ -108029,8 +160588,8 @@ * @property {google.protobuf.IFeatureSet|null} [features] FieldOptions features * @property {Array.|null} [uninterpretedOption] FieldOptions uninterpretedOption * @property {Array.|null} [".google.api.fieldBehavior"] FieldOptions .google.api.fieldBehavior - * @property {google.api.IResourceReference|null} [".google.api.resourceReference"] FieldOptions .google.api.resourceReference * @property {google.api.IFieldInfo|null} [".google.api.fieldInfo"] FieldOptions .google.api.fieldInfo + * @property {google.api.IResourceReference|null} [".google.api.resourceReference"] FieldOptions .google.api.resourceReference */ /** @@ -108165,20 +160724,20 @@ FieldOptions.prototype[".google.api.fieldBehavior"] = $util.emptyArray; /** - * FieldOptions .google.api.resourceReference. - * @member {google.api.IResourceReference|null|undefined} .google.api.resourceReference + * FieldOptions .google.api.fieldInfo. + * @member {google.api.IFieldInfo|null|undefined} .google.api.fieldInfo * @memberof google.protobuf.FieldOptions * @instance */ - FieldOptions.prototype[".google.api.resourceReference"] = null; + FieldOptions.prototype[".google.api.fieldInfo"] = null; /** - * FieldOptions .google.api.fieldInfo. - * @member {google.api.IFieldInfo|null|undefined} .google.api.fieldInfo + * FieldOptions .google.api.resourceReference. + * @member {google.api.IResourceReference|null|undefined} .google.api.resourceReference * @memberof google.protobuf.FieldOptions * @instance */ - FieldOptions.prototype[".google.api.fieldInfo"] = null; + FieldOptions.prototype[".google.api.resourceReference"] = null; /** * Creates a new FieldOptions instance using the specified properties. @@ -108350,14 +160909,14 @@ message[".google.api.fieldBehavior"].push(reader.int32()); break; } - case 1055: { - message[".google.api.resourceReference"] = $root.google.api.ResourceReference.decode(reader, reader.uint32()); - break; - } case 291403980: { message[".google.api.fieldInfo"] = $root.google.api.FieldInfo.decode(reader, reader.uint32()); break; } + case 1055: { + message[".google.api.resourceReference"] = $root.google.api.ResourceReference.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -108500,16 +161059,16 @@ break; } } - if (message[".google.api.resourceReference"] != null && message.hasOwnProperty(".google.api.resourceReference")) { - var error = $root.google.api.ResourceReference.verify(message[".google.api.resourceReference"]); - if (error) - return ".google.api.resourceReference." + error; - } if (message[".google.api.fieldInfo"] != null && message.hasOwnProperty(".google.api.fieldInfo")) { var error = $root.google.api.FieldInfo.verify(message[".google.api.fieldInfo"]); if (error) return ".google.api.fieldInfo." + error; } + if (message[".google.api.resourceReference"] != null && message.hasOwnProperty(".google.api.resourceReference")) { + var error = $root.google.api.ResourceReference.verify(message[".google.api.resourceReference"]); + if (error) + return ".google.api.resourceReference." + error; + } return null; }; @@ -108724,16 +161283,16 @@ break; } } - if (object[".google.api.resourceReference"] != null) { - if (typeof object[".google.api.resourceReference"] !== "object") - throw TypeError(".google.protobuf.FieldOptions..google.api.resourceReference: object expected"); - message[".google.api.resourceReference"] = $root.google.api.ResourceReference.fromObject(object[".google.api.resourceReference"]); - } if (object[".google.api.fieldInfo"] != null) { if (typeof object[".google.api.fieldInfo"] !== "object") throw TypeError(".google.protobuf.FieldOptions..google.api.fieldInfo: object expected"); message[".google.api.fieldInfo"] = $root.google.api.FieldInfo.fromObject(object[".google.api.fieldInfo"]); } + if (object[".google.api.resourceReference"] != null) { + if (typeof object[".google.api.resourceReference"] !== "object") + throw TypeError(".google.protobuf.FieldOptions..google.api.resourceReference: object expected"); + message[".google.api.resourceReference"] = $root.google.api.ResourceReference.fromObject(object[".google.api.resourceReference"]); + } return message; }; @@ -114179,32 +166738,275 @@ }; /** - * Converts this Duration to JSON. + * Converts this Duration to JSON. + * @function toJSON + * @memberof google.protobuf.Duration + * @instance + * @returns {Object.} JSON object + */ + Duration.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Duration + * @function getTypeUrl + * @memberof google.protobuf.Duration + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Duration.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Duration"; + }; + + return Duration; + })(); + + protobuf.Timestamp = (function() { + + /** + * Properties of a Timestamp. + * @memberof google.protobuf + * @interface ITimestamp + * @property {number|Long|null} [seconds] Timestamp seconds + * @property {number|null} [nanos] Timestamp nanos + */ + + /** + * Constructs a new Timestamp. + * @memberof google.protobuf + * @classdesc Represents a Timestamp. + * @implements ITimestamp + * @constructor + * @param {google.protobuf.ITimestamp=} [properties] Properties to set + */ + function Timestamp(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Timestamp seconds. + * @member {number|Long} seconds + * @memberof google.protobuf.Timestamp + * @instance + */ + Timestamp.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Timestamp nanos. + * @member {number} nanos + * @memberof google.protobuf.Timestamp + * @instance + */ + Timestamp.prototype.nanos = 0; + + /** + * Creates a new Timestamp instance using the specified properties. + * @function create + * @memberof google.protobuf.Timestamp + * @static + * @param {google.protobuf.ITimestamp=} [properties] Properties to set + * @returns {google.protobuf.Timestamp} Timestamp instance + */ + Timestamp.create = function create(properties) { + return new Timestamp(properties); + }; + + /** + * Encodes the specified Timestamp message. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Timestamp + * @static + * @param {google.protobuf.ITimestamp} message Timestamp message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Timestamp.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.seconds != null && Object.hasOwnProperty.call(message, "seconds")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.seconds); + if (message.nanos != null && Object.hasOwnProperty.call(message, "nanos")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.nanos); + return writer; + }; + + /** + * Encodes the specified Timestamp message, length delimited. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Timestamp + * @static + * @param {google.protobuf.ITimestamp} message Timestamp message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Timestamp.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Timestamp message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Timestamp + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Timestamp} Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Timestamp.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Timestamp(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.seconds = reader.int64(); + break; + } + case 2: { + message.nanos = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Timestamp message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Timestamp + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Timestamp} Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Timestamp.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Timestamp message. + * @function verify + * @memberof google.protobuf.Timestamp + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Timestamp.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.seconds != null && message.hasOwnProperty("seconds")) + if (!$util.isInteger(message.seconds) && !(message.seconds && $util.isInteger(message.seconds.low) && $util.isInteger(message.seconds.high))) + return "seconds: integer|Long expected"; + if (message.nanos != null && message.hasOwnProperty("nanos")) + if (!$util.isInteger(message.nanos)) + return "nanos: integer expected"; + return null; + }; + + /** + * Creates a Timestamp message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Timestamp + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Timestamp} Timestamp + */ + Timestamp.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Timestamp) + return object; + var message = new $root.google.protobuf.Timestamp(); + if (object.seconds != null) + if ($util.Long) + (message.seconds = $util.Long.fromValue(object.seconds)).unsigned = false; + else if (typeof object.seconds === "string") + message.seconds = parseInt(object.seconds, 10); + else if (typeof object.seconds === "number") + message.seconds = object.seconds; + else if (typeof object.seconds === "object") + message.seconds = new $util.LongBits(object.seconds.low >>> 0, object.seconds.high >>> 0).toNumber(); + if (object.nanos != null) + message.nanos = object.nanos | 0; + return message; + }; + + /** + * Creates a plain object from a Timestamp message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Timestamp + * @static + * @param {google.protobuf.Timestamp} message Timestamp + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Timestamp.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.seconds = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.seconds = options.longs === String ? "0" : 0; + object.nanos = 0; + } + if (message.seconds != null && message.hasOwnProperty("seconds")) + if (typeof message.seconds === "number") + object.seconds = options.longs === String ? String(message.seconds) : message.seconds; + else + object.seconds = options.longs === String ? $util.Long.prototype.toString.call(message.seconds) : options.longs === Number ? new $util.LongBits(message.seconds.low >>> 0, message.seconds.high >>> 0).toNumber() : message.seconds; + if (message.nanos != null && message.hasOwnProperty("nanos")) + object.nanos = message.nanos; + return object; + }; + + /** + * Converts this Timestamp to JSON. * @function toJSON - * @memberof google.protobuf.Duration + * @memberof google.protobuf.Timestamp * @instance * @returns {Object.} JSON object */ - Duration.prototype.toJSON = function toJSON() { + Timestamp.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for Duration + * Gets the default type url for Timestamp * @function getTypeUrl - * @memberof google.protobuf.Duration + * @memberof google.protobuf.Timestamp * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - Duration.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + Timestamp.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.protobuf.Duration"; + return typeUrlPrefix + "/google.protobuf.Timestamp"; }; - return Duration; + return Timestamp; })(); protobuf.Any = (function() { @@ -114843,249 +167645,6 @@ return FieldMask; })(); - protobuf.Timestamp = (function() { - - /** - * Properties of a Timestamp. - * @memberof google.protobuf - * @interface ITimestamp - * @property {number|Long|null} [seconds] Timestamp seconds - * @property {number|null} [nanos] Timestamp nanos - */ - - /** - * Constructs a new Timestamp. - * @memberof google.protobuf - * @classdesc Represents a Timestamp. - * @implements ITimestamp - * @constructor - * @param {google.protobuf.ITimestamp=} [properties] Properties to set - */ - function Timestamp(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Timestamp seconds. - * @member {number|Long} seconds - * @memberof google.protobuf.Timestamp - * @instance - */ - Timestamp.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * Timestamp nanos. - * @member {number} nanos - * @memberof google.protobuf.Timestamp - * @instance - */ - Timestamp.prototype.nanos = 0; - - /** - * Creates a new Timestamp instance using the specified properties. - * @function create - * @memberof google.protobuf.Timestamp - * @static - * @param {google.protobuf.ITimestamp=} [properties] Properties to set - * @returns {google.protobuf.Timestamp} Timestamp instance - */ - Timestamp.create = function create(properties) { - return new Timestamp(properties); - }; - - /** - * Encodes the specified Timestamp message. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. - * @function encode - * @memberof google.protobuf.Timestamp - * @static - * @param {google.protobuf.ITimestamp} message Timestamp message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Timestamp.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.seconds != null && Object.hasOwnProperty.call(message, "seconds")) - writer.uint32(/* id 1, wireType 0 =*/8).int64(message.seconds); - if (message.nanos != null && Object.hasOwnProperty.call(message, "nanos")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.nanos); - return writer; - }; - - /** - * Encodes the specified Timestamp message, length delimited. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.Timestamp - * @static - * @param {google.protobuf.ITimestamp} message Timestamp message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Timestamp.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Timestamp message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.Timestamp - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.Timestamp} Timestamp - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Timestamp.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Timestamp(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.seconds = reader.int64(); - break; - } - case 2: { - message.nanos = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Timestamp message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.Timestamp - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.Timestamp} Timestamp - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Timestamp.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Timestamp message. - * @function verify - * @memberof google.protobuf.Timestamp - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Timestamp.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.seconds != null && message.hasOwnProperty("seconds")) - if (!$util.isInteger(message.seconds) && !(message.seconds && $util.isInteger(message.seconds.low) && $util.isInteger(message.seconds.high))) - return "seconds: integer|Long expected"; - if (message.nanos != null && message.hasOwnProperty("nanos")) - if (!$util.isInteger(message.nanos)) - return "nanos: integer expected"; - return null; - }; - - /** - * Creates a Timestamp message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.Timestamp - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.Timestamp} Timestamp - */ - Timestamp.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.Timestamp) - return object; - var message = new $root.google.protobuf.Timestamp(); - if (object.seconds != null) - if ($util.Long) - (message.seconds = $util.Long.fromValue(object.seconds)).unsigned = false; - else if (typeof object.seconds === "string") - message.seconds = parseInt(object.seconds, 10); - else if (typeof object.seconds === "number") - message.seconds = object.seconds; - else if (typeof object.seconds === "object") - message.seconds = new $util.LongBits(object.seconds.low >>> 0, object.seconds.high >>> 0).toNumber(); - if (object.nanos != null) - message.nanos = object.nanos | 0; - return message; - }; - - /** - * Creates a plain object from a Timestamp message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.Timestamp - * @static - * @param {google.protobuf.Timestamp} message Timestamp - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Timestamp.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.seconds = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.seconds = options.longs === String ? "0" : 0; - object.nanos = 0; - } - if (message.seconds != null && message.hasOwnProperty("seconds")) - if (typeof message.seconds === "number") - object.seconds = options.longs === String ? String(message.seconds) : message.seconds; - else - object.seconds = options.longs === String ? $util.Long.prototype.toString.call(message.seconds) : options.longs === Number ? new $util.LongBits(message.seconds.low >>> 0, message.seconds.high >>> 0).toNumber() : message.seconds; - if (message.nanos != null && message.hasOwnProperty("nanos")) - object.nanos = message.nanos; - return object; - }; - - /** - * Converts this Timestamp to JSON. - * @function toJSON - * @memberof google.protobuf.Timestamp - * @instance - * @returns {Object.} JSON object - */ - Timestamp.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Timestamp - * @function getTypeUrl - * @memberof google.protobuf.Timestamp - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Timestamp.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.Timestamp"; - }; - - return Timestamp; - })(); - return protobuf; })(); diff --git a/packages/google-cloud-networksecurity/protos/protos.json b/packages/google-cloud-networksecurity/protos/protos.json index 28cf3970f18..c90cc437ab4 100644 --- a/packages/google-cloud-networksecurity/protos/protos.json +++ b/packages/google-cloud-networksecurity/protos/protos.json @@ -11,12 +11,12 @@ "csharp_namespace": "Google.Cloud.NetworkSecurity.V1", "go_package": "cloud.google.com/go/networksecurity/apiv1/networksecuritypb;networksecuritypb", "java_multiple_files": true, - "java_outer_classname": "ServerTlsPolicyProto", + "java_outer_classname": "SecurityProfileGroupServiceProto", "java_package": "com.google.cloud.networksecurity.v1", "php_namespace": "Google\\Cloud\\NetworkSecurity\\V1", "ruby_package": "Google::Cloud::NetworkSecurity::V1", - "(google.api.resource_definition).type": "networksecurity.googleapis.com/OrganizationLocation", - "(google.api.resource_definition).pattern": "organizations/{organization}/locations/{location}" + "(google.api.resource_definition).type": "privateca.googleapis.com/CaPool", + "(google.api.resource_definition).pattern": "projects/{project}/locations/{location}/caPools/{ca_pool}" }, "nested": { "AddressGroupService": { @@ -838,6 +838,59 @@ } } }, + "OperationMetadata": { + "fields": { + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "endTime": { + "type": "google.protobuf.Timestamp", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "target": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "verb": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "statusMessage": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "requestedCancellation": { + "type": "bool", + "id": 6, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "apiVersion": { + "type": "string", + "id": 7, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, "AuthorizationPolicy": { "options": { "(google.api.resource).type": "networksecurity.googleapis.com/AuthorizationPolicy", @@ -1111,38 +1164,40 @@ } } }, - "ClientTlsPolicy": { + "AuthzPolicy": { "options": { - "(google.api.resource).type": "networksecurity.googleapis.com/ClientTlsPolicy", - "(google.api.resource).pattern": "projects/{project}/locations/{location}/clientTlsPolicies/{client_tls_policy}" + "(google.api.resource).type": "networksecurity.googleapis.com/AuthzPolicy", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/authzPolicies/{authz_policy}", + "(google.api.resource).plural": "authzPolicies", + "(google.api.resource).singular": "authzPolicy" }, "fields": { "name": { "type": "string", "id": 1, "options": { - "(google.api.field_behavior)": "REQUIRED" + "(google.api.field_behavior)": "IDENTIFIER" } }, - "description": { - "type": "string", + "createTime": { + "type": "google.protobuf.Timestamp", "id": 2, "options": { - "(google.api.field_behavior)": "OPTIONAL" + "(google.api.field_behavior)": "OUTPUT_ONLY" } }, - "createTime": { + "updateTime": { "type": "google.protobuf.Timestamp", "id": 3, "options": { "(google.api.field_behavior)": "OUTPUT_ONLY" } }, - "updateTime": { - "type": "google.protobuf.Timestamp", + "description": { + "type": "string", "id": 4, "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" + "(google.api.field_behavior)": "OPTIONAL" } }, "labels": { @@ -1153,381 +1208,7660 @@ "(google.api.field_behavior)": "OPTIONAL" } }, - "sni": { - "type": "string", + "target": { + "type": "Target", "id": 6, "options": { - "(google.api.field_behavior)": "OPTIONAL" + "(google.api.field_behavior)": "REQUIRED" } }, - "clientCertificate": { - "type": "CertificateProvider", + "httpRules": { + "rule": "repeated", + "type": "AuthzRule", "id": 7, "options": { "(google.api.field_behavior)": "OPTIONAL" } }, - "serverValidationCa": { - "rule": "repeated", - "type": "ValidationCA", + "action": { + "type": "AuthzAction", "id": 8, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "ListClientTlsPoliciesRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "locations.googleapis.com/Location" - } - }, - "pageSize": { - "type": "int32", - "id": 2 - }, - "pageToken": { - "type": "string", - "id": 3 - } - } - }, - "ListClientTlsPoliciesResponse": { - "fields": { - "clientTlsPolicies": { - "rule": "repeated", - "type": "ClientTlsPolicy", - "id": 1 - }, - "nextPageToken": { - "type": "string", - "id": 2 - } - } - }, - "GetClientTlsPolicyRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "networksecurity.googleapis.com/ClientTlsPolicy" - } - } - } - }, - "CreateClientTlsPolicyRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).child_type": "networksecurity.googleapis.com/ClientTlsPolicy" - } - }, - "clientTlsPolicyId": { - "type": "string", - "id": 2, "options": { "(google.api.field_behavior)": "REQUIRED" } }, - "clientTlsPolicy": { - "type": "ClientTlsPolicy", - "id": 3, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - } - }, - "UpdateClientTlsPolicyRequest": { - "fields": { - "updateMask": { - "type": "google.protobuf.FieldMask", - "id": 1, + "customProvider": { + "type": "CustomProvider", + "id": 10, "options": { "(google.api.field_behavior)": "OPTIONAL" } }, - "clientTlsPolicy": { - "type": "ClientTlsPolicy", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - } - }, - "DeleteClientTlsPolicyRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "networksecurity.googleapis.com/ClientTlsPolicy" - } - } - } - }, - "GrpcEndpoint": { - "fields": { - "targetUri": { - "type": "string", - "id": 1, + "policyProfile": { + "type": "PolicyProfile", + "id": 11, "options": { - "(google.api.field_behavior)": "REQUIRED" + "(google.api.field_behavior)": "IMMUTABLE" } } - } - }, - "ValidationCA": { - "oneofs": { - "type": { - "oneof": [ - "grpcEndpoint", - "certificateProviderInstance" - ] - } }, - "fields": { - "grpcEndpoint": { - "type": "GrpcEndpoint", - "id": 2 - }, - "certificateProviderInstance": { - "type": "CertificateProviderInstance", - "id": 3 - } - } - }, - "CertificateProviderInstance": { - "fields": { - "pluginInstance": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" + "nested": { + "Target": { + "fields": { + "loadBalancingScheme": { + "type": "LoadBalancingScheme", + "id": 8, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "resources": { + "rule": "repeated", + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } } - } - } - }, - "CertificateProvider": { + }, + "AuthzRule": { + "fields": { + "from": { + "type": "From", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "to": { + "type": "To", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "when": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "StringMatch": { + "oneofs": { + "matchPattern": { + "oneof": [ + "exact", + "prefix", + "suffix", + "contains" + ] + } + }, + "fields": { + "exact": { + "type": "string", + "id": 1 + }, + "prefix": { + "type": "string", + "id": 2 + }, + "suffix": { + "type": "string", + "id": 3 + }, + "contains": { + "type": "string", + "id": 4 + }, + "ignoreCase": { + "type": "bool", + "id": 5 + } + } + }, + "IpBlock": { + "fields": { + "prefix": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "length": { + "type": "int32", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "RequestResource": { + "fields": { + "tagValueIdSet": { + "type": "TagValueIdSet", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "iamServiceAccount": { + "type": "StringMatch", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "TagValueIdSet": { + "fields": { + "ids": { + "rule": "repeated", + "type": "int64", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + } + } + }, + "HeaderMatch": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "value": { + "type": "StringMatch", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "Principal": { + "fields": { + "principalSelector": { + "type": "PrincipalSelector", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "principal": { + "type": "StringMatch", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + }, + "nested": { + "PrincipalSelector": { + "values": { + "PRINCIPAL_SELECTOR_UNSPECIFIED": 0, + "CLIENT_CERT_URI_SAN": 1, + "CLIENT_CERT_DNS_NAME_SAN": 2, + "CLIENT_CERT_COMMON_NAME": 3 + } + } + } + }, + "From": { + "fields": { + "sources": { + "rule": "repeated", + "type": "RequestSource", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "notSources": { + "rule": "repeated", + "type": "RequestSource", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "RequestSource": { + "fields": { + "principals": { + "rule": "repeated", + "type": "Principal", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "ipBlocks": { + "rule": "repeated", + "type": "IpBlock", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "resources": { + "rule": "repeated", + "type": "RequestResource", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + } + } + }, + "To": { + "fields": { + "operations": { + "rule": "repeated", + "type": "RequestOperation", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "notOperations": { + "rule": "repeated", + "type": "RequestOperation", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "RequestOperation": { + "fields": { + "headerSet": { + "type": "HeaderSet", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "hosts": { + "rule": "repeated", + "type": "StringMatch", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "paths": { + "rule": "repeated", + "type": "StringMatch", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "methods": { + "rule": "repeated", + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "mcp": { + "type": "MCP", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "HeaderSet": { + "fields": { + "headers": { + "rule": "repeated", + "type": "HeaderMatch", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "MCPMethod": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "params": { + "rule": "repeated", + "type": "StringMatch", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "MCP": { + "fields": { + "baseProtocolMethodsOption": { + "type": "BaseProtocolMethodsOption", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "methods": { + "rule": "repeated", + "type": "MCPMethod", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "BaseProtocolMethodsOption": { + "values": { + "BASE_PROTOCOL_METHODS_OPTION_UNSPECIFIED": 0, + "SKIP_BASE_PROTOCOL_METHODS": 1, + "MATCH_BASE_PROTOCOL_METHODS": 2 + } + } + } + } + } + } + } + }, + "CustomProvider": { + "fields": { + "cloudIap": { + "type": "CloudIap", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "authzExtension": { + "type": "AuthzExtension", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "CloudIap": { + "fields": {} + }, + "AuthzExtension": { + "fields": { + "resources": { + "rule": "repeated", + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + } + } + }, + "LoadBalancingScheme": { + "values": { + "LOAD_BALANCING_SCHEME_UNSPECIFIED": 0, + "INTERNAL_MANAGED": 1, + "EXTERNAL_MANAGED": 2, + "INTERNAL_SELF_MANAGED": 3 + } + }, + "AuthzAction": { + "values": { + "AUTHZ_ACTION_UNSPECIFIED": 0, + "ALLOW": 1, + "DENY": 2, + "CUSTOM": 3 + } + }, + "PolicyProfile": { + "values": { + "POLICY_PROFILE_UNSPECIFIED": 0, + "REQUEST_AUTHZ": 1, + "CONTENT_AUTHZ": 2 + } + } + } + }, + "CreateAuthzPolicyRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "networksecurity.googleapis.com/AuthzPolicy" + } + }, + "authzPolicyId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "authzPolicy": { + "type": "AuthzPolicy", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_info).format": "UUID4", + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListAuthzPoliciesRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "networksecurity.googleapis.com/AuthzPolicy" + } + }, + "pageSize": { + "type": "int32", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageToken": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "filter": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "orderBy": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListAuthzPoliciesResponse": { + "fields": { + "authzPolicies": { + "rule": "repeated", + "type": "AuthzPolicy", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + }, + "unreachable": { + "rule": "repeated", + "type": "string", + "id": 3 + } + } + }, + "GetAuthzPolicyRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "networksecurity.googleapis.com/AuthzPolicy" + } + } + } + }, + "UpdateAuthzPolicyRequest": { + "fields": { + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "authzPolicy": { + "type": "AuthzPolicy", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_info).format": "UUID4", + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "DeleteAuthzPolicyRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "networksecurity.googleapis.com/AuthzPolicy" + } + }, + "requestId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_info).format": "UUID4", + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "BackendAuthenticationConfig": { + "options": { + "(google.api.resource).type": "networksecurity.googleapis.com/BackendAuthenticationConfig", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/backendAuthenticationConfigs/{backend_authentication_config}" + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "description": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "labels": { + "keyType": "string", + "type": "string", + "id": 5 + }, + "clientCertificate": { + "type": "string", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "(google.api.resource_reference).type": "certificatemanager.googleapis.com/Certificate" + } + }, + "trustConfig": { + "type": "string", + "id": 7, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "(google.api.resource_reference).type": "certificatemanager.googleapis.com/TrustConfig" + } + }, + "wellKnownRoots": { + "type": "WellKnownRoots", + "id": 8 + }, + "etag": { + "type": "string", + "id": 9, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + }, + "nested": { + "WellKnownRoots": { + "values": { + "WELL_KNOWN_ROOTS_UNSPECIFIED": 0, + "NONE": 1, + "PUBLIC_ROOTS": 2 + } + } + } + }, + "ListBackendAuthenticationConfigsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "locations.googleapis.com/Location" + } + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + } + } + }, + "ListBackendAuthenticationConfigsResponse": { + "fields": { + "backendAuthenticationConfigs": { + "rule": "repeated", + "type": "BackendAuthenticationConfig", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + }, + "unreachable": { + "rule": "repeated", + "type": "string", + "id": 3 + } + } + }, + "GetBackendAuthenticationConfigRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "networksecurity.googleapis.com/BackendAuthenticationConfig" + } + } + } + }, + "CreateBackendAuthenticationConfigRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "networksecurity.googleapis.com/BackendAuthenticationConfig" + } + }, + "backendAuthenticationConfigId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "backendAuthenticationConfig": { + "type": "BackendAuthenticationConfig", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "UpdateBackendAuthenticationConfigRequest": { + "fields": { + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "backendAuthenticationConfig": { + "type": "BackendAuthenticationConfig", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "DeleteBackendAuthenticationConfigRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "networksecurity.googleapis.com/BackendAuthenticationConfig" + } + }, + "etag": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ClientTlsPolicy": { + "options": { + "(google.api.resource).type": "networksecurity.googleapis.com/ClientTlsPolicy", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/clientTlsPolicies/{client_tls_policy}" + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "description": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "labels": { + "keyType": "string", + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "sni": { + "type": "string", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "clientCertificate": { + "type": "CertificateProvider", + "id": 7, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "serverValidationCa": { + "rule": "repeated", + "type": "ValidationCA", + "id": 8, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListClientTlsPoliciesRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "locations.googleapis.com/Location" + } + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + } + } + }, + "ListClientTlsPoliciesResponse": { + "fields": { + "clientTlsPolicies": { + "rule": "repeated", + "type": "ClientTlsPolicy", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "GetClientTlsPolicyRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "networksecurity.googleapis.com/ClientTlsPolicy" + } + } + } + }, + "CreateClientTlsPolicyRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "networksecurity.googleapis.com/ClientTlsPolicy" + } + }, + "clientTlsPolicyId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "clientTlsPolicy": { + "type": "ClientTlsPolicy", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "UpdateClientTlsPolicyRequest": { + "fields": { + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "clientTlsPolicy": { + "type": "ClientTlsPolicy", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "DeleteClientTlsPolicyRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "networksecurity.googleapis.com/ClientTlsPolicy" + } + } + } + }, + "GrpcEndpoint": { + "fields": { + "targetUri": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "ValidationCA": { + "oneofs": { + "type": { + "oneof": [ + "grpcEndpoint", + "certificateProviderInstance" + ] + } + }, + "fields": { + "grpcEndpoint": { + "type": "GrpcEndpoint", + "id": 2 + }, + "certificateProviderInstance": { + "type": "CertificateProviderInstance", + "id": 3 + } + } + }, + "CertificateProviderInstance": { + "fields": { + "pluginInstance": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "CertificateProvider": { + "oneofs": { + "type": { + "oneof": [ + "grpcEndpoint", + "certificateProviderInstance" + ] + } + }, + "fields": { + "grpcEndpoint": { + "type": "GrpcEndpoint", + "id": 2 + }, + "certificateProviderInstance": { + "type": "CertificateProviderInstance", + "id": 3 + } + } + }, + "DnsThreatDetectorService": { + "options": { + "(google.api.default_host)": "networksecurity.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform" + }, + "methods": { + "ListDnsThreatDetectors": { + "requestType": "ListDnsThreatDetectorsRequest", + "responseType": "ListDnsThreatDetectorsResponse", + "options": { + "(google.api.http).get": "/v1/{parent=projects/*/locations/*}/dnsThreatDetectors", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=projects/*/locations/*}/dnsThreatDetectors" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "GetDnsThreatDetector": { + "requestType": "GetDnsThreatDetectorRequest", + "responseType": "DnsThreatDetector", + "options": { + "(google.api.http).get": "/v1/{name=projects/*/locations/*/dnsThreatDetectors/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=projects/*/locations/*/dnsThreatDetectors/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "CreateDnsThreatDetector": { + "requestType": "CreateDnsThreatDetectorRequest", + "responseType": "DnsThreatDetector", + "options": { + "(google.api.http).post": "/v1/{parent=projects/*/locations/*}/dnsThreatDetectors", + "(google.api.http).body": "dns_threat_detector", + "(google.api.method_signature)": "parent,dns_threat_detector,dns_threat_detector_id" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{parent=projects/*/locations/*}/dnsThreatDetectors", + "body": "dns_threat_detector" + } + }, + { + "(google.api.method_signature)": "parent,dns_threat_detector,dns_threat_detector_id" + } + ] + }, + "UpdateDnsThreatDetector": { + "requestType": "UpdateDnsThreatDetectorRequest", + "responseType": "DnsThreatDetector", + "options": { + "(google.api.http).patch": "/v1/{dns_threat_detector.name=projects/*/locations/*/dnsThreatDetectors/*}", + "(google.api.http).body": "dns_threat_detector", + "(google.api.method_signature)": "dns_threat_detector,update_mask" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1/{dns_threat_detector.name=projects/*/locations/*/dnsThreatDetectors/*}", + "body": "dns_threat_detector" + } + }, + { + "(google.api.method_signature)": "dns_threat_detector,update_mask" + } + ] + }, + "DeleteDnsThreatDetector": { + "requestType": "DeleteDnsThreatDetectorRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v1/{name=projects/*/locations/*/dnsThreatDetectors/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1/{name=projects/*/locations/*/dnsThreatDetectors/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + } + } + }, + "DnsThreatDetector": { + "options": { + "(google.api.resource).type": "networksecurity.googleapis.com/DnsThreatDetector", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/dnsThreatDetectors/{dns_threat_detector}", + "(google.api.resource).plural": "dnsThreatDetectors", + "(google.api.resource).singular": "dnsThreatDetector" + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "IMMUTABLE" + } + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "labels": { + "keyType": "string", + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "excludedNetworks": { + "rule": "repeated", + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "(google.api.resource_reference).type": "compute.googleapis.com/Network" + } + }, + "provider": { + "type": "Provider", + "id": 6, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + }, + "nested": { + "Provider": { + "values": { + "PROVIDER_UNSPECIFIED": 0, + "INFOBLOX": 1 + } + } + } + }, + "ListDnsThreatDetectorsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "networksecurity.googleapis.com/DnsThreatDetector" + } + }, + "pageSize": { + "type": "int32", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageToken": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListDnsThreatDetectorsResponse": { + "fields": { + "dnsThreatDetectors": { + "rule": "repeated", + "type": "DnsThreatDetector", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + }, + "unreachable": { + "rule": "repeated", + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "UNORDERED_LIST" + } + } + } + }, + "GetDnsThreatDetectorRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "networksecurity.googleapis.com/DnsThreatDetector" + } + } + } + }, + "CreateDnsThreatDetectorRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "networksecurity.googleapis.com/DnsThreatDetector" + } + }, + "dnsThreatDetectorId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "dnsThreatDetector": { + "type": "DnsThreatDetector", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "UpdateDnsThreatDetectorRequest": { + "fields": { + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "dnsThreatDetector": { + "type": "DnsThreatDetector", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "DeleteDnsThreatDetectorRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "networksecurity.googleapis.com/DnsThreatDetector" + } + } + } + }, + "FirewallActivation": { + "options": { + "(google.api.default_host)": "networksecurity.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform" + }, + "methods": { + "ListFirewallEndpoints": { + "requestType": "ListFirewallEndpointsRequest", + "responseType": "ListFirewallEndpointsResponse", + "options": { + "(google.api.http).get": "/v1/{parent=organizations/*/locations/*}/firewallEndpoints", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=organizations/*/locations/*}/firewallEndpoints" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "GetFirewallEndpoint": { + "requestType": "GetFirewallEndpointRequest", + "responseType": "FirewallEndpoint", + "options": { + "(google.api.http).get": "/v1/{name=organizations/*/locations/*/firewallEndpoints/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=organizations/*/locations/*/firewallEndpoints/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "CreateFirewallEndpoint": { + "requestType": "CreateFirewallEndpointRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1/{parent=organizations/*/locations/*}/firewallEndpoints", + "(google.api.http).body": "firewall_endpoint", + "(google.api.method_signature)": "parent,firewall_endpoint,firewall_endpoint_id", + "(google.longrunning.operation_info).response_type": "FirewallEndpoint", + "(google.longrunning.operation_info).metadata_type": "google.cloud.networksecurity.v1.OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{parent=organizations/*/locations/*}/firewallEndpoints", + "body": "firewall_endpoint" + } + }, + { + "(google.api.method_signature)": "parent,firewall_endpoint,firewall_endpoint_id" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "FirewallEndpoint", + "metadata_type": "google.cloud.networksecurity.v1.OperationMetadata" + } + } + ] + }, + "DeleteFirewallEndpoint": { + "requestType": "DeleteFirewallEndpointRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).delete": "/v1/{name=organizations/*/locations/*/firewallEndpoints/*}", + "(google.api.method_signature)": "name", + "(google.longrunning.operation_info).response_type": "google.protobuf.Empty", + "(google.longrunning.operation_info).metadata_type": "google.cloud.networksecurity.v1.OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1/{name=organizations/*/locations/*/firewallEndpoints/*}" + } + }, + { + "(google.api.method_signature)": "name" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "google.protobuf.Empty", + "metadata_type": "google.cloud.networksecurity.v1.OperationMetadata" + } + } + ] + }, + "UpdateFirewallEndpoint": { + "requestType": "UpdateFirewallEndpointRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).patch": "/v1/{firewall_endpoint.name=organizations/*/locations/*/firewallEndpoints/*}", + "(google.api.http).body": "firewall_endpoint", + "(google.api.method_signature)": "firewall_endpoint,update_mask", + "(google.longrunning.operation_info).response_type": "FirewallEndpoint", + "(google.longrunning.operation_info).metadata_type": "google.cloud.networksecurity.v1.OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1/{firewall_endpoint.name=organizations/*/locations/*/firewallEndpoints/*}", + "body": "firewall_endpoint" + } + }, + { + "(google.api.method_signature)": "firewall_endpoint,update_mask" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "FirewallEndpoint", + "metadata_type": "google.cloud.networksecurity.v1.OperationMetadata" + } + } + ] + }, + "ListFirewallEndpointAssociations": { + "requestType": "ListFirewallEndpointAssociationsRequest", + "responseType": "ListFirewallEndpointAssociationsResponse", + "options": { + "(google.api.http).get": "/v1/{parent=projects/*/locations/*}/firewallEndpointAssociations", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=projects/*/locations/*}/firewallEndpointAssociations" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "GetFirewallEndpointAssociation": { + "requestType": "GetFirewallEndpointAssociationRequest", + "responseType": "FirewallEndpointAssociation", + "options": { + "(google.api.http).get": "/v1/{name=projects/*/locations/*/firewallEndpointAssociations/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=projects/*/locations/*/firewallEndpointAssociations/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "CreateFirewallEndpointAssociation": { + "requestType": "CreateFirewallEndpointAssociationRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1/{parent=projects/*/locations/*}/firewallEndpointAssociations", + "(google.api.http).body": "firewall_endpoint_association", + "(google.api.method_signature)": "parent,firewall_endpoint_association,firewall_endpoint_association_id", + "(google.longrunning.operation_info).response_type": "FirewallEndpointAssociation", + "(google.longrunning.operation_info).metadata_type": "google.cloud.networksecurity.v1.OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{parent=projects/*/locations/*}/firewallEndpointAssociations", + "body": "firewall_endpoint_association" + } + }, + { + "(google.api.method_signature)": "parent,firewall_endpoint_association,firewall_endpoint_association_id" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "FirewallEndpointAssociation", + "metadata_type": "google.cloud.networksecurity.v1.OperationMetadata" + } + } + ] + }, + "DeleteFirewallEndpointAssociation": { + "requestType": "DeleteFirewallEndpointAssociationRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).delete": "/v1/{name=projects/*/locations/*/firewallEndpointAssociations/*}", + "(google.api.method_signature)": "name", + "(google.longrunning.operation_info).response_type": "google.protobuf.Empty", + "(google.longrunning.operation_info).metadata_type": "google.cloud.networksecurity.v1.OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1/{name=projects/*/locations/*/firewallEndpointAssociations/*}" + } + }, + { + "(google.api.method_signature)": "name" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "google.protobuf.Empty", + "metadata_type": "google.cloud.networksecurity.v1.OperationMetadata" + } + } + ] + }, + "UpdateFirewallEndpointAssociation": { + "requestType": "UpdateFirewallEndpointAssociationRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).patch": "/v1/{firewall_endpoint_association.name=projects/*/locations/*/firewallEndpointAssociations/*}", + "(google.api.http).body": "firewall_endpoint_association", + "(google.api.method_signature)": "firewall_endpoint_association,update_mask", + "(google.longrunning.operation_info).response_type": "FirewallEndpointAssociation", + "(google.longrunning.operation_info).metadata_type": "google.cloud.networksecurity.v1.OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1/{firewall_endpoint_association.name=projects/*/locations/*/firewallEndpointAssociations/*}", + "body": "firewall_endpoint_association" + } + }, + { + "(google.api.method_signature)": "firewall_endpoint_association,update_mask" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "FirewallEndpointAssociation", + "metadata_type": "google.cloud.networksecurity.v1.OperationMetadata" + } + } + ] + } + } + }, + "FirewallEndpoint": { + "options": { + "(google.api.resource).type": "networksecurity.googleapis.com/FirewallEndpoint", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/firewallEndpoints/{firewall_endpoint}", + "(google.api.resource).plural": "firewallEndpoints", + "(google.api.resource).singular": "firewallEndpoint" + }, + "oneofs": { + "_satisfiesPzs": { + "oneof": [ + "satisfiesPzs" + ] + }, + "_satisfiesPzi": { + "oneof": [ + "satisfiesPzi" + ] + } + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "IDENTIFIER" + } + }, + "description": { + "type": "string", + "id": 9, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "labels": { + "keyType": "string", + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "state": { + "type": "State", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "reconciling": { + "type": "bool", + "id": 6, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "associatedNetworks": { + "rule": "repeated", + "type": "string", + "id": 7, + "options": { + "deprecated": true, + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "associations": { + "rule": "repeated", + "type": "AssociationReference", + "id": 13, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "satisfiesPzs": { + "type": "bool", + "id": 14, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY", + "proto3_optional": true + } + }, + "satisfiesPzi": { + "type": "bool", + "id": 15, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY", + "proto3_optional": true + } + }, + "billingProjectId": { + "type": "string", + "id": 8, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "endpointSettings": { + "type": "EndpointSettings", + "id": 19, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "AssociationReference": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY", + "(google.api.resource_reference).type": "networksecurity.googleapis.com/FirewallEndpointAssociation" + } + }, + "network": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY", + "(google.api.resource_reference).type": "compute.googleapis.com/Network" + } + } + } + }, + "EndpointSettings": { + "fields": { + "jumboFramesEnabled": { + "type": "bool", + "id": 1, + "options": { + "(google.api.field_behavior)": "IMMUTABLE" + } + } + } + }, + "State": { + "values": { + "STATE_UNSPECIFIED": 0, + "CREATING": 1, + "ACTIVE": 2, + "DELETING": 3, + "INACTIVE": 4 + } + } + } + }, + "ListFirewallEndpointsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "networksecurity.googleapis.com/FirewallEndpoint" + } + }, + "pageSize": { + "type": "int32", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageToken": { + "type": "string", + "id": 3 + }, + "filter": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "orderBy": { + "type": "string", + "id": 5 + } + } + }, + "ListFirewallEndpointsResponse": { + "fields": { + "firewallEndpoints": { + "rule": "repeated", + "type": "FirewallEndpoint", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + }, + "unreachable": { + "rule": "repeated", + "type": "string", + "id": 3 + } + } + }, + "GetFirewallEndpointRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "networksecurity.googleapis.com/FirewallEndpoint" + } + } + } + }, + "CreateFirewallEndpointRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "networksecurity.googleapis.com/FirewallEndpoint" + } + }, + "firewallEndpointId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "firewallEndpoint": { + "type": "FirewallEndpoint", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "UpdateFirewallEndpointRequest": { + "fields": { + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "firewallEndpoint": { + "type": "FirewallEndpoint", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "DeleteFirewallEndpointRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "networksecurity.googleapis.com/FirewallEndpoint" + } + }, + "requestId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "FirewallEndpointAssociation": { + "options": { + "(google.api.resource).type": "networksecurity.googleapis.com/FirewallEndpointAssociation", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/firewallEndpointAssociations/{firewall_endpoint_association}" + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "IDENTIFIER" + } + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "labels": { + "keyType": "string", + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "state": { + "type": "State", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "network": { + "type": "string", + "id": 6, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "firewallEndpoint": { + "type": "string", + "id": 7, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "tlsInspectionPolicy": { + "type": "string", + "id": 8, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "(google.api.resource_reference).type": "networksecurity.googleapis.com/TlsInspectionPolicy" + } + }, + "reconciling": { + "type": "bool", + "id": 9, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "disabled": { + "type": "bool", + "id": 10, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "State": { + "values": { + "STATE_UNSPECIFIED": 0, + "CREATING": 1, + "ACTIVE": 2, + "DELETING": 3, + "INACTIVE": 4, + "ORPHAN": 5 + } + } + } + }, + "ListFirewallEndpointAssociationsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "networksecurity.googleapis.com/FirewallEndpointAssociation" + } + }, + "pageSize": { + "type": "int32", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageToken": { + "type": "string", + "id": 3 + }, + "filter": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "orderBy": { + "type": "string", + "id": 5 + } + } + }, + "ListFirewallEndpointAssociationsResponse": { + "fields": { + "firewallEndpointAssociations": { + "rule": "repeated", + "type": "FirewallEndpointAssociation", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + }, + "unreachable": { + "rule": "repeated", + "type": "string", + "id": 3 + } + } + }, + "GetFirewallEndpointAssociationRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "networksecurity.googleapis.com/FirewallEndpointAssociation" + } + } + } + }, + "CreateFirewallEndpointAssociationRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "networksecurity.googleapis.com/FirewallEndpointAssociation" + } + }, + "firewallEndpointAssociationId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "firewallEndpointAssociation": { + "type": "FirewallEndpointAssociation", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "DeleteFirewallEndpointAssociationRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "networksecurity.googleapis.com/FirewallEndpointAssociation" + } + }, + "requestId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "UpdateFirewallEndpointAssociationRequest": { + "fields": { + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "firewallEndpointAssociation": { + "type": "FirewallEndpointAssociation", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "GatewaySecurityPolicy": { + "options": { + "(google.api.resource).type": "networksecurity.googleapis.com/GatewaySecurityPolicy", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/gatewaySecurityPolicies/{gateway_security_policy}" + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "description": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "tlsInspectionPolicy": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "(google.api.resource_reference).type": "networksecurity.googleapis.com/TlsInspectionPolicy" + } + } + } + }, + "CreateGatewaySecurityPolicyRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "networksecurity.googleapis.com/GatewaySecurityPolicy" + } + }, + "gatewaySecurityPolicyId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "gatewaySecurityPolicy": { + "type": "GatewaySecurityPolicy", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "ListGatewaySecurityPoliciesRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "locations.googleapis.com/Location" + } + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + } + } + }, + "ListGatewaySecurityPoliciesResponse": { + "fields": { + "gatewaySecurityPolicies": { + "rule": "repeated", + "type": "GatewaySecurityPolicy", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + }, + "unreachable": { + "rule": "repeated", + "type": "string", + "id": 3 + } + } + }, + "GetGatewaySecurityPolicyRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "networksecurity.googleapis.com/GatewaySecurityPolicy" + } + } + } + }, + "DeleteGatewaySecurityPolicyRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "networksecurity.googleapis.com/GatewaySecurityPolicy" + } + } + } + }, + "UpdateGatewaySecurityPolicyRequest": { + "fields": { + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "gatewaySecurityPolicy": { + "type": "GatewaySecurityPolicy", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "GatewaySecurityPolicyRule": { + "options": { + "(google.api.resource).type": "networksecurity.googleapis.com/GatewaySecurityPolicyRule", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/gatewaySecurityPolicies/{gateway_security_policy}/rules/{rule}" + }, + "oneofs": { + "profile": { + "oneof": [ + "basicProfile" + ] + } + }, + "fields": { + "basicProfile": { + "type": "BasicProfile", + "id": 9, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "IMMUTABLE" + } + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "enabled": { + "type": "bool", + "id": 4, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "priority": { + "type": "int32", + "id": 5, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "description": { + "type": "string", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "sessionMatcher": { + "type": "string", + "id": 7, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "applicationMatcher": { + "type": "string", + "id": 8, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "tlsInspectionEnabled": { + "type": "bool", + "id": 10, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "BasicProfile": { + "values": { + "BASIC_PROFILE_UNSPECIFIED": 0, + "ALLOW": 1, + "DENY": 2 + } + } + } + }, + "CreateGatewaySecurityPolicyRuleRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "networksecurity.googleapis.com/GatewaySecurityPolicyRule" + } + }, + "gatewaySecurityPolicyRule": { + "type": "GatewaySecurityPolicyRule", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "gatewaySecurityPolicyRuleId": { + "type": "string", + "id": 3 + } + } + }, + "GetGatewaySecurityPolicyRuleRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "networksecurity.googleapis.com/GatewaySecurityPolicyRule" + } + } + } + }, + "UpdateGatewaySecurityPolicyRuleRequest": { + "fields": { + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "gatewaySecurityPolicyRule": { + "type": "GatewaySecurityPolicyRule", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "ListGatewaySecurityPolicyRulesRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "networksecurity.googleapis.com/GatewaySecurityPolicy" + } + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + } + } + }, + "ListGatewaySecurityPolicyRulesResponse": { + "fields": { + "gatewaySecurityPolicyRules": { + "rule": "repeated", + "type": "GatewaySecurityPolicyRule", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + }, + "unreachable": { + "rule": "repeated", + "type": "string", + "id": 3 + } + } + }, + "DeleteGatewaySecurityPolicyRuleRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "networksecurity.googleapis.com/GatewaySecurityPolicyRule" + } + } + } + }, + "Intercept": { + "options": { + "(google.api.default_host)": "networksecurity.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform" + }, + "methods": { + "ListInterceptEndpointGroups": { + "requestType": "ListInterceptEndpointGroupsRequest", + "responseType": "ListInterceptEndpointGroupsResponse", + "options": { + "(google.api.http).get": "/v1/{parent=projects/*/locations/*}/interceptEndpointGroups", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=projects/*/locations/*}/interceptEndpointGroups" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "GetInterceptEndpointGroup": { + "requestType": "GetInterceptEndpointGroupRequest", + "responseType": "InterceptEndpointGroup", + "options": { + "(google.api.http).get": "/v1/{name=projects/*/locations/*/interceptEndpointGroups/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=projects/*/locations/*/interceptEndpointGroups/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "CreateInterceptEndpointGroup": { + "requestType": "CreateInterceptEndpointGroupRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1/{parent=projects/*/locations/*}/interceptEndpointGroups", + "(google.api.http).body": "intercept_endpoint_group", + "(google.api.method_signature)": "parent,intercept_endpoint_group,intercept_endpoint_group_id", + "(google.longrunning.operation_info).response_type": "InterceptEndpointGroup", + "(google.longrunning.operation_info).metadata_type": "google.cloud.networksecurity.v1.OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{parent=projects/*/locations/*}/interceptEndpointGroups", + "body": "intercept_endpoint_group" + } + }, + { + "(google.api.method_signature)": "parent,intercept_endpoint_group,intercept_endpoint_group_id" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "InterceptEndpointGroup", + "metadata_type": "google.cloud.networksecurity.v1.OperationMetadata" + } + } + ] + }, + "UpdateInterceptEndpointGroup": { + "requestType": "UpdateInterceptEndpointGroupRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).patch": "/v1/{intercept_endpoint_group.name=projects/*/locations/*/interceptEndpointGroups/*}", + "(google.api.http).body": "intercept_endpoint_group", + "(google.api.method_signature)": "intercept_endpoint_group,update_mask", + "(google.longrunning.operation_info).response_type": "InterceptEndpointGroup", + "(google.longrunning.operation_info).metadata_type": "google.cloud.networksecurity.v1.OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1/{intercept_endpoint_group.name=projects/*/locations/*/interceptEndpointGroups/*}", + "body": "intercept_endpoint_group" + } + }, + { + "(google.api.method_signature)": "intercept_endpoint_group,update_mask" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "InterceptEndpointGroup", + "metadata_type": "google.cloud.networksecurity.v1.OperationMetadata" + } + } + ] + }, + "DeleteInterceptEndpointGroup": { + "requestType": "DeleteInterceptEndpointGroupRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).delete": "/v1/{name=projects/*/locations/*/interceptEndpointGroups/*}", + "(google.api.method_signature)": "name", + "(google.longrunning.operation_info).response_type": "google.protobuf.Empty", + "(google.longrunning.operation_info).metadata_type": "google.cloud.networksecurity.v1.OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1/{name=projects/*/locations/*/interceptEndpointGroups/*}" + } + }, + { + "(google.api.method_signature)": "name" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "google.protobuf.Empty", + "metadata_type": "google.cloud.networksecurity.v1.OperationMetadata" + } + } + ] + }, + "ListInterceptEndpointGroupAssociations": { + "requestType": "ListInterceptEndpointGroupAssociationsRequest", + "responseType": "ListInterceptEndpointGroupAssociationsResponse", + "options": { + "(google.api.http).get": "/v1/{parent=projects/*/locations/*}/interceptEndpointGroupAssociations", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=projects/*/locations/*}/interceptEndpointGroupAssociations" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "GetInterceptEndpointGroupAssociation": { + "requestType": "GetInterceptEndpointGroupAssociationRequest", + "responseType": "InterceptEndpointGroupAssociation", + "options": { + "(google.api.http).get": "/v1/{name=projects/*/locations/*/interceptEndpointGroupAssociations/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=projects/*/locations/*/interceptEndpointGroupAssociations/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "CreateInterceptEndpointGroupAssociation": { + "requestType": "CreateInterceptEndpointGroupAssociationRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1/{parent=projects/*/locations/*}/interceptEndpointGroupAssociations", + "(google.api.http).body": "intercept_endpoint_group_association", + "(google.api.method_signature)": "parent,intercept_endpoint_group_association,intercept_endpoint_group_association_id", + "(google.longrunning.operation_info).response_type": "InterceptEndpointGroupAssociation", + "(google.longrunning.operation_info).metadata_type": "google.cloud.networksecurity.v1.OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{parent=projects/*/locations/*}/interceptEndpointGroupAssociations", + "body": "intercept_endpoint_group_association" + } + }, + { + "(google.api.method_signature)": "parent,intercept_endpoint_group_association,intercept_endpoint_group_association_id" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "InterceptEndpointGroupAssociation", + "metadata_type": "google.cloud.networksecurity.v1.OperationMetadata" + } + } + ] + }, + "UpdateInterceptEndpointGroupAssociation": { + "requestType": "UpdateInterceptEndpointGroupAssociationRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).patch": "/v1/{intercept_endpoint_group_association.name=projects/*/locations/*/interceptEndpointGroupAssociations/*}", + "(google.api.http).body": "intercept_endpoint_group_association", + "(google.api.method_signature)": "intercept_endpoint_group_association,update_mask", + "(google.longrunning.operation_info).response_type": "InterceptEndpointGroupAssociation", + "(google.longrunning.operation_info).metadata_type": "google.cloud.networksecurity.v1.OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1/{intercept_endpoint_group_association.name=projects/*/locations/*/interceptEndpointGroupAssociations/*}", + "body": "intercept_endpoint_group_association" + } + }, + { + "(google.api.method_signature)": "intercept_endpoint_group_association,update_mask" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "InterceptEndpointGroupAssociation", + "metadata_type": "google.cloud.networksecurity.v1.OperationMetadata" + } + } + ] + }, + "DeleteInterceptEndpointGroupAssociation": { + "requestType": "DeleteInterceptEndpointGroupAssociationRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).delete": "/v1/{name=projects/*/locations/*/interceptEndpointGroupAssociations/*}", + "(google.api.method_signature)": "name", + "(google.longrunning.operation_info).response_type": "google.protobuf.Empty", + "(google.longrunning.operation_info).metadata_type": "google.cloud.networksecurity.v1.OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1/{name=projects/*/locations/*/interceptEndpointGroupAssociations/*}" + } + }, + { + "(google.api.method_signature)": "name" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "google.protobuf.Empty", + "metadata_type": "google.cloud.networksecurity.v1.OperationMetadata" + } + } + ] + }, + "ListInterceptDeploymentGroups": { + "requestType": "ListInterceptDeploymentGroupsRequest", + "responseType": "ListInterceptDeploymentGroupsResponse", + "options": { + "(google.api.http).get": "/v1/{parent=projects/*/locations/*}/interceptDeploymentGroups", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=projects/*/locations/*}/interceptDeploymentGroups" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "GetInterceptDeploymentGroup": { + "requestType": "GetInterceptDeploymentGroupRequest", + "responseType": "InterceptDeploymentGroup", + "options": { + "(google.api.http).get": "/v1/{name=projects/*/locations/*/interceptDeploymentGroups/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=projects/*/locations/*/interceptDeploymentGroups/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "CreateInterceptDeploymentGroup": { + "requestType": "CreateInterceptDeploymentGroupRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1/{parent=projects/*/locations/*}/interceptDeploymentGroups", + "(google.api.http).body": "intercept_deployment_group", + "(google.api.method_signature)": "parent,intercept_deployment_group,intercept_deployment_group_id", + "(google.longrunning.operation_info).response_type": "InterceptDeploymentGroup", + "(google.longrunning.operation_info).metadata_type": "google.cloud.networksecurity.v1.OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{parent=projects/*/locations/*}/interceptDeploymentGroups", + "body": "intercept_deployment_group" + } + }, + { + "(google.api.method_signature)": "parent,intercept_deployment_group,intercept_deployment_group_id" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "InterceptDeploymentGroup", + "metadata_type": "google.cloud.networksecurity.v1.OperationMetadata" + } + } + ] + }, + "UpdateInterceptDeploymentGroup": { + "requestType": "UpdateInterceptDeploymentGroupRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).patch": "/v1/{intercept_deployment_group.name=projects/*/locations/*/interceptDeploymentGroups/*}", + "(google.api.http).body": "intercept_deployment_group", + "(google.api.method_signature)": "intercept_deployment_group,update_mask", + "(google.longrunning.operation_info).response_type": "InterceptDeploymentGroup", + "(google.longrunning.operation_info).metadata_type": "google.cloud.networksecurity.v1.OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1/{intercept_deployment_group.name=projects/*/locations/*/interceptDeploymentGroups/*}", + "body": "intercept_deployment_group" + } + }, + { + "(google.api.method_signature)": "intercept_deployment_group,update_mask" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "InterceptDeploymentGroup", + "metadata_type": "google.cloud.networksecurity.v1.OperationMetadata" + } + } + ] + }, + "DeleteInterceptDeploymentGroup": { + "requestType": "DeleteInterceptDeploymentGroupRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).delete": "/v1/{name=projects/*/locations/*/interceptDeploymentGroups/*}", + "(google.api.method_signature)": "name", + "(google.longrunning.operation_info).response_type": "google.protobuf.Empty", + "(google.longrunning.operation_info).metadata_type": "google.cloud.networksecurity.v1.OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1/{name=projects/*/locations/*/interceptDeploymentGroups/*}" + } + }, + { + "(google.api.method_signature)": "name" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "google.protobuf.Empty", + "metadata_type": "google.cloud.networksecurity.v1.OperationMetadata" + } + } + ] + }, + "ListInterceptDeployments": { + "requestType": "ListInterceptDeploymentsRequest", + "responseType": "ListInterceptDeploymentsResponse", + "options": { + "(google.api.http).get": "/v1/{parent=projects/*/locations/*}/interceptDeployments", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=projects/*/locations/*}/interceptDeployments" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "GetInterceptDeployment": { + "requestType": "GetInterceptDeploymentRequest", + "responseType": "InterceptDeployment", + "options": { + "(google.api.http).get": "/v1/{name=projects/*/locations/*/interceptDeployments/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=projects/*/locations/*/interceptDeployments/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "CreateInterceptDeployment": { + "requestType": "CreateInterceptDeploymentRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1/{parent=projects/*/locations/*}/interceptDeployments", + "(google.api.http).body": "intercept_deployment", + "(google.api.method_signature)": "parent,intercept_deployment,intercept_deployment_id", + "(google.longrunning.operation_info).response_type": "InterceptDeployment", + "(google.longrunning.operation_info).metadata_type": "google.cloud.networksecurity.v1.OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{parent=projects/*/locations/*}/interceptDeployments", + "body": "intercept_deployment" + } + }, + { + "(google.api.method_signature)": "parent,intercept_deployment,intercept_deployment_id" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "InterceptDeployment", + "metadata_type": "google.cloud.networksecurity.v1.OperationMetadata" + } + } + ] + }, + "UpdateInterceptDeployment": { + "requestType": "UpdateInterceptDeploymentRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).patch": "/v1/{intercept_deployment.name=projects/*/locations/*/interceptDeployments/*}", + "(google.api.http).body": "intercept_deployment", + "(google.api.method_signature)": "intercept_deployment,update_mask", + "(google.longrunning.operation_info).response_type": "InterceptDeployment", + "(google.longrunning.operation_info).metadata_type": "google.cloud.networksecurity.v1.OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1/{intercept_deployment.name=projects/*/locations/*/interceptDeployments/*}", + "body": "intercept_deployment" + } + }, + { + "(google.api.method_signature)": "intercept_deployment,update_mask" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "InterceptDeployment", + "metadata_type": "google.cloud.networksecurity.v1.OperationMetadata" + } + } + ] + }, + "DeleteInterceptDeployment": { + "requestType": "DeleteInterceptDeploymentRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).delete": "/v1/{name=projects/*/locations/*/interceptDeployments/*}", + "(google.api.method_signature)": "name", + "(google.longrunning.operation_info).response_type": "google.protobuf.Empty", + "(google.longrunning.operation_info).metadata_type": "google.cloud.networksecurity.v1.OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1/{name=projects/*/locations/*/interceptDeployments/*}" + } + }, + { + "(google.api.method_signature)": "name" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "google.protobuf.Empty", + "metadata_type": "google.cloud.networksecurity.v1.OperationMetadata" + } + } + ] + } + } + }, + "InterceptEndpointGroup": { + "options": { + "(google.api.resource).type": "networksecurity.googleapis.com/InterceptEndpointGroup", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/interceptEndpointGroups/{intercept_endpoint_group}", + "(google.api.resource).plural": "interceptEndpointGroups", + "(google.api.resource).singular": "interceptEndpointGroup" + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "IMMUTABLE" + } + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "labels": { + "keyType": "string", + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "interceptDeploymentGroup": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "IMMUTABLE", + "(google.api.resource_reference).type": "networksecurity.googleapis.com/InterceptDeploymentGroup" + } + }, + "connectedDeploymentGroup": { + "type": "ConnectedDeploymentGroup", + "id": 11, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "state": { + "type": "State", + "id": 7, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "reconciling": { + "type": "bool", + "id": 8, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "associations": { + "rule": "repeated", + "type": "AssociationDetails", + "id": 9, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "description": { + "type": "string", + "id": 10, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "ConnectedDeploymentGroup": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY", + "(google.api.resource_reference).type": "networksecurity.googleapis.com/InterceptDeploymentGroup" + } + }, + "locations": { + "rule": "repeated", + "type": "InterceptLocation", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "AssociationDetails": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY", + "(google.api.resource_reference).type": "networksecurity.googleapis.com/InterceptEndpointGroupAssociation" + } + }, + "network": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY", + "(google.api.resource_reference).type": "compute.googleapis.com/Network" + } + }, + "state": { + "type": "InterceptEndpointGroupAssociation.State", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "State": { + "values": { + "STATE_UNSPECIFIED": 0, + "ACTIVE": 1, + "CLOSED": 2, + "CREATING": 3, + "DELETING": 4, + "OUT_OF_SYNC": 5, + "DELETE_FAILED": 6 + } + } + } + }, + "ListInterceptEndpointGroupsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "networksecurity.googleapis.com/InterceptEndpointGroup" + } + }, + "pageSize": { + "type": "int32", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageToken": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "filter": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "orderBy": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListInterceptEndpointGroupsResponse": { + "fields": { + "interceptEndpointGroups": { + "rule": "repeated", + "type": "InterceptEndpointGroup", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "GetInterceptEndpointGroupRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "networksecurity.googleapis.com/InterceptEndpointGroup" + } + } + } + }, + "CreateInterceptEndpointGroupRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "networksecurity.googleapis.com/InterceptEndpointGroup" + } + }, + "interceptEndpointGroupId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "interceptEndpointGroup": { + "type": "InterceptEndpointGroup", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_info).format": "UUID4", + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "UpdateInterceptEndpointGroupRequest": { + "fields": { + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "interceptEndpointGroup": { + "type": "InterceptEndpointGroup", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_info).format": "UUID4", + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "DeleteInterceptEndpointGroupRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "networksecurity.googleapis.com/InterceptEndpointGroup" + } + }, + "requestId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_info).format": "UUID4", + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "InterceptEndpointGroupAssociation": { + "options": { + "(google.api.resource).type": "networksecurity.googleapis.com/InterceptEndpointGroupAssociation", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/interceptEndpointGroupAssociations/{intercept_endpoint_group_association}", + "(google.api.resource).plural": "interceptEndpointGroupAssociations", + "(google.api.resource).singular": "interceptEndpointGroupAssociation" + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "IMMUTABLE" + } + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "labels": { + "keyType": "string", + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "interceptEndpointGroup": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "IMMUTABLE", + "(google.api.resource_reference).type": "networksecurity.googleapis.com/InterceptEndpointGroup" + } + }, + "network": { + "type": "string", + "id": 6, + "options": { + "(google.api.field_behavior)": "IMMUTABLE", + "(google.api.resource_reference).type": "compute.googleapis.com/Network" + } + }, + "locationsDetails": { + "rule": "repeated", + "type": "LocationDetails", + "id": 7, + "options": { + "deprecated": true, + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "state": { + "type": "State", + "id": 8, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "reconciling": { + "type": "bool", + "id": 9, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "locations": { + "rule": "repeated", + "type": "InterceptLocation", + "id": 10, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "networkCookie": { + "type": "uint32", + "id": 12, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + }, + "nested": { + "LocationDetails": { + "fields": { + "location": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "state": { + "type": "State", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + }, + "nested": { + "State": { + "values": { + "STATE_UNSPECIFIED": 0, + "ACTIVE": 1, + "OUT_OF_SYNC": 2 + } + } + } + }, + "State": { + "values": { + "STATE_UNSPECIFIED": 0, + "ACTIVE": 1, + "CREATING": 2, + "DELETING": 3, + "CLOSED": 4, + "OUT_OF_SYNC": 5, + "DELETE_FAILED": 6 + } + } + } + }, + "ListInterceptEndpointGroupAssociationsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "networksecurity.googleapis.com/InterceptEndpointGroupAssociation" + } + }, + "pageSize": { + "type": "int32", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageToken": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "filter": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "orderBy": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListInterceptEndpointGroupAssociationsResponse": { + "fields": { + "interceptEndpointGroupAssociations": { + "rule": "repeated", + "type": "InterceptEndpointGroupAssociation", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "GetInterceptEndpointGroupAssociationRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "networksecurity.googleapis.com/InterceptEndpointGroupAssociation" + } + } + } + }, + "CreateInterceptEndpointGroupAssociationRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "networksecurity.googleapis.com/InterceptEndpointGroupAssociation" + } + }, + "interceptEndpointGroupAssociationId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "interceptEndpointGroupAssociation": { + "type": "InterceptEndpointGroupAssociation", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_info).format": "UUID4", + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "UpdateInterceptEndpointGroupAssociationRequest": { + "fields": { + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "interceptEndpointGroupAssociation": { + "type": "InterceptEndpointGroupAssociation", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_info).format": "UUID4", + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "DeleteInterceptEndpointGroupAssociationRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "networksecurity.googleapis.com/InterceptEndpointGroupAssociation" + } + }, + "requestId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_info).format": "UUID4", + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "InterceptDeploymentGroup": { + "options": { + "(google.api.resource).type": "networksecurity.googleapis.com/InterceptDeploymentGroup", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/interceptDeploymentGroups/{intercept_deployment_group}", + "(google.api.resource).plural": "interceptDeploymentGroups", + "(google.api.resource).singular": "interceptDeploymentGroup" + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "IMMUTABLE" + } + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "labels": { + "keyType": "string", + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "network": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "IMMUTABLE", + "(google.api.resource_reference).type": "compute.googleapis.com/Network" + } + }, + "connectedEndpointGroups": { + "rule": "repeated", + "type": "ConnectedEndpointGroup", + "id": 6, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "nestedDeployments": { + "rule": "repeated", + "type": "Deployment", + "id": 10, + "options": { + "deprecated": true, + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "state": { + "type": "State", + "id": 7, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "reconciling": { + "type": "bool", + "id": 8, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "description": { + "type": "string", + "id": 9, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "locations": { + "rule": "repeated", + "type": "InterceptLocation", + "id": 11, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + }, + "nested": { + "ConnectedEndpointGroup": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY", + "(google.api.resource_reference).type": "networksecurity.googleapis.com/InterceptEndpointGroup" + } + } + } + }, + "Deployment": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY", + "(google.api.resource_reference).type": "networksecurity.googleapis.com/InterceptDeployment" + } + }, + "state": { + "type": "InterceptDeployment.State", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "State": { + "values": { + "STATE_UNSPECIFIED": 0, + "ACTIVE": 1, + "CREATING": 2, + "DELETING": 3 + } + } + } + }, + "ListInterceptDeploymentGroupsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "networksecurity.googleapis.com/InterceptDeploymentGroup" + } + }, + "pageSize": { + "type": "int32", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageToken": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "filter": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "orderBy": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListInterceptDeploymentGroupsResponse": { + "fields": { + "interceptDeploymentGroups": { + "rule": "repeated", + "type": "InterceptDeploymentGroup", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "GetInterceptDeploymentGroupRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "networksecurity.googleapis.com/InterceptDeploymentGroup" + } + } + } + }, + "CreateInterceptDeploymentGroupRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "networksecurity.googleapis.com/InterceptDeploymentGroup" + } + }, + "interceptDeploymentGroupId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "interceptDeploymentGroup": { + "type": "InterceptDeploymentGroup", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_info).format": "UUID4", + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "UpdateInterceptDeploymentGroupRequest": { + "fields": { + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "interceptDeploymentGroup": { + "type": "InterceptDeploymentGroup", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_info).format": "UUID4", + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "DeleteInterceptDeploymentGroupRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "networksecurity.googleapis.com/InterceptDeploymentGroup" + } + }, + "requestId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_info).format": "UUID4", + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "InterceptDeployment": { + "options": { + "(google.api.resource).type": "networksecurity.googleapis.com/InterceptDeployment", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/interceptDeployments/{intercept_deployment}", + "(google.api.resource).plural": "interceptDeployments", + "(google.api.resource).singular": "interceptDeployment" + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "IMMUTABLE" + } + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "labels": { + "keyType": "string", + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "forwardingRule": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "IMMUTABLE", + "(google.api.resource_reference).type": "compute.googleapis.com/ForwardingRule" + } + }, + "interceptDeploymentGroup": { + "type": "string", + "id": 6, + "options": { + "(google.api.field_behavior)": "IMMUTABLE", + "(google.api.resource_reference).type": "networksecurity.googleapis.com/InterceptDeploymentGroup" + } + }, + "state": { + "type": "State", + "id": 7, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "reconciling": { + "type": "bool", + "id": 8, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "description": { + "type": "string", + "id": 9, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "State": { + "values": { + "STATE_UNSPECIFIED": 0, + "ACTIVE": 1, + "CREATING": 2, + "DELETING": 3, + "OUT_OF_SYNC": 4, + "DELETE_FAILED": 5 + } + } + } + }, + "ListInterceptDeploymentsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "networksecurity.googleapis.com/InterceptDeployment" + } + }, + "pageSize": { + "type": "int32", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageToken": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "filter": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "orderBy": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListInterceptDeploymentsResponse": { + "fields": { + "interceptDeployments": { + "rule": "repeated", + "type": "InterceptDeployment", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + }, + "unreachable": { + "rule": "repeated", + "type": "string", + "id": 3 + } + } + }, + "GetInterceptDeploymentRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "networksecurity.googleapis.com/InterceptDeployment" + } + } + } + }, + "CreateInterceptDeploymentRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "networksecurity.googleapis.com/InterceptDeployment" + } + }, + "interceptDeploymentId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "interceptDeployment": { + "type": "InterceptDeployment", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_info).format": "UUID4", + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "UpdateInterceptDeploymentRequest": { + "fields": { + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "interceptDeployment": { + "type": "InterceptDeployment", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_info).format": "UUID4", + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "DeleteInterceptDeploymentRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "networksecurity.googleapis.com/InterceptDeployment" + } + }, + "requestId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_info).format": "UUID4", + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "InterceptLocation": { + "fields": { + "location": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "state": { + "type": "State", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + }, + "nested": { + "State": { + "values": { + "STATE_UNSPECIFIED": 0, + "ACTIVE": 1, + "OUT_OF_SYNC": 2 + } + } + } + }, + "Mirroring": { + "options": { + "(google.api.default_host)": "networksecurity.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform" + }, + "methods": { + "ListMirroringEndpointGroups": { + "requestType": "ListMirroringEndpointGroupsRequest", + "responseType": "ListMirroringEndpointGroupsResponse", + "options": { + "(google.api.http).get": "/v1/{parent=projects/*/locations/*}/mirroringEndpointGroups", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=projects/*/locations/*}/mirroringEndpointGroups" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "GetMirroringEndpointGroup": { + "requestType": "GetMirroringEndpointGroupRequest", + "responseType": "MirroringEndpointGroup", + "options": { + "(google.api.http).get": "/v1/{name=projects/*/locations/*/mirroringEndpointGroups/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=projects/*/locations/*/mirroringEndpointGroups/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "CreateMirroringEndpointGroup": { + "requestType": "CreateMirroringEndpointGroupRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1/{parent=projects/*/locations/*}/mirroringEndpointGroups", + "(google.api.http).body": "mirroring_endpoint_group", + "(google.api.method_signature)": "parent,mirroring_endpoint_group,mirroring_endpoint_group_id", + "(google.longrunning.operation_info).response_type": "MirroringEndpointGroup", + "(google.longrunning.operation_info).metadata_type": "google.cloud.networksecurity.v1.OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{parent=projects/*/locations/*}/mirroringEndpointGroups", + "body": "mirroring_endpoint_group" + } + }, + { + "(google.api.method_signature)": "parent,mirroring_endpoint_group,mirroring_endpoint_group_id" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "MirroringEndpointGroup", + "metadata_type": "google.cloud.networksecurity.v1.OperationMetadata" + } + } + ] + }, + "UpdateMirroringEndpointGroup": { + "requestType": "UpdateMirroringEndpointGroupRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).patch": "/v1/{mirroring_endpoint_group.name=projects/*/locations/*/mirroringEndpointGroups/*}", + "(google.api.http).body": "mirroring_endpoint_group", + "(google.api.method_signature)": "mirroring_endpoint_group,update_mask", + "(google.longrunning.operation_info).response_type": "MirroringEndpointGroup", + "(google.longrunning.operation_info).metadata_type": "google.cloud.networksecurity.v1.OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1/{mirroring_endpoint_group.name=projects/*/locations/*/mirroringEndpointGroups/*}", + "body": "mirroring_endpoint_group" + } + }, + { + "(google.api.method_signature)": "mirroring_endpoint_group,update_mask" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "MirroringEndpointGroup", + "metadata_type": "google.cloud.networksecurity.v1.OperationMetadata" + } + } + ] + }, + "DeleteMirroringEndpointGroup": { + "requestType": "DeleteMirroringEndpointGroupRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).delete": "/v1/{name=projects/*/locations/*/mirroringEndpointGroups/*}", + "(google.api.method_signature)": "name", + "(google.longrunning.operation_info).response_type": "google.protobuf.Empty", + "(google.longrunning.operation_info).metadata_type": "google.cloud.networksecurity.v1.OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1/{name=projects/*/locations/*/mirroringEndpointGroups/*}" + } + }, + { + "(google.api.method_signature)": "name" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "google.protobuf.Empty", + "metadata_type": "google.cloud.networksecurity.v1.OperationMetadata" + } + } + ] + }, + "ListMirroringEndpointGroupAssociations": { + "requestType": "ListMirroringEndpointGroupAssociationsRequest", + "responseType": "ListMirroringEndpointGroupAssociationsResponse", + "options": { + "(google.api.http).get": "/v1/{parent=projects/*/locations/*}/mirroringEndpointGroupAssociations", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=projects/*/locations/*}/mirroringEndpointGroupAssociations" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "GetMirroringEndpointGroupAssociation": { + "requestType": "GetMirroringEndpointGroupAssociationRequest", + "responseType": "MirroringEndpointGroupAssociation", + "options": { + "(google.api.http).get": "/v1/{name=projects/*/locations/*/mirroringEndpointGroupAssociations/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=projects/*/locations/*/mirroringEndpointGroupAssociations/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "CreateMirroringEndpointGroupAssociation": { + "requestType": "CreateMirroringEndpointGroupAssociationRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1/{parent=projects/*/locations/*}/mirroringEndpointGroupAssociations", + "(google.api.http).body": "mirroring_endpoint_group_association", + "(google.api.method_signature)": "parent,mirroring_endpoint_group_association,mirroring_endpoint_group_association_id", + "(google.longrunning.operation_info).response_type": "MirroringEndpointGroupAssociation", + "(google.longrunning.operation_info).metadata_type": "google.cloud.networksecurity.v1.OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{parent=projects/*/locations/*}/mirroringEndpointGroupAssociations", + "body": "mirroring_endpoint_group_association" + } + }, + { + "(google.api.method_signature)": "parent,mirroring_endpoint_group_association,mirroring_endpoint_group_association_id" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "MirroringEndpointGroupAssociation", + "metadata_type": "google.cloud.networksecurity.v1.OperationMetadata" + } + } + ] + }, + "UpdateMirroringEndpointGroupAssociation": { + "requestType": "UpdateMirroringEndpointGroupAssociationRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).patch": "/v1/{mirroring_endpoint_group_association.name=projects/*/locations/*/mirroringEndpointGroupAssociations/*}", + "(google.api.http).body": "mirroring_endpoint_group_association", + "(google.api.method_signature)": "mirroring_endpoint_group_association,update_mask", + "(google.longrunning.operation_info).response_type": "MirroringEndpointGroupAssociation", + "(google.longrunning.operation_info).metadata_type": "google.cloud.networksecurity.v1.OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1/{mirroring_endpoint_group_association.name=projects/*/locations/*/mirroringEndpointGroupAssociations/*}", + "body": "mirroring_endpoint_group_association" + } + }, + { + "(google.api.method_signature)": "mirroring_endpoint_group_association,update_mask" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "MirroringEndpointGroupAssociation", + "metadata_type": "google.cloud.networksecurity.v1.OperationMetadata" + } + } + ] + }, + "DeleteMirroringEndpointGroupAssociation": { + "requestType": "DeleteMirroringEndpointGroupAssociationRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).delete": "/v1/{name=projects/*/locations/*/mirroringEndpointGroupAssociations/*}", + "(google.api.method_signature)": "name", + "(google.longrunning.operation_info).response_type": "google.protobuf.Empty", + "(google.longrunning.operation_info).metadata_type": "google.cloud.networksecurity.v1.OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1/{name=projects/*/locations/*/mirroringEndpointGroupAssociations/*}" + } + }, + { + "(google.api.method_signature)": "name" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "google.protobuf.Empty", + "metadata_type": "google.cloud.networksecurity.v1.OperationMetadata" + } + } + ] + }, + "ListMirroringDeploymentGroups": { + "requestType": "ListMirroringDeploymentGroupsRequest", + "responseType": "ListMirroringDeploymentGroupsResponse", + "options": { + "(google.api.http).get": "/v1/{parent=projects/*/locations/*}/mirroringDeploymentGroups", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=projects/*/locations/*}/mirroringDeploymentGroups" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "GetMirroringDeploymentGroup": { + "requestType": "GetMirroringDeploymentGroupRequest", + "responseType": "MirroringDeploymentGroup", + "options": { + "(google.api.http).get": "/v1/{name=projects/*/locations/*/mirroringDeploymentGroups/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=projects/*/locations/*/mirroringDeploymentGroups/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "CreateMirroringDeploymentGroup": { + "requestType": "CreateMirroringDeploymentGroupRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1/{parent=projects/*/locations/*}/mirroringDeploymentGroups", + "(google.api.http).body": "mirroring_deployment_group", + "(google.api.method_signature)": "parent,mirroring_deployment_group,mirroring_deployment_group_id", + "(google.longrunning.operation_info).response_type": "MirroringDeploymentGroup", + "(google.longrunning.operation_info).metadata_type": "google.cloud.networksecurity.v1.OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{parent=projects/*/locations/*}/mirroringDeploymentGroups", + "body": "mirroring_deployment_group" + } + }, + { + "(google.api.method_signature)": "parent,mirroring_deployment_group,mirroring_deployment_group_id" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "MirroringDeploymentGroup", + "metadata_type": "google.cloud.networksecurity.v1.OperationMetadata" + } + } + ] + }, + "UpdateMirroringDeploymentGroup": { + "requestType": "UpdateMirroringDeploymentGroupRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).patch": "/v1/{mirroring_deployment_group.name=projects/*/locations/*/mirroringDeploymentGroups/*}", + "(google.api.http).body": "mirroring_deployment_group", + "(google.api.method_signature)": "mirroring_deployment_group,update_mask", + "(google.longrunning.operation_info).response_type": "MirroringDeploymentGroup", + "(google.longrunning.operation_info).metadata_type": "google.cloud.networksecurity.v1.OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1/{mirroring_deployment_group.name=projects/*/locations/*/mirroringDeploymentGroups/*}", + "body": "mirroring_deployment_group" + } + }, + { + "(google.api.method_signature)": "mirroring_deployment_group,update_mask" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "MirroringDeploymentGroup", + "metadata_type": "google.cloud.networksecurity.v1.OperationMetadata" + } + } + ] + }, + "DeleteMirroringDeploymentGroup": { + "requestType": "DeleteMirroringDeploymentGroupRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).delete": "/v1/{name=projects/*/locations/*/mirroringDeploymentGroups/*}", + "(google.api.method_signature)": "name", + "(google.longrunning.operation_info).response_type": "google.protobuf.Empty", + "(google.longrunning.operation_info).metadata_type": "google.cloud.networksecurity.v1.OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1/{name=projects/*/locations/*/mirroringDeploymentGroups/*}" + } + }, + { + "(google.api.method_signature)": "name" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "google.protobuf.Empty", + "metadata_type": "google.cloud.networksecurity.v1.OperationMetadata" + } + } + ] + }, + "ListMirroringDeployments": { + "requestType": "ListMirroringDeploymentsRequest", + "responseType": "ListMirroringDeploymentsResponse", + "options": { + "(google.api.http).get": "/v1/{parent=projects/*/locations/*}/mirroringDeployments", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=projects/*/locations/*}/mirroringDeployments" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "GetMirroringDeployment": { + "requestType": "GetMirroringDeploymentRequest", + "responseType": "MirroringDeployment", + "options": { + "(google.api.http).get": "/v1/{name=projects/*/locations/*/mirroringDeployments/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=projects/*/locations/*/mirroringDeployments/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "CreateMirroringDeployment": { + "requestType": "CreateMirroringDeploymentRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1/{parent=projects/*/locations/*}/mirroringDeployments", + "(google.api.http).body": "mirroring_deployment", + "(google.api.method_signature)": "parent,mirroring_deployment,mirroring_deployment_id", + "(google.longrunning.operation_info).response_type": "MirroringDeployment", + "(google.longrunning.operation_info).metadata_type": "google.cloud.networksecurity.v1.OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{parent=projects/*/locations/*}/mirroringDeployments", + "body": "mirroring_deployment" + } + }, + { + "(google.api.method_signature)": "parent,mirroring_deployment,mirroring_deployment_id" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "MirroringDeployment", + "metadata_type": "google.cloud.networksecurity.v1.OperationMetadata" + } + } + ] + }, + "UpdateMirroringDeployment": { + "requestType": "UpdateMirroringDeploymentRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).patch": "/v1/{mirroring_deployment.name=projects/*/locations/*/mirroringDeployments/*}", + "(google.api.http).body": "mirroring_deployment", + "(google.api.method_signature)": "mirroring_deployment,update_mask", + "(google.longrunning.operation_info).response_type": "MirroringDeployment", + "(google.longrunning.operation_info).metadata_type": "google.cloud.networksecurity.v1.OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1/{mirroring_deployment.name=projects/*/locations/*/mirroringDeployments/*}", + "body": "mirroring_deployment" + } + }, + { + "(google.api.method_signature)": "mirroring_deployment,update_mask" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "MirroringDeployment", + "metadata_type": "google.cloud.networksecurity.v1.OperationMetadata" + } + } + ] + }, + "DeleteMirroringDeployment": { + "requestType": "DeleteMirroringDeploymentRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).delete": "/v1/{name=projects/*/locations/*/mirroringDeployments/*}", + "(google.api.method_signature)": "name", + "(google.longrunning.operation_info).response_type": "google.protobuf.Empty", + "(google.longrunning.operation_info).metadata_type": "google.cloud.networksecurity.v1.OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1/{name=projects/*/locations/*/mirroringDeployments/*}" + } + }, + { + "(google.api.method_signature)": "name" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "google.protobuf.Empty", + "metadata_type": "google.cloud.networksecurity.v1.OperationMetadata" + } + } + ] + } + } + }, + "MirroringEndpointGroup": { + "options": { + "(google.api.resource).type": "networksecurity.googleapis.com/MirroringEndpointGroup", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/mirroringEndpointGroups/{mirroring_endpoint_group}", + "(google.api.resource).plural": "mirroringEndpointGroups", + "(google.api.resource).singular": "mirroringEndpointGroup" + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "IMMUTABLE" + } + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "labels": { + "keyType": "string", + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "mirroringDeploymentGroup": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "IMMUTABLE", + "(google.api.resource_reference).type": "networksecurity.googleapis.com/MirroringDeploymentGroup" + } + }, + "connectedDeploymentGroups": { + "rule": "repeated", + "type": "ConnectedDeploymentGroup", + "id": 13, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "state": { + "type": "State", + "id": 7, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "reconciling": { + "type": "bool", + "id": 8, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "type": { + "type": "Type", + "id": 11, + "options": { + "(google.api.field_behavior)": "IMMUTABLE" + } + }, + "associations": { + "rule": "repeated", + "type": "AssociationDetails", + "id": 9, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "description": { + "type": "string", + "id": 10, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "ConnectedDeploymentGroup": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY", + "(google.api.resource_reference).type": "networksecurity.googleapis.com/MirroringDeploymentGroup" + } + }, + "locations": { + "rule": "repeated", + "type": "MirroringLocation", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "AssociationDetails": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY", + "(google.api.resource_reference).type": "networksecurity.googleapis.com/MirroringEndpointGroupAssociation" + } + }, + "network": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY", + "(google.api.resource_reference).type": "compute.googleapis.com/Network" + } + }, + "state": { + "type": "MirroringEndpointGroupAssociation.State", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "State": { + "values": { + "STATE_UNSPECIFIED": 0, + "ACTIVE": 1, + "CLOSED": 2, + "CREATING": 3, + "DELETING": 4, + "OUT_OF_SYNC": 5, + "DELETE_FAILED": 6 + } + }, + "Type": { + "values": { + "TYPE_UNSPECIFIED": 0, + "DIRECT": 1 + } + } + } + }, + "ListMirroringEndpointGroupsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "networksecurity.googleapis.com/MirroringEndpointGroup" + } + }, + "pageSize": { + "type": "int32", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageToken": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "filter": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "orderBy": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListMirroringEndpointGroupsResponse": { + "fields": { + "mirroringEndpointGroups": { + "rule": "repeated", + "type": "MirroringEndpointGroup", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "GetMirroringEndpointGroupRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "networksecurity.googleapis.com/MirroringEndpointGroup" + } + } + } + }, + "CreateMirroringEndpointGroupRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "networksecurity.googleapis.com/MirroringEndpointGroup" + } + }, + "mirroringEndpointGroupId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "mirroringEndpointGroup": { + "type": "MirroringEndpointGroup", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_info).format": "UUID4", + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "UpdateMirroringEndpointGroupRequest": { + "fields": { + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "mirroringEndpointGroup": { + "type": "MirroringEndpointGroup", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_info).format": "UUID4", + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "DeleteMirroringEndpointGroupRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "networksecurity.googleapis.com/MirroringEndpointGroup" + } + }, + "requestId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_info).format": "UUID4", + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "MirroringEndpointGroupAssociation": { + "options": { + "(google.api.resource).type": "networksecurity.googleapis.com/MirroringEndpointGroupAssociation", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/mirroringEndpointGroupAssociations/{mirroring_endpoint_group_association}", + "(google.api.resource).plural": "mirroringEndpointGroupAssociations", + "(google.api.resource).singular": "mirroringEndpointGroupAssociation" + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "IMMUTABLE" + } + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "labels": { + "keyType": "string", + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "mirroringEndpointGroup": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "IMMUTABLE", + "(google.api.resource_reference).type": "networksecurity.googleapis.com/MirroringEndpointGroup" + } + }, + "network": { + "type": "string", + "id": 6, + "options": { + "(google.api.field_behavior)": "IMMUTABLE", + "(google.api.resource_reference).type": "compute.googleapis.com/Network" + } + }, + "locationsDetails": { + "rule": "repeated", + "type": "LocationDetails", + "id": 7, + "options": { + "deprecated": true, + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "state": { + "type": "State", + "id": 8, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "reconciling": { + "type": "bool", + "id": 9, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "locations": { + "rule": "repeated", + "type": "MirroringLocation", + "id": 10, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + }, + "nested": { + "LocationDetails": { + "fields": { + "location": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "state": { + "type": "State", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + }, + "nested": { + "State": { + "values": { + "STATE_UNSPECIFIED": 0, + "ACTIVE": 1, + "OUT_OF_SYNC": 2 + } + } + } + }, + "State": { + "values": { + "STATE_UNSPECIFIED": 0, + "ACTIVE": 1, + "CREATING": 3, + "DELETING": 4, + "CLOSED": 5, + "OUT_OF_SYNC": 6, + "DELETE_FAILED": 7 + } + } + } + }, + "ListMirroringEndpointGroupAssociationsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "networksecurity.googleapis.com/MirroringEndpointGroupAssociation" + } + }, + "pageSize": { + "type": "int32", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageToken": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "filter": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "orderBy": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListMirroringEndpointGroupAssociationsResponse": { + "fields": { + "mirroringEndpointGroupAssociations": { + "rule": "repeated", + "type": "MirroringEndpointGroupAssociation", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "GetMirroringEndpointGroupAssociationRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "networksecurity.googleapis.com/MirroringEndpointGroupAssociation" + } + } + } + }, + "CreateMirroringEndpointGroupAssociationRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "networksecurity.googleapis.com/MirroringEndpointGroupAssociation" + } + }, + "mirroringEndpointGroupAssociationId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "mirroringEndpointGroupAssociation": { + "type": "MirroringEndpointGroupAssociation", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_info).format": "UUID4", + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "UpdateMirroringEndpointGroupAssociationRequest": { + "fields": { + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "mirroringEndpointGroupAssociation": { + "type": "MirroringEndpointGroupAssociation", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_info).format": "UUID4", + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "DeleteMirroringEndpointGroupAssociationRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "networksecurity.googleapis.com/MirroringEndpointGroupAssociation" + } + }, + "requestId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_info).format": "UUID4", + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "MirroringDeploymentGroup": { + "options": { + "(google.api.resource).type": "networksecurity.googleapis.com/MirroringDeploymentGroup", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/mirroringDeploymentGroups/{mirroring_deployment_group}", + "(google.api.resource).plural": "mirroringDeploymentGroups", + "(google.api.resource).singular": "mirroringDeploymentGroup" + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "IMMUTABLE" + } + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "labels": { + "keyType": "string", + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "network": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "IMMUTABLE", + "(google.api.resource_reference).type": "compute.googleapis.com/Network" + } + }, + "connectedEndpointGroups": { + "rule": "repeated", + "type": "ConnectedEndpointGroup", + "id": 6, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "nestedDeployments": { + "rule": "repeated", + "type": "Deployment", + "id": 10, + "options": { + "deprecated": true, + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "state": { + "type": "State", + "id": 7, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "reconciling": { + "type": "bool", + "id": 8, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "description": { + "type": "string", + "id": 9, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "locations": { + "rule": "repeated", + "type": "MirroringLocation", + "id": 11, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + }, + "nested": { + "ConnectedEndpointGroup": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY", + "(google.api.resource_reference).type": "networksecurity.googleapis.com/MirroringEndpointGroup" + } + } + } + }, + "Deployment": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY", + "(google.api.resource_reference).type": "networksecurity.googleapis.com/MirroringDeployment" + } + }, + "state": { + "type": "MirroringDeployment.State", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "State": { + "values": { + "STATE_UNSPECIFIED": 0, + "ACTIVE": 1, + "CREATING": 2, + "DELETING": 3, + "CLOSED": 4 + } + } + } + }, + "ListMirroringDeploymentGroupsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "networksecurity.googleapis.com/MirroringDeploymentGroup" + } + }, + "pageSize": { + "type": "int32", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageToken": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "filter": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "orderBy": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListMirroringDeploymentGroupsResponse": { + "fields": { + "mirroringDeploymentGroups": { + "rule": "repeated", + "type": "MirroringDeploymentGroup", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "GetMirroringDeploymentGroupRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "networksecurity.googleapis.com/MirroringDeploymentGroup" + } + } + } + }, + "CreateMirroringDeploymentGroupRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "networksecurity.googleapis.com/MirroringDeploymentGroup" + } + }, + "mirroringDeploymentGroupId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "mirroringDeploymentGroup": { + "type": "MirroringDeploymentGroup", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_info).format": "UUID4", + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "UpdateMirroringDeploymentGroupRequest": { + "fields": { + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "mirroringDeploymentGroup": { + "type": "MirroringDeploymentGroup", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_info).format": "UUID4", + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "DeleteMirroringDeploymentGroupRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "networksecurity.googleapis.com/MirroringDeploymentGroup" + } + }, + "requestId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_info).format": "UUID4", + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "MirroringDeployment": { + "options": { + "(google.api.resource).type": "networksecurity.googleapis.com/MirroringDeployment", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/mirroringDeployments/{mirroring_deployment}", + "(google.api.resource).plural": "mirroringDeployments", + "(google.api.resource).singular": "mirroringDeployment" + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "IMMUTABLE" + } + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "labels": { + "keyType": "string", + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "forwardingRule": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "IMMUTABLE", + "(google.api.resource_reference).type": "compute.googleapis.com/ForwardingRule" + } + }, + "mirroringDeploymentGroup": { + "type": "string", + "id": 6, + "options": { + "(google.api.field_behavior)": "IMMUTABLE", + "(google.api.resource_reference).type": "networksecurity.googleapis.com/MirroringDeploymentGroup" + } + }, + "state": { + "type": "State", + "id": 7, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "reconciling": { + "type": "bool", + "id": 8, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "description": { + "type": "string", + "id": 9, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "State": { + "values": { + "STATE_UNSPECIFIED": 0, + "ACTIVE": 1, + "CREATING": 2, + "DELETING": 3, + "OUT_OF_SYNC": 4, + "DELETE_FAILED": 5 + } + } + } + }, + "ListMirroringDeploymentsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "networksecurity.googleapis.com/MirroringDeployment" + } + }, + "pageSize": { + "type": "int32", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageToken": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "filter": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "orderBy": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListMirroringDeploymentsResponse": { + "fields": { + "mirroringDeployments": { + "rule": "repeated", + "type": "MirroringDeployment", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + }, + "unreachable": { + "rule": "repeated", + "type": "string", + "id": 3 + } + } + }, + "GetMirroringDeploymentRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "networksecurity.googleapis.com/MirroringDeployment" + } + } + } + }, + "CreateMirroringDeploymentRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "networksecurity.googleapis.com/MirroringDeployment" + } + }, + "mirroringDeploymentId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "mirroringDeployment": { + "type": "MirroringDeployment", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_info).format": "UUID4", + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "UpdateMirroringDeploymentRequest": { + "fields": { + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "mirroringDeployment": { + "type": "MirroringDeployment", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_info).format": "UUID4", + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "DeleteMirroringDeploymentRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "networksecurity.googleapis.com/MirroringDeployment" + } + }, + "requestId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_info).format": "UUID4", + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "MirroringLocation": { + "fields": { + "location": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "state": { + "type": "State", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + }, + "nested": { + "State": { + "values": { + "STATE_UNSPECIFIED": 0, + "ACTIVE": 1, + "OUT_OF_SYNC": 2 + } + } + } + }, + "NetworkSecurity": { + "options": { + "(google.api.default_host)": "networksecurity.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform" + }, + "methods": { + "ListAuthorizationPolicies": { + "requestType": "ListAuthorizationPoliciesRequest", + "responseType": "ListAuthorizationPoliciesResponse", + "options": { + "(google.api.http).get": "/v1/{parent=projects/*/locations/*}/authorizationPolicies", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=projects/*/locations/*}/authorizationPolicies" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "GetAuthorizationPolicy": { + "requestType": "GetAuthorizationPolicyRequest", + "responseType": "AuthorizationPolicy", + "options": { + "(google.api.http).get": "/v1/{name=projects/*/locations/*/authorizationPolicies/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=projects/*/locations/*/authorizationPolicies/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "CreateAuthorizationPolicy": { + "requestType": "CreateAuthorizationPolicyRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1/{parent=projects/*/locations/*}/authorizationPolicies", + "(google.api.http).body": "authorization_policy", + "(google.api.method_signature)": "parent,authorization_policy,authorization_policy_id", + "(google.longrunning.operation_info).response_type": "AuthorizationPolicy", + "(google.longrunning.operation_info).metadata_type": "google.cloud.networksecurity.v1.OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{parent=projects/*/locations/*}/authorizationPolicies", + "body": "authorization_policy" + } + }, + { + "(google.api.method_signature)": "parent,authorization_policy,authorization_policy_id" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "AuthorizationPolicy", + "metadata_type": "google.cloud.networksecurity.v1.OperationMetadata" + } + } + ] + }, + "UpdateAuthorizationPolicy": { + "requestType": "UpdateAuthorizationPolicyRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).patch": "/v1/{authorization_policy.name=projects/*/locations/*/authorizationPolicies/*}", + "(google.api.http).body": "authorization_policy", + "(google.api.method_signature)": "authorization_policy,update_mask", + "(google.longrunning.operation_info).response_type": "AuthorizationPolicy", + "(google.longrunning.operation_info).metadata_type": "google.cloud.networksecurity.v1.OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1/{authorization_policy.name=projects/*/locations/*/authorizationPolicies/*}", + "body": "authorization_policy" + } + }, + { + "(google.api.method_signature)": "authorization_policy,update_mask" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "AuthorizationPolicy", + "metadata_type": "google.cloud.networksecurity.v1.OperationMetadata" + } + } + ] + }, + "DeleteAuthorizationPolicy": { + "requestType": "DeleteAuthorizationPolicyRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).delete": "/v1/{name=projects/*/locations/*/authorizationPolicies/*}", + "(google.api.method_signature)": "name", + "(google.longrunning.operation_info).response_type": "google.protobuf.Empty", + "(google.longrunning.operation_info).metadata_type": "google.cloud.networksecurity.v1.OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1/{name=projects/*/locations/*/authorizationPolicies/*}" + } + }, + { + "(google.api.method_signature)": "name" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "google.protobuf.Empty", + "metadata_type": "google.cloud.networksecurity.v1.OperationMetadata" + } + } + ] + }, + "ListBackendAuthenticationConfigs": { + "requestType": "ListBackendAuthenticationConfigsRequest", + "responseType": "ListBackendAuthenticationConfigsResponse", + "options": { + "(google.api.http).get": "/v1/{parent=projects/*/locations/*}/backendAuthenticationConfigs", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=projects/*/locations/*}/backendAuthenticationConfigs" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "GetBackendAuthenticationConfig": { + "requestType": "GetBackendAuthenticationConfigRequest", + "responseType": "BackendAuthenticationConfig", + "options": { + "(google.api.http).get": "/v1/{name=projects/*/locations/*/backendAuthenticationConfigs/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=projects/*/locations/*/backendAuthenticationConfigs/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "CreateBackendAuthenticationConfig": { + "requestType": "CreateBackendAuthenticationConfigRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1/{parent=projects/*/locations/*}/backendAuthenticationConfigs", + "(google.api.http).body": "backend_authentication_config", + "(google.api.method_signature)": "parent,backend_authentication_config,backend_authentication_config_id", + "(google.longrunning.operation_info).response_type": "BackendAuthenticationConfig", + "(google.longrunning.operation_info).metadata_type": "google.cloud.networksecurity.v1.OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{parent=projects/*/locations/*}/backendAuthenticationConfigs", + "body": "backend_authentication_config" + } + }, + { + "(google.api.method_signature)": "parent,backend_authentication_config,backend_authentication_config_id" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "BackendAuthenticationConfig", + "metadata_type": "google.cloud.networksecurity.v1.OperationMetadata" + } + } + ] + }, + "UpdateBackendAuthenticationConfig": { + "requestType": "UpdateBackendAuthenticationConfigRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).patch": "/v1/{backend_authentication_config.name=projects/*/locations/*/backendAuthenticationConfigs/*}", + "(google.api.http).body": "backend_authentication_config", + "(google.api.method_signature)": "backend_authentication_config,update_mask", + "(google.longrunning.operation_info).response_type": "BackendAuthenticationConfig", + "(google.longrunning.operation_info).metadata_type": "google.cloud.networksecurity.v1.OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1/{backend_authentication_config.name=projects/*/locations/*/backendAuthenticationConfigs/*}", + "body": "backend_authentication_config" + } + }, + { + "(google.api.method_signature)": "backend_authentication_config,update_mask" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "BackendAuthenticationConfig", + "metadata_type": "google.cloud.networksecurity.v1.OperationMetadata" + } + } + ] + }, + "DeleteBackendAuthenticationConfig": { + "requestType": "DeleteBackendAuthenticationConfigRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).delete": "/v1/{name=projects/*/locations/*/backendAuthenticationConfigs/*}", + "(google.api.method_signature)": "name", + "(google.longrunning.operation_info).response_type": "google.protobuf.Empty", + "(google.longrunning.operation_info).metadata_type": "google.cloud.networksecurity.v1.OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1/{name=projects/*/locations/*/backendAuthenticationConfigs/*}" + } + }, + { + "(google.api.method_signature)": "name" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "google.protobuf.Empty", + "metadata_type": "google.cloud.networksecurity.v1.OperationMetadata" + } + } + ] + }, + "ListServerTlsPolicies": { + "requestType": "ListServerTlsPoliciesRequest", + "responseType": "ListServerTlsPoliciesResponse", + "options": { + "(google.api.http).get": "/v1/{parent=projects/*/locations/*}/serverTlsPolicies", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=projects/*/locations/*}/serverTlsPolicies" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "GetServerTlsPolicy": { + "requestType": "GetServerTlsPolicyRequest", + "responseType": "ServerTlsPolicy", + "options": { + "(google.api.http).get": "/v1/{name=projects/*/locations/*/serverTlsPolicies/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=projects/*/locations/*/serverTlsPolicies/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "CreateServerTlsPolicy": { + "requestType": "CreateServerTlsPolicyRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1/{parent=projects/*/locations/*}/serverTlsPolicies", + "(google.api.http).body": "server_tls_policy", + "(google.api.method_signature)": "parent,server_tls_policy,server_tls_policy_id", + "(google.longrunning.operation_info).response_type": "ServerTlsPolicy", + "(google.longrunning.operation_info).metadata_type": "google.cloud.networksecurity.v1.OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{parent=projects/*/locations/*}/serverTlsPolicies", + "body": "server_tls_policy" + } + }, + { + "(google.api.method_signature)": "parent,server_tls_policy,server_tls_policy_id" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "ServerTlsPolicy", + "metadata_type": "google.cloud.networksecurity.v1.OperationMetadata" + } + } + ] + }, + "UpdateServerTlsPolicy": { + "requestType": "UpdateServerTlsPolicyRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).patch": "/v1/{server_tls_policy.name=projects/*/locations/*/serverTlsPolicies/*}", + "(google.api.http).body": "server_tls_policy", + "(google.api.method_signature)": "server_tls_policy,update_mask", + "(google.longrunning.operation_info).response_type": "ServerTlsPolicy", + "(google.longrunning.operation_info).metadata_type": "google.cloud.networksecurity.v1.OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1/{server_tls_policy.name=projects/*/locations/*/serverTlsPolicies/*}", + "body": "server_tls_policy" + } + }, + { + "(google.api.method_signature)": "server_tls_policy,update_mask" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "ServerTlsPolicy", + "metadata_type": "google.cloud.networksecurity.v1.OperationMetadata" + } + } + ] + }, + "DeleteServerTlsPolicy": { + "requestType": "DeleteServerTlsPolicyRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).delete": "/v1/{name=projects/*/locations/*/serverTlsPolicies/*}", + "(google.api.method_signature)": "name", + "(google.longrunning.operation_info).response_type": "google.protobuf.Empty", + "(google.longrunning.operation_info).metadata_type": "google.cloud.networksecurity.v1.OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1/{name=projects/*/locations/*/serverTlsPolicies/*}" + } + }, + { + "(google.api.method_signature)": "name" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "google.protobuf.Empty", + "metadata_type": "google.cloud.networksecurity.v1.OperationMetadata" + } + } + ] + }, + "ListClientTlsPolicies": { + "requestType": "ListClientTlsPoliciesRequest", + "responseType": "ListClientTlsPoliciesResponse", + "options": { + "(google.api.http).get": "/v1/{parent=projects/*/locations/*}/clientTlsPolicies", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=projects/*/locations/*}/clientTlsPolicies" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "GetClientTlsPolicy": { + "requestType": "GetClientTlsPolicyRequest", + "responseType": "ClientTlsPolicy", + "options": { + "(google.api.http).get": "/v1/{name=projects/*/locations/*/clientTlsPolicies/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=projects/*/locations/*/clientTlsPolicies/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "CreateClientTlsPolicy": { + "requestType": "CreateClientTlsPolicyRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1/{parent=projects/*/locations/*}/clientTlsPolicies", + "(google.api.http).body": "client_tls_policy", + "(google.api.method_signature)": "parent,client_tls_policy,client_tls_policy_id", + "(google.longrunning.operation_info).response_type": "ClientTlsPolicy", + "(google.longrunning.operation_info).metadata_type": "google.cloud.networksecurity.v1.OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{parent=projects/*/locations/*}/clientTlsPolicies", + "body": "client_tls_policy" + } + }, + { + "(google.api.method_signature)": "parent,client_tls_policy,client_tls_policy_id" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "ClientTlsPolicy", + "metadata_type": "google.cloud.networksecurity.v1.OperationMetadata" + } + } + ] + }, + "UpdateClientTlsPolicy": { + "requestType": "UpdateClientTlsPolicyRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).patch": "/v1/{client_tls_policy.name=projects/*/locations/*/clientTlsPolicies/*}", + "(google.api.http).body": "client_tls_policy", + "(google.api.method_signature)": "client_tls_policy,update_mask", + "(google.longrunning.operation_info).response_type": "ClientTlsPolicy", + "(google.longrunning.operation_info).metadata_type": "google.cloud.networksecurity.v1.OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1/{client_tls_policy.name=projects/*/locations/*/clientTlsPolicies/*}", + "body": "client_tls_policy" + } + }, + { + "(google.api.method_signature)": "client_tls_policy,update_mask" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "ClientTlsPolicy", + "metadata_type": "google.cloud.networksecurity.v1.OperationMetadata" + } + } + ] + }, + "DeleteClientTlsPolicy": { + "requestType": "DeleteClientTlsPolicyRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).delete": "/v1/{name=projects/*/locations/*/clientTlsPolicies/*}", + "(google.api.method_signature)": "name", + "(google.longrunning.operation_info).response_type": "google.protobuf.Empty", + "(google.longrunning.operation_info).metadata_type": "google.cloud.networksecurity.v1.OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1/{name=projects/*/locations/*/clientTlsPolicies/*}" + } + }, + { + "(google.api.method_signature)": "name" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "google.protobuf.Empty", + "metadata_type": "google.cloud.networksecurity.v1.OperationMetadata" + } + } + ] + }, + "ListGatewaySecurityPolicies": { + "requestType": "ListGatewaySecurityPoliciesRequest", + "responseType": "ListGatewaySecurityPoliciesResponse", + "options": { + "(google.api.http).get": "/v1/{parent=projects/*/locations/*}/gatewaySecurityPolicies", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=projects/*/locations/*}/gatewaySecurityPolicies" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "GetGatewaySecurityPolicy": { + "requestType": "GetGatewaySecurityPolicyRequest", + "responseType": "GatewaySecurityPolicy", + "options": { + "(google.api.http).get": "/v1/{name=projects/*/locations/*/gatewaySecurityPolicies/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=projects/*/locations/*/gatewaySecurityPolicies/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "CreateGatewaySecurityPolicy": { + "requestType": "CreateGatewaySecurityPolicyRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1/{parent=projects/*/locations/*}/gatewaySecurityPolicies", + "(google.api.http).body": "gateway_security_policy", + "(google.api.method_signature)": "parent,gateway_security_policy,gateway_security_policy_id", + "(google.longrunning.operation_info).response_type": "GatewaySecurityPolicy", + "(google.longrunning.operation_info).metadata_type": "google.cloud.networksecurity.v1.OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{parent=projects/*/locations/*}/gatewaySecurityPolicies", + "body": "gateway_security_policy" + } + }, + { + "(google.api.method_signature)": "parent,gateway_security_policy,gateway_security_policy_id" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "GatewaySecurityPolicy", + "metadata_type": "google.cloud.networksecurity.v1.OperationMetadata" + } + } + ] + }, + "UpdateGatewaySecurityPolicy": { + "requestType": "UpdateGatewaySecurityPolicyRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).patch": "/v1/{gateway_security_policy.name=projects/*/locations/*/gatewaySecurityPolicies/*}", + "(google.api.http).body": "gateway_security_policy", + "(google.api.method_signature)": "gateway_security_policy,update_mask", + "(google.longrunning.operation_info).response_type": "GatewaySecurityPolicy", + "(google.longrunning.operation_info).metadata_type": "google.cloud.networksecurity.v1.OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1/{gateway_security_policy.name=projects/*/locations/*/gatewaySecurityPolicies/*}", + "body": "gateway_security_policy" + } + }, + { + "(google.api.method_signature)": "gateway_security_policy,update_mask" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "GatewaySecurityPolicy", + "metadata_type": "google.cloud.networksecurity.v1.OperationMetadata" + } + } + ] + }, + "DeleteGatewaySecurityPolicy": { + "requestType": "DeleteGatewaySecurityPolicyRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).delete": "/v1/{name=projects/*/locations/*/gatewaySecurityPolicies/*}", + "(google.api.method_signature)": "name", + "(google.longrunning.operation_info).response_type": "google.protobuf.Empty", + "(google.longrunning.operation_info).metadata_type": "google.cloud.networksecurity.v1.OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1/{name=projects/*/locations/*/gatewaySecurityPolicies/*}" + } + }, + { + "(google.api.method_signature)": "name" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "google.protobuf.Empty", + "metadata_type": "google.cloud.networksecurity.v1.OperationMetadata" + } + } + ] + }, + "ListGatewaySecurityPolicyRules": { + "requestType": "ListGatewaySecurityPolicyRulesRequest", + "responseType": "ListGatewaySecurityPolicyRulesResponse", + "options": { + "(google.api.http).get": "/v1/{parent=projects/*/locations/*/gatewaySecurityPolicies/*}/rules", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=projects/*/locations/*/gatewaySecurityPolicies/*}/rules" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "GetGatewaySecurityPolicyRule": { + "requestType": "GetGatewaySecurityPolicyRuleRequest", + "responseType": "GatewaySecurityPolicyRule", + "options": { + "(google.api.http).get": "/v1/{name=projects/*/locations/*/gatewaySecurityPolicies/*/rules/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=projects/*/locations/*/gatewaySecurityPolicies/*/rules/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "CreateGatewaySecurityPolicyRule": { + "requestType": "CreateGatewaySecurityPolicyRuleRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1/{parent=projects/*/locations/*/gatewaySecurityPolicies/*}/rules", + "(google.api.http).body": "gateway_security_policy_rule", + "(google.api.method_signature)": "parent,gateway_security_policy_rule,gateway_security_policy_rule_id", + "(google.longrunning.operation_info).response_type": "GatewaySecurityPolicyRule", + "(google.longrunning.operation_info).metadata_type": "google.cloud.networksecurity.v1.OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{parent=projects/*/locations/*/gatewaySecurityPolicies/*}/rules", + "body": "gateway_security_policy_rule" + } + }, + { + "(google.api.method_signature)": "parent,gateway_security_policy_rule,gateway_security_policy_rule_id" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "GatewaySecurityPolicyRule", + "metadata_type": "google.cloud.networksecurity.v1.OperationMetadata" + } + } + ] + }, + "UpdateGatewaySecurityPolicyRule": { + "requestType": "UpdateGatewaySecurityPolicyRuleRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).patch": "/v1/{gateway_security_policy_rule.name=projects/*/locations/*/gatewaySecurityPolicies/*/rules/*}", + "(google.api.http).body": "gateway_security_policy_rule", + "(google.api.method_signature)": "gateway_security_policy_rule,update_mask", + "(google.longrunning.operation_info).response_type": "GatewaySecurityPolicyRule", + "(google.longrunning.operation_info).metadata_type": "google.cloud.networksecurity.v1.OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1/{gateway_security_policy_rule.name=projects/*/locations/*/gatewaySecurityPolicies/*/rules/*}", + "body": "gateway_security_policy_rule" + } + }, + { + "(google.api.method_signature)": "gateway_security_policy_rule,update_mask" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "GatewaySecurityPolicyRule", + "metadata_type": "google.cloud.networksecurity.v1.OperationMetadata" + } + } + ] + }, + "DeleteGatewaySecurityPolicyRule": { + "requestType": "DeleteGatewaySecurityPolicyRuleRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).delete": "/v1/{name=projects/*/locations/*/gatewaySecurityPolicies/*/rules/*}", + "(google.api.method_signature)": "name", + "(google.longrunning.operation_info).response_type": "google.protobuf.Empty", + "(google.longrunning.operation_info).metadata_type": "google.cloud.networksecurity.v1.OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1/{name=projects/*/locations/*/gatewaySecurityPolicies/*/rules/*}" + } + }, + { + "(google.api.method_signature)": "name" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "google.protobuf.Empty", + "metadata_type": "google.cloud.networksecurity.v1.OperationMetadata" + } + } + ] + }, + "ListUrlLists": { + "requestType": "ListUrlListsRequest", + "responseType": "ListUrlListsResponse", + "options": { + "(google.api.http).get": "/v1/{parent=projects/*/locations/*}/urlLists", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=projects/*/locations/*}/urlLists" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "GetUrlList": { + "requestType": "GetUrlListRequest", + "responseType": "UrlList", + "options": { + "(google.api.http).get": "/v1/{name=projects/*/locations/*/urlLists/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=projects/*/locations/*/urlLists/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "CreateUrlList": { + "requestType": "CreateUrlListRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1/{parent=projects/*/locations/*}/urlLists", + "(google.api.http).body": "url_list", + "(google.api.method_signature)": "parent,url_list,url_list_id", + "(google.longrunning.operation_info).response_type": "UrlList", + "(google.longrunning.operation_info).metadata_type": "google.cloud.networksecurity.v1.OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{parent=projects/*/locations/*}/urlLists", + "body": "url_list" + } + }, + { + "(google.api.method_signature)": "parent,url_list,url_list_id" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "UrlList", + "metadata_type": "google.cloud.networksecurity.v1.OperationMetadata" + } + } + ] + }, + "UpdateUrlList": { + "requestType": "UpdateUrlListRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).patch": "/v1/{url_list.name=projects/*/locations/*/urlLists/*}", + "(google.api.http).body": "url_list", + "(google.api.method_signature)": "url_list,update_mask", + "(google.longrunning.operation_info).response_type": "UrlList", + "(google.longrunning.operation_info).metadata_type": "google.cloud.networksecurity.v1.OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1/{url_list.name=projects/*/locations/*/urlLists/*}", + "body": "url_list" + } + }, + { + "(google.api.method_signature)": "url_list,update_mask" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "UrlList", + "metadata_type": "google.cloud.networksecurity.v1.OperationMetadata" + } + } + ] + }, + "DeleteUrlList": { + "requestType": "DeleteUrlListRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).delete": "/v1/{name=projects/*/locations/*/urlLists/*}", + "(google.api.method_signature)": "name", + "(google.longrunning.operation_info).response_type": "google.protobuf.Empty", + "(google.longrunning.operation_info).metadata_type": "google.cloud.networksecurity.v1.OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1/{name=projects/*/locations/*/urlLists/*}" + } + }, + { + "(google.api.method_signature)": "name" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "google.protobuf.Empty", + "metadata_type": "google.cloud.networksecurity.v1.OperationMetadata" + } + } + ] + }, + "ListTlsInspectionPolicies": { + "requestType": "ListTlsInspectionPoliciesRequest", + "responseType": "ListTlsInspectionPoliciesResponse", + "options": { + "(google.api.http).get": "/v1/{parent=projects/*/locations/*}/tlsInspectionPolicies", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=projects/*/locations/*}/tlsInspectionPolicies" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "GetTlsInspectionPolicy": { + "requestType": "GetTlsInspectionPolicyRequest", + "responseType": "TlsInspectionPolicy", + "options": { + "(google.api.http).get": "/v1/{name=projects/*/locations/*/tlsInspectionPolicies/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=projects/*/locations/*/tlsInspectionPolicies/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "CreateTlsInspectionPolicy": { + "requestType": "CreateTlsInspectionPolicyRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1/{parent=projects/*/locations/*}/tlsInspectionPolicies", + "(google.api.http).body": "tls_inspection_policy", + "(google.api.method_signature)": "parent,tls_inspection_policy,tls_inspection_policy_id", + "(google.longrunning.operation_info).response_type": "TlsInspectionPolicy", + "(google.longrunning.operation_info).metadata_type": "google.cloud.networksecurity.v1.OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{parent=projects/*/locations/*}/tlsInspectionPolicies", + "body": "tls_inspection_policy" + } + }, + { + "(google.api.method_signature)": "parent,tls_inspection_policy,tls_inspection_policy_id" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "TlsInspectionPolicy", + "metadata_type": "google.cloud.networksecurity.v1.OperationMetadata" + } + } + ] + }, + "UpdateTlsInspectionPolicy": { + "requestType": "UpdateTlsInspectionPolicyRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).patch": "/v1/{tls_inspection_policy.name=projects/*/locations/*/tlsInspectionPolicies/*}", + "(google.api.http).body": "tls_inspection_policy", + "(google.api.method_signature)": "tls_inspection_policy,update_mask", + "(google.longrunning.operation_info).response_type": "TlsInspectionPolicy", + "(google.longrunning.operation_info).metadata_type": "google.cloud.networksecurity.v1.OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1/{tls_inspection_policy.name=projects/*/locations/*/tlsInspectionPolicies/*}", + "body": "tls_inspection_policy" + } + }, + { + "(google.api.method_signature)": "tls_inspection_policy,update_mask" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "TlsInspectionPolicy", + "metadata_type": "google.cloud.networksecurity.v1.OperationMetadata" + } + } + ] + }, + "DeleteTlsInspectionPolicy": { + "requestType": "DeleteTlsInspectionPolicyRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).delete": "/v1/{name=projects/*/locations/*/tlsInspectionPolicies/*}", + "(google.api.method_signature)": "name", + "(google.longrunning.operation_info).response_type": "google.protobuf.Empty", + "(google.longrunning.operation_info).metadata_type": "google.cloud.networksecurity.v1.OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1/{name=projects/*/locations/*/tlsInspectionPolicies/*}" + } + }, + { + "(google.api.method_signature)": "name" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "google.protobuf.Empty", + "metadata_type": "google.cloud.networksecurity.v1.OperationMetadata" + } + } + ] + }, + "ListAuthzPolicies": { + "requestType": "ListAuthzPoliciesRequest", + "responseType": "ListAuthzPoliciesResponse", + "options": { + "(google.api.http).get": "/v1/{parent=projects/*/locations/*}/authzPolicies", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=projects/*/locations/*}/authzPolicies" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "GetAuthzPolicy": { + "requestType": "GetAuthzPolicyRequest", + "responseType": "AuthzPolicy", + "options": { + "(google.api.http).get": "/v1/{name=projects/*/locations/*/authzPolicies/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=projects/*/locations/*/authzPolicies/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "CreateAuthzPolicy": { + "requestType": "CreateAuthzPolicyRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1/{parent=projects/*/locations/*}/authzPolicies", + "(google.api.http).body": "authz_policy", + "(google.api.method_signature)": "parent,authz_policy,authz_policy_id", + "(google.longrunning.operation_info).response_type": "AuthzPolicy", + "(google.longrunning.operation_info).metadata_type": "google.cloud.networksecurity.v1.OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{parent=projects/*/locations/*}/authzPolicies", + "body": "authz_policy" + } + }, + { + "(google.api.method_signature)": "parent,authz_policy,authz_policy_id" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "AuthzPolicy", + "metadata_type": "google.cloud.networksecurity.v1.OperationMetadata" + } + } + ] + }, + "UpdateAuthzPolicy": { + "requestType": "UpdateAuthzPolicyRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).patch": "/v1/{authz_policy.name=projects/*/locations/*/authzPolicies/*}", + "(google.api.http).body": "authz_policy", + "(google.api.method_signature)": "authz_policy,update_mask", + "(google.longrunning.operation_info).response_type": "AuthzPolicy", + "(google.longrunning.operation_info).metadata_type": "google.cloud.networksecurity.v1.OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1/{authz_policy.name=projects/*/locations/*/authzPolicies/*}", + "body": "authz_policy" + } + }, + { + "(google.api.method_signature)": "authz_policy,update_mask" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "AuthzPolicy", + "metadata_type": "google.cloud.networksecurity.v1.OperationMetadata" + } + } + ] + }, + "DeleteAuthzPolicy": { + "requestType": "DeleteAuthzPolicyRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).delete": "/v1/{name=projects/*/locations/*/authzPolicies/*}", + "(google.api.method_signature)": "name", + "(google.longrunning.operation_info).response_type": "google.protobuf.Empty", + "(google.longrunning.operation_info).metadata_type": "google.cloud.networksecurity.v1.OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1/{name=projects/*/locations/*/authzPolicies/*}" + } + }, + { + "(google.api.method_signature)": "name" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "google.protobuf.Empty", + "metadata_type": "google.cloud.networksecurity.v1.OperationMetadata" + } + } + ] + } + } + }, + "ServerTlsPolicy": { + "options": { + "(google.api.resource).type": "networksecurity.googleapis.com/ServerTlsPolicy", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/serverTlsPolicies/{server_tls_policy}" + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "description": { + "type": "string", + "id": 2 + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "labels": { + "keyType": "string", + "type": "string", + "id": 5 + }, + "allowOpen": { + "type": "bool", + "id": 6 + }, + "serverCertificate": { + "type": "CertificateProvider", + "id": 7 + }, + "mtlsPolicy": { + "type": "MTLSPolicy", + "id": 8 + } + }, + "nested": { + "MTLSPolicy": { + "fields": { + "clientValidationMode": { + "type": "ClientValidationMode", + "id": 2 + }, + "clientValidationCa": { + "rule": "repeated", + "type": "ValidationCA", + "id": 1 + }, + "clientValidationTrustConfig": { + "type": "string", + "id": 4, + "options": { + "(google.api.resource_reference).type": "certificatemanager.googleapis.com/TrustConfig" + } + } + }, + "nested": { + "ClientValidationMode": { + "values": { + "CLIENT_VALIDATION_MODE_UNSPECIFIED": 0, + "ALLOW_INVALID_OR_MISSING_CLIENT_CERT": 1, + "REJECT_INVALID": 2 + } + } + } + } + } + }, + "ListServerTlsPoliciesRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "locations.googleapis.com/Location" + } + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + }, + "returnPartialSuccess": { + "type": "bool", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListServerTlsPoliciesResponse": { + "fields": { + "serverTlsPolicies": { + "rule": "repeated", + "type": "ServerTlsPolicy", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + }, + "unreachable": { + "rule": "repeated", + "type": "string", + "id": 3 + } + } + }, + "GetServerTlsPolicyRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "networksecurity.googleapis.com/ServerTlsPolicy" + } + } + } + }, + "CreateServerTlsPolicyRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "networksecurity.googleapis.com/ServerTlsPolicy" + } + }, + "serverTlsPolicyId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "serverTlsPolicy": { + "type": "ServerTlsPolicy", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "UpdateServerTlsPolicyRequest": { + "fields": { + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "serverTlsPolicy": { + "type": "ServerTlsPolicy", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "DeleteServerTlsPolicyRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "networksecurity.googleapis.com/ServerTlsPolicy" + } + } + } + }, + "TlsInspectionPolicy": { + "options": { + "(google.api.resource).type": "networksecurity.googleapis.com/TlsInspectionPolicy", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/tlsInspectionPolicies/{tls_inspection_policy}" + }, "oneofs": { - "type": { + "_excludePublicCaSet": { "oneof": [ - "grpcEndpoint", - "certificateProviderInstance" + "excludePublicCaSet" ] } }, "fields": { - "grpcEndpoint": { - "type": "GrpcEndpoint", + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "description": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "caPool": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "privateca.googleapis.com/CaPool" + } + }, + "trustConfig": { + "type": "string", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "(google.api.resource_reference).type": "certificatemanager.googleapis.com/TrustConfig" + } + }, + "excludePublicCaSet": { + "type": "bool", + "id": 7, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + }, + "minTlsVersion": { + "type": "TlsVersion", + "id": 8, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "tlsFeatureProfile": { + "type": "Profile", + "id": 9, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "customTlsFeatures": { + "rule": "repeated", + "type": "string", + "id": 10, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "TlsVersion": { + "values": { + "TLS_VERSION_UNSPECIFIED": 0, + "TLS_1_0": 1, + "TLS_1_1": 2, + "TLS_1_2": 3, + "TLS_1_3": 4 + } + }, + "Profile": { + "values": { + "PROFILE_UNSPECIFIED": 0, + "PROFILE_COMPATIBLE": 1, + "PROFILE_MODERN": 2, + "PROFILE_RESTRICTED": 3, + "PROFILE_CUSTOM": 4 + } + } + } + }, + "CreateTlsInspectionPolicyRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "networksecurity.googleapis.com/TlsInspectionPolicy" + } + }, + "tlsInspectionPolicyId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "tlsInspectionPolicy": { + "type": "TlsInspectionPolicy", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "ListTlsInspectionPoliciesRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "locations.googleapis.com/Location" + } + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + } + } + }, + "ListTlsInspectionPoliciesResponse": { + "fields": { + "tlsInspectionPolicies": { + "rule": "repeated", + "type": "TlsInspectionPolicy", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + }, + "unreachable": { + "rule": "repeated", + "type": "string", + "id": 3 + } + } + }, + "GetTlsInspectionPolicyRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "networksecurity.googleapis.com/TlsInspectionPolicy" + } + } + } + }, + "DeleteTlsInspectionPolicyRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "networksecurity.googleapis.com/TlsInspectionPolicy" + } + }, + "force": { + "type": "bool", + "id": 2 + } + } + }, + "UpdateTlsInspectionPolicyRequest": { + "fields": { + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "tlsInspectionPolicy": { + "type": "TlsInspectionPolicy", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "UrlList": { + "options": { + "(google.api.resource).type": "networksecurity.googleapis.com/UrlList", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/urlLists/{url_list}" + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "description": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "values": { + "rule": "repeated", + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "ListUrlListsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "locations.googleapis.com/Location" + } + }, + "pageSize": { + "type": "int32", "id": 2 }, - "certificateProviderInstance": { - "type": "CertificateProviderInstance", + "pageToken": { + "type": "string", + "id": 3 + } + } + }, + "ListUrlListsResponse": { + "fields": { + "urlLists": { + "rule": "repeated", + "type": "UrlList", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + }, + "unreachable": { + "rule": "repeated", + "type": "string", "id": 3 } - } - }, - "OperationMetadata": { + } + }, + "GetUrlListRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "networksecurity.googleapis.com/UrlList" + } + } + } + }, + "CreateUrlListRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "networksecurity.googleapis.com/UrlList" + } + }, + "urlListId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "urlList": { + "type": "UrlList", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "UpdateUrlListRequest": { + "fields": { + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "urlList": { + "type": "UrlList", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "DeleteUrlListRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "networksecurity.googleapis.com/UrlList" + } + } + } + }, + "SecurityProfileGroup": { + "options": { + "(google.api.resource).type": "networksecurity.googleapis.com/SecurityProfileGroup", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/securityProfileGroups/{security_profile_group}" + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "IDENTIFIER" + } + }, + "description": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "etag": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "dataPathId": { + "type": "uint64", + "id": 12, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "labels": { + "keyType": "string", + "type": "string", + "id": 7, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "threatPreventionProfile": { + "type": "string", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "(google.api.resource_reference).type": "networksecurity.googleapis.com/SecurityProfile" + } + }, + "customMirroringProfile": { + "type": "string", + "id": 8, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "(google.api.resource_reference).type": "networksecurity.googleapis.com/SecurityProfile" + } + }, + "customInterceptProfile": { + "type": "string", + "id": 9, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "(google.api.resource_reference).type": "networksecurity.googleapis.com/SecurityProfile" + } + }, + "urlFilteringProfile": { + "type": "string", + "id": 11, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "(google.api.resource_reference).type": "networksecurity.googleapis.com/SecurityProfile" + } + } + } + }, + "SecurityProfile": { + "options": { + "(google.api.resource).type": "networksecurity.googleapis.com/SecurityProfile", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/securityProfiles/{security_profile}" + }, + "oneofs": { + "profile": { + "oneof": [ + "threatPreventionProfile", + "customMirroringProfile", + "customInterceptProfile", + "urlFilteringProfile" + ] + } + }, "fields": { + "threatPreventionProfile": { + "type": "ThreatPreventionProfile", + "id": 7 + }, + "customMirroringProfile": { + "type": "CustomMirroringProfile", + "id": 9 + }, + "customInterceptProfile": { + "type": "CustomInterceptProfile", + "id": 10 + }, + "urlFilteringProfile": { + "type": "UrlFilteringProfile", + "id": 12 + }, + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "IDENTIFIER" + } + }, + "description": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, "createTime": { "type": "google.protobuf.Timestamp", - "id": 1, + "id": 3, "options": { "(google.api.field_behavior)": "OUTPUT_ONLY" } }, - "endTime": { + "updateTime": { "type": "google.protobuf.Timestamp", - "id": 2, + "id": 4, "options": { "(google.api.field_behavior)": "OUTPUT_ONLY" } }, - "target": { + "etag": { "type": "string", - "id": 3, + "id": 5, "options": { "(google.api.field_behavior)": "OUTPUT_ONLY" } }, - "verb": { + "labels": { + "keyType": "string", + "type": "string", + "id": 8, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "type": { + "type": "ProfileType", + "id": 6, + "options": { + "(google.api.field_behavior)": "IMMUTABLE" + } + } + }, + "nested": { + "ProfileType": { + "values": { + "PROFILE_TYPE_UNSPECIFIED": 0, + "THREAT_PREVENTION": 1, + "CUSTOM_MIRRORING": 2, + "CUSTOM_INTERCEPT": 3, + "URL_FILTERING": 5 + } + } + } + }, + "CustomInterceptProfile": { + "fields": { + "interceptEndpointGroup": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "networksecurity.googleapis.com/InterceptEndpointGroup" + } + } + } + }, + "CustomMirroringProfile": { + "fields": { + "mirroringEndpointGroup": { "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "IMMUTABLE", + "(google.api.resource_reference).type": "networksecurity.googleapis.com/MirroringEndpointGroup" + } + } + } + }, + "Severity": { + "values": { + "SEVERITY_UNSPECIFIED": 0, + "INFORMATIONAL": 1, + "LOW": 2, + "MEDIUM": 3, + "HIGH": 4, + "CRITICAL": 5 + } + }, + "ThreatType": { + "values": { + "THREAT_TYPE_UNSPECIFIED": 0, + "UNKNOWN": 1, + "VULNERABILITY": 2, + "ANTIVIRUS": 3, + "SPYWARE": 4, + "DNS": 5 + } + }, + "ThreatAction": { + "values": { + "THREAT_ACTION_UNSPECIFIED": 0, + "DEFAULT_ACTION": 4, + "ALLOW": 1, + "ALERT": 2, + "DENY": 3 + } + }, + "Protocol": { + "values": { + "PROTOCOL_UNSPECIFIED": 0, + "SMTP": 1, + "SMB": 2, + "POP3": 3, + "IMAP": 4, + "HTTP2": 5, + "HTTP": 6, + "FTP": 7 + } + }, + "ThreatPreventionProfile": { + "fields": { + "severityOverrides": { + "rule": "repeated", + "type": "SeverityOverride", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "threatOverrides": { + "rule": "repeated", + "type": "ThreatOverride", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "antivirusOverrides": { + "rule": "repeated", + "type": "AntivirusOverride", "id": 4, "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "SeverityOverride": { + "fields": { + "severity": { + "type": "Severity", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" } }, - "statusMessage": { + "action": { + "type": "ThreatAction", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "ThreatOverride": { + "fields": { + "threatId": { "type": "string", - "id": 5, + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "type": { + "type": "ThreatType", + "id": 2, "options": { "(google.api.field_behavior)": "OUTPUT_ONLY" } }, - "requestedCancellation": { - "type": "bool", - "id": 6, + "action": { + "type": "ThreatAction", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "AntivirusOverride": { + "fields": { + "protocol": { + "type": "Protocol", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "action": { + "type": "ThreatAction", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "UrlFilteringProfile": { + "fields": { + "urlFilters": { + "rule": "repeated", + "type": "UrlFilter", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "UrlFilter": { + "oneofs": { + "_priority": { + "oneof": [ + "priority" + ] + } + }, + "fields": { + "filteringAction": { + "type": "UrlFilteringAction", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "urls": { + "rule": "repeated", + "type": "string", + "id": 2, "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" + "(google.api.field_behavior)": "REQUIRED" } }, - "apiVersion": { - "type": "string", - "id": 7, + "priority": { + "type": "int32", + "id": 3, "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" + "(google.api.field_behavior)": "REQUIRED", + "proto3_optional": true + } + } + }, + "nested": { + "UrlFilteringAction": { + "values": { + "URL_FILTERING_ACTION_UNSPECIFIED": 0, + "ALLOW": 1, + "DENY": 2 } } } }, - "NetworkSecurity": { + "OrganizationSecurityProfileGroupService": { "options": { "(google.api.default_host)": "networksecurity.googleapis.com", "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform" }, "methods": { - "ListAuthorizationPolicies": { - "requestType": "ListAuthorizationPoliciesRequest", - "responseType": "ListAuthorizationPoliciesResponse", - "options": { - "(google.api.http).get": "/v1/{parent=projects/*/locations/*}/authorizationPolicies", - "(google.api.method_signature)": "parent" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v1/{parent=projects/*/locations/*}/authorizationPolicies" - } - }, - { - "(google.api.method_signature)": "parent" - } - ] - }, - "GetAuthorizationPolicy": { - "requestType": "GetAuthorizationPolicyRequest", - "responseType": "AuthorizationPolicy", - "options": { - "(google.api.http).get": "/v1/{name=projects/*/locations/*/authorizationPolicies/*}", - "(google.api.method_signature)": "name" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v1/{name=projects/*/locations/*/authorizationPolicies/*}" - } - }, - { - "(google.api.method_signature)": "name" - } - ] - }, - "CreateAuthorizationPolicy": { - "requestType": "CreateAuthorizationPolicyRequest", - "responseType": "google.longrunning.Operation", - "options": { - "(google.api.http).post": "/v1/{parent=projects/*/locations/*}/authorizationPolicies", - "(google.api.http).body": "authorization_policy", - "(google.api.method_signature)": "parent,authorization_policy,authorization_policy_id", - "(google.longrunning.operation_info).response_type": "AuthorizationPolicy", - "(google.longrunning.operation_info).metadata_type": "google.cloud.networksecurity.v1.OperationMetadata" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1/{parent=projects/*/locations/*}/authorizationPolicies", - "body": "authorization_policy" - } - }, - { - "(google.api.method_signature)": "parent,authorization_policy,authorization_policy_id" - }, - { - "(google.longrunning.operation_info)": { - "response_type": "AuthorizationPolicy", - "metadata_type": "google.cloud.networksecurity.v1.OperationMetadata" - } - } - ] - }, - "UpdateAuthorizationPolicy": { - "requestType": "UpdateAuthorizationPolicyRequest", - "responseType": "google.longrunning.Operation", - "options": { - "(google.api.http).patch": "/v1/{authorization_policy.name=projects/*/locations/*/authorizationPolicies/*}", - "(google.api.http).body": "authorization_policy", - "(google.api.method_signature)": "authorization_policy,update_mask", - "(google.longrunning.operation_info).response_type": "AuthorizationPolicy", - "(google.longrunning.operation_info).metadata_type": "google.cloud.networksecurity.v1.OperationMetadata" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "patch": "/v1/{authorization_policy.name=projects/*/locations/*/authorizationPolicies/*}", - "body": "authorization_policy" - } - }, - { - "(google.api.method_signature)": "authorization_policy,update_mask" - }, - { - "(google.longrunning.operation_info)": { - "response_type": "AuthorizationPolicy", - "metadata_type": "google.cloud.networksecurity.v1.OperationMetadata" - } - } - ] - }, - "DeleteAuthorizationPolicy": { - "requestType": "DeleteAuthorizationPolicyRequest", - "responseType": "google.longrunning.Operation", - "options": { - "(google.api.http).delete": "/v1/{name=projects/*/locations/*/authorizationPolicies/*}", - "(google.api.method_signature)": "name", - "(google.longrunning.operation_info).response_type": "google.protobuf.Empty", - "(google.longrunning.operation_info).metadata_type": "google.cloud.networksecurity.v1.OperationMetadata" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "delete": "/v1/{name=projects/*/locations/*/authorizationPolicies/*}" - } - }, - { - "(google.api.method_signature)": "name" - }, - { - "(google.longrunning.operation_info)": { - "response_type": "google.protobuf.Empty", - "metadata_type": "google.cloud.networksecurity.v1.OperationMetadata" - } - } - ] - }, - "ListServerTlsPolicies": { - "requestType": "ListServerTlsPoliciesRequest", - "responseType": "ListServerTlsPoliciesResponse", + "ListSecurityProfileGroups": { + "requestType": "ListSecurityProfileGroupsRequest", + "responseType": "ListSecurityProfileGroupsResponse", "options": { - "(google.api.http).get": "/v1/{parent=projects/*/locations/*}/serverTlsPolicies", + "(google.api.http).get": "/v1/{parent=organizations/*/locations/*}/securityProfileGroups", "(google.api.method_signature)": "parent" }, "parsedOptions": [ { "(google.api.http)": { - "get": "/v1/{parent=projects/*/locations/*}/serverTlsPolicies" + "get": "/v1/{parent=organizations/*/locations/*}/securityProfileGroups" } }, { @@ -1535,17 +8869,17 @@ } ] }, - "GetServerTlsPolicy": { - "requestType": "GetServerTlsPolicyRequest", - "responseType": "ServerTlsPolicy", + "GetSecurityProfileGroup": { + "requestType": "GetSecurityProfileGroupRequest", + "responseType": "SecurityProfileGroup", "options": { - "(google.api.http).get": "/v1/{name=projects/*/locations/*/serverTlsPolicies/*}", + "(google.api.http).get": "/v1/{name=organizations/*/locations/*/securityProfileGroups/*}", "(google.api.method_signature)": "name" }, "parsedOptions": [ { "(google.api.http)": { - "get": "/v1/{name=projects/*/locations/*/serverTlsPolicies/*}" + "get": "/v1/{name=organizations/*/locations/*/securityProfileGroups/*}" } }, { @@ -1553,67 +8887,67 @@ } ] }, - "CreateServerTlsPolicy": { - "requestType": "CreateServerTlsPolicyRequest", + "CreateSecurityProfileGroup": { + "requestType": "CreateSecurityProfileGroupRequest", "responseType": "google.longrunning.Operation", "options": { - "(google.api.http).post": "/v1/{parent=projects/*/locations/*}/serverTlsPolicies", - "(google.api.http).body": "server_tls_policy", - "(google.api.method_signature)": "parent,server_tls_policy,server_tls_policy_id", - "(google.longrunning.operation_info).response_type": "ServerTlsPolicy", + "(google.api.http).post": "/v1/{parent=organizations/*/locations/*}/securityProfileGroups", + "(google.api.http).body": "security_profile_group", + "(google.api.method_signature)": "parent,security_profile_group,security_profile_group_id", + "(google.longrunning.operation_info).response_type": "SecurityProfileGroup", "(google.longrunning.operation_info).metadata_type": "google.cloud.networksecurity.v1.OperationMetadata" }, "parsedOptions": [ { "(google.api.http)": { - "post": "/v1/{parent=projects/*/locations/*}/serverTlsPolicies", - "body": "server_tls_policy" + "post": "/v1/{parent=organizations/*/locations/*}/securityProfileGroups", + "body": "security_profile_group" } }, { - "(google.api.method_signature)": "parent,server_tls_policy,server_tls_policy_id" + "(google.api.method_signature)": "parent,security_profile_group,security_profile_group_id" }, { "(google.longrunning.operation_info)": { - "response_type": "ServerTlsPolicy", + "response_type": "SecurityProfileGroup", "metadata_type": "google.cloud.networksecurity.v1.OperationMetadata" } } ] }, - "UpdateServerTlsPolicy": { - "requestType": "UpdateServerTlsPolicyRequest", + "UpdateSecurityProfileGroup": { + "requestType": "UpdateSecurityProfileGroupRequest", "responseType": "google.longrunning.Operation", "options": { - "(google.api.http).patch": "/v1/{server_tls_policy.name=projects/*/locations/*/serverTlsPolicies/*}", - "(google.api.http).body": "server_tls_policy", - "(google.api.method_signature)": "server_tls_policy,update_mask", - "(google.longrunning.operation_info).response_type": "ServerTlsPolicy", + "(google.api.http).patch": "/v1/{security_profile_group.name=organizations/*/locations/*/securityProfileGroups/*}", + "(google.api.http).body": "security_profile_group", + "(google.api.method_signature)": "security_profile_group,update_mask", + "(google.longrunning.operation_info).response_type": "SecurityProfileGroup", "(google.longrunning.operation_info).metadata_type": "google.cloud.networksecurity.v1.OperationMetadata" }, "parsedOptions": [ { "(google.api.http)": { - "patch": "/v1/{server_tls_policy.name=projects/*/locations/*/serverTlsPolicies/*}", - "body": "server_tls_policy" + "patch": "/v1/{security_profile_group.name=organizations/*/locations/*/securityProfileGroups/*}", + "body": "security_profile_group" } }, { - "(google.api.method_signature)": "server_tls_policy,update_mask" + "(google.api.method_signature)": "security_profile_group,update_mask" }, { "(google.longrunning.operation_info)": { - "response_type": "ServerTlsPolicy", + "response_type": "SecurityProfileGroup", "metadata_type": "google.cloud.networksecurity.v1.OperationMetadata" } } ] }, - "DeleteServerTlsPolicy": { - "requestType": "DeleteServerTlsPolicyRequest", + "DeleteSecurityProfileGroup": { + "requestType": "DeleteSecurityProfileGroupRequest", "responseType": "google.longrunning.Operation", "options": { - "(google.api.http).delete": "/v1/{name=projects/*/locations/*/serverTlsPolicies/*}", + "(google.api.http).delete": "/v1/{name=organizations/*/locations/*/securityProfileGroups/*}", "(google.api.method_signature)": "name", "(google.longrunning.operation_info).response_type": "google.protobuf.Empty", "(google.longrunning.operation_info).metadata_type": "google.cloud.networksecurity.v1.OperationMetadata" @@ -1621,7 +8955,7 @@ "parsedOptions": [ { "(google.api.http)": { - "delete": "/v1/{name=projects/*/locations/*/serverTlsPolicies/*}" + "delete": "/v1/{name=organizations/*/locations/*/securityProfileGroups/*}" } }, { @@ -1635,17 +8969,17 @@ } ] }, - "ListClientTlsPolicies": { - "requestType": "ListClientTlsPoliciesRequest", - "responseType": "ListClientTlsPoliciesResponse", + "ListSecurityProfiles": { + "requestType": "ListSecurityProfilesRequest", + "responseType": "ListSecurityProfilesResponse", "options": { - "(google.api.http).get": "/v1/{parent=projects/*/locations/*}/clientTlsPolicies", + "(google.api.http).get": "/v1/{parent=organizations/*/locations/*}/securityProfiles", "(google.api.method_signature)": "parent" }, "parsedOptions": [ { "(google.api.http)": { - "get": "/v1/{parent=projects/*/locations/*}/clientTlsPolicies" + "get": "/v1/{parent=organizations/*/locations/*}/securityProfiles" } }, { @@ -1653,17 +8987,17 @@ } ] }, - "GetClientTlsPolicy": { - "requestType": "GetClientTlsPolicyRequest", - "responseType": "ClientTlsPolicy", + "GetSecurityProfile": { + "requestType": "GetSecurityProfileRequest", + "responseType": "SecurityProfile", "options": { - "(google.api.http).get": "/v1/{name=projects/*/locations/*/clientTlsPolicies/*}", + "(google.api.http).get": "/v1/{name=organizations/*/locations/*/securityProfiles/*}", "(google.api.method_signature)": "name" }, "parsedOptions": [ { "(google.api.http)": { - "get": "/v1/{name=projects/*/locations/*/clientTlsPolicies/*}" + "get": "/v1/{name=organizations/*/locations/*/securityProfiles/*}" } }, { @@ -1671,67 +9005,67 @@ } ] }, - "CreateClientTlsPolicy": { - "requestType": "CreateClientTlsPolicyRequest", + "CreateSecurityProfile": { + "requestType": "CreateSecurityProfileRequest", "responseType": "google.longrunning.Operation", "options": { - "(google.api.http).post": "/v1/{parent=projects/*/locations/*}/clientTlsPolicies", - "(google.api.http).body": "client_tls_policy", - "(google.api.method_signature)": "parent,client_tls_policy,client_tls_policy_id", - "(google.longrunning.operation_info).response_type": "ClientTlsPolicy", + "(google.api.http).post": "/v1/{parent=organizations/*/locations/*}/securityProfiles", + "(google.api.http).body": "security_profile", + "(google.api.method_signature)": "parent,security_profile,security_profile_id", + "(google.longrunning.operation_info).response_type": "SecurityProfile", "(google.longrunning.operation_info).metadata_type": "google.cloud.networksecurity.v1.OperationMetadata" }, "parsedOptions": [ { "(google.api.http)": { - "post": "/v1/{parent=projects/*/locations/*}/clientTlsPolicies", - "body": "client_tls_policy" + "post": "/v1/{parent=organizations/*/locations/*}/securityProfiles", + "body": "security_profile" } }, { - "(google.api.method_signature)": "parent,client_tls_policy,client_tls_policy_id" + "(google.api.method_signature)": "parent,security_profile,security_profile_id" }, { "(google.longrunning.operation_info)": { - "response_type": "ClientTlsPolicy", + "response_type": "SecurityProfile", "metadata_type": "google.cloud.networksecurity.v1.OperationMetadata" } } ] }, - "UpdateClientTlsPolicy": { - "requestType": "UpdateClientTlsPolicyRequest", + "UpdateSecurityProfile": { + "requestType": "UpdateSecurityProfileRequest", "responseType": "google.longrunning.Operation", "options": { - "(google.api.http).patch": "/v1/{client_tls_policy.name=projects/*/locations/*/clientTlsPolicies/*}", - "(google.api.http).body": "client_tls_policy", - "(google.api.method_signature)": "client_tls_policy,update_mask", - "(google.longrunning.operation_info).response_type": "ClientTlsPolicy", + "(google.api.http).patch": "/v1/{security_profile.name=organizations/*/locations/*/securityProfiles/*}", + "(google.api.http).body": "security_profile", + "(google.api.method_signature)": "security_profile,update_mask", + "(google.longrunning.operation_info).response_type": "SecurityProfile", "(google.longrunning.operation_info).metadata_type": "google.cloud.networksecurity.v1.OperationMetadata" }, "parsedOptions": [ { "(google.api.http)": { - "patch": "/v1/{client_tls_policy.name=projects/*/locations/*/clientTlsPolicies/*}", - "body": "client_tls_policy" + "patch": "/v1/{security_profile.name=organizations/*/locations/*/securityProfiles/*}", + "body": "security_profile" } }, { - "(google.api.method_signature)": "client_tls_policy,update_mask" + "(google.api.method_signature)": "security_profile,update_mask" }, { "(google.longrunning.operation_info)": { - "response_type": "ClientTlsPolicy", + "response_type": "SecurityProfile", "metadata_type": "google.cloud.networksecurity.v1.OperationMetadata" } } ] }, - "DeleteClientTlsPolicy": { - "requestType": "DeleteClientTlsPolicyRequest", + "DeleteSecurityProfile": { + "requestType": "DeleteSecurityProfileRequest", "responseType": "google.longrunning.Operation", "options": { - "(google.api.http).delete": "/v1/{name=projects/*/locations/*/clientTlsPolicies/*}", + "(google.api.http).delete": "/v1/{name=organizations/*/locations/*/securityProfiles/*}", "(google.api.method_signature)": "name", "(google.longrunning.operation_info).response_type": "google.protobuf.Empty", "(google.longrunning.operation_info).metadata_type": "google.cloud.networksecurity.v1.OperationMetadata" @@ -1739,7 +9073,7 @@ "parsedOptions": [ { "(google.api.http)": { - "delete": "/v1/{name=projects/*/locations/*/clientTlsPolicies/*}" + "delete": "/v1/{name=organizations/*/locations/*/securityProfiles/*}" } }, { @@ -1755,92 +9089,151 @@ } } }, - "ServerTlsPolicy": { - "options": { - "(google.api.resource).type": "networksecurity.googleapis.com/ServerTlsPolicy", - "(google.api.resource).pattern": "projects/{project}/locations/{location}/serverTlsPolicies/{server_tls_policy}" - }, + "ListSecurityProfileGroupsRequest": { "fields": { - "name": { + "parent": { "type": "string", "id": 1, "options": { - "(google.api.field_behavior)": "REQUIRED" + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "networksecurity.googleapis.com/SecurityProfileGroup" } }, - "description": { - "type": "string", - "id": 2 + "pageSize": { + "type": "int32", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } }, - "createTime": { - "type": "google.protobuf.Timestamp", + "pageToken": { + "type": "string", "id": 3, "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" + "(google.api.field_behavior)": "OPTIONAL" } + } + } + }, + "ListSecurityProfileGroupsResponse": { + "fields": { + "securityProfileGroups": { + "rule": "repeated", + "type": "SecurityProfileGroup", + "id": 1 }, - "updateTime": { - "type": "google.protobuf.Timestamp", - "id": 4, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "GetSecurityProfileGroupRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "networksecurity.googleapis.com/SecurityProfileGroup" } - }, - "labels": { - "keyType": "string", + } + } + }, + "CreateSecurityProfileGroupRequest": { + "fields": { + "parent": { "type": "string", - "id": 5 + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "networksecurity.googleapis.com/SecurityProfileGroup" + } }, - "allowOpen": { - "type": "bool", - "id": 6 + "securityProfileGroupId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } }, - "serverCertificate": { - "type": "CertificateProvider", - "id": 7 + "securityProfileGroup": { + "type": "SecurityProfileGroup", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "UpdateSecurityProfileGroupRequest": { + "fields": { + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } }, - "mtlsPolicy": { - "type": "MTLSPolicy", - "id": 8 + "securityProfileGroup": { + "type": "SecurityProfileGroup", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } } - }, - "nested": { - "MTLSPolicy": { - "fields": { - "clientValidationCa": { - "rule": "repeated", - "type": "ValidationCA", - "id": 1 - } + } + }, + "DeleteSecurityProfileGroupRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "networksecurity.googleapis.com/SecurityProfileGroup" + } + }, + "etag": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" } } } }, - "ListServerTlsPoliciesRequest": { + "ListSecurityProfilesRequest": { "fields": { "parent": { "type": "string", "id": 1, "options": { "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "locations.googleapis.com/Location" + "(google.api.resource_reference).child_type": "networksecurity.googleapis.com/SecurityProfile" } }, "pageSize": { "type": "int32", - "id": 2 + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } }, "pageToken": { "type": "string", - "id": 3 + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } } } }, - "ListServerTlsPoliciesResponse": { + "ListSecurityProfilesResponse": { "fields": { - "serverTlsPolicies": { + "securityProfiles": { "rule": "repeated", - "type": "ServerTlsPolicy", + "type": "SecurityProfile", "id": 1 }, "nextPageToken": { @@ -1849,37 +9242,37 @@ } } }, - "GetServerTlsPolicyRequest": { + "GetSecurityProfileRequest": { "fields": { "name": { "type": "string", "id": 1, "options": { "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "networksecurity.googleapis.com/ServerTlsPolicy" + "(google.api.resource_reference).type": "networksecurity.googleapis.com/SecurityProfile" } } } }, - "CreateServerTlsPolicyRequest": { + "CreateSecurityProfileRequest": { "fields": { "parent": { "type": "string", "id": 1, "options": { "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).child_type": "networksecurity.googleapis.com/ServerTlsPolicy" + "(google.api.resource_reference).child_type": "networksecurity.googleapis.com/SecurityProfile" } }, - "serverTlsPolicyId": { + "securityProfileId": { "type": "string", "id": 2, "options": { "(google.api.field_behavior)": "REQUIRED" } }, - "serverTlsPolicy": { - "type": "ServerTlsPolicy", + "securityProfile": { + "type": "SecurityProfile", "id": 3, "options": { "(google.api.field_behavior)": "REQUIRED" @@ -1887,17 +9280,17 @@ } } }, - "UpdateServerTlsPolicyRequest": { + "UpdateSecurityProfileRequest": { "fields": { "updateMask": { "type": "google.protobuf.FieldMask", "id": 1, "options": { - "(google.api.field_behavior)": "OPTIONAL" + "(google.api.field_behavior)": "REQUIRED" } }, - "serverTlsPolicy": { - "type": "ServerTlsPolicy", + "securityProfile": { + "type": "SecurityProfile", "id": 2, "options": { "(google.api.field_behavior)": "REQUIRED" @@ -1905,14 +9298,21 @@ } } }, - "DeleteServerTlsPolicyRequest": { + "DeleteSecurityProfileRequest": { "fields": { "name": { "type": "string", "id": 1, "options": { "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "networksecurity.googleapis.com/ServerTlsPolicy" + "(google.api.resource_reference).type": "networksecurity.googleapis.com/SecurityProfile" + } + }, + "etag": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" } } } @@ -13395,7 +20795,7 @@ "options": { "go_package": "google.golang.org/genproto/googleapis/api/annotations;annotations", "java_multiple_files": true, - "java_outer_classname": "FieldInfoProto", + "java_outer_classname": "ResourceProto", "java_package": "com.google.api", "objc_class_prefix": "GAPI", "cc_enable_arenas": true @@ -13814,6 +21214,30 @@ "IDENTIFIER": 8 } }, + "fieldInfo": { + "type": "google.api.FieldInfo", + "id": 291403980, + "extend": "google.protobuf.FieldOptions" + }, + "FieldInfo": { + "fields": { + "format": { + "type": "Format", + "id": 1 + } + }, + "nested": { + "Format": { + "values": { + "FORMAT_UNSPECIFIED": 0, + "UUID4": 1, + "IPV4": 2, + "IPV6": 3, + "IPV4_OR_IPV6": 4 + } + } + } + }, "resourceReference": { "type": "google.api.ResourceReference", "id": 1055, @@ -13890,30 +21314,6 @@ "id": 2 } } - }, - "fieldInfo": { - "type": "google.api.FieldInfo", - "id": 291403980, - "extend": "google.protobuf.FieldOptions" - }, - "FieldInfo": { - "fields": { - "format": { - "type": "Format", - "id": 1 - } - }, - "nested": { - "Format": { - "values": { - "FORMAT_UNSPECIFIED": 0, - "UUID4": 1, - "IPV4": 2, - "IPV6": 3, - "IPV4_OR_IPV6": 4 - } - } - } } } }, @@ -15240,6 +22640,18 @@ } } }, + "Timestamp": { + "fields": { + "seconds": { + "type": "int64", + "id": 1 + }, + "nanos": { + "type": "int32", + "id": 2 + } + } + }, "Any": { "fields": { "type_url": { @@ -15263,18 +22675,6 @@ "id": 1 } } - }, - "Timestamp": { - "fields": { - "seconds": { - "type": "int64", - "id": 1 - }, - "nanos": { - "type": "int32", - "id": 2 - } - } } } }, diff --git a/packages/google-cloud-networksecurity/samples/generated/v1/dns_threat_detector_service.create_dns_threat_detector.js b/packages/google-cloud-networksecurity/samples/generated/v1/dns_threat_detector_service.create_dns_threat_detector.js new file mode 100644 index 00000000000..98c6e845714 --- /dev/null +++ b/packages/google-cloud-networksecurity/samples/generated/v1/dns_threat_detector_service.create_dns_threat_detector.js @@ -0,0 +1,71 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent, dnsThreatDetector) { + // [START networksecurity_v1_generated_DnsThreatDetectorService_CreateDnsThreatDetector_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The value for the parent of the DnsThreatDetector resource. + */ + // const parent = 'abc123' + /** + * Optional. The ID of the requesting DnsThreatDetector object. + * If this field is not supplied, the service generates an identifier. + */ + // const dnsThreatDetectorId = 'abc123' + /** + * Required. The `DnsThreatDetector` resource to create. + */ + // const dnsThreatDetector = {} + + // Imports the Networksecurity library + const {DnsThreatDetectorServiceClient} = require('@google-cloud/network-security').v1; + + // Instantiates a client + const networksecurityClient = new DnsThreatDetectorServiceClient(); + + async function callCreateDnsThreatDetector() { + // Construct request + const request = { + parent, + dnsThreatDetector, + }; + + // Run request + const response = await networksecurityClient.createDnsThreatDetector(request); + console.log(response); + } + + callCreateDnsThreatDetector(); + // [END networksecurity_v1_generated_DnsThreatDetectorService_CreateDnsThreatDetector_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-networksecurity/samples/generated/v1/dns_threat_detector_service.delete_dns_threat_detector.js b/packages/google-cloud-networksecurity/samples/generated/v1/dns_threat_detector_service.delete_dns_threat_detector.js new file mode 100644 index 00000000000..7df1a21c52d --- /dev/null +++ b/packages/google-cloud-networksecurity/samples/generated/v1/dns_threat_detector_service.delete_dns_threat_detector.js @@ -0,0 +1,61 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START networksecurity_v1_generated_DnsThreatDetectorService_DeleteDnsThreatDetector_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Name of the DnsThreatDetector resource. + */ + // const name = 'abc123' + + // Imports the Networksecurity library + const {DnsThreatDetectorServiceClient} = require('@google-cloud/network-security').v1; + + // Instantiates a client + const networksecurityClient = new DnsThreatDetectorServiceClient(); + + async function callDeleteDnsThreatDetector() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await networksecurityClient.deleteDnsThreatDetector(request); + console.log(response); + } + + callDeleteDnsThreatDetector(); + // [END networksecurity_v1_generated_DnsThreatDetectorService_DeleteDnsThreatDetector_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-networksecurity/samples/generated/v1/dns_threat_detector_service.get_dns_threat_detector.js b/packages/google-cloud-networksecurity/samples/generated/v1/dns_threat_detector_service.get_dns_threat_detector.js new file mode 100644 index 00000000000..cdc807bd1ff --- /dev/null +++ b/packages/google-cloud-networksecurity/samples/generated/v1/dns_threat_detector_service.get_dns_threat_detector.js @@ -0,0 +1,61 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START networksecurity_v1_generated_DnsThreatDetectorService_GetDnsThreatDetector_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Name of the DnsThreatDetector resource. + */ + // const name = 'abc123' + + // Imports the Networksecurity library + const {DnsThreatDetectorServiceClient} = require('@google-cloud/network-security').v1; + + // Instantiates a client + const networksecurityClient = new DnsThreatDetectorServiceClient(); + + async function callGetDnsThreatDetector() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await networksecurityClient.getDnsThreatDetector(request); + console.log(response); + } + + callGetDnsThreatDetector(); + // [END networksecurity_v1_generated_DnsThreatDetectorService_GetDnsThreatDetector_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-networksecurity/samples/generated/v1/dns_threat_detector_service.list_dns_threat_detectors.js b/packages/google-cloud-networksecurity/samples/generated/v1/dns_threat_detector_service.list_dns_threat_detectors.js new file mode 100644 index 00000000000..2eb2fdeb61e --- /dev/null +++ b/packages/google-cloud-networksecurity/samples/generated/v1/dns_threat_detector_service.list_dns_threat_detectors.js @@ -0,0 +1,74 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent) { + // [START networksecurity_v1_generated_DnsThreatDetectorService_ListDnsThreatDetectors_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The parent value for `ListDnsThreatDetectorsRequest`. + */ + // const parent = 'abc123' + /** + * Optional. The requested page size. The server may return fewer items than + * requested. If unspecified, the server picks an appropriate default. + */ + // const pageSize = 1234 + /** + * Optional. A page token received from a previous + * `ListDnsThreatDetectorsRequest` call. Provide this to retrieve the + * subsequent page. + */ + // const pageToken = 'abc123' + + // Imports the Networksecurity library + const {DnsThreatDetectorServiceClient} = require('@google-cloud/network-security').v1; + + // Instantiates a client + const networksecurityClient = new DnsThreatDetectorServiceClient(); + + async function callListDnsThreatDetectors() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = networksecurityClient.listDnsThreatDetectorsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListDnsThreatDetectors(); + // [END networksecurity_v1_generated_DnsThreatDetectorService_ListDnsThreatDetectors_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-networksecurity/samples/generated/v1/dns_threat_detector_service.update_dns_threat_detector.js b/packages/google-cloud-networksecurity/samples/generated/v1/dns_threat_detector_service.update_dns_threat_detector.js new file mode 100644 index 00000000000..797db490984 --- /dev/null +++ b/packages/google-cloud-networksecurity/samples/generated/v1/dns_threat_detector_service.update_dns_threat_detector.js @@ -0,0 +1,69 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(dnsThreatDetector) { + // [START networksecurity_v1_generated_DnsThreatDetectorService_UpdateDnsThreatDetector_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Optional. The field mask is used to specify the fields to be overwritten in + * the DnsThreatDetector resource by the update. The fields specified in the + * update_mask are relative to the resource, not the full request. A field + * will be overwritten if it is in the mask. If the mask is not provided then + * all fields present in the request will be overwritten. + */ + // const updateMask = {} + /** + * Required. The DnsThreatDetector resource being updated. + */ + // const dnsThreatDetector = {} + + // Imports the Networksecurity library + const {DnsThreatDetectorServiceClient} = require('@google-cloud/network-security').v1; + + // Instantiates a client + const networksecurityClient = new DnsThreatDetectorServiceClient(); + + async function callUpdateDnsThreatDetector() { + // Construct request + const request = { + dnsThreatDetector, + }; + + // Run request + const response = await networksecurityClient.updateDnsThreatDetector(request); + console.log(response); + } + + callUpdateDnsThreatDetector(); + // [END networksecurity_v1_generated_DnsThreatDetectorService_UpdateDnsThreatDetector_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-networksecurity/samples/generated/v1/firewall_activation.create_firewall_endpoint.js b/packages/google-cloud-networksecurity/samples/generated/v1/firewall_activation.create_firewall_endpoint.js new file mode 100644 index 00000000000..eef30aa6418 --- /dev/null +++ b/packages/google-cloud-networksecurity/samples/generated/v1/firewall_activation.create_firewall_endpoint.js @@ -0,0 +1,88 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent, firewallEndpointId, firewallEndpoint) { + // [START networksecurity_v1_generated_FirewallActivation_CreateFirewallEndpoint_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Value for parent. + */ + // const parent = 'abc123' + /** + * Required. Id of the requesting object. + * If auto-generating Id server-side, remove this field and + * firewall_endpoint_id from the method_signature of Create RPC. + */ + // const firewallEndpointId = 'abc123' + /** + * Required. The resource being created + */ + // const firewallEndpoint = {} + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + */ + // const requestId = 'abc123' + + // Imports the Networksecurity library + const {FirewallActivationClient} = require('@google-cloud/network-security').v1; + + // Instantiates a client + const networksecurityClient = new FirewallActivationClient(); + + async function callCreateFirewallEndpoint() { + // Construct request + const request = { + parent, + firewallEndpointId, + firewallEndpoint, + }; + + // Run request + const [operation] = await networksecurityClient.createFirewallEndpoint(request); + const [response] = await operation.promise(); + console.log(response); + } + + callCreateFirewallEndpoint(); + // [END networksecurity_v1_generated_FirewallActivation_CreateFirewallEndpoint_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-networksecurity/samples/generated/v1/firewall_activation.create_firewall_endpoint_association.js b/packages/google-cloud-networksecurity/samples/generated/v1/firewall_activation.create_firewall_endpoint_association.js new file mode 100644 index 00000000000..27ff3c27775 --- /dev/null +++ b/packages/google-cloud-networksecurity/samples/generated/v1/firewall_activation.create_firewall_endpoint_association.js @@ -0,0 +1,87 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent, firewallEndpointAssociation) { + // [START networksecurity_v1_generated_FirewallActivation_CreateFirewallEndpointAssociation_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Value for parent. + */ + // const parent = 'abc123' + /** + * Optional. Id of the requesting object. + * If auto-generating Id server-side, remove this field and + * firewall_endpoint_association_id from the method_signature of Create RPC. + */ + // const firewallEndpointAssociationId = 'abc123' + /** + * Required. The resource being created + */ + // const firewallEndpointAssociation = {} + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + */ + // const requestId = 'abc123' + + // Imports the Networksecurity library + const {FirewallActivationClient} = require('@google-cloud/network-security').v1; + + // Instantiates a client + const networksecurityClient = new FirewallActivationClient(); + + async function callCreateFirewallEndpointAssociation() { + // Construct request + const request = { + parent, + firewallEndpointAssociation, + }; + + // Run request + const [operation] = await networksecurityClient.createFirewallEndpointAssociation(request); + const [response] = await operation.promise(); + console.log(response); + } + + callCreateFirewallEndpointAssociation(); + // [END networksecurity_v1_generated_FirewallActivation_CreateFirewallEndpointAssociation_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-networksecurity/samples/generated/v1/firewall_activation.delete_firewall_endpoint.js b/packages/google-cloud-networksecurity/samples/generated/v1/firewall_activation.delete_firewall_endpoint.js new file mode 100644 index 00000000000..e375c2c20a6 --- /dev/null +++ b/packages/google-cloud-networksecurity/samples/generated/v1/firewall_activation.delete_firewall_endpoint.js @@ -0,0 +1,76 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START networksecurity_v1_generated_FirewallActivation_DeleteFirewallEndpoint_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Name of the resource + */ + // const name = 'abc123' + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes after the first request. + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + */ + // const requestId = 'abc123' + + // Imports the Networksecurity library + const {FirewallActivationClient} = require('@google-cloud/network-security').v1; + + // Instantiates a client + const networksecurityClient = new FirewallActivationClient(); + + async function callDeleteFirewallEndpoint() { + // Construct request + const request = { + name, + }; + + // Run request + const [operation] = await networksecurityClient.deleteFirewallEndpoint(request); + const [response] = await operation.promise(); + console.log(response); + } + + callDeleteFirewallEndpoint(); + // [END networksecurity_v1_generated_FirewallActivation_DeleteFirewallEndpoint_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-networksecurity/samples/generated/v1/firewall_activation.delete_firewall_endpoint_association.js b/packages/google-cloud-networksecurity/samples/generated/v1/firewall_activation.delete_firewall_endpoint_association.js new file mode 100644 index 00000000000..8b769429d69 --- /dev/null +++ b/packages/google-cloud-networksecurity/samples/generated/v1/firewall_activation.delete_firewall_endpoint_association.js @@ -0,0 +1,76 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START networksecurity_v1_generated_FirewallActivation_DeleteFirewallEndpointAssociation_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Name of the resource + */ + // const name = 'abc123' + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes after the first request. + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + */ + // const requestId = 'abc123' + + // Imports the Networksecurity library + const {FirewallActivationClient} = require('@google-cloud/network-security').v1; + + // Instantiates a client + const networksecurityClient = new FirewallActivationClient(); + + async function callDeleteFirewallEndpointAssociation() { + // Construct request + const request = { + name, + }; + + // Run request + const [operation] = await networksecurityClient.deleteFirewallEndpointAssociation(request); + const [response] = await operation.promise(); + console.log(response); + } + + callDeleteFirewallEndpointAssociation(); + // [END networksecurity_v1_generated_FirewallActivation_DeleteFirewallEndpointAssociation_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-networksecurity/samples/generated/v1/firewall_activation.get_firewall_endpoint.js b/packages/google-cloud-networksecurity/samples/generated/v1/firewall_activation.get_firewall_endpoint.js new file mode 100644 index 00000000000..bd234b8ec08 --- /dev/null +++ b/packages/google-cloud-networksecurity/samples/generated/v1/firewall_activation.get_firewall_endpoint.js @@ -0,0 +1,61 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START networksecurity_v1_generated_FirewallActivation_GetFirewallEndpoint_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Name of the resource + */ + // const name = 'abc123' + + // Imports the Networksecurity library + const {FirewallActivationClient} = require('@google-cloud/network-security').v1; + + // Instantiates a client + const networksecurityClient = new FirewallActivationClient(); + + async function callGetFirewallEndpoint() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await networksecurityClient.getFirewallEndpoint(request); + console.log(response); + } + + callGetFirewallEndpoint(); + // [END networksecurity_v1_generated_FirewallActivation_GetFirewallEndpoint_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-networksecurity/samples/generated/v1/firewall_activation.get_firewall_endpoint_association.js b/packages/google-cloud-networksecurity/samples/generated/v1/firewall_activation.get_firewall_endpoint_association.js new file mode 100644 index 00000000000..c5d899a4d07 --- /dev/null +++ b/packages/google-cloud-networksecurity/samples/generated/v1/firewall_activation.get_firewall_endpoint_association.js @@ -0,0 +1,61 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START networksecurity_v1_generated_FirewallActivation_GetFirewallEndpointAssociation_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Name of the resource + */ + // const name = 'abc123' + + // Imports the Networksecurity library + const {FirewallActivationClient} = require('@google-cloud/network-security').v1; + + // Instantiates a client + const networksecurityClient = new FirewallActivationClient(); + + async function callGetFirewallEndpointAssociation() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await networksecurityClient.getFirewallEndpointAssociation(request); + console.log(response); + } + + callGetFirewallEndpointAssociation(); + // [END networksecurity_v1_generated_FirewallActivation_GetFirewallEndpointAssociation_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-networksecurity/samples/generated/v1/firewall_activation.list_firewall_endpoint_associations.js b/packages/google-cloud-networksecurity/samples/generated/v1/firewall_activation.list_firewall_endpoint_associations.js new file mode 100644 index 00000000000..eda43c439a8 --- /dev/null +++ b/packages/google-cloud-networksecurity/samples/generated/v1/firewall_activation.list_firewall_endpoint_associations.js @@ -0,0 +1,80 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent) { + // [START networksecurity_v1_generated_FirewallActivation_ListFirewallEndpointAssociations_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Parent value for ListAssociationsRequest + */ + // const parent = 'abc123' + /** + * Optional. Requested page size. Server may return fewer items than + * requested. If unspecified, server will pick an appropriate default. + */ + // const pageSize = 1234 + /** + * A token identifying a page of results the server should return. + */ + // const pageToken = 'abc123' + /** + * Optional. Filtering results + */ + // const filter = 'abc123' + /** + * Hint for how to order the results + */ + // const orderBy = 'abc123' + + // Imports the Networksecurity library + const {FirewallActivationClient} = require('@google-cloud/network-security').v1; + + // Instantiates a client + const networksecurityClient = new FirewallActivationClient(); + + async function callListFirewallEndpointAssociations() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = networksecurityClient.listFirewallEndpointAssociationsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListFirewallEndpointAssociations(); + // [END networksecurity_v1_generated_FirewallActivation_ListFirewallEndpointAssociations_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-networksecurity/samples/generated/v1/firewall_activation.list_firewall_endpoints.js b/packages/google-cloud-networksecurity/samples/generated/v1/firewall_activation.list_firewall_endpoints.js new file mode 100644 index 00000000000..cc83862dd93 --- /dev/null +++ b/packages/google-cloud-networksecurity/samples/generated/v1/firewall_activation.list_firewall_endpoints.js @@ -0,0 +1,80 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent) { + // [START networksecurity_v1_generated_FirewallActivation_ListFirewallEndpoints_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Parent value for ListEndpointsRequest + */ + // const parent = 'abc123' + /** + * Optional. Requested page size. Server may return fewer items than + * requested. If unspecified, server will pick an appropriate default. + */ + // const pageSize = 1234 + /** + * A token identifying a page of results the server should return. + */ + // const pageToken = 'abc123' + /** + * Optional. Filtering results + */ + // const filter = 'abc123' + /** + * Hint for how to order the results + */ + // const orderBy = 'abc123' + + // Imports the Networksecurity library + const {FirewallActivationClient} = require('@google-cloud/network-security').v1; + + // Instantiates a client + const networksecurityClient = new FirewallActivationClient(); + + async function callListFirewallEndpoints() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = networksecurityClient.listFirewallEndpointsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListFirewallEndpoints(); + // [END networksecurity_v1_generated_FirewallActivation_ListFirewallEndpoints_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-networksecurity/samples/generated/v1/firewall_activation.update_firewall_endpoint.js b/packages/google-cloud-networksecurity/samples/generated/v1/firewall_activation.update_firewall_endpoint.js new file mode 100644 index 00000000000..8202ad5fc62 --- /dev/null +++ b/packages/google-cloud-networksecurity/samples/generated/v1/firewall_activation.update_firewall_endpoint.js @@ -0,0 +1,85 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(updateMask, firewallEndpoint) { + // [START networksecurity_v1_generated_FirewallActivation_UpdateFirewallEndpoint_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Field mask is used to specify the fields to be overwritten in the + * Endpoint resource by the update. + * The fields specified in the update_mask are relative to the resource, not + * the full request. A field will be overwritten if it is in the mask. If the + * user does not provide a mask then all fields will be overwritten. + */ + // const updateMask = {} + /** + * Required. The resource being updated + */ + // const firewallEndpoint = {} + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + */ + // const requestId = 'abc123' + + // Imports the Networksecurity library + const {FirewallActivationClient} = require('@google-cloud/network-security').v1; + + // Instantiates a client + const networksecurityClient = new FirewallActivationClient(); + + async function callUpdateFirewallEndpoint() { + // Construct request + const request = { + updateMask, + firewallEndpoint, + }; + + // Run request + const [operation] = await networksecurityClient.updateFirewallEndpoint(request); + const [response] = await operation.promise(); + console.log(response); + } + + callUpdateFirewallEndpoint(); + // [END networksecurity_v1_generated_FirewallActivation_UpdateFirewallEndpoint_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-networksecurity/samples/generated/v1/firewall_activation.update_firewall_endpoint_association.js b/packages/google-cloud-networksecurity/samples/generated/v1/firewall_activation.update_firewall_endpoint_association.js new file mode 100644 index 00000000000..ccb8684db33 --- /dev/null +++ b/packages/google-cloud-networksecurity/samples/generated/v1/firewall_activation.update_firewall_endpoint_association.js @@ -0,0 +1,85 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(updateMask, firewallEndpointAssociation) { + // [START networksecurity_v1_generated_FirewallActivation_UpdateFirewallEndpointAssociation_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Field mask is used to specify the fields to be overwritten in the + * Association resource by the update. + * The fields specified in the update_mask are relative to the resource, not + * the full request. A field will be overwritten if it is in the mask. If the + * user does not provide a mask then all fields will be overwritten. + */ + // const updateMask = {} + /** + * Required. The resource being updated + */ + // const firewallEndpointAssociation = {} + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + */ + // const requestId = 'abc123' + + // Imports the Networksecurity library + const {FirewallActivationClient} = require('@google-cloud/network-security').v1; + + // Instantiates a client + const networksecurityClient = new FirewallActivationClient(); + + async function callUpdateFirewallEndpointAssociation() { + // Construct request + const request = { + updateMask, + firewallEndpointAssociation, + }; + + // Run request + const [operation] = await networksecurityClient.updateFirewallEndpointAssociation(request); + const [response] = await operation.promise(); + console.log(response); + } + + callUpdateFirewallEndpointAssociation(); + // [END networksecurity_v1_generated_FirewallActivation_UpdateFirewallEndpointAssociation_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-networksecurity/samples/generated/v1/intercept.create_intercept_deployment.js b/packages/google-cloud-networksecurity/samples/generated/v1/intercept.create_intercept_deployment.js new file mode 100644 index 00000000000..c7923b63542 --- /dev/null +++ b/packages/google-cloud-networksecurity/samples/generated/v1/intercept.create_intercept_deployment.js @@ -0,0 +1,80 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent, interceptDeploymentId, interceptDeployment) { + // [START networksecurity_v1_generated_Intercept_CreateInterceptDeployment_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The parent resource where this deployment will be created. + * Format: projects/{project}/locations/{location} + */ + // const parent = 'abc123' + /** + * Required. The ID to use for the new deployment, which will become the final + * component of the deployment's resource name. + */ + // const interceptDeploymentId = 'abc123' + /** + * Required. The deployment to create. + */ + // const interceptDeployment = {} + /** + * Optional. A unique identifier for this request. Must be a UUID4. + * This request is only idempotent if a `request_id` is provided. + * See https://google.aip.dev/155 for more details. + */ + // const requestId = 'abc123' + + // Imports the Networksecurity library + const {InterceptClient} = require('@google-cloud/network-security').v1; + + // Instantiates a client + const networksecurityClient = new InterceptClient(); + + async function callCreateInterceptDeployment() { + // Construct request + const request = { + parent, + interceptDeploymentId, + interceptDeployment, + }; + + // Run request + const [operation] = await networksecurityClient.createInterceptDeployment(request); + const [response] = await operation.promise(); + console.log(response); + } + + callCreateInterceptDeployment(); + // [END networksecurity_v1_generated_Intercept_CreateInterceptDeployment_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-networksecurity/samples/generated/v1/intercept.create_intercept_deployment_group.js b/packages/google-cloud-networksecurity/samples/generated/v1/intercept.create_intercept_deployment_group.js new file mode 100644 index 00000000000..fa208b4fe61 --- /dev/null +++ b/packages/google-cloud-networksecurity/samples/generated/v1/intercept.create_intercept_deployment_group.js @@ -0,0 +1,80 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent, interceptDeploymentGroupId, interceptDeploymentGroup) { + // [START networksecurity_v1_generated_Intercept_CreateInterceptDeploymentGroup_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The parent resource where this deployment group will be created. + * Format: projects/{project}/locations/{location} + */ + // const parent = 'abc123' + /** + * Required. The ID to use for the new deployment group, which will become the + * final component of the deployment group's resource name. + */ + // const interceptDeploymentGroupId = 'abc123' + /** + * Required. The deployment group to create. + */ + // const interceptDeploymentGroup = {} + /** + * Optional. A unique identifier for this request. Must be a UUID4. + * This request is only idempotent if a `request_id` is provided. + * See https://google.aip.dev/155 for more details. + */ + // const requestId = 'abc123' + + // Imports the Networksecurity library + const {InterceptClient} = require('@google-cloud/network-security').v1; + + // Instantiates a client + const networksecurityClient = new InterceptClient(); + + async function callCreateInterceptDeploymentGroup() { + // Construct request + const request = { + parent, + interceptDeploymentGroupId, + interceptDeploymentGroup, + }; + + // Run request + const [operation] = await networksecurityClient.createInterceptDeploymentGroup(request); + const [response] = await operation.promise(); + console.log(response); + } + + callCreateInterceptDeploymentGroup(); + // [END networksecurity_v1_generated_Intercept_CreateInterceptDeploymentGroup_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-networksecurity/samples/generated/v1/intercept.create_intercept_endpoint_group.js b/packages/google-cloud-networksecurity/samples/generated/v1/intercept.create_intercept_endpoint_group.js new file mode 100644 index 00000000000..39ecd6fc2b7 --- /dev/null +++ b/packages/google-cloud-networksecurity/samples/generated/v1/intercept.create_intercept_endpoint_group.js @@ -0,0 +1,80 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent, interceptEndpointGroupId, interceptEndpointGroup) { + // [START networksecurity_v1_generated_Intercept_CreateInterceptEndpointGroup_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The parent resource where this endpoint group will be created. + * Format: projects/{project}/locations/{location} + */ + // const parent = 'abc123' + /** + * Required. The ID to use for the endpoint group, which will become the final + * component of the endpoint group's resource name. + */ + // const interceptEndpointGroupId = 'abc123' + /** + * Required. The endpoint group to create. + */ + // const interceptEndpointGroup = {} + /** + * Optional. A unique identifier for this request. Must be a UUID4. + * This request is only idempotent if a `request_id` is provided. + * See https://google.aip.dev/155 for more details. + */ + // const requestId = 'abc123' + + // Imports the Networksecurity library + const {InterceptClient} = require('@google-cloud/network-security').v1; + + // Instantiates a client + const networksecurityClient = new InterceptClient(); + + async function callCreateInterceptEndpointGroup() { + // Construct request + const request = { + parent, + interceptEndpointGroupId, + interceptEndpointGroup, + }; + + // Run request + const [operation] = await networksecurityClient.createInterceptEndpointGroup(request); + const [response] = await operation.promise(); + console.log(response); + } + + callCreateInterceptEndpointGroup(); + // [END networksecurity_v1_generated_Intercept_CreateInterceptEndpointGroup_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-networksecurity/samples/generated/v1/intercept.create_intercept_endpoint_group_association.js b/packages/google-cloud-networksecurity/samples/generated/v1/intercept.create_intercept_endpoint_group_association.js new file mode 100644 index 00000000000..71249cdbc66 --- /dev/null +++ b/packages/google-cloud-networksecurity/samples/generated/v1/intercept.create_intercept_endpoint_group_association.js @@ -0,0 +1,80 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent, interceptEndpointGroupAssociation) { + // [START networksecurity_v1_generated_Intercept_CreateInterceptEndpointGroupAssociation_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The parent resource where this association will be created. + * Format: projects/{project}/locations/{location} + */ + // const parent = 'abc123' + /** + * Optional. The ID to use for the new association, which will become the + * final component of the endpoint group's resource name. If not provided, the + * server will generate a unique ID. + */ + // const interceptEndpointGroupAssociationId = 'abc123' + /** + * Required. The association to create. + */ + // const interceptEndpointGroupAssociation = {} + /** + * Optional. A unique identifier for this request. Must be a UUID4. + * This request is only idempotent if a `request_id` is provided. + * See https://google.aip.dev/155 for more details. + */ + // const requestId = 'abc123' + + // Imports the Networksecurity library + const {InterceptClient} = require('@google-cloud/network-security').v1; + + // Instantiates a client + const networksecurityClient = new InterceptClient(); + + async function callCreateInterceptEndpointGroupAssociation() { + // Construct request + const request = { + parent, + interceptEndpointGroupAssociation, + }; + + // Run request + const [operation] = await networksecurityClient.createInterceptEndpointGroupAssociation(request); + const [response] = await operation.promise(); + console.log(response); + } + + callCreateInterceptEndpointGroupAssociation(); + // [END networksecurity_v1_generated_Intercept_CreateInterceptEndpointGroupAssociation_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-networksecurity/samples/generated/v1/intercept.delete_intercept_deployment.js b/packages/google-cloud-networksecurity/samples/generated/v1/intercept.delete_intercept_deployment.js new file mode 100644 index 00000000000..e9f97922dfd --- /dev/null +++ b/packages/google-cloud-networksecurity/samples/generated/v1/intercept.delete_intercept_deployment.js @@ -0,0 +1,68 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START networksecurity_v1_generated_Intercept_DeleteInterceptDeployment_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Name of the resource + */ + // const name = 'abc123' + /** + * Optional. A unique identifier for this request. Must be a UUID4. + * This request is only idempotent if a `request_id` is provided. + * See https://google.aip.dev/155 for more details. + */ + // const requestId = 'abc123' + + // Imports the Networksecurity library + const {InterceptClient} = require('@google-cloud/network-security').v1; + + // Instantiates a client + const networksecurityClient = new InterceptClient(); + + async function callDeleteInterceptDeployment() { + // Construct request + const request = { + name, + }; + + // Run request + const [operation] = await networksecurityClient.deleteInterceptDeployment(request); + const [response] = await operation.promise(); + console.log(response); + } + + callDeleteInterceptDeployment(); + // [END networksecurity_v1_generated_Intercept_DeleteInterceptDeployment_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-networksecurity/samples/generated/v1/intercept.delete_intercept_deployment_group.js b/packages/google-cloud-networksecurity/samples/generated/v1/intercept.delete_intercept_deployment_group.js new file mode 100644 index 00000000000..cb52557deda --- /dev/null +++ b/packages/google-cloud-networksecurity/samples/generated/v1/intercept.delete_intercept_deployment_group.js @@ -0,0 +1,68 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START networksecurity_v1_generated_Intercept_DeleteInterceptDeploymentGroup_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The deployment group to delete. + */ + // const name = 'abc123' + /** + * Optional. A unique identifier for this request. Must be a UUID4. + * This request is only idempotent if a `request_id` is provided. + * See https://google.aip.dev/155 for more details. + */ + // const requestId = 'abc123' + + // Imports the Networksecurity library + const {InterceptClient} = require('@google-cloud/network-security').v1; + + // Instantiates a client + const networksecurityClient = new InterceptClient(); + + async function callDeleteInterceptDeploymentGroup() { + // Construct request + const request = { + name, + }; + + // Run request + const [operation] = await networksecurityClient.deleteInterceptDeploymentGroup(request); + const [response] = await operation.promise(); + console.log(response); + } + + callDeleteInterceptDeploymentGroup(); + // [END networksecurity_v1_generated_Intercept_DeleteInterceptDeploymentGroup_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-networksecurity/samples/generated/v1/intercept.delete_intercept_endpoint_group.js b/packages/google-cloud-networksecurity/samples/generated/v1/intercept.delete_intercept_endpoint_group.js new file mode 100644 index 00000000000..5f8b5db2b98 --- /dev/null +++ b/packages/google-cloud-networksecurity/samples/generated/v1/intercept.delete_intercept_endpoint_group.js @@ -0,0 +1,68 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START networksecurity_v1_generated_Intercept_DeleteInterceptEndpointGroup_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The endpoint group to delete. + */ + // const name = 'abc123' + /** + * Optional. A unique identifier for this request. Must be a UUID4. + * This request is only idempotent if a `request_id` is provided. + * See https://google.aip.dev/155 for more details. + */ + // const requestId = 'abc123' + + // Imports the Networksecurity library + const {InterceptClient} = require('@google-cloud/network-security').v1; + + // Instantiates a client + const networksecurityClient = new InterceptClient(); + + async function callDeleteInterceptEndpointGroup() { + // Construct request + const request = { + name, + }; + + // Run request + const [operation] = await networksecurityClient.deleteInterceptEndpointGroup(request); + const [response] = await operation.promise(); + console.log(response); + } + + callDeleteInterceptEndpointGroup(); + // [END networksecurity_v1_generated_Intercept_DeleteInterceptEndpointGroup_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-networksecurity/samples/generated/v1/intercept.delete_intercept_endpoint_group_association.js b/packages/google-cloud-networksecurity/samples/generated/v1/intercept.delete_intercept_endpoint_group_association.js new file mode 100644 index 00000000000..d33a2983349 --- /dev/null +++ b/packages/google-cloud-networksecurity/samples/generated/v1/intercept.delete_intercept_endpoint_group_association.js @@ -0,0 +1,68 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START networksecurity_v1_generated_Intercept_DeleteInterceptEndpointGroupAssociation_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The association to delete. + */ + // const name = 'abc123' + /** + * Optional. A unique identifier for this request. Must be a UUID4. + * This request is only idempotent if a `request_id` is provided. + * See https://google.aip.dev/155 for more details. + */ + // const requestId = 'abc123' + + // Imports the Networksecurity library + const {InterceptClient} = require('@google-cloud/network-security').v1; + + // Instantiates a client + const networksecurityClient = new InterceptClient(); + + async function callDeleteInterceptEndpointGroupAssociation() { + // Construct request + const request = { + name, + }; + + // Run request + const [operation] = await networksecurityClient.deleteInterceptEndpointGroupAssociation(request); + const [response] = await operation.promise(); + console.log(response); + } + + callDeleteInterceptEndpointGroupAssociation(); + // [END networksecurity_v1_generated_Intercept_DeleteInterceptEndpointGroupAssociation_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-networksecurity/samples/generated/v1/intercept.get_intercept_deployment.js b/packages/google-cloud-networksecurity/samples/generated/v1/intercept.get_intercept_deployment.js new file mode 100644 index 00000000000..de9ae9e6467 --- /dev/null +++ b/packages/google-cloud-networksecurity/samples/generated/v1/intercept.get_intercept_deployment.js @@ -0,0 +1,63 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START networksecurity_v1_generated_Intercept_GetInterceptDeployment_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the deployment to retrieve. + * Format: + * projects/{project}/locations/{location}/interceptDeployments/{intercept_deployment} + */ + // const name = 'abc123' + + // Imports the Networksecurity library + const {InterceptClient} = require('@google-cloud/network-security').v1; + + // Instantiates a client + const networksecurityClient = new InterceptClient(); + + async function callGetInterceptDeployment() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await networksecurityClient.getInterceptDeployment(request); + console.log(response); + } + + callGetInterceptDeployment(); + // [END networksecurity_v1_generated_Intercept_GetInterceptDeployment_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-networksecurity/samples/generated/v1/intercept.get_intercept_deployment_group.js b/packages/google-cloud-networksecurity/samples/generated/v1/intercept.get_intercept_deployment_group.js new file mode 100644 index 00000000000..e653aca0c81 --- /dev/null +++ b/packages/google-cloud-networksecurity/samples/generated/v1/intercept.get_intercept_deployment_group.js @@ -0,0 +1,63 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START networksecurity_v1_generated_Intercept_GetInterceptDeploymentGroup_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the deployment group to retrieve. + * Format: + * projects/{project}/locations/{location}/interceptDeploymentGroups/{intercept_deployment_group} + */ + // const name = 'abc123' + + // Imports the Networksecurity library + const {InterceptClient} = require('@google-cloud/network-security').v1; + + // Instantiates a client + const networksecurityClient = new InterceptClient(); + + async function callGetInterceptDeploymentGroup() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await networksecurityClient.getInterceptDeploymentGroup(request); + console.log(response); + } + + callGetInterceptDeploymentGroup(); + // [END networksecurity_v1_generated_Intercept_GetInterceptDeploymentGroup_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-networksecurity/samples/generated/v1/intercept.get_intercept_endpoint_group.js b/packages/google-cloud-networksecurity/samples/generated/v1/intercept.get_intercept_endpoint_group.js new file mode 100644 index 00000000000..bf18862b3dd --- /dev/null +++ b/packages/google-cloud-networksecurity/samples/generated/v1/intercept.get_intercept_endpoint_group.js @@ -0,0 +1,63 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START networksecurity_v1_generated_Intercept_GetInterceptEndpointGroup_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the endpoint group to retrieve. + * Format: + * projects/{project}/locations/{location}/interceptEndpointGroups/{intercept_endpoint_group} + */ + // const name = 'abc123' + + // Imports the Networksecurity library + const {InterceptClient} = require('@google-cloud/network-security').v1; + + // Instantiates a client + const networksecurityClient = new InterceptClient(); + + async function callGetInterceptEndpointGroup() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await networksecurityClient.getInterceptEndpointGroup(request); + console.log(response); + } + + callGetInterceptEndpointGroup(); + // [END networksecurity_v1_generated_Intercept_GetInterceptEndpointGroup_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-networksecurity/samples/generated/v1/intercept.get_intercept_endpoint_group_association.js b/packages/google-cloud-networksecurity/samples/generated/v1/intercept.get_intercept_endpoint_group_association.js new file mode 100644 index 00000000000..f9035451c33 --- /dev/null +++ b/packages/google-cloud-networksecurity/samples/generated/v1/intercept.get_intercept_endpoint_group_association.js @@ -0,0 +1,63 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START networksecurity_v1_generated_Intercept_GetInterceptEndpointGroupAssociation_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the association to retrieve. + * Format: + * projects/{project}/locations/{location}/interceptEndpointGroupAssociations/{intercept_endpoint_group_association} + */ + // const name = 'abc123' + + // Imports the Networksecurity library + const {InterceptClient} = require('@google-cloud/network-security').v1; + + // Instantiates a client + const networksecurityClient = new InterceptClient(); + + async function callGetInterceptEndpointGroupAssociation() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await networksecurityClient.getInterceptEndpointGroupAssociation(request); + console.log(response); + } + + callGetInterceptEndpointGroupAssociation(); + // [END networksecurity_v1_generated_Intercept_GetInterceptEndpointGroupAssociation_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-networksecurity/samples/generated/v1/intercept.list_intercept_deployment_groups.js b/packages/google-cloud-networksecurity/samples/generated/v1/intercept.list_intercept_deployment_groups.js new file mode 100644 index 00000000000..65ffe37db23 --- /dev/null +++ b/packages/google-cloud-networksecurity/samples/generated/v1/intercept.list_intercept_deployment_groups.js @@ -0,0 +1,89 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent) { + // [START networksecurity_v1_generated_Intercept_ListInterceptDeploymentGroups_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The parent, which owns this collection of deployment groups. + * Example: `projects/123456789/locations/global`. + * See https://google.aip.dev/132 for more details. + */ + // const parent = 'abc123' + /** + * Optional. Requested page size. Server may return fewer items than + * requested. If unspecified, server will pick an appropriate default. See + * https://google.aip.dev/158 for more details. + */ + // const pageSize = 1234 + /** + * Optional. A page token, received from a previous + * `ListInterceptDeploymentGroups` call. Provide this to retrieve the + * subsequent page. When paginating, all other parameters provided to + * `ListInterceptDeploymentGroups` must match the call that provided the page + * token. See https://google.aip.dev/158 for more details. + */ + // const pageToken = 'abc123' + /** + * Optional. Filter expression. + * See https://google.aip.dev/160#filtering for more details. + */ + // const filter = 'abc123' + /** + * Optional. Sort expression. + * See https://google.aip.dev/132#ordering for more details. + */ + // const orderBy = 'abc123' + + // Imports the Networksecurity library + const {InterceptClient} = require('@google-cloud/network-security').v1; + + // Instantiates a client + const networksecurityClient = new InterceptClient(); + + async function callListInterceptDeploymentGroups() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = networksecurityClient.listInterceptDeploymentGroupsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListInterceptDeploymentGroups(); + // [END networksecurity_v1_generated_Intercept_ListInterceptDeploymentGroups_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-networksecurity/samples/generated/v1/intercept.list_intercept_deployments.js b/packages/google-cloud-networksecurity/samples/generated/v1/intercept.list_intercept_deployments.js new file mode 100644 index 00000000000..d5527099540 --- /dev/null +++ b/packages/google-cloud-networksecurity/samples/generated/v1/intercept.list_intercept_deployments.js @@ -0,0 +1,89 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent) { + // [START networksecurity_v1_generated_Intercept_ListInterceptDeployments_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The parent, which owns this collection of deployments. + * Example: `projects/123456789/locations/us-central1-a`. + * See https://google.aip.dev/132 for more details. + */ + // const parent = 'abc123' + /** + * Optional. Requested page size. Server may return fewer items than + * requested. If unspecified, server will pick an appropriate default. See + * https://google.aip.dev/158 for more details. + */ + // const pageSize = 1234 + /** + * Optional. A page token, received from a previous `ListInterceptDeployments` + * call. Provide this to retrieve the subsequent page. When paginating, all + * other parameters provided to `ListInterceptDeployments` must match the call + * that provided the page token. See https://google.aip.dev/158 for more + * details. + */ + // const pageToken = 'abc123' + /** + * Optional. Filter expression. + * See https://google.aip.dev/160#filtering for more details. + */ + // const filter = 'abc123' + /** + * Optional. Sort expression. + * See https://google.aip.dev/132#ordering for more details. + */ + // const orderBy = 'abc123' + + // Imports the Networksecurity library + const {InterceptClient} = require('@google-cloud/network-security').v1; + + // Instantiates a client + const networksecurityClient = new InterceptClient(); + + async function callListInterceptDeployments() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = networksecurityClient.listInterceptDeploymentsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListInterceptDeployments(); + // [END networksecurity_v1_generated_Intercept_ListInterceptDeployments_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-networksecurity/samples/generated/v1/intercept.list_intercept_endpoint_group_associations.js b/packages/google-cloud-networksecurity/samples/generated/v1/intercept.list_intercept_endpoint_group_associations.js new file mode 100644 index 00000000000..32435724d00 --- /dev/null +++ b/packages/google-cloud-networksecurity/samples/generated/v1/intercept.list_intercept_endpoint_group_associations.js @@ -0,0 +1,89 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent) { + // [START networksecurity_v1_generated_Intercept_ListInterceptEndpointGroupAssociations_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The parent, which owns this collection of associations. + * Example: `projects/123456789/locations/global`. + * See https://google.aip.dev/132 for more details. + */ + // const parent = 'abc123' + /** + * Optional. Requested page size. Server may return fewer items than + * requested. If unspecified, server will pick an appropriate default. See + * https://google.aip.dev/158 for more details. + */ + // const pageSize = 1234 + /** + * Optional. A page token, received from a previous + * `ListInterceptEndpointGroups` call. Provide this to retrieve the subsequent + * page. When paginating, all other parameters provided to + * `ListInterceptEndpointGroups` must match the call that provided the page + * token. See https://google.aip.dev/158 for more details. + */ + // const pageToken = 'abc123' + /** + * Optional. Filter expression. + * See https://google.aip.dev/160#filtering for more details. + */ + // const filter = 'abc123' + /** + * Optional. Sort expression. + * See https://google.aip.dev/132#ordering for more details. + */ + // const orderBy = 'abc123' + + // Imports the Networksecurity library + const {InterceptClient} = require('@google-cloud/network-security').v1; + + // Instantiates a client + const networksecurityClient = new InterceptClient(); + + async function callListInterceptEndpointGroupAssociations() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = networksecurityClient.listInterceptEndpointGroupAssociationsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListInterceptEndpointGroupAssociations(); + // [END networksecurity_v1_generated_Intercept_ListInterceptEndpointGroupAssociations_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-networksecurity/samples/generated/v1/intercept.list_intercept_endpoint_groups.js b/packages/google-cloud-networksecurity/samples/generated/v1/intercept.list_intercept_endpoint_groups.js new file mode 100644 index 00000000000..6e2fb5b1720 --- /dev/null +++ b/packages/google-cloud-networksecurity/samples/generated/v1/intercept.list_intercept_endpoint_groups.js @@ -0,0 +1,90 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent) { + // [START networksecurity_v1_generated_Intercept_ListInterceptEndpointGroups_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The parent, which owns this collection of endpoint groups. + * Example: `projects/123456789/locations/global`. + * See https://google.aip.dev/132 for more details. + */ + // const parent = 'abc123' + /** + * Optional. Requested page size. Server may return fewer items than + * requested. If unspecified, server will pick an appropriate default. See + * https://google.aip.dev/158 for more details. + */ + // const pageSize = 1234 + /** + * Optional. A page token, received from a previous + * `ListInterceptEndpointGroups` call. Provide this to retrieve the subsequent + * page. When paginating, all other parameters provided to + * `ListInterceptEndpointGroups` must match the call that provided the page + * token. + * See https://google.aip.dev/158 for more details. + */ + // const pageToken = 'abc123' + /** + * Optional. Filter expression. + * See https://google.aip.dev/160#filtering for more details. + */ + // const filter = 'abc123' + /** + * Optional. Sort expression. + * See https://google.aip.dev/132#ordering for more details. + */ + // const orderBy = 'abc123' + + // Imports the Networksecurity library + const {InterceptClient} = require('@google-cloud/network-security').v1; + + // Instantiates a client + const networksecurityClient = new InterceptClient(); + + async function callListInterceptEndpointGroups() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = networksecurityClient.listInterceptEndpointGroupsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListInterceptEndpointGroups(); + // [END networksecurity_v1_generated_Intercept_ListInterceptEndpointGroups_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-networksecurity/samples/generated/v1/intercept.update_intercept_deployment.js b/packages/google-cloud-networksecurity/samples/generated/v1/intercept.update_intercept_deployment.js new file mode 100644 index 00000000000..0ecdc7c4606 --- /dev/null +++ b/packages/google-cloud-networksecurity/samples/generated/v1/intercept.update_intercept_deployment.js @@ -0,0 +1,75 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(interceptDeployment) { + // [START networksecurity_v1_generated_Intercept_UpdateInterceptDeployment_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Optional. The list of fields to update. + * Fields are specified relative to the deployment + * (e.g. `description`; *not* `intercept_deployment.description`). + * See https://google.aip.dev/161 for more details. + */ + // const updateMask = {} + /** + * Required. The deployment to update. + */ + // const interceptDeployment = {} + /** + * Optional. A unique identifier for this request. Must be a UUID4. + * This request is only idempotent if a `request_id` is provided. + * See https://google.aip.dev/155 for more details. + */ + // const requestId = 'abc123' + + // Imports the Networksecurity library + const {InterceptClient} = require('@google-cloud/network-security').v1; + + // Instantiates a client + const networksecurityClient = new InterceptClient(); + + async function callUpdateInterceptDeployment() { + // Construct request + const request = { + interceptDeployment, + }; + + // Run request + const [operation] = await networksecurityClient.updateInterceptDeployment(request); + const [response] = await operation.promise(); + console.log(response); + } + + callUpdateInterceptDeployment(); + // [END networksecurity_v1_generated_Intercept_UpdateInterceptDeployment_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-networksecurity/samples/generated/v1/intercept.update_intercept_deployment_group.js b/packages/google-cloud-networksecurity/samples/generated/v1/intercept.update_intercept_deployment_group.js new file mode 100644 index 00000000000..bf64a4eaaa5 --- /dev/null +++ b/packages/google-cloud-networksecurity/samples/generated/v1/intercept.update_intercept_deployment_group.js @@ -0,0 +1,76 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(interceptDeploymentGroup) { + // [START networksecurity_v1_generated_Intercept_UpdateInterceptDeploymentGroup_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Optional. The list of fields to update. + * Fields are specified relative to the deployment group + * (e.g. `description`; *not* + * `intercept_deployment_group.description`). See + * https://google.aip.dev/161 for more details. + */ + // const updateMask = {} + /** + * Required. The deployment group to update. + */ + // const interceptDeploymentGroup = {} + /** + * Optional. A unique identifier for this request. Must be a UUID4. + * This request is only idempotent if a `request_id` is provided. + * See https://google.aip.dev/155 for more details. + */ + // const requestId = 'abc123' + + // Imports the Networksecurity library + const {InterceptClient} = require('@google-cloud/network-security').v1; + + // Instantiates a client + const networksecurityClient = new InterceptClient(); + + async function callUpdateInterceptDeploymentGroup() { + // Construct request + const request = { + interceptDeploymentGroup, + }; + + // Run request + const [operation] = await networksecurityClient.updateInterceptDeploymentGroup(request); + const [response] = await operation.promise(); + console.log(response); + } + + callUpdateInterceptDeploymentGroup(); + // [END networksecurity_v1_generated_Intercept_UpdateInterceptDeploymentGroup_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-networksecurity/samples/generated/v1/intercept.update_intercept_endpoint_group.js b/packages/google-cloud-networksecurity/samples/generated/v1/intercept.update_intercept_endpoint_group.js new file mode 100644 index 00000000000..a0d4d5f658c --- /dev/null +++ b/packages/google-cloud-networksecurity/samples/generated/v1/intercept.update_intercept_endpoint_group.js @@ -0,0 +1,75 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(interceptEndpointGroup) { + // [START networksecurity_v1_generated_Intercept_UpdateInterceptEndpointGroup_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Optional. The list of fields to update. + * Fields are specified relative to the endpoint group + * (e.g. `description`; *not* `intercept_endpoint_group.description`). + * See https://google.aip.dev/161 for more details. + */ + // const updateMask = {} + /** + * Required. The endpoint group to update. + */ + // const interceptEndpointGroup = {} + /** + * Optional. A unique identifier for this request. Must be a UUID4. + * This request is only idempotent if a `request_id` is provided. + * See https://google.aip.dev/155 for more details. + */ + // const requestId = 'abc123' + + // Imports the Networksecurity library + const {InterceptClient} = require('@google-cloud/network-security').v1; + + // Instantiates a client + const networksecurityClient = new InterceptClient(); + + async function callUpdateInterceptEndpointGroup() { + // Construct request + const request = { + interceptEndpointGroup, + }; + + // Run request + const [operation] = await networksecurityClient.updateInterceptEndpointGroup(request); + const [response] = await operation.promise(); + console.log(response); + } + + callUpdateInterceptEndpointGroup(); + // [END networksecurity_v1_generated_Intercept_UpdateInterceptEndpointGroup_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-networksecurity/samples/generated/v1/intercept.update_intercept_endpoint_group_association.js b/packages/google-cloud-networksecurity/samples/generated/v1/intercept.update_intercept_endpoint_group_association.js new file mode 100644 index 00000000000..c946b77739d --- /dev/null +++ b/packages/google-cloud-networksecurity/samples/generated/v1/intercept.update_intercept_endpoint_group_association.js @@ -0,0 +1,76 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(interceptEndpointGroupAssociation) { + // [START networksecurity_v1_generated_Intercept_UpdateInterceptEndpointGroupAssociation_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Optional. The list of fields to update. + * Fields are specified relative to the association + * (e.g. `description`; *not* + * `intercept_endpoint_group_association.description`). See + * https://google.aip.dev/161 for more details. + */ + // const updateMask = {} + /** + * Required. The association to update. + */ + // const interceptEndpointGroupAssociation = {} + /** + * Optional. A unique identifier for this request. Must be a UUID4. + * This request is only idempotent if a `request_id` is provided. + * See https://google.aip.dev/155 for more details. + */ + // const requestId = 'abc123' + + // Imports the Networksecurity library + const {InterceptClient} = require('@google-cloud/network-security').v1; + + // Instantiates a client + const networksecurityClient = new InterceptClient(); + + async function callUpdateInterceptEndpointGroupAssociation() { + // Construct request + const request = { + interceptEndpointGroupAssociation, + }; + + // Run request + const [operation] = await networksecurityClient.updateInterceptEndpointGroupAssociation(request); + const [response] = await operation.promise(); + console.log(response); + } + + callUpdateInterceptEndpointGroupAssociation(); + // [END networksecurity_v1_generated_Intercept_UpdateInterceptEndpointGroupAssociation_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-networksecurity/samples/generated/v1/mirroring.create_mirroring_deployment.js b/packages/google-cloud-networksecurity/samples/generated/v1/mirroring.create_mirroring_deployment.js new file mode 100644 index 00000000000..0afe2ce6641 --- /dev/null +++ b/packages/google-cloud-networksecurity/samples/generated/v1/mirroring.create_mirroring_deployment.js @@ -0,0 +1,80 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent, mirroringDeploymentId, mirroringDeployment) { + // [START networksecurity_v1_generated_Mirroring_CreateMirroringDeployment_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The parent resource where this deployment will be created. + * Format: projects/{project}/locations/{location} + */ + // const parent = 'abc123' + /** + * Required. The ID to use for the new deployment, which will become the final + * component of the deployment's resource name. + */ + // const mirroringDeploymentId = 'abc123' + /** + * Required. The deployment to create. + */ + // const mirroringDeployment = {} + /** + * Optional. A unique identifier for this request. Must be a UUID4. + * This request is only idempotent if a `request_id` is provided. + * See https://google.aip.dev/155 for more details. + */ + // const requestId = 'abc123' + + // Imports the Networksecurity library + const {MirroringClient} = require('@google-cloud/network-security').v1; + + // Instantiates a client + const networksecurityClient = new MirroringClient(); + + async function callCreateMirroringDeployment() { + // Construct request + const request = { + parent, + mirroringDeploymentId, + mirroringDeployment, + }; + + // Run request + const [operation] = await networksecurityClient.createMirroringDeployment(request); + const [response] = await operation.promise(); + console.log(response); + } + + callCreateMirroringDeployment(); + // [END networksecurity_v1_generated_Mirroring_CreateMirroringDeployment_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-networksecurity/samples/generated/v1/mirroring.create_mirroring_deployment_group.js b/packages/google-cloud-networksecurity/samples/generated/v1/mirroring.create_mirroring_deployment_group.js new file mode 100644 index 00000000000..cbf5e643ee0 --- /dev/null +++ b/packages/google-cloud-networksecurity/samples/generated/v1/mirroring.create_mirroring_deployment_group.js @@ -0,0 +1,80 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent, mirroringDeploymentGroupId, mirroringDeploymentGroup) { + // [START networksecurity_v1_generated_Mirroring_CreateMirroringDeploymentGroup_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The parent resource where this deployment group will be created. + * Format: projects/{project}/locations/{location} + */ + // const parent = 'abc123' + /** + * Required. The ID to use for the new deployment group, which will become the + * final component of the deployment group's resource name. + */ + // const mirroringDeploymentGroupId = 'abc123' + /** + * Required. The deployment group to create. + */ + // const mirroringDeploymentGroup = {} + /** + * Optional. A unique identifier for this request. Must be a UUID4. + * This request is only idempotent if a `request_id` is provided. + * See https://google.aip.dev/155 for more details. + */ + // const requestId = 'abc123' + + // Imports the Networksecurity library + const {MirroringClient} = require('@google-cloud/network-security').v1; + + // Instantiates a client + const networksecurityClient = new MirroringClient(); + + async function callCreateMirroringDeploymentGroup() { + // Construct request + const request = { + parent, + mirroringDeploymentGroupId, + mirroringDeploymentGroup, + }; + + // Run request + const [operation] = await networksecurityClient.createMirroringDeploymentGroup(request); + const [response] = await operation.promise(); + console.log(response); + } + + callCreateMirroringDeploymentGroup(); + // [END networksecurity_v1_generated_Mirroring_CreateMirroringDeploymentGroup_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-networksecurity/samples/generated/v1/mirroring.create_mirroring_endpoint_group.js b/packages/google-cloud-networksecurity/samples/generated/v1/mirroring.create_mirroring_endpoint_group.js new file mode 100644 index 00000000000..fdfff873e41 --- /dev/null +++ b/packages/google-cloud-networksecurity/samples/generated/v1/mirroring.create_mirroring_endpoint_group.js @@ -0,0 +1,80 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent, mirroringEndpointGroupId, mirroringEndpointGroup) { + // [START networksecurity_v1_generated_Mirroring_CreateMirroringEndpointGroup_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The parent resource where this endpoint group will be created. + * Format: projects/{project}/locations/{location} + */ + // const parent = 'abc123' + /** + * Required. The ID to use for the endpoint group, which will become the final + * component of the endpoint group's resource name. + */ + // const mirroringEndpointGroupId = 'abc123' + /** + * Required. The endpoint group to create. + */ + // const mirroringEndpointGroup = {} + /** + * Optional. A unique identifier for this request. Must be a UUID4. + * This request is only idempotent if a `request_id` is provided. + * See https://google.aip.dev/155 for more details. + */ + // const requestId = 'abc123' + + // Imports the Networksecurity library + const {MirroringClient} = require('@google-cloud/network-security').v1; + + // Instantiates a client + const networksecurityClient = new MirroringClient(); + + async function callCreateMirroringEndpointGroup() { + // Construct request + const request = { + parent, + mirroringEndpointGroupId, + mirroringEndpointGroup, + }; + + // Run request + const [operation] = await networksecurityClient.createMirroringEndpointGroup(request); + const [response] = await operation.promise(); + console.log(response); + } + + callCreateMirroringEndpointGroup(); + // [END networksecurity_v1_generated_Mirroring_CreateMirroringEndpointGroup_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-networksecurity/samples/generated/v1/mirroring.create_mirroring_endpoint_group_association.js b/packages/google-cloud-networksecurity/samples/generated/v1/mirroring.create_mirroring_endpoint_group_association.js new file mode 100644 index 00000000000..d670ffe5363 --- /dev/null +++ b/packages/google-cloud-networksecurity/samples/generated/v1/mirroring.create_mirroring_endpoint_group_association.js @@ -0,0 +1,80 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent, mirroringEndpointGroupAssociation) { + // [START networksecurity_v1_generated_Mirroring_CreateMirroringEndpointGroupAssociation_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The parent resource where this association will be created. + * Format: projects/{project}/locations/{location} + */ + // const parent = 'abc123' + /** + * Optional. The ID to use for the new association, which will become the + * final component of the endpoint group's resource name. If not provided, the + * server will generate a unique ID. + */ + // const mirroringEndpointGroupAssociationId = 'abc123' + /** + * Required. The association to create. + */ + // const mirroringEndpointGroupAssociation = {} + /** + * Optional. A unique identifier for this request. Must be a UUID4. + * This request is only idempotent if a `request_id` is provided. + * See https://google.aip.dev/155 for more details. + */ + // const requestId = 'abc123' + + // Imports the Networksecurity library + const {MirroringClient} = require('@google-cloud/network-security').v1; + + // Instantiates a client + const networksecurityClient = new MirroringClient(); + + async function callCreateMirroringEndpointGroupAssociation() { + // Construct request + const request = { + parent, + mirroringEndpointGroupAssociation, + }; + + // Run request + const [operation] = await networksecurityClient.createMirroringEndpointGroupAssociation(request); + const [response] = await operation.promise(); + console.log(response); + } + + callCreateMirroringEndpointGroupAssociation(); + // [END networksecurity_v1_generated_Mirroring_CreateMirroringEndpointGroupAssociation_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-networksecurity/samples/generated/v1/mirroring.delete_mirroring_deployment.js b/packages/google-cloud-networksecurity/samples/generated/v1/mirroring.delete_mirroring_deployment.js new file mode 100644 index 00000000000..b82246bf251 --- /dev/null +++ b/packages/google-cloud-networksecurity/samples/generated/v1/mirroring.delete_mirroring_deployment.js @@ -0,0 +1,68 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START networksecurity_v1_generated_Mirroring_DeleteMirroringDeployment_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Name of the resource + */ + // const name = 'abc123' + /** + * Optional. A unique identifier for this request. Must be a UUID4. + * This request is only idempotent if a `request_id` is provided. + * See https://google.aip.dev/155 for more details. + */ + // const requestId = 'abc123' + + // Imports the Networksecurity library + const {MirroringClient} = require('@google-cloud/network-security').v1; + + // Instantiates a client + const networksecurityClient = new MirroringClient(); + + async function callDeleteMirroringDeployment() { + // Construct request + const request = { + name, + }; + + // Run request + const [operation] = await networksecurityClient.deleteMirroringDeployment(request); + const [response] = await operation.promise(); + console.log(response); + } + + callDeleteMirroringDeployment(); + // [END networksecurity_v1_generated_Mirroring_DeleteMirroringDeployment_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-networksecurity/samples/generated/v1/mirroring.delete_mirroring_deployment_group.js b/packages/google-cloud-networksecurity/samples/generated/v1/mirroring.delete_mirroring_deployment_group.js new file mode 100644 index 00000000000..11decb0d56b --- /dev/null +++ b/packages/google-cloud-networksecurity/samples/generated/v1/mirroring.delete_mirroring_deployment_group.js @@ -0,0 +1,68 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START networksecurity_v1_generated_Mirroring_DeleteMirroringDeploymentGroup_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The deployment group to delete. + */ + // const name = 'abc123' + /** + * Optional. A unique identifier for this request. Must be a UUID4. + * This request is only idempotent if a `request_id` is provided. + * See https://google.aip.dev/155 for more details. + */ + // const requestId = 'abc123' + + // Imports the Networksecurity library + const {MirroringClient} = require('@google-cloud/network-security').v1; + + // Instantiates a client + const networksecurityClient = new MirroringClient(); + + async function callDeleteMirroringDeploymentGroup() { + // Construct request + const request = { + name, + }; + + // Run request + const [operation] = await networksecurityClient.deleteMirroringDeploymentGroup(request); + const [response] = await operation.promise(); + console.log(response); + } + + callDeleteMirroringDeploymentGroup(); + // [END networksecurity_v1_generated_Mirroring_DeleteMirroringDeploymentGroup_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-networksecurity/samples/generated/v1/mirroring.delete_mirroring_endpoint_group.js b/packages/google-cloud-networksecurity/samples/generated/v1/mirroring.delete_mirroring_endpoint_group.js new file mode 100644 index 00000000000..1061b9c10ea --- /dev/null +++ b/packages/google-cloud-networksecurity/samples/generated/v1/mirroring.delete_mirroring_endpoint_group.js @@ -0,0 +1,68 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START networksecurity_v1_generated_Mirroring_DeleteMirroringEndpointGroup_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The endpoint group to delete. + */ + // const name = 'abc123' + /** + * Optional. A unique identifier for this request. Must be a UUID4. + * This request is only idempotent if a `request_id` is provided. + * See https://google.aip.dev/155 for more details. + */ + // const requestId = 'abc123' + + // Imports the Networksecurity library + const {MirroringClient} = require('@google-cloud/network-security').v1; + + // Instantiates a client + const networksecurityClient = new MirroringClient(); + + async function callDeleteMirroringEndpointGroup() { + // Construct request + const request = { + name, + }; + + // Run request + const [operation] = await networksecurityClient.deleteMirroringEndpointGroup(request); + const [response] = await operation.promise(); + console.log(response); + } + + callDeleteMirroringEndpointGroup(); + // [END networksecurity_v1_generated_Mirroring_DeleteMirroringEndpointGroup_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-networksecurity/samples/generated/v1/mirroring.delete_mirroring_endpoint_group_association.js b/packages/google-cloud-networksecurity/samples/generated/v1/mirroring.delete_mirroring_endpoint_group_association.js new file mode 100644 index 00000000000..11e7d9012d6 --- /dev/null +++ b/packages/google-cloud-networksecurity/samples/generated/v1/mirroring.delete_mirroring_endpoint_group_association.js @@ -0,0 +1,68 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START networksecurity_v1_generated_Mirroring_DeleteMirroringEndpointGroupAssociation_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The association to delete. + */ + // const name = 'abc123' + /** + * Optional. A unique identifier for this request. Must be a UUID4. + * This request is only idempotent if a `request_id` is provided. + * See https://google.aip.dev/155 for more details. + */ + // const requestId = 'abc123' + + // Imports the Networksecurity library + const {MirroringClient} = require('@google-cloud/network-security').v1; + + // Instantiates a client + const networksecurityClient = new MirroringClient(); + + async function callDeleteMirroringEndpointGroupAssociation() { + // Construct request + const request = { + name, + }; + + // Run request + const [operation] = await networksecurityClient.deleteMirroringEndpointGroupAssociation(request); + const [response] = await operation.promise(); + console.log(response); + } + + callDeleteMirroringEndpointGroupAssociation(); + // [END networksecurity_v1_generated_Mirroring_DeleteMirroringEndpointGroupAssociation_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-networksecurity/samples/generated/v1/mirroring.get_mirroring_deployment.js b/packages/google-cloud-networksecurity/samples/generated/v1/mirroring.get_mirroring_deployment.js new file mode 100644 index 00000000000..5339c0e1745 --- /dev/null +++ b/packages/google-cloud-networksecurity/samples/generated/v1/mirroring.get_mirroring_deployment.js @@ -0,0 +1,63 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START networksecurity_v1_generated_Mirroring_GetMirroringDeployment_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the deployment to retrieve. + * Format: + * projects/{project}/locations/{location}/mirroringDeployments/{mirroring_deployment} + */ + // const name = 'abc123' + + // Imports the Networksecurity library + const {MirroringClient} = require('@google-cloud/network-security').v1; + + // Instantiates a client + const networksecurityClient = new MirroringClient(); + + async function callGetMirroringDeployment() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await networksecurityClient.getMirroringDeployment(request); + console.log(response); + } + + callGetMirroringDeployment(); + // [END networksecurity_v1_generated_Mirroring_GetMirroringDeployment_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-networksecurity/samples/generated/v1/mirroring.get_mirroring_deployment_group.js b/packages/google-cloud-networksecurity/samples/generated/v1/mirroring.get_mirroring_deployment_group.js new file mode 100644 index 00000000000..a1d48a2bdc3 --- /dev/null +++ b/packages/google-cloud-networksecurity/samples/generated/v1/mirroring.get_mirroring_deployment_group.js @@ -0,0 +1,63 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START networksecurity_v1_generated_Mirroring_GetMirroringDeploymentGroup_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the deployment group to retrieve. + * Format: + * projects/{project}/locations/{location}/mirroringDeploymentGroups/{mirroring_deployment_group} + */ + // const name = 'abc123' + + // Imports the Networksecurity library + const {MirroringClient} = require('@google-cloud/network-security').v1; + + // Instantiates a client + const networksecurityClient = new MirroringClient(); + + async function callGetMirroringDeploymentGroup() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await networksecurityClient.getMirroringDeploymentGroup(request); + console.log(response); + } + + callGetMirroringDeploymentGroup(); + // [END networksecurity_v1_generated_Mirroring_GetMirroringDeploymentGroup_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-networksecurity/samples/generated/v1/mirroring.get_mirroring_endpoint_group.js b/packages/google-cloud-networksecurity/samples/generated/v1/mirroring.get_mirroring_endpoint_group.js new file mode 100644 index 00000000000..124740a24a3 --- /dev/null +++ b/packages/google-cloud-networksecurity/samples/generated/v1/mirroring.get_mirroring_endpoint_group.js @@ -0,0 +1,63 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START networksecurity_v1_generated_Mirroring_GetMirroringEndpointGroup_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the endpoint group to retrieve. + * Format: + * projects/{project}/locations/{location}/mirroringEndpointGroups/{mirroring_endpoint_group} + */ + // const name = 'abc123' + + // Imports the Networksecurity library + const {MirroringClient} = require('@google-cloud/network-security').v1; + + // Instantiates a client + const networksecurityClient = new MirroringClient(); + + async function callGetMirroringEndpointGroup() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await networksecurityClient.getMirroringEndpointGroup(request); + console.log(response); + } + + callGetMirroringEndpointGroup(); + // [END networksecurity_v1_generated_Mirroring_GetMirroringEndpointGroup_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-networksecurity/samples/generated/v1/mirroring.get_mirroring_endpoint_group_association.js b/packages/google-cloud-networksecurity/samples/generated/v1/mirroring.get_mirroring_endpoint_group_association.js new file mode 100644 index 00000000000..9d355d551dc --- /dev/null +++ b/packages/google-cloud-networksecurity/samples/generated/v1/mirroring.get_mirroring_endpoint_group_association.js @@ -0,0 +1,63 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START networksecurity_v1_generated_Mirroring_GetMirroringEndpointGroupAssociation_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the association to retrieve. + * Format: + * projects/{project}/locations/{location}/mirroringEndpointGroupAssociations/{mirroring_endpoint_group_association} + */ + // const name = 'abc123' + + // Imports the Networksecurity library + const {MirroringClient} = require('@google-cloud/network-security').v1; + + // Instantiates a client + const networksecurityClient = new MirroringClient(); + + async function callGetMirroringEndpointGroupAssociation() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await networksecurityClient.getMirroringEndpointGroupAssociation(request); + console.log(response); + } + + callGetMirroringEndpointGroupAssociation(); + // [END networksecurity_v1_generated_Mirroring_GetMirroringEndpointGroupAssociation_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-networksecurity/samples/generated/v1/mirroring.list_mirroring_deployment_groups.js b/packages/google-cloud-networksecurity/samples/generated/v1/mirroring.list_mirroring_deployment_groups.js new file mode 100644 index 00000000000..39028207836 --- /dev/null +++ b/packages/google-cloud-networksecurity/samples/generated/v1/mirroring.list_mirroring_deployment_groups.js @@ -0,0 +1,89 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent) { + // [START networksecurity_v1_generated_Mirroring_ListMirroringDeploymentGroups_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The parent, which owns this collection of deployment groups. + * Example: `projects/123456789/locations/global`. + * See https://google.aip.dev/132 for more details. + */ + // const parent = 'abc123' + /** + * Optional. Requested page size. Server may return fewer items than + * requested. If unspecified, server will pick an appropriate default. See + * https://google.aip.dev/158 for more details. + */ + // const pageSize = 1234 + /** + * Optional. A page token, received from a previous + * `ListMirroringDeploymentGroups` call. Provide this to retrieve the + * subsequent page. When paginating, all other parameters provided to + * `ListMirroringDeploymentGroups` must match the call that provided the page + * token. See https://google.aip.dev/158 for more details. + */ + // const pageToken = 'abc123' + /** + * Optional. Filter expression. + * See https://google.aip.dev/160#filtering for more details. + */ + // const filter = 'abc123' + /** + * Optional. Sort expression. + * See https://google.aip.dev/132#ordering for more details. + */ + // const orderBy = 'abc123' + + // Imports the Networksecurity library + const {MirroringClient} = require('@google-cloud/network-security').v1; + + // Instantiates a client + const networksecurityClient = new MirroringClient(); + + async function callListMirroringDeploymentGroups() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = networksecurityClient.listMirroringDeploymentGroupsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListMirroringDeploymentGroups(); + // [END networksecurity_v1_generated_Mirroring_ListMirroringDeploymentGroups_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-networksecurity/samples/generated/v1/mirroring.list_mirroring_deployments.js b/packages/google-cloud-networksecurity/samples/generated/v1/mirroring.list_mirroring_deployments.js new file mode 100644 index 00000000000..570ed61a5c3 --- /dev/null +++ b/packages/google-cloud-networksecurity/samples/generated/v1/mirroring.list_mirroring_deployments.js @@ -0,0 +1,89 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent) { + // [START networksecurity_v1_generated_Mirroring_ListMirroringDeployments_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The parent, which owns this collection of deployments. + * Example: `projects/123456789/locations/us-central1-a`. + * See https://google.aip.dev/132 for more details. + */ + // const parent = 'abc123' + /** + * Optional. Requested page size. Server may return fewer items than + * requested. If unspecified, server will pick an appropriate default. See + * https://google.aip.dev/158 for more details. + */ + // const pageSize = 1234 + /** + * Optional. A page token, received from a previous `ListMirroringDeployments` + * call. Provide this to retrieve the subsequent page. When paginating, all + * other parameters provided to `ListMirroringDeployments` must match the call + * that provided the page token. See https://google.aip.dev/158 for more + * details. + */ + // const pageToken = 'abc123' + /** + * Optional. Filter expression. + * See https://google.aip.dev/160#filtering for more details. + */ + // const filter = 'abc123' + /** + * Optional. Sort expression. + * See https://google.aip.dev/132#ordering for more details. + */ + // const orderBy = 'abc123' + + // Imports the Networksecurity library + const {MirroringClient} = require('@google-cloud/network-security').v1; + + // Instantiates a client + const networksecurityClient = new MirroringClient(); + + async function callListMirroringDeployments() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = networksecurityClient.listMirroringDeploymentsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListMirroringDeployments(); + // [END networksecurity_v1_generated_Mirroring_ListMirroringDeployments_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-networksecurity/samples/generated/v1/mirroring.list_mirroring_endpoint_group_associations.js b/packages/google-cloud-networksecurity/samples/generated/v1/mirroring.list_mirroring_endpoint_group_associations.js new file mode 100644 index 00000000000..79a9684332f --- /dev/null +++ b/packages/google-cloud-networksecurity/samples/generated/v1/mirroring.list_mirroring_endpoint_group_associations.js @@ -0,0 +1,89 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent) { + // [START networksecurity_v1_generated_Mirroring_ListMirroringEndpointGroupAssociations_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The parent, which owns this collection of associations. + * Example: `projects/123456789/locations/global`. + * See https://google.aip.dev/132 for more details. + */ + // const parent = 'abc123' + /** + * Optional. Requested page size. Server may return fewer items than + * requested. If unspecified, server will pick an appropriate default. See + * https://google.aip.dev/158 for more details. + */ + // const pageSize = 1234 + /** + * Optional. A page token, received from a previous + * `ListMirroringEndpointGroups` call. Provide this to retrieve the subsequent + * page. When paginating, all other parameters provided to + * `ListMirroringEndpointGroups` must match the call that provided the page + * token. See https://google.aip.dev/158 for more details. + */ + // const pageToken = 'abc123' + /** + * Optional. Filter expression. + * See https://google.aip.dev/160#filtering for more details. + */ + // const filter = 'abc123' + /** + * Optional. Sort expression. + * See https://google.aip.dev/132#ordering for more details. + */ + // const orderBy = 'abc123' + + // Imports the Networksecurity library + const {MirroringClient} = require('@google-cloud/network-security').v1; + + // Instantiates a client + const networksecurityClient = new MirroringClient(); + + async function callListMirroringEndpointGroupAssociations() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = networksecurityClient.listMirroringEndpointGroupAssociationsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListMirroringEndpointGroupAssociations(); + // [END networksecurity_v1_generated_Mirroring_ListMirroringEndpointGroupAssociations_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-networksecurity/samples/generated/v1/mirroring.list_mirroring_endpoint_groups.js b/packages/google-cloud-networksecurity/samples/generated/v1/mirroring.list_mirroring_endpoint_groups.js new file mode 100644 index 00000000000..0f7162474f2 --- /dev/null +++ b/packages/google-cloud-networksecurity/samples/generated/v1/mirroring.list_mirroring_endpoint_groups.js @@ -0,0 +1,90 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent) { + // [START networksecurity_v1_generated_Mirroring_ListMirroringEndpointGroups_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The parent, which owns this collection of endpoint groups. + * Example: `projects/123456789/locations/global`. + * See https://google.aip.dev/132 for more details. + */ + // const parent = 'abc123' + /** + * Optional. Requested page size. Server may return fewer items than + * requested. If unspecified, server will pick an appropriate default. See + * https://google.aip.dev/158 for more details. + */ + // const pageSize = 1234 + /** + * Optional. A page token, received from a previous + * `ListMirroringEndpointGroups` call. Provide this to retrieve the subsequent + * page. When paginating, all other parameters provided to + * `ListMirroringEndpointGroups` must match the call that provided the page + * token. + * See https://google.aip.dev/158 for more details. + */ + // const pageToken = 'abc123' + /** + * Optional. Filter expression. + * See https://google.aip.dev/160#filtering for more details. + */ + // const filter = 'abc123' + /** + * Optional. Sort expression. + * See https://google.aip.dev/132#ordering for more details. + */ + // const orderBy = 'abc123' + + // Imports the Networksecurity library + const {MirroringClient} = require('@google-cloud/network-security').v1; + + // Instantiates a client + const networksecurityClient = new MirroringClient(); + + async function callListMirroringEndpointGroups() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = networksecurityClient.listMirroringEndpointGroupsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListMirroringEndpointGroups(); + // [END networksecurity_v1_generated_Mirroring_ListMirroringEndpointGroups_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-networksecurity/samples/generated/v1/mirroring.update_mirroring_deployment.js b/packages/google-cloud-networksecurity/samples/generated/v1/mirroring.update_mirroring_deployment.js new file mode 100644 index 00000000000..92fd984017f --- /dev/null +++ b/packages/google-cloud-networksecurity/samples/generated/v1/mirroring.update_mirroring_deployment.js @@ -0,0 +1,75 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(mirroringDeployment) { + // [START networksecurity_v1_generated_Mirroring_UpdateMirroringDeployment_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Optional. The list of fields to update. + * Fields are specified relative to the deployment + * (e.g. `description`; *not* `mirroring_deployment.description`). + * See https://google.aip.dev/161 for more details. + */ + // const updateMask = {} + /** + * Required. The deployment to update. + */ + // const mirroringDeployment = {} + /** + * Optional. A unique identifier for this request. Must be a UUID4. + * This request is only idempotent if a `request_id` is provided. + * See https://google.aip.dev/155 for more details. + */ + // const requestId = 'abc123' + + // Imports the Networksecurity library + const {MirroringClient} = require('@google-cloud/network-security').v1; + + // Instantiates a client + const networksecurityClient = new MirroringClient(); + + async function callUpdateMirroringDeployment() { + // Construct request + const request = { + mirroringDeployment, + }; + + // Run request + const [operation] = await networksecurityClient.updateMirroringDeployment(request); + const [response] = await operation.promise(); + console.log(response); + } + + callUpdateMirroringDeployment(); + // [END networksecurity_v1_generated_Mirroring_UpdateMirroringDeployment_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-networksecurity/samples/generated/v1/mirroring.update_mirroring_deployment_group.js b/packages/google-cloud-networksecurity/samples/generated/v1/mirroring.update_mirroring_deployment_group.js new file mode 100644 index 00000000000..2642ba4f385 --- /dev/null +++ b/packages/google-cloud-networksecurity/samples/generated/v1/mirroring.update_mirroring_deployment_group.js @@ -0,0 +1,76 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(mirroringDeploymentGroup) { + // [START networksecurity_v1_generated_Mirroring_UpdateMirroringDeploymentGroup_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Optional. The list of fields to update. + * Fields are specified relative to the deployment group + * (e.g. `description`; *not* + * `mirroring_deployment_group.description`). See + * https://google.aip.dev/161 for more details. + */ + // const updateMask = {} + /** + * Required. The deployment group to update. + */ + // const mirroringDeploymentGroup = {} + /** + * Optional. A unique identifier for this request. Must be a UUID4. + * This request is only idempotent if a `request_id` is provided. + * See https://google.aip.dev/155 for more details. + */ + // const requestId = 'abc123' + + // Imports the Networksecurity library + const {MirroringClient} = require('@google-cloud/network-security').v1; + + // Instantiates a client + const networksecurityClient = new MirroringClient(); + + async function callUpdateMirroringDeploymentGroup() { + // Construct request + const request = { + mirroringDeploymentGroup, + }; + + // Run request + const [operation] = await networksecurityClient.updateMirroringDeploymentGroup(request); + const [response] = await operation.promise(); + console.log(response); + } + + callUpdateMirroringDeploymentGroup(); + // [END networksecurity_v1_generated_Mirroring_UpdateMirroringDeploymentGroup_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-networksecurity/samples/generated/v1/mirroring.update_mirroring_endpoint_group.js b/packages/google-cloud-networksecurity/samples/generated/v1/mirroring.update_mirroring_endpoint_group.js new file mode 100644 index 00000000000..2187e1c952e --- /dev/null +++ b/packages/google-cloud-networksecurity/samples/generated/v1/mirroring.update_mirroring_endpoint_group.js @@ -0,0 +1,75 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(mirroringEndpointGroup) { + // [START networksecurity_v1_generated_Mirroring_UpdateMirroringEndpointGroup_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Optional. The list of fields to update. + * Fields are specified relative to the endpoint group + * (e.g. `description`; *not* `mirroring_endpoint_group.description`). + * See https://google.aip.dev/161 for more details. + */ + // const updateMask = {} + /** + * Required. The endpoint group to update. + */ + // const mirroringEndpointGroup = {} + /** + * Optional. A unique identifier for this request. Must be a UUID4. + * This request is only idempotent if a `request_id` is provided. + * See https://google.aip.dev/155 for more details. + */ + // const requestId = 'abc123' + + // Imports the Networksecurity library + const {MirroringClient} = require('@google-cloud/network-security').v1; + + // Instantiates a client + const networksecurityClient = new MirroringClient(); + + async function callUpdateMirroringEndpointGroup() { + // Construct request + const request = { + mirroringEndpointGroup, + }; + + // Run request + const [operation] = await networksecurityClient.updateMirroringEndpointGroup(request); + const [response] = await operation.promise(); + console.log(response); + } + + callUpdateMirroringEndpointGroup(); + // [END networksecurity_v1_generated_Mirroring_UpdateMirroringEndpointGroup_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-networksecurity/samples/generated/v1/mirroring.update_mirroring_endpoint_group_association.js b/packages/google-cloud-networksecurity/samples/generated/v1/mirroring.update_mirroring_endpoint_group_association.js new file mode 100644 index 00000000000..d4ce91e4ced --- /dev/null +++ b/packages/google-cloud-networksecurity/samples/generated/v1/mirroring.update_mirroring_endpoint_group_association.js @@ -0,0 +1,76 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(mirroringEndpointGroupAssociation) { + // [START networksecurity_v1_generated_Mirroring_UpdateMirroringEndpointGroupAssociation_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Optional. The list of fields to update. + * Fields are specified relative to the association + * (e.g. `description`; *not* + * `mirroring_endpoint_group_association.description`). See + * https://google.aip.dev/161 for more details. + */ + // const updateMask = {} + /** + * Required. The association to update. + */ + // const mirroringEndpointGroupAssociation = {} + /** + * Optional. A unique identifier for this request. Must be a UUID4. + * This request is only idempotent if a `request_id` is provided. + * See https://google.aip.dev/155 for more details. + */ + // const requestId = 'abc123' + + // Imports the Networksecurity library + const {MirroringClient} = require('@google-cloud/network-security').v1; + + // Instantiates a client + const networksecurityClient = new MirroringClient(); + + async function callUpdateMirroringEndpointGroupAssociation() { + // Construct request + const request = { + mirroringEndpointGroupAssociation, + }; + + // Run request + const [operation] = await networksecurityClient.updateMirroringEndpointGroupAssociation(request); + const [response] = await operation.promise(); + console.log(response); + } + + callUpdateMirroringEndpointGroupAssociation(); + // [END networksecurity_v1_generated_Mirroring_UpdateMirroringEndpointGroupAssociation_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-networksecurity/samples/generated/v1/network_security.create_authz_policy.js b/packages/google-cloud-networksecurity/samples/generated/v1/network_security.create_authz_policy.js new file mode 100644 index 00000000000..691c5554bb2 --- /dev/null +++ b/packages/google-cloud-networksecurity/samples/generated/v1/network_security.create_authz_policy.js @@ -0,0 +1,87 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent, authzPolicyId, authzPolicy) { + // [START networksecurity_v1_generated_NetworkSecurity_CreateAuthzPolicy_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The parent resource of the `AuthzPolicy` resource. Must be in + * the format `projects/{project}/locations/{location}`. + */ + // const parent = 'abc123' + /** + * Required. User-provided ID of the `AuthzPolicy` resource to be created. + */ + // const authzPolicyId = 'abc123' + /** + * Required. `AuthzPolicy` resource to be created. + */ + // const authzPolicy = {} + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server can ignore + * the request if it has already been completed. The server guarantees + * that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and the + * request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, ignores the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + */ + // const requestId = 'abc123' + + // Imports the Networksecurity library + const {NetworkSecurityClient} = require('@google-cloud/network-security').v1; + + // Instantiates a client + const networksecurityClient = new NetworkSecurityClient(); + + async function callCreateAuthzPolicy() { + // Construct request + const request = { + parent, + authzPolicyId, + authzPolicy, + }; + + // Run request + const [operation] = await networksecurityClient.createAuthzPolicy(request); + const [response] = await operation.promise(); + console.log(response); + } + + callCreateAuthzPolicy(); + // [END networksecurity_v1_generated_NetworkSecurity_CreateAuthzPolicy_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-networksecurity/samples/generated/v1/network_security.create_backend_authentication_config.js b/packages/google-cloud-networksecurity/samples/generated/v1/network_security.create_backend_authentication_config.js new file mode 100644 index 00000000000..ebc8d2a79da --- /dev/null +++ b/packages/google-cloud-networksecurity/samples/generated/v1/network_security.create_backend_authentication_config.js @@ -0,0 +1,76 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent, backendAuthenticationConfigId, backendAuthenticationConfig) { + // [START networksecurity_v1_generated_NetworkSecurity_CreateBackendAuthenticationConfig_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The parent resource of the BackendAuthenticationConfig. Must be + * in the format `projects/* /locations/{location}`. + */ + // const parent = 'abc123' + /** + * Required. Short name of the BackendAuthenticationConfig resource to be + * created. This value should be 1-63 characters long, containing only + * letters, numbers, hyphens, and underscores, and should not start with a + * number. E.g. "backend-auth-config". + */ + // const backendAuthenticationConfigId = 'abc123' + /** + * Required. BackendAuthenticationConfig resource to be created. + */ + // const backendAuthenticationConfig = {} + + // Imports the Networksecurity library + const {NetworkSecurityClient} = require('@google-cloud/network-security').v1; + + // Instantiates a client + const networksecurityClient = new NetworkSecurityClient(); + + async function callCreateBackendAuthenticationConfig() { + // Construct request + const request = { + parent, + backendAuthenticationConfigId, + backendAuthenticationConfig, + }; + + // Run request + const [operation] = await networksecurityClient.createBackendAuthenticationConfig(request); + const [response] = await operation.promise(); + console.log(response); + } + + callCreateBackendAuthenticationConfig(); + // [END networksecurity_v1_generated_NetworkSecurity_CreateBackendAuthenticationConfig_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-networksecurity/samples/generated/v1/network_security.create_client_tls_policy.js b/packages/google-cloud-networksecurity/samples/generated/v1/network_security.create_client_tls_policy.js index 6d0594c851e..feccd66babc 100644 --- a/packages/google-cloud-networksecurity/samples/generated/v1/network_security.create_client_tls_policy.js +++ b/packages/google-cloud-networksecurity/samples/generated/v1/network_security.create_client_tls_policy.js @@ -34,9 +34,10 @@ function main(parent, clientTlsPolicyId, clientTlsPolicy) { */ // const parent = 'abc123' /** - * Required. Short name of the ClientTlsPolicy resource to be created. This value should - * be 1-63 characters long, containing only letters, numbers, hyphens, and - * underscores, and should not start with a number. E.g. "client_mtls_policy". + * Required. Short name of the ClientTlsPolicy resource to be created. This + * value should be 1-63 characters long, containing only letters, numbers, + * hyphens, and underscores, and should not start with a number. E.g. + * "client_mtls_policy". */ // const clientTlsPolicyId = 'abc123' /** diff --git a/packages/google-cloud-networksecurity/samples/generated/v1/network_security.create_gateway_security_policy.js b/packages/google-cloud-networksecurity/samples/generated/v1/network_security.create_gateway_security_policy.js new file mode 100644 index 00000000000..21332028c22 --- /dev/null +++ b/packages/google-cloud-networksecurity/samples/generated/v1/network_security.create_gateway_security_policy.js @@ -0,0 +1,76 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent, gatewaySecurityPolicyId, gatewaySecurityPolicy) { + // [START networksecurity_v1_generated_NetworkSecurity_CreateGatewaySecurityPolicy_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The parent resource of the GatewaySecurityPolicy. Must be in the + * format `projects/{project}/locations/{location}`. + */ + // const parent = 'abc123' + /** + * Required. Short name of the GatewaySecurityPolicy resource to be created. + * This value should be 1-63 characters long, containing only + * letters, numbers, hyphens, and underscores, and should not start + * with a number. E.g. "gateway_security_policy1". + */ + // const gatewaySecurityPolicyId = 'abc123' + /** + * Required. GatewaySecurityPolicy resource to be created. + */ + // const gatewaySecurityPolicy = {} + + // Imports the Networksecurity library + const {NetworkSecurityClient} = require('@google-cloud/network-security').v1; + + // Instantiates a client + const networksecurityClient = new NetworkSecurityClient(); + + async function callCreateGatewaySecurityPolicy() { + // Construct request + const request = { + parent, + gatewaySecurityPolicyId, + gatewaySecurityPolicy, + }; + + // Run request + const [operation] = await networksecurityClient.createGatewaySecurityPolicy(request); + const [response] = await operation.promise(); + console.log(response); + } + + callCreateGatewaySecurityPolicy(); + // [END networksecurity_v1_generated_NetworkSecurity_CreateGatewaySecurityPolicy_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-networksecurity/samples/generated/v1/network_security.create_gateway_security_policy_rule.js b/packages/google-cloud-networksecurity/samples/generated/v1/network_security.create_gateway_security_policy_rule.js new file mode 100644 index 00000000000..f5b52144741 --- /dev/null +++ b/packages/google-cloud-networksecurity/samples/generated/v1/network_security.create_gateway_security_policy_rule.js @@ -0,0 +1,76 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent, gatewaySecurityPolicyRule) { + // [START networksecurity_v1_generated_NetworkSecurity_CreateGatewaySecurityPolicyRule_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The parent where this rule will be created. + * Format : + * projects/{project}/location/{location}/gatewaySecurityPolicies/* + */ + // const parent = 'abc123' + /** + * Required. The rule to be created. + */ + // const gatewaySecurityPolicyRule = {} + /** + * The ID to use for the rule, which will become the final component of + * the rule's resource name. + * This value should be 4-63 characters, and valid characters + * are /[a-z][0-9]-/. + */ + // const gatewaySecurityPolicyRuleId = 'abc123' + + // Imports the Networksecurity library + const {NetworkSecurityClient} = require('@google-cloud/network-security').v1; + + // Instantiates a client + const networksecurityClient = new NetworkSecurityClient(); + + async function callCreateGatewaySecurityPolicyRule() { + // Construct request + const request = { + parent, + gatewaySecurityPolicyRule, + }; + + // Run request + const [operation] = await networksecurityClient.createGatewaySecurityPolicyRule(request); + const [response] = await operation.promise(); + console.log(response); + } + + callCreateGatewaySecurityPolicyRule(); + // [END networksecurity_v1_generated_NetworkSecurity_CreateGatewaySecurityPolicyRule_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-networksecurity/samples/generated/v1/network_security.create_server_tls_policy.js b/packages/google-cloud-networksecurity/samples/generated/v1/network_security.create_server_tls_policy.js index 72d361cb544..b7facc74a00 100644 --- a/packages/google-cloud-networksecurity/samples/generated/v1/network_security.create_server_tls_policy.js +++ b/packages/google-cloud-networksecurity/samples/generated/v1/network_security.create_server_tls_policy.js @@ -34,9 +34,10 @@ function main(parent, serverTlsPolicyId, serverTlsPolicy) { */ // const parent = 'abc123' /** - * Required. Short name of the ServerTlsPolicy resource to be created. This value should - * be 1-63 characters long, containing only letters, numbers, hyphens, and - * underscores, and should not start with a number. E.g. "server_mtls_policy". + * Required. Short name of the ServerTlsPolicy resource to be created. This + * value should be 1-63 characters long, containing only letters, numbers, + * hyphens, and underscores, and should not start with a number. E.g. + * "server_mtls_policy". */ // const serverTlsPolicyId = 'abc123' /** diff --git a/packages/google-cloud-networksecurity/samples/generated/v1/network_security.create_tls_inspection_policy.js b/packages/google-cloud-networksecurity/samples/generated/v1/network_security.create_tls_inspection_policy.js new file mode 100644 index 00000000000..abbffe1b71c --- /dev/null +++ b/packages/google-cloud-networksecurity/samples/generated/v1/network_security.create_tls_inspection_policy.js @@ -0,0 +1,76 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent, tlsInspectionPolicyId, tlsInspectionPolicy) { + // [START networksecurity_v1_generated_NetworkSecurity_CreateTlsInspectionPolicy_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The parent resource of the TlsInspectionPolicy. Must be in the + * format `projects/{project}/locations/{location}`. + */ + // const parent = 'abc123' + /** + * Required. Short name of the TlsInspectionPolicy resource to be created. + * This value should be 1-63 characters long, containing only + * letters, numbers, hyphens, and underscores, and should not start + * with a number. E.g. "tls_inspection_policy1". + */ + // const tlsInspectionPolicyId = 'abc123' + /** + * Required. TlsInspectionPolicy resource to be created. + */ + // const tlsInspectionPolicy = {} + + // Imports the Networksecurity library + const {NetworkSecurityClient} = require('@google-cloud/network-security').v1; + + // Instantiates a client + const networksecurityClient = new NetworkSecurityClient(); + + async function callCreateTlsInspectionPolicy() { + // Construct request + const request = { + parent, + tlsInspectionPolicyId, + tlsInspectionPolicy, + }; + + // Run request + const [operation] = await networksecurityClient.createTlsInspectionPolicy(request); + const [response] = await operation.promise(); + console.log(response); + } + + callCreateTlsInspectionPolicy(); + // [END networksecurity_v1_generated_NetworkSecurity_CreateTlsInspectionPolicy_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-networksecurity/samples/generated/v1/network_security.create_url_list.js b/packages/google-cloud-networksecurity/samples/generated/v1/network_security.create_url_list.js new file mode 100644 index 00000000000..3d8b1edbf4d --- /dev/null +++ b/packages/google-cloud-networksecurity/samples/generated/v1/network_security.create_url_list.js @@ -0,0 +1,75 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent, urlListId, urlList) { + // [START networksecurity_v1_generated_NetworkSecurity_CreateUrlList_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The parent resource of the UrlList. Must be in + * the format `projects/* /locations/{location}`. + */ + // const parent = 'abc123' + /** + * Required. Short name of the UrlList resource to be created. This value + * should be 1-63 characters long, containing only letters, numbers, hyphens, + * and underscores, and should not start with a number. E.g. "url_list". + */ + // const urlListId = 'abc123' + /** + * Required. UrlList resource to be created. + */ + // const urlList = {} + + // Imports the Networksecurity library + const {NetworkSecurityClient} = require('@google-cloud/network-security').v1; + + // Instantiates a client + const networksecurityClient = new NetworkSecurityClient(); + + async function callCreateUrlList() { + // Construct request + const request = { + parent, + urlListId, + urlList, + }; + + // Run request + const [operation] = await networksecurityClient.createUrlList(request); + const [response] = await operation.promise(); + console.log(response); + } + + callCreateUrlList(); + // [END networksecurity_v1_generated_NetworkSecurity_CreateUrlList_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-networksecurity/samples/generated/v1/network_security.delete_authorization_policy.js b/packages/google-cloud-networksecurity/samples/generated/v1/network_security.delete_authorization_policy.js index 9d56a8ac06e..81ac95c25b3 100644 --- a/packages/google-cloud-networksecurity/samples/generated/v1/network_security.delete_authorization_policy.js +++ b/packages/google-cloud-networksecurity/samples/generated/v1/network_security.delete_authorization_policy.js @@ -29,8 +29,8 @@ function main(name) { * TODO(developer): Uncomment these variables before running the sample. */ /** - * Required. A name of the AuthorizationPolicy to delete. Must be in the format - * `projects/{project}/locations/{location}/authorizationPolicies/*`. + * Required. A name of the AuthorizationPolicy to delete. Must be in the + * format `projects/{project}/locations/{location}/authorizationPolicies/*`. */ // const name = 'abc123' diff --git a/packages/google-cloud-networksecurity/samples/generated/v1/network_security.delete_authz_policy.js b/packages/google-cloud-networksecurity/samples/generated/v1/network_security.delete_authz_policy.js new file mode 100644 index 00000000000..2fbef61ac15 --- /dev/null +++ b/packages/google-cloud-networksecurity/samples/generated/v1/network_security.delete_authz_policy.js @@ -0,0 +1,78 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START networksecurity_v1_generated_NetworkSecurity_DeleteAuthzPolicy_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the `AuthzPolicy` resource to delete. Must be in + * the format + * `projects/{project}/locations/{location}/authzPolicies/{authz_policy}`. + */ + // const name = 'abc123' + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server can ignore + * the request if it has already been completed. The server guarantees + * that for at least 60 minutes after the first request. + * For example, consider a situation where you make an initial request and the + * request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, ignores the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + */ + // const requestId = 'abc123' + + // Imports the Networksecurity library + const {NetworkSecurityClient} = require('@google-cloud/network-security').v1; + + // Instantiates a client + const networksecurityClient = new NetworkSecurityClient(); + + async function callDeleteAuthzPolicy() { + // Construct request + const request = { + name, + }; + + // Run request + const [operation] = await networksecurityClient.deleteAuthzPolicy(request); + const [response] = await operation.promise(); + console.log(response); + } + + callDeleteAuthzPolicy(); + // [END networksecurity_v1_generated_NetworkSecurity_DeleteAuthzPolicy_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-networksecurity/samples/generated/v1/network_security.delete_backend_authentication_config.js b/packages/google-cloud-networksecurity/samples/generated/v1/network_security.delete_backend_authentication_config.js new file mode 100644 index 00000000000..57eb72e9d0b --- /dev/null +++ b/packages/google-cloud-networksecurity/samples/generated/v1/network_security.delete_backend_authentication_config.js @@ -0,0 +1,69 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START networksecurity_v1_generated_NetworkSecurity_DeleteBackendAuthenticationConfig_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. A name of the BackendAuthenticationConfig to delete. Must be in + * the format + * `projects/* /locations/{location}/backendAuthenticationConfigs/*`. + */ + // const name = 'abc123' + /** + * Optional. Etag of the resource. + * If this is provided, it must match the server's etag. + */ + // const etag = 'abc123' + + // Imports the Networksecurity library + const {NetworkSecurityClient} = require('@google-cloud/network-security').v1; + + // Instantiates a client + const networksecurityClient = new NetworkSecurityClient(); + + async function callDeleteBackendAuthenticationConfig() { + // Construct request + const request = { + name, + }; + + // Run request + const [operation] = await networksecurityClient.deleteBackendAuthenticationConfig(request); + const [response] = await operation.promise(); + console.log(response); + } + + callDeleteBackendAuthenticationConfig(); + // [END networksecurity_v1_generated_NetworkSecurity_DeleteBackendAuthenticationConfig_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-networksecurity/samples/generated/v1/network_security.delete_gateway_security_policy.js b/packages/google-cloud-networksecurity/samples/generated/v1/network_security.delete_gateway_security_policy.js new file mode 100644 index 00000000000..fd6db618068 --- /dev/null +++ b/packages/google-cloud-networksecurity/samples/generated/v1/network_security.delete_gateway_security_policy.js @@ -0,0 +1,63 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START networksecurity_v1_generated_NetworkSecurity_DeleteGatewaySecurityPolicy_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. A name of the GatewaySecurityPolicy to delete. Must be in the + * format `projects/{project}/locations/{location}/gatewaySecurityPolicies/*`. + */ + // const name = 'abc123' + + // Imports the Networksecurity library + const {NetworkSecurityClient} = require('@google-cloud/network-security').v1; + + // Instantiates a client + const networksecurityClient = new NetworkSecurityClient(); + + async function callDeleteGatewaySecurityPolicy() { + // Construct request + const request = { + name, + }; + + // Run request + const [operation] = await networksecurityClient.deleteGatewaySecurityPolicy(request); + const [response] = await operation.promise(); + console.log(response); + } + + callDeleteGatewaySecurityPolicy(); + // [END networksecurity_v1_generated_NetworkSecurity_DeleteGatewaySecurityPolicy_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-networksecurity/samples/generated/v1/network_security.delete_gateway_security_policy_rule.js b/packages/google-cloud-networksecurity/samples/generated/v1/network_security.delete_gateway_security_policy_rule.js new file mode 100644 index 00000000000..82814bfbdf8 --- /dev/null +++ b/packages/google-cloud-networksecurity/samples/generated/v1/network_security.delete_gateway_security_policy_rule.js @@ -0,0 +1,64 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START networksecurity_v1_generated_NetworkSecurity_DeleteGatewaySecurityPolicyRule_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. A name of the GatewaySecurityPolicyRule to delete. Must be in the + * format + * `projects/{project}/locations/{location}/gatewaySecurityPolicies/{gatewaySecurityPolicy}/rules/*`. + */ + // const name = 'abc123' + + // Imports the Networksecurity library + const {NetworkSecurityClient} = require('@google-cloud/network-security').v1; + + // Instantiates a client + const networksecurityClient = new NetworkSecurityClient(); + + async function callDeleteGatewaySecurityPolicyRule() { + // Construct request + const request = { + name, + }; + + // Run request + const [operation] = await networksecurityClient.deleteGatewaySecurityPolicyRule(request); + const [response] = await operation.promise(); + console.log(response); + } + + callDeleteGatewaySecurityPolicyRule(); + // [END networksecurity_v1_generated_NetworkSecurity_DeleteGatewaySecurityPolicyRule_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-networksecurity/samples/generated/v1/network_security.delete_tls_inspection_policy.js b/packages/google-cloud-networksecurity/samples/generated/v1/network_security.delete_tls_inspection_policy.js new file mode 100644 index 00000000000..cf47bc4f780 --- /dev/null +++ b/packages/google-cloud-networksecurity/samples/generated/v1/network_security.delete_tls_inspection_policy.js @@ -0,0 +1,70 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START networksecurity_v1_generated_NetworkSecurity_DeleteTlsInspectionPolicy_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. A name of the TlsInspectionPolicy to delete. Must be in the + * format + * `projects/{project}/locations/{location}/tlsInspectionPolicies/{tls_inspection_policy}`. + */ + // const name = 'abc123' + /** + * If set to true, any rules for this TlsInspectionPolicy will also be + * deleted. (Otherwise, the request will only work if the TlsInspectionPolicy + * has no rules.) + */ + // const force = true + + // Imports the Networksecurity library + const {NetworkSecurityClient} = require('@google-cloud/network-security').v1; + + // Instantiates a client + const networksecurityClient = new NetworkSecurityClient(); + + async function callDeleteTlsInspectionPolicy() { + // Construct request + const request = { + name, + }; + + // Run request + const [operation] = await networksecurityClient.deleteTlsInspectionPolicy(request); + const [response] = await operation.promise(); + console.log(response); + } + + callDeleteTlsInspectionPolicy(); + // [END networksecurity_v1_generated_NetworkSecurity_DeleteTlsInspectionPolicy_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-networksecurity/samples/generated/v1/network_security.delete_url_list.js b/packages/google-cloud-networksecurity/samples/generated/v1/network_security.delete_url_list.js new file mode 100644 index 00000000000..db6c4b1095e --- /dev/null +++ b/packages/google-cloud-networksecurity/samples/generated/v1/network_security.delete_url_list.js @@ -0,0 +1,63 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START networksecurity_v1_generated_NetworkSecurity_DeleteUrlList_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. A name of the UrlList to delete. Must be in + * the format `projects/* /locations/{location}/urlLists/*`. + */ + // const name = 'abc123' + + // Imports the Networksecurity library + const {NetworkSecurityClient} = require('@google-cloud/network-security').v1; + + // Instantiates a client + const networksecurityClient = new NetworkSecurityClient(); + + async function callDeleteUrlList() { + // Construct request + const request = { + name, + }; + + // Run request + const [operation] = await networksecurityClient.deleteUrlList(request); + const [response] = await operation.promise(); + console.log(response); + } + + callDeleteUrlList(); + // [END networksecurity_v1_generated_NetworkSecurity_DeleteUrlList_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-networksecurity/samples/generated/v1/network_security.get_authz_policy.js b/packages/google-cloud-networksecurity/samples/generated/v1/network_security.get_authz_policy.js new file mode 100644 index 00000000000..9947aaa819f --- /dev/null +++ b/packages/google-cloud-networksecurity/samples/generated/v1/network_security.get_authz_policy.js @@ -0,0 +1,63 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START networksecurity_v1_generated_NetworkSecurity_GetAuthzPolicy_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. A name of the `AuthzPolicy` resource to get. Must be in the + * format + * `projects/{project}/locations/{location}/authzPolicies/{authz_policy}`. + */ + // const name = 'abc123' + + // Imports the Networksecurity library + const {NetworkSecurityClient} = require('@google-cloud/network-security').v1; + + // Instantiates a client + const networksecurityClient = new NetworkSecurityClient(); + + async function callGetAuthzPolicy() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await networksecurityClient.getAuthzPolicy(request); + console.log(response); + } + + callGetAuthzPolicy(); + // [END networksecurity_v1_generated_NetworkSecurity_GetAuthzPolicy_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-networksecurity/samples/generated/v1/network_security.get_backend_authentication_config.js b/packages/google-cloud-networksecurity/samples/generated/v1/network_security.get_backend_authentication_config.js new file mode 100644 index 00000000000..97f718539d2 --- /dev/null +++ b/packages/google-cloud-networksecurity/samples/generated/v1/network_security.get_backend_authentication_config.js @@ -0,0 +1,62 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START networksecurity_v1_generated_NetworkSecurity_GetBackendAuthenticationConfig_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. A name of the BackendAuthenticationConfig to get. Must be in the + * format `projects/* /locations/{location}/backendAuthenticationConfigs/*`. + */ + // const name = 'abc123' + + // Imports the Networksecurity library + const {NetworkSecurityClient} = require('@google-cloud/network-security').v1; + + // Instantiates a client + const networksecurityClient = new NetworkSecurityClient(); + + async function callGetBackendAuthenticationConfig() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await networksecurityClient.getBackendAuthenticationConfig(request); + console.log(response); + } + + callGetBackendAuthenticationConfig(); + // [END networksecurity_v1_generated_NetworkSecurity_GetBackendAuthenticationConfig_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-networksecurity/samples/generated/v1/network_security.get_gateway_security_policy.js b/packages/google-cloud-networksecurity/samples/generated/v1/network_security.get_gateway_security_policy.js new file mode 100644 index 00000000000..3f8d3377fd1 --- /dev/null +++ b/packages/google-cloud-networksecurity/samples/generated/v1/network_security.get_gateway_security_policy.js @@ -0,0 +1,62 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START networksecurity_v1_generated_NetworkSecurity_GetGatewaySecurityPolicy_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. A name of the GatewaySecurityPolicy to get. Must be in the format + * `projects/{project}/locations/{location}/gatewaySecurityPolicies/*`. + */ + // const name = 'abc123' + + // Imports the Networksecurity library + const {NetworkSecurityClient} = require('@google-cloud/network-security').v1; + + // Instantiates a client + const networksecurityClient = new NetworkSecurityClient(); + + async function callGetGatewaySecurityPolicy() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await networksecurityClient.getGatewaySecurityPolicy(request); + console.log(response); + } + + callGetGatewaySecurityPolicy(); + // [END networksecurity_v1_generated_NetworkSecurity_GetGatewaySecurityPolicy_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-networksecurity/samples/generated/v1/network_security.get_gateway_security_policy_rule.js b/packages/google-cloud-networksecurity/samples/generated/v1/network_security.get_gateway_security_policy_rule.js new file mode 100644 index 00000000000..793f5387532 --- /dev/null +++ b/packages/google-cloud-networksecurity/samples/generated/v1/network_security.get_gateway_security_policy_rule.js @@ -0,0 +1,63 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START networksecurity_v1_generated_NetworkSecurity_GetGatewaySecurityPolicyRule_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the GatewaySecurityPolicyRule to retrieve. + * Format: + * projects/{project}/location/{location}/gatewaySecurityPolicies/* /rules/* + */ + // const name = 'abc123' + + // Imports the Networksecurity library + const {NetworkSecurityClient} = require('@google-cloud/network-security').v1; + + // Instantiates a client + const networksecurityClient = new NetworkSecurityClient(); + + async function callGetGatewaySecurityPolicyRule() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await networksecurityClient.getGatewaySecurityPolicyRule(request); + console.log(response); + } + + callGetGatewaySecurityPolicyRule(); + // [END networksecurity_v1_generated_NetworkSecurity_GetGatewaySecurityPolicyRule_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-networksecurity/samples/generated/v1/network_security.get_tls_inspection_policy.js b/packages/google-cloud-networksecurity/samples/generated/v1/network_security.get_tls_inspection_policy.js new file mode 100644 index 00000000000..666a5d985e7 --- /dev/null +++ b/packages/google-cloud-networksecurity/samples/generated/v1/network_security.get_tls_inspection_policy.js @@ -0,0 +1,62 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START networksecurity_v1_generated_NetworkSecurity_GetTlsInspectionPolicy_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. A name of the TlsInspectionPolicy to get. Must be in the format + * `projects/{project}/locations/{location}/tlsInspectionPolicies/{tls_inspection_policy}`. + */ + // const name = 'abc123' + + // Imports the Networksecurity library + const {NetworkSecurityClient} = require('@google-cloud/network-security').v1; + + // Instantiates a client + const networksecurityClient = new NetworkSecurityClient(); + + async function callGetTlsInspectionPolicy() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await networksecurityClient.getTlsInspectionPolicy(request); + console.log(response); + } + + callGetTlsInspectionPolicy(); + // [END networksecurity_v1_generated_NetworkSecurity_GetTlsInspectionPolicy_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-networksecurity/samples/generated/v1/network_security.get_url_list.js b/packages/google-cloud-networksecurity/samples/generated/v1/network_security.get_url_list.js new file mode 100644 index 00000000000..230ebdba573 --- /dev/null +++ b/packages/google-cloud-networksecurity/samples/generated/v1/network_security.get_url_list.js @@ -0,0 +1,62 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START networksecurity_v1_generated_NetworkSecurity_GetUrlList_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. A name of the UrlList to get. Must be in the format + * `projects/* /locations/{location}/urlLists/*`. + */ + // const name = 'abc123' + + // Imports the Networksecurity library + const {NetworkSecurityClient} = require('@google-cloud/network-security').v1; + + // Instantiates a client + const networksecurityClient = new NetworkSecurityClient(); + + async function callGetUrlList() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await networksecurityClient.getUrlList(request); + console.log(response); + } + + callGetUrlList(); + // [END networksecurity_v1_generated_NetworkSecurity_GetUrlList_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-networksecurity/samples/generated/v1/network_security.list_authz_policies.js b/packages/google-cloud-networksecurity/samples/generated/v1/network_security.list_authz_policies.js new file mode 100644 index 00000000000..6c16a6e8c55 --- /dev/null +++ b/packages/google-cloud-networksecurity/samples/generated/v1/network_security.list_authz_policies.js @@ -0,0 +1,82 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent) { + // [START networksecurity_v1_generated_NetworkSecurity_ListAuthzPolicies_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The project and location from which the `AuthzPolicy` resources + * are listed, specified in the following format: + * `projects/{project}/locations/{location}`. + */ + // const parent = 'abc123' + /** + * Optional. Requested page size. The server might return fewer items than + * requested. If unspecified, the server picks an appropriate default. + */ + // const pageSize = 1234 + /** + * Optional. A token identifying a page of results that the server returns. + */ + // const pageToken = 'abc123' + /** + * Optional. Filtering results. + */ + // const filter = 'abc123' + /** + * Optional. Hint for how to order the results. + */ + // const orderBy = 'abc123' + + // Imports the Networksecurity library + const {NetworkSecurityClient} = require('@google-cloud/network-security').v1; + + // Instantiates a client + const networksecurityClient = new NetworkSecurityClient(); + + async function callListAuthzPolicies() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = networksecurityClient.listAuthzPoliciesAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListAuthzPolicies(); + // [END networksecurity_v1_generated_NetworkSecurity_ListAuthzPolicies_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-networksecurity/samples/generated/v1/network_security.list_backend_authentication_configs.js b/packages/google-cloud-networksecurity/samples/generated/v1/network_security.list_backend_authentication_configs.js new file mode 100644 index 00000000000..75d04f1329b --- /dev/null +++ b/packages/google-cloud-networksecurity/samples/generated/v1/network_security.list_backend_authentication_configs.js @@ -0,0 +1,76 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent) { + // [START networksecurity_v1_generated_NetworkSecurity_ListBackendAuthenticationConfigs_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The project and location from which the + * BackendAuthenticationConfigs should be listed, specified in the format + * `projects/* /locations/{location}`. + */ + // const parent = 'abc123' + /** + * Maximum number of BackendAuthenticationConfigs to return per call. + */ + // const pageSize = 1234 + /** + * The value returned by the last `ListBackendAuthenticationConfigsResponse` + * Indicates that this is a continuation of a prior + * `ListBackendAuthenticationConfigs` call, and that the system + * should return the next page of data. + */ + // const pageToken = 'abc123' + + // Imports the Networksecurity library + const {NetworkSecurityClient} = require('@google-cloud/network-security').v1; + + // Instantiates a client + const networksecurityClient = new NetworkSecurityClient(); + + async function callListBackendAuthenticationConfigs() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = networksecurityClient.listBackendAuthenticationConfigsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListBackendAuthenticationConfigs(); + // [END networksecurity_v1_generated_NetworkSecurity_ListBackendAuthenticationConfigs_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-networksecurity/samples/generated/v1/network_security.list_gateway_security_policies.js b/packages/google-cloud-networksecurity/samples/generated/v1/network_security.list_gateway_security_policies.js new file mode 100644 index 00000000000..863e2155699 --- /dev/null +++ b/packages/google-cloud-networksecurity/samples/generated/v1/network_security.list_gateway_security_policies.js @@ -0,0 +1,76 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent) { + // [START networksecurity_v1_generated_NetworkSecurity_ListGatewaySecurityPolicies_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The project and location from which the GatewaySecurityPolicies + * should be listed, specified in the format + * `projects/{project}/locations/{location}`. + */ + // const parent = 'abc123' + /** + * Maximum number of GatewaySecurityPolicies to return per call. + */ + // const pageSize = 1234 + /** + * The value returned by the last + * 'ListGatewaySecurityPoliciesResponse' Indicates that this is a + * continuation of a prior 'ListGatewaySecurityPolicies' call, and + * that the system should return the next page of data. + */ + // const pageToken = 'abc123' + + // Imports the Networksecurity library + const {NetworkSecurityClient} = require('@google-cloud/network-security').v1; + + // Instantiates a client + const networksecurityClient = new NetworkSecurityClient(); + + async function callListGatewaySecurityPolicies() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = networksecurityClient.listGatewaySecurityPoliciesAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListGatewaySecurityPolicies(); + // [END networksecurity_v1_generated_NetworkSecurity_ListGatewaySecurityPolicies_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-networksecurity/samples/generated/v1/network_security.list_gateway_security_policy_rules.js b/packages/google-cloud-networksecurity/samples/generated/v1/network_security.list_gateway_security_policy_rules.js new file mode 100644 index 00000000000..54b8a1ce582 --- /dev/null +++ b/packages/google-cloud-networksecurity/samples/generated/v1/network_security.list_gateway_security_policy_rules.js @@ -0,0 +1,76 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent) { + // [START networksecurity_v1_generated_NetworkSecurity_ListGatewaySecurityPolicyRules_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The project, location and GatewaySecurityPolicy from which the + * GatewaySecurityPolicyRules should be listed, specified in the format + * `projects/{project}/locations/{location}/gatewaySecurityPolicies/{gatewaySecurityPolicy}`. + */ + // const parent = 'abc123' + /** + * Maximum number of GatewaySecurityPolicyRules to return per call. + */ + // const pageSize = 1234 + /** + * The value returned by the last + * 'ListGatewaySecurityPolicyRulesResponse' Indicates that this is a + * continuation of a prior 'ListGatewaySecurityPolicyRules' call, and + * that the system should return the next page of data. + */ + // const pageToken = 'abc123' + + // Imports the Networksecurity library + const {NetworkSecurityClient} = require('@google-cloud/network-security').v1; + + // Instantiates a client + const networksecurityClient = new NetworkSecurityClient(); + + async function callListGatewaySecurityPolicyRules() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = networksecurityClient.listGatewaySecurityPolicyRulesAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListGatewaySecurityPolicyRules(); + // [END networksecurity_v1_generated_NetworkSecurity_ListGatewaySecurityPolicyRules_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-networksecurity/samples/generated/v1/network_security.list_server_tls_policies.js b/packages/google-cloud-networksecurity/samples/generated/v1/network_security.list_server_tls_policies.js index 5874ae17f0a..fd80a98a192 100644 --- a/packages/google-cloud-networksecurity/samples/generated/v1/network_security.list_server_tls_policies.js +++ b/packages/google-cloud-networksecurity/samples/generated/v1/network_security.list_server_tls_policies.js @@ -44,6 +44,14 @@ function main(parent) { * should return the next page of data. */ // const pageToken = 'abc123' + /** + * Optional. Setting this field to `true` will opt the request into returning + * the resources that are reachable, and into including the names of those + * that were unreachable in the ListServerTlsPoliciesResponse.unreachable + * field. This can only be `true` when reading across collections e.g. when + * `parent` is set to `"projects/example/locations/-"`. + */ + // const returnPartialSuccess = true // Imports the Networksecurity library const {NetworkSecurityClient} = require('@google-cloud/network-security').v1; diff --git a/packages/google-cloud-networksecurity/samples/generated/v1/network_security.list_tls_inspection_policies.js b/packages/google-cloud-networksecurity/samples/generated/v1/network_security.list_tls_inspection_policies.js new file mode 100644 index 00000000000..0c87810d933 --- /dev/null +++ b/packages/google-cloud-networksecurity/samples/generated/v1/network_security.list_tls_inspection_policies.js @@ -0,0 +1,76 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent) { + // [START networksecurity_v1_generated_NetworkSecurity_ListTlsInspectionPolicies_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The project and location from which the TlsInspectionPolicies + * should be listed, specified in the format + * `projects/{project}/locations/{location}`. + */ + // const parent = 'abc123' + /** + * Maximum number of TlsInspectionPolicies to return per call. + */ + // const pageSize = 1234 + /** + * The value returned by the last + * 'ListTlsInspectionPoliciesResponse' Indicates that this is a + * continuation of a prior 'ListTlsInspectionPolicies' call, and + * that the system should return the next page of data. + */ + // const pageToken = 'abc123' + + // Imports the Networksecurity library + const {NetworkSecurityClient} = require('@google-cloud/network-security').v1; + + // Instantiates a client + const networksecurityClient = new NetworkSecurityClient(); + + async function callListTlsInspectionPolicies() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = networksecurityClient.listTlsInspectionPoliciesAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListTlsInspectionPolicies(); + // [END networksecurity_v1_generated_NetworkSecurity_ListTlsInspectionPolicies_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-networksecurity/samples/generated/v1/network_security.list_url_lists.js b/packages/google-cloud-networksecurity/samples/generated/v1/network_security.list_url_lists.js new file mode 100644 index 00000000000..feaec453b41 --- /dev/null +++ b/packages/google-cloud-networksecurity/samples/generated/v1/network_security.list_url_lists.js @@ -0,0 +1,76 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent) { + // [START networksecurity_v1_generated_NetworkSecurity_ListUrlLists_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The project and location from which the UrlLists should + * be listed, specified in the format + * `projects/{project}/locations/{location}`. + */ + // const parent = 'abc123' + /** + * Maximum number of UrlLists to return per call. + */ + // const pageSize = 1234 + /** + * The value returned by the last `ListUrlListsResponse` + * Indicates that this is a continuation of a prior + * `ListUrlLists` call, and that the system + * should return the next page of data. + */ + // const pageToken = 'abc123' + + // Imports the Networksecurity library + const {NetworkSecurityClient} = require('@google-cloud/network-security').v1; + + // Instantiates a client + const networksecurityClient = new NetworkSecurityClient(); + + async function callListUrlLists() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = networksecurityClient.listUrlListsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListUrlLists(); + // [END networksecurity_v1_generated_NetworkSecurity_ListUrlLists_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-networksecurity/samples/generated/v1/network_security.update_authz_policy.js b/packages/google-cloud-networksecurity/samples/generated/v1/network_security.update_authz_policy.js new file mode 100644 index 00000000000..2f097a4db86 --- /dev/null +++ b/packages/google-cloud-networksecurity/samples/generated/v1/network_security.update_authz_policy.js @@ -0,0 +1,85 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(updateMask, authzPolicy) { + // [START networksecurity_v1_generated_NetworkSecurity_UpdateAuthzPolicy_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Used to specify the fields to be overwritten in the + * `AuthzPolicy` resource by the update. + * The fields specified in the `update_mask` are relative to the resource, not + * the full request. A field is overwritten if it is in the mask. If the + * user does not specify a mask, then all fields are overwritten. + */ + // const updateMask = {} + /** + * Required. `AuthzPolicy` resource being updated. + */ + // const authzPolicy = {} + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server can ignore + * the request if it has already been completed. The server guarantees + * that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and the + * request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, ignores the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + */ + // const requestId = 'abc123' + + // Imports the Networksecurity library + const {NetworkSecurityClient} = require('@google-cloud/network-security').v1; + + // Instantiates a client + const networksecurityClient = new NetworkSecurityClient(); + + async function callUpdateAuthzPolicy() { + // Construct request + const request = { + updateMask, + authzPolicy, + }; + + // Run request + const [operation] = await networksecurityClient.updateAuthzPolicy(request); + const [response] = await operation.promise(); + console.log(response); + } + + callUpdateAuthzPolicy(); + // [END networksecurity_v1_generated_NetworkSecurity_UpdateAuthzPolicy_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-networksecurity/samples/generated/v1/network_security.update_backend_authentication_config.js b/packages/google-cloud-networksecurity/samples/generated/v1/network_security.update_backend_authentication_config.js new file mode 100644 index 00000000000..8dad4e41a50 --- /dev/null +++ b/packages/google-cloud-networksecurity/samples/generated/v1/network_security.update_backend_authentication_config.js @@ -0,0 +1,71 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(backendAuthenticationConfig) { + // [START networksecurity_v1_generated_NetworkSecurity_UpdateBackendAuthenticationConfig_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Optional. Field mask is used to specify the fields to be overwritten in the + * BackendAuthenticationConfig resource by the update. The fields + * specified in the update_mask are relative to the resource, not + * the full request. A field will be overwritten if it is in the + * mask. If the user does not provide a mask then all fields will be + * overwritten. + */ + // const updateMask = {} + /** + * Required. Updated BackendAuthenticationConfig resource. + */ + // const backendAuthenticationConfig = {} + + // Imports the Networksecurity library + const {NetworkSecurityClient} = require('@google-cloud/network-security').v1; + + // Instantiates a client + const networksecurityClient = new NetworkSecurityClient(); + + async function callUpdateBackendAuthenticationConfig() { + // Construct request + const request = { + backendAuthenticationConfig, + }; + + // Run request + const [operation] = await networksecurityClient.updateBackendAuthenticationConfig(request); + const [response] = await operation.promise(); + console.log(response); + } + + callUpdateBackendAuthenticationConfig(); + // [END networksecurity_v1_generated_NetworkSecurity_UpdateBackendAuthenticationConfig_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-networksecurity/samples/generated/v1/network_security.update_gateway_security_policy.js b/packages/google-cloud-networksecurity/samples/generated/v1/network_security.update_gateway_security_policy.js new file mode 100644 index 00000000000..9bdc5dc0f11 --- /dev/null +++ b/packages/google-cloud-networksecurity/samples/generated/v1/network_security.update_gateway_security_policy.js @@ -0,0 +1,70 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(gatewaySecurityPolicy) { + // [START networksecurity_v1_generated_NetworkSecurity_UpdateGatewaySecurityPolicy_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Optional. Field mask is used to specify the fields to be overwritten in the + * GatewaySecurityPolicy resource by the update. + * The fields specified in the update_mask are relative to the resource, not + * the full request. A field will be overwritten if it is in the mask. If the + * user does not provide a mask then all fields will be overwritten. + */ + // const updateMask = {} + /** + * Required. Updated GatewaySecurityPolicy resource. + */ + // const gatewaySecurityPolicy = {} + + // Imports the Networksecurity library + const {NetworkSecurityClient} = require('@google-cloud/network-security').v1; + + // Instantiates a client + const networksecurityClient = new NetworkSecurityClient(); + + async function callUpdateGatewaySecurityPolicy() { + // Construct request + const request = { + gatewaySecurityPolicy, + }; + + // Run request + const [operation] = await networksecurityClient.updateGatewaySecurityPolicy(request); + const [response] = await operation.promise(); + console.log(response); + } + + callUpdateGatewaySecurityPolicy(); + // [END networksecurity_v1_generated_NetworkSecurity_UpdateGatewaySecurityPolicy_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-networksecurity/samples/generated/v1/network_security.update_gateway_security_policy_rule.js b/packages/google-cloud-networksecurity/samples/generated/v1/network_security.update_gateway_security_policy_rule.js new file mode 100644 index 00000000000..0d406e049f1 --- /dev/null +++ b/packages/google-cloud-networksecurity/samples/generated/v1/network_security.update_gateway_security_policy_rule.js @@ -0,0 +1,70 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(gatewaySecurityPolicyRule) { + // [START networksecurity_v1_generated_NetworkSecurity_UpdateGatewaySecurityPolicyRule_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Optional. Field mask is used to specify the fields to be overwritten in the + * GatewaySecurityPolicy resource by the update. + * The fields specified in the update_mask are relative to the resource, not + * the full request. A field will be overwritten if it is in the mask. If the + * user does not provide a mask then all fields will be overwritten. + */ + // const updateMask = {} + /** + * Required. Updated GatewaySecurityPolicyRule resource. + */ + // const gatewaySecurityPolicyRule = {} + + // Imports the Networksecurity library + const {NetworkSecurityClient} = require('@google-cloud/network-security').v1; + + // Instantiates a client + const networksecurityClient = new NetworkSecurityClient(); + + async function callUpdateGatewaySecurityPolicyRule() { + // Construct request + const request = { + gatewaySecurityPolicyRule, + }; + + // Run request + const [operation] = await networksecurityClient.updateGatewaySecurityPolicyRule(request); + const [response] = await operation.promise(); + console.log(response); + } + + callUpdateGatewaySecurityPolicyRule(); + // [END networksecurity_v1_generated_NetworkSecurity_UpdateGatewaySecurityPolicyRule_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-networksecurity/samples/generated/v1/network_security.update_tls_inspection_policy.js b/packages/google-cloud-networksecurity/samples/generated/v1/network_security.update_tls_inspection_policy.js new file mode 100644 index 00000000000..66f7decea1d --- /dev/null +++ b/packages/google-cloud-networksecurity/samples/generated/v1/network_security.update_tls_inspection_policy.js @@ -0,0 +1,70 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(tlsInspectionPolicy) { + // [START networksecurity_v1_generated_NetworkSecurity_UpdateTlsInspectionPolicy_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Optional. Field mask is used to specify the fields to be overwritten in the + * TlsInspectionPolicy resource by the update. + * The fields specified in the update_mask are relative to the resource, not + * the full request. A field will be overwritten if it is in the mask. If the + * user does not provide a mask then all fields will be overwritten. + */ + // const updateMask = {} + /** + * Required. Updated TlsInspectionPolicy resource. + */ + // const tlsInspectionPolicy = {} + + // Imports the Networksecurity library + const {NetworkSecurityClient} = require('@google-cloud/network-security').v1; + + // Instantiates a client + const networksecurityClient = new NetworkSecurityClient(); + + async function callUpdateTlsInspectionPolicy() { + // Construct request + const request = { + tlsInspectionPolicy, + }; + + // Run request + const [operation] = await networksecurityClient.updateTlsInspectionPolicy(request); + const [response] = await operation.promise(); + console.log(response); + } + + callUpdateTlsInspectionPolicy(); + // [END networksecurity_v1_generated_NetworkSecurity_UpdateTlsInspectionPolicy_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-networksecurity/samples/generated/v1/network_security.update_url_list.js b/packages/google-cloud-networksecurity/samples/generated/v1/network_security.update_url_list.js new file mode 100644 index 00000000000..bf3d420cd18 --- /dev/null +++ b/packages/google-cloud-networksecurity/samples/generated/v1/network_security.update_url_list.js @@ -0,0 +1,71 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(urlList) { + // [START networksecurity_v1_generated_NetworkSecurity_UpdateUrlList_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Optional. Field mask is used to specify the fields to be overwritten in the + * UrlList resource by the update. The fields + * specified in the update_mask are relative to the resource, not + * the full request. A field will be overwritten if it is in the + * mask. If the user does not provide a mask then all fields will be + * overwritten. + */ + // const updateMask = {} + /** + * Required. Updated UrlList resource. + */ + // const urlList = {} + + // Imports the Networksecurity library + const {NetworkSecurityClient} = require('@google-cloud/network-security').v1; + + // Instantiates a client + const networksecurityClient = new NetworkSecurityClient(); + + async function callUpdateUrlList() { + // Construct request + const request = { + urlList, + }; + + // Run request + const [operation] = await networksecurityClient.updateUrlList(request); + const [response] = await operation.promise(); + console.log(response); + } + + callUpdateUrlList(); + // [END networksecurity_v1_generated_NetworkSecurity_UpdateUrlList_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-networksecurity/samples/generated/v1/organization_security_profile_group_service.create_security_profile.js b/packages/google-cloud-networksecurity/samples/generated/v1/organization_security_profile_group_service.create_security_profile.js new file mode 100644 index 00000000000..204fac2d0e8 --- /dev/null +++ b/packages/google-cloud-networksecurity/samples/generated/v1/organization_security_profile_group_service.create_security_profile.js @@ -0,0 +1,76 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent, securityProfileId, securityProfile) { + // [START networksecurity_v1_generated_OrganizationSecurityProfileGroupService_CreateSecurityProfile_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The parent resource of the SecurityProfile. Must be in the format + * `projects|organizations/* /locations/{location}`. + */ + // const parent = 'abc123' + /** + * Required. Short name of the SecurityProfile resource to be created. This + * value should be 1-63 characters long, containing only letters, numbers, + * hyphens, and underscores, and should not start with a number. E.g. + * "security_profile1". + */ + // const securityProfileId = 'abc123' + /** + * Required. SecurityProfile resource to be created. + */ + // const securityProfile = {} + + // Imports the Networksecurity library + const {OrganizationSecurityProfileGroupServiceClient} = require('@google-cloud/network-security').v1; + + // Instantiates a client + const networksecurityClient = new OrganizationSecurityProfileGroupServiceClient(); + + async function callCreateSecurityProfile() { + // Construct request + const request = { + parent, + securityProfileId, + securityProfile, + }; + + // Run request + const [operation] = await networksecurityClient.createSecurityProfile(request); + const [response] = await operation.promise(); + console.log(response); + } + + callCreateSecurityProfile(); + // [END networksecurity_v1_generated_OrganizationSecurityProfileGroupService_CreateSecurityProfile_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-networksecurity/samples/generated/v1/organization_security_profile_group_service.create_security_profile_group.js b/packages/google-cloud-networksecurity/samples/generated/v1/organization_security_profile_group_service.create_security_profile_group.js new file mode 100644 index 00000000000..52bb8bd2297 --- /dev/null +++ b/packages/google-cloud-networksecurity/samples/generated/v1/organization_security_profile_group_service.create_security_profile_group.js @@ -0,0 +1,76 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent, securityProfileGroupId, securityProfileGroup) { + // [START networksecurity_v1_generated_OrganizationSecurityProfileGroupService_CreateSecurityProfileGroup_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The parent resource of the SecurityProfileGroup. Must be in the + * format `projects|organizations/* /locations/{location}`. + */ + // const parent = 'abc123' + /** + * Required. Short name of the SecurityProfileGroup resource to be created. + * This value should be 1-63 characters long, containing only + * letters, numbers, hyphens, and underscores, and should not start + * with a number. E.g. "security_profile_group1". + */ + // const securityProfileGroupId = 'abc123' + /** + * Required. SecurityProfileGroup resource to be created. + */ + // const securityProfileGroup = {} + + // Imports the Networksecurity library + const {OrganizationSecurityProfileGroupServiceClient} = require('@google-cloud/network-security').v1; + + // Instantiates a client + const networksecurityClient = new OrganizationSecurityProfileGroupServiceClient(); + + async function callCreateSecurityProfileGroup() { + // Construct request + const request = { + parent, + securityProfileGroupId, + securityProfileGroup, + }; + + // Run request + const [operation] = await networksecurityClient.createSecurityProfileGroup(request); + const [response] = await operation.promise(); + console.log(response); + } + + callCreateSecurityProfileGroup(); + // [END networksecurity_v1_generated_OrganizationSecurityProfileGroupService_CreateSecurityProfileGroup_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-networksecurity/samples/generated/v1/organization_security_profile_group_service.delete_security_profile.js b/packages/google-cloud-networksecurity/samples/generated/v1/organization_security_profile_group_service.delete_security_profile.js new file mode 100644 index 00000000000..38d9d60d5da --- /dev/null +++ b/packages/google-cloud-networksecurity/samples/generated/v1/organization_security_profile_group_service.delete_security_profile.js @@ -0,0 +1,68 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START networksecurity_v1_generated_OrganizationSecurityProfileGroupService_DeleteSecurityProfile_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. A name of the SecurityProfile to delete. Must be in the format + * `projects|organizations/* /locations/{location}/securityProfiles/{security_profile_id}`. + */ + // const name = 'abc123' + /** + * Optional. If client provided etag is out of date, delete will return + * FAILED_PRECONDITION error. + */ + // const etag = 'abc123' + + // Imports the Networksecurity library + const {OrganizationSecurityProfileGroupServiceClient} = require('@google-cloud/network-security').v1; + + // Instantiates a client + const networksecurityClient = new OrganizationSecurityProfileGroupServiceClient(); + + async function callDeleteSecurityProfile() { + // Construct request + const request = { + name, + }; + + // Run request + const [operation] = await networksecurityClient.deleteSecurityProfile(request); + const [response] = await operation.promise(); + console.log(response); + } + + callDeleteSecurityProfile(); + // [END networksecurity_v1_generated_OrganizationSecurityProfileGroupService_DeleteSecurityProfile_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-networksecurity/samples/generated/v1/organization_security_profile_group_service.delete_security_profile_group.js b/packages/google-cloud-networksecurity/samples/generated/v1/organization_security_profile_group_service.delete_security_profile_group.js new file mode 100644 index 00000000000..dccc797caca --- /dev/null +++ b/packages/google-cloud-networksecurity/samples/generated/v1/organization_security_profile_group_service.delete_security_profile_group.js @@ -0,0 +1,69 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START networksecurity_v1_generated_OrganizationSecurityProfileGroupService_DeleteSecurityProfileGroup_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. A name of the SecurityProfileGroup to delete. Must be in the + * format + * `projects|organizations/* /locations/{location}/securityProfileGroups/{security_profile_group}`. + */ + // const name = 'abc123' + /** + * Optional. If client provided etag is out of date, delete will return + * FAILED_PRECONDITION error. + */ + // const etag = 'abc123' + + // Imports the Networksecurity library + const {OrganizationSecurityProfileGroupServiceClient} = require('@google-cloud/network-security').v1; + + // Instantiates a client + const networksecurityClient = new OrganizationSecurityProfileGroupServiceClient(); + + async function callDeleteSecurityProfileGroup() { + // Construct request + const request = { + name, + }; + + // Run request + const [operation] = await networksecurityClient.deleteSecurityProfileGroup(request); + const [response] = await operation.promise(); + console.log(response); + } + + callDeleteSecurityProfileGroup(); + // [END networksecurity_v1_generated_OrganizationSecurityProfileGroupService_DeleteSecurityProfileGroup_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-networksecurity/samples/generated/v1/organization_security_profile_group_service.get_security_profile.js b/packages/google-cloud-networksecurity/samples/generated/v1/organization_security_profile_group_service.get_security_profile.js new file mode 100644 index 00000000000..091bd7a7e63 --- /dev/null +++ b/packages/google-cloud-networksecurity/samples/generated/v1/organization_security_profile_group_service.get_security_profile.js @@ -0,0 +1,62 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START networksecurity_v1_generated_OrganizationSecurityProfileGroupService_GetSecurityProfile_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. A name of the SecurityProfile to get. Must be in the format + * `projects|organizations/* /locations/{location}/securityProfiles/{security_profile_id}`. + */ + // const name = 'abc123' + + // Imports the Networksecurity library + const {OrganizationSecurityProfileGroupServiceClient} = require('@google-cloud/network-security').v1; + + // Instantiates a client + const networksecurityClient = new OrganizationSecurityProfileGroupServiceClient(); + + async function callGetSecurityProfile() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await networksecurityClient.getSecurityProfile(request); + console.log(response); + } + + callGetSecurityProfile(); + // [END networksecurity_v1_generated_OrganizationSecurityProfileGroupService_GetSecurityProfile_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-networksecurity/samples/generated/v1/organization_security_profile_group_service.get_security_profile_group.js b/packages/google-cloud-networksecurity/samples/generated/v1/organization_security_profile_group_service.get_security_profile_group.js new file mode 100644 index 00000000000..d4de3810136 --- /dev/null +++ b/packages/google-cloud-networksecurity/samples/generated/v1/organization_security_profile_group_service.get_security_profile_group.js @@ -0,0 +1,62 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START networksecurity_v1_generated_OrganizationSecurityProfileGroupService_GetSecurityProfileGroup_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. A name of the SecurityProfileGroup to get. Must be in the format + * `projects|organizations/* /locations/{location}/securityProfileGroups/{security_profile_group}`. + */ + // const name = 'abc123' + + // Imports the Networksecurity library + const {OrganizationSecurityProfileGroupServiceClient} = require('@google-cloud/network-security').v1; + + // Instantiates a client + const networksecurityClient = new OrganizationSecurityProfileGroupServiceClient(); + + async function callGetSecurityProfileGroup() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await networksecurityClient.getSecurityProfileGroup(request); + console.log(response); + } + + callGetSecurityProfileGroup(); + // [END networksecurity_v1_generated_OrganizationSecurityProfileGroupService_GetSecurityProfileGroup_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-networksecurity/samples/generated/v1/organization_security_profile_group_service.list_security_profile_groups.js b/packages/google-cloud-networksecurity/samples/generated/v1/organization_security_profile_group_service.list_security_profile_groups.js new file mode 100644 index 00000000000..af657b51315 --- /dev/null +++ b/packages/google-cloud-networksecurity/samples/generated/v1/organization_security_profile_group_service.list_security_profile_groups.js @@ -0,0 +1,76 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent) { + // [START networksecurity_v1_generated_OrganizationSecurityProfileGroupService_ListSecurityProfileGroups_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The project or organization and location from which the + * SecurityProfileGroups should be listed, specified in the format + * `projects|organizations/* /locations/{location}`. + */ + // const parent = 'abc123' + /** + * Optional. Maximum number of SecurityProfileGroups to return per call. + */ + // const pageSize = 1234 + /** + * Optional. The value returned by the last + * `ListSecurityProfileGroupsResponse` Indicates that this is a + * continuation of a prior `ListSecurityProfileGroups` call, and + * that the system should return the next page of data. + */ + // const pageToken = 'abc123' + + // Imports the Networksecurity library + const {OrganizationSecurityProfileGroupServiceClient} = require('@google-cloud/network-security').v1; + + // Instantiates a client + const networksecurityClient = new OrganizationSecurityProfileGroupServiceClient(); + + async function callListSecurityProfileGroups() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = networksecurityClient.listSecurityProfileGroupsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListSecurityProfileGroups(); + // [END networksecurity_v1_generated_OrganizationSecurityProfileGroupService_ListSecurityProfileGroups_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-networksecurity/samples/generated/v1/organization_security_profile_group_service.list_security_profiles.js b/packages/google-cloud-networksecurity/samples/generated/v1/organization_security_profile_group_service.list_security_profiles.js new file mode 100644 index 00000000000..93f66d0a29e --- /dev/null +++ b/packages/google-cloud-networksecurity/samples/generated/v1/organization_security_profile_group_service.list_security_profiles.js @@ -0,0 +1,76 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent) { + // [START networksecurity_v1_generated_OrganizationSecurityProfileGroupService_ListSecurityProfiles_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The project or organization and location from which the + * SecurityProfiles should be listed, specified in the format + * `projects|organizations/* /locations/{location}`. + */ + // const parent = 'abc123' + /** + * Optional. Maximum number of SecurityProfiles to return per call. + */ + // const pageSize = 1234 + /** + * Optional. The value returned by the last + * `ListSecurityProfilesResponse` Indicates that this is a continuation of a + * prior `ListSecurityProfiles` call, and that the system should return the + * next page of data. + */ + // const pageToken = 'abc123' + + // Imports the Networksecurity library + const {OrganizationSecurityProfileGroupServiceClient} = require('@google-cloud/network-security').v1; + + // Instantiates a client + const networksecurityClient = new OrganizationSecurityProfileGroupServiceClient(); + + async function callListSecurityProfiles() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = networksecurityClient.listSecurityProfilesAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListSecurityProfiles(); + // [END networksecurity_v1_generated_OrganizationSecurityProfileGroupService_ListSecurityProfiles_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-networksecurity/samples/generated/v1/organization_security_profile_group_service.update_security_profile.js b/packages/google-cloud-networksecurity/samples/generated/v1/organization_security_profile_group_service.update_security_profile.js new file mode 100644 index 00000000000..5b7d56bf199 --- /dev/null +++ b/packages/google-cloud-networksecurity/samples/generated/v1/organization_security_profile_group_service.update_security_profile.js @@ -0,0 +1,70 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(updateMask, securityProfile) { + // [START networksecurity_v1_generated_OrganizationSecurityProfileGroupService_UpdateSecurityProfile_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Field mask is used to specify the fields to be overwritten in the + * SecurityProfile resource by the update. + * The fields specified in the update_mask are relative to the resource, not + * the full request. A field will be overwritten if it is in the mask. + */ + // const updateMask = {} + /** + * Required. Updated SecurityProfile resource. + */ + // const securityProfile = {} + + // Imports the Networksecurity library + const {OrganizationSecurityProfileGroupServiceClient} = require('@google-cloud/network-security').v1; + + // Instantiates a client + const networksecurityClient = new OrganizationSecurityProfileGroupServiceClient(); + + async function callUpdateSecurityProfile() { + // Construct request + const request = { + updateMask, + securityProfile, + }; + + // Run request + const [operation] = await networksecurityClient.updateSecurityProfile(request); + const [response] = await operation.promise(); + console.log(response); + } + + callUpdateSecurityProfile(); + // [END networksecurity_v1_generated_OrganizationSecurityProfileGroupService_UpdateSecurityProfile_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-networksecurity/samples/generated/v1/organization_security_profile_group_service.update_security_profile_group.js b/packages/google-cloud-networksecurity/samples/generated/v1/organization_security_profile_group_service.update_security_profile_group.js new file mode 100644 index 00000000000..c0487ab9ceb --- /dev/null +++ b/packages/google-cloud-networksecurity/samples/generated/v1/organization_security_profile_group_service.update_security_profile_group.js @@ -0,0 +1,70 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(updateMask, securityProfileGroup) { + // [START networksecurity_v1_generated_OrganizationSecurityProfileGroupService_UpdateSecurityProfileGroup_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Field mask is used to specify the fields to be overwritten in the + * SecurityProfileGroup resource by the update. + * The fields specified in the update_mask are relative to the resource, not + * the full request. A field will be overwritten if it is in the mask. + */ + // const updateMask = {} + /** + * Required. Updated SecurityProfileGroup resource. + */ + // const securityProfileGroup = {} + + // Imports the Networksecurity library + const {OrganizationSecurityProfileGroupServiceClient} = require('@google-cloud/network-security').v1; + + // Instantiates a client + const networksecurityClient = new OrganizationSecurityProfileGroupServiceClient(); + + async function callUpdateSecurityProfileGroup() { + // Construct request + const request = { + updateMask, + securityProfileGroup, + }; + + // Run request + const [operation] = await networksecurityClient.updateSecurityProfileGroup(request); + const [response] = await operation.promise(); + console.log(response); + } + + callUpdateSecurityProfileGroup(); + // [END networksecurity_v1_generated_OrganizationSecurityProfileGroupService_UpdateSecurityProfileGroup_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-networksecurity/samples/generated/v1/snippet_metadata_google.cloud.networksecurity.v1.json b/packages/google-cloud-networksecurity/samples/generated/v1/snippet_metadata_google.cloud.networksecurity.v1.json index 30c8c93d3a0..3d5168ac9dc 100644 --- a/packages/google-cloud-networksecurity/samples/generated/v1/snippet_metadata_google.cloud.networksecurity.v1.json +++ b/packages/google-cloud-networksecurity/samples/generated/v1/snippet_metadata_google.cloud.networksecurity.v1.json @@ -440,23 +440,23 @@ } }, { - "regionTag": "networksecurity_v1_generated_NetworkSecurity_ListAuthorizationPolicies_async", - "title": "AddressGroupService listAuthorizationPolicies Sample", + "regionTag": "networksecurity_v1_generated_DnsThreatDetectorService_ListDnsThreatDetectors_async", + "title": "AddressGroupService listDnsThreatDetectors Sample", "origin": "API_DEFINITION", - "description": " Lists AuthorizationPolicies in a given project and location.", + "description": " Lists DnsThreatDetectors in a given project and location.", "canonical": true, - "file": "network_security.list_authorization_policies.js", + "file": "dns_threat_detector_service.list_dns_threat_detectors.js", "language": "JAVASCRIPT", "segments": [ { "start": 25, - "end": 68, + "end": 66, "type": "FULL" } ], "clientMethod": { - "shortName": "ListAuthorizationPolicies", - "fullName": "google.cloud.networksecurity.v1.NetworkSecurity.ListAuthorizationPolicies", + "shortName": "ListDnsThreatDetectors", + "fullName": "google.cloud.networksecurity.v1.DnsThreatDetectorService.ListDnsThreatDetectors", "async": true, "parameters": [ { @@ -472,39 +472,39 @@ "type": "TYPE_STRING" } ], - "resultType": ".google.cloud.networksecurity.v1.ListAuthorizationPoliciesResponse", + "resultType": ".google.cloud.networksecurity.v1.ListDnsThreatDetectorsResponse", "client": { - "shortName": "NetworkSecurityClient", - "fullName": "google.cloud.networksecurity.v1.NetworkSecurityClient" + "shortName": "DnsThreatDetectorServiceClient", + "fullName": "google.cloud.networksecurity.v1.DnsThreatDetectorServiceClient" }, "method": { - "shortName": "ListAuthorizationPolicies", - "fullName": "google.cloud.networksecurity.v1.NetworkSecurity.ListAuthorizationPolicies", + "shortName": "ListDnsThreatDetectors", + "fullName": "google.cloud.networksecurity.v1.DnsThreatDetectorService.ListDnsThreatDetectors", "service": { - "shortName": "NetworkSecurity", - "fullName": "google.cloud.networksecurity.v1.NetworkSecurity" + "shortName": "DnsThreatDetectorService", + "fullName": "google.cloud.networksecurity.v1.DnsThreatDetectorService" } } } }, { - "regionTag": "networksecurity_v1_generated_NetworkSecurity_GetAuthorizationPolicy_async", - "title": "AddressGroupService getAuthorizationPolicy Sample", + "regionTag": "networksecurity_v1_generated_DnsThreatDetectorService_GetDnsThreatDetector_async", + "title": "AddressGroupService getDnsThreatDetector Sample", "origin": "API_DEFINITION", - "description": " Gets details of a single AuthorizationPolicy.", + "description": " Gets the details of a single DnsThreatDetector.", "canonical": true, - "file": "network_security.get_authorization_policy.js", + "file": "dns_threat_detector_service.get_dns_threat_detector.js", "language": "JAVASCRIPT", "segments": [ { "start": 25, - "end": 54, + "end": 53, "type": "FULL" } ], "clientMethod": { - "shortName": "GetAuthorizationPolicy", - "fullName": "google.cloud.networksecurity.v1.NetworkSecurity.GetAuthorizationPolicy", + "shortName": "GetDnsThreatDetector", + "fullName": "google.cloud.networksecurity.v1.DnsThreatDetectorService.GetDnsThreatDetector", "async": true, "parameters": [ { @@ -512,39 +512,39 @@ "type": "TYPE_STRING" } ], - "resultType": ".google.cloud.networksecurity.v1.AuthorizationPolicy", + "resultType": ".google.cloud.networksecurity.v1.DnsThreatDetector", "client": { - "shortName": "NetworkSecurityClient", - "fullName": "google.cloud.networksecurity.v1.NetworkSecurityClient" + "shortName": "DnsThreatDetectorServiceClient", + "fullName": "google.cloud.networksecurity.v1.DnsThreatDetectorServiceClient" }, "method": { - "shortName": "GetAuthorizationPolicy", - "fullName": "google.cloud.networksecurity.v1.NetworkSecurity.GetAuthorizationPolicy", + "shortName": "GetDnsThreatDetector", + "fullName": "google.cloud.networksecurity.v1.DnsThreatDetectorService.GetDnsThreatDetector", "service": { - "shortName": "NetworkSecurity", - "fullName": "google.cloud.networksecurity.v1.NetworkSecurity" + "shortName": "DnsThreatDetectorService", + "fullName": "google.cloud.networksecurity.v1.DnsThreatDetectorService" } } } }, { - "regionTag": "networksecurity_v1_generated_NetworkSecurity_CreateAuthorizationPolicy_async", - "title": "AddressGroupService createAuthorizationPolicy Sample", + "regionTag": "networksecurity_v1_generated_DnsThreatDetectorService_CreateDnsThreatDetector_async", + "title": "AddressGroupService createDnsThreatDetector Sample", "origin": "API_DEFINITION", - "description": " Creates a new AuthorizationPolicy in a given project and location.", + "description": " Creates a new DnsThreatDetector in a given project and location.", "canonical": true, - "file": "network_security.create_authorization_policy.js", + "file": "dns_threat_detector_service.create_dns_threat_detector.js", "language": "JAVASCRIPT", "segments": [ { "start": 25, - "end": 68, + "end": 63, "type": "FULL" } ], "clientMethod": { - "shortName": "CreateAuthorizationPolicy", - "fullName": "google.cloud.networksecurity.v1.NetworkSecurity.CreateAuthorizationPolicy", + "shortName": "CreateDnsThreatDetector", + "fullName": "google.cloud.networksecurity.v1.DnsThreatDetectorService.CreateDnsThreatDetector", "async": true, "parameters": [ { @@ -552,47 +552,47 @@ "type": "TYPE_STRING" }, { - "name": "authorization_policy_id", + "name": "dns_threat_detector_id", "type": "TYPE_STRING" }, { - "name": "authorization_policy", - "type": ".google.cloud.networksecurity.v1.AuthorizationPolicy" + "name": "dns_threat_detector", + "type": ".google.cloud.networksecurity.v1.DnsThreatDetector" } ], - "resultType": ".google.longrunning.Operation", + "resultType": ".google.cloud.networksecurity.v1.DnsThreatDetector", "client": { - "shortName": "NetworkSecurityClient", - "fullName": "google.cloud.networksecurity.v1.NetworkSecurityClient" + "shortName": "DnsThreatDetectorServiceClient", + "fullName": "google.cloud.networksecurity.v1.DnsThreatDetectorServiceClient" }, "method": { - "shortName": "CreateAuthorizationPolicy", - "fullName": "google.cloud.networksecurity.v1.NetworkSecurity.CreateAuthorizationPolicy", + "shortName": "CreateDnsThreatDetector", + "fullName": "google.cloud.networksecurity.v1.DnsThreatDetectorService.CreateDnsThreatDetector", "service": { - "shortName": "NetworkSecurity", - "fullName": "google.cloud.networksecurity.v1.NetworkSecurity" + "shortName": "DnsThreatDetectorService", + "fullName": "google.cloud.networksecurity.v1.DnsThreatDetectorService" } } } }, { - "regionTag": "networksecurity_v1_generated_NetworkSecurity_UpdateAuthorizationPolicy_async", - "title": "AddressGroupService updateAuthorizationPolicy Sample", + "regionTag": "networksecurity_v1_generated_DnsThreatDetectorService_UpdateDnsThreatDetector_async", + "title": "AddressGroupService updateDnsThreatDetector Sample", "origin": "API_DEFINITION", - "description": " Updates the parameters of a single AuthorizationPolicy.", + "description": " Updates a single DnsThreatDetector.", "canonical": true, - "file": "network_security.update_authorization_policy.js", + "file": "dns_threat_detector_service.update_dns_threat_detector.js", "language": "JAVASCRIPT", "segments": [ { "start": 25, - "end": 62, + "end": 61, "type": "FULL" } ], "clientMethod": { - "shortName": "UpdateAuthorizationPolicy", - "fullName": "google.cloud.networksecurity.v1.NetworkSecurity.UpdateAuthorizationPolicy", + "shortName": "UpdateDnsThreatDetector", + "fullName": "google.cloud.networksecurity.v1.DnsThreatDetectorService.UpdateDnsThreatDetector", "async": true, "parameters": [ { @@ -600,43 +600,43 @@ "type": ".google.protobuf.FieldMask" }, { - "name": "authorization_policy", - "type": ".google.cloud.networksecurity.v1.AuthorizationPolicy" + "name": "dns_threat_detector", + "type": ".google.cloud.networksecurity.v1.DnsThreatDetector" } ], - "resultType": ".google.longrunning.Operation", + "resultType": ".google.cloud.networksecurity.v1.DnsThreatDetector", "client": { - "shortName": "NetworkSecurityClient", - "fullName": "google.cloud.networksecurity.v1.NetworkSecurityClient" + "shortName": "DnsThreatDetectorServiceClient", + "fullName": "google.cloud.networksecurity.v1.DnsThreatDetectorServiceClient" }, "method": { - "shortName": "UpdateAuthorizationPolicy", - "fullName": "google.cloud.networksecurity.v1.NetworkSecurity.UpdateAuthorizationPolicy", + "shortName": "UpdateDnsThreatDetector", + "fullName": "google.cloud.networksecurity.v1.DnsThreatDetectorService.UpdateDnsThreatDetector", "service": { - "shortName": "NetworkSecurity", - "fullName": "google.cloud.networksecurity.v1.NetworkSecurity" + "shortName": "DnsThreatDetectorService", + "fullName": "google.cloud.networksecurity.v1.DnsThreatDetectorService" } } } }, { - "regionTag": "networksecurity_v1_generated_NetworkSecurity_DeleteAuthorizationPolicy_async", - "title": "AddressGroupService deleteAuthorizationPolicy Sample", + "regionTag": "networksecurity_v1_generated_DnsThreatDetectorService_DeleteDnsThreatDetector_async", + "title": "AddressGroupService deleteDnsThreatDetector Sample", "origin": "API_DEFINITION", - "description": " Deletes a single AuthorizationPolicy.", + "description": " Deletes a single DnsThreatDetector.", "canonical": true, - "file": "network_security.delete_authorization_policy.js", + "file": "dns_threat_detector_service.delete_dns_threat_detector.js", "language": "JAVASCRIPT", "segments": [ { "start": 25, - "end": 55, + "end": 53, "type": "FULL" } ], "clientMethod": { - "shortName": "DeleteAuthorizationPolicy", - "fullName": "google.cloud.networksecurity.v1.NetworkSecurity.DeleteAuthorizationPolicy", + "shortName": "DeleteDnsThreatDetector", + "fullName": "google.cloud.networksecurity.v1.DnsThreatDetectorService.DeleteDnsThreatDetector", "async": true, "parameters": [ { @@ -644,39 +644,39 @@ "type": "TYPE_STRING" } ], - "resultType": ".google.longrunning.Operation", + "resultType": ".google.protobuf.Empty", "client": { - "shortName": "NetworkSecurityClient", - "fullName": "google.cloud.networksecurity.v1.NetworkSecurityClient" + "shortName": "DnsThreatDetectorServiceClient", + "fullName": "google.cloud.networksecurity.v1.DnsThreatDetectorServiceClient" }, "method": { - "shortName": "DeleteAuthorizationPolicy", - "fullName": "google.cloud.networksecurity.v1.NetworkSecurity.DeleteAuthorizationPolicy", + "shortName": "DeleteDnsThreatDetector", + "fullName": "google.cloud.networksecurity.v1.DnsThreatDetectorService.DeleteDnsThreatDetector", "service": { - "shortName": "NetworkSecurity", - "fullName": "google.cloud.networksecurity.v1.NetworkSecurity" + "shortName": "DnsThreatDetectorService", + "fullName": "google.cloud.networksecurity.v1.DnsThreatDetectorService" } } } }, { - "regionTag": "networksecurity_v1_generated_NetworkSecurity_ListServerTlsPolicies_async", - "title": "AddressGroupService listServerTlsPolicies Sample", + "regionTag": "networksecurity_v1_generated_FirewallActivation_ListFirewallEndpoints_async", + "title": "AddressGroupService listFirewallEndpoints Sample", "origin": "API_DEFINITION", - "description": " Lists ServerTlsPolicies in a given project and location.", + "description": " Lists FirewallEndpoints in a given organization and location.", "canonical": true, - "file": "network_security.list_server_tls_policies.js", + "file": "firewall_activation.list_firewall_endpoints.js", "language": "JAVASCRIPT", "segments": [ { "start": 25, - "end": 67, + "end": 72, "type": "FULL" } ], "clientMethod": { - "shortName": "ListServerTlsPolicies", - "fullName": "google.cloud.networksecurity.v1.NetworkSecurity.ListServerTlsPolicies", + "shortName": "ListFirewallEndpoints", + "fullName": "google.cloud.networksecurity.v1.FirewallActivation.ListFirewallEndpoints", "async": true, "parameters": [ { @@ -690,41 +690,49 @@ { "name": "page_token", "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + }, + { + "name": "order_by", + "type": "TYPE_STRING" } ], - "resultType": ".google.cloud.networksecurity.v1.ListServerTlsPoliciesResponse", + "resultType": ".google.cloud.networksecurity.v1.ListFirewallEndpointsResponse", "client": { - "shortName": "NetworkSecurityClient", - "fullName": "google.cloud.networksecurity.v1.NetworkSecurityClient" + "shortName": "FirewallActivationClient", + "fullName": "google.cloud.networksecurity.v1.FirewallActivationClient" }, "method": { - "shortName": "ListServerTlsPolicies", - "fullName": "google.cloud.networksecurity.v1.NetworkSecurity.ListServerTlsPolicies", + "shortName": "ListFirewallEndpoints", + "fullName": "google.cloud.networksecurity.v1.FirewallActivation.ListFirewallEndpoints", "service": { - "shortName": "NetworkSecurity", - "fullName": "google.cloud.networksecurity.v1.NetworkSecurity" + "shortName": "FirewallActivation", + "fullName": "google.cloud.networksecurity.v1.FirewallActivation" } } } }, { - "regionTag": "networksecurity_v1_generated_NetworkSecurity_GetServerTlsPolicy_async", - "title": "AddressGroupService getServerTlsPolicy Sample", + "regionTag": "networksecurity_v1_generated_FirewallActivation_GetFirewallEndpoint_async", + "title": "AddressGroupService getFirewallEndpoint Sample", "origin": "API_DEFINITION", - "description": " Gets details of a single ServerTlsPolicy.", + "description": " Gets details of a single org Endpoint.", "canonical": true, - "file": "network_security.get_server_tls_policy.js", + "file": "firewall_activation.get_firewall_endpoint.js", "language": "JAVASCRIPT", "segments": [ { "start": 25, - "end": 54, + "end": 53, "type": "FULL" } ], "clientMethod": { - "shortName": "GetServerTlsPolicy", - "fullName": "google.cloud.networksecurity.v1.NetworkSecurity.GetServerTlsPolicy", + "shortName": "GetFirewallEndpoint", + "fullName": "google.cloud.networksecurity.v1.FirewallActivation.GetFirewallEndpoint", "async": true, "parameters": [ { @@ -732,39 +740,39 @@ "type": "TYPE_STRING" } ], - "resultType": ".google.cloud.networksecurity.v1.ServerTlsPolicy", + "resultType": ".google.cloud.networksecurity.v1.FirewallEndpoint", "client": { - "shortName": "NetworkSecurityClient", - "fullName": "google.cloud.networksecurity.v1.NetworkSecurityClient" + "shortName": "FirewallActivationClient", + "fullName": "google.cloud.networksecurity.v1.FirewallActivationClient" }, "method": { - "shortName": "GetServerTlsPolicy", - "fullName": "google.cloud.networksecurity.v1.NetworkSecurity.GetServerTlsPolicy", + "shortName": "GetFirewallEndpoint", + "fullName": "google.cloud.networksecurity.v1.FirewallActivation.GetFirewallEndpoint", "service": { - "shortName": "NetworkSecurity", - "fullName": "google.cloud.networksecurity.v1.NetworkSecurity" + "shortName": "FirewallActivation", + "fullName": "google.cloud.networksecurity.v1.FirewallActivation" } } } }, { - "regionTag": "networksecurity_v1_generated_NetworkSecurity_CreateServerTlsPolicy_async", - "title": "AddressGroupService createServerTlsPolicy Sample", + "regionTag": "networksecurity_v1_generated_FirewallActivation_CreateFirewallEndpoint_async", + "title": "AddressGroupService createFirewallEndpoint Sample", "origin": "API_DEFINITION", - "description": " Creates a new ServerTlsPolicy in a given project and location.", + "description": " Creates a new FirewallEndpoint in a given organization and location.", "canonical": true, - "file": "network_security.create_server_tls_policy.js", + "file": "firewall_activation.create_firewall_endpoint.js", "language": "JAVASCRIPT", "segments": [ { "start": 25, - "end": 67, + "end": 80, "type": "FULL" } ], "clientMethod": { - "shortName": "CreateServerTlsPolicy", - "fullName": "google.cloud.networksecurity.v1.NetworkSecurity.CreateServerTlsPolicy", + "shortName": "CreateFirewallEndpoint", + "fullName": "google.cloud.networksecurity.v1.FirewallActivation.CreateFirewallEndpoint", "async": true, "parameters": [ { @@ -772,131 +780,143 @@ "type": "TYPE_STRING" }, { - "name": "server_tls_policy_id", + "name": "firewall_endpoint_id", "type": "TYPE_STRING" }, { - "name": "server_tls_policy", - "type": ".google.cloud.networksecurity.v1.ServerTlsPolicy" + "name": "firewall_endpoint", + "type": ".google.cloud.networksecurity.v1.FirewallEndpoint" + }, + { + "name": "request_id", + "type": "TYPE_STRING" } ], "resultType": ".google.longrunning.Operation", "client": { - "shortName": "NetworkSecurityClient", - "fullName": "google.cloud.networksecurity.v1.NetworkSecurityClient" + "shortName": "FirewallActivationClient", + "fullName": "google.cloud.networksecurity.v1.FirewallActivationClient" }, "method": { - "shortName": "CreateServerTlsPolicy", - "fullName": "google.cloud.networksecurity.v1.NetworkSecurity.CreateServerTlsPolicy", + "shortName": "CreateFirewallEndpoint", + "fullName": "google.cloud.networksecurity.v1.FirewallActivation.CreateFirewallEndpoint", "service": { - "shortName": "NetworkSecurity", - "fullName": "google.cloud.networksecurity.v1.NetworkSecurity" + "shortName": "FirewallActivation", + "fullName": "google.cloud.networksecurity.v1.FirewallActivation" } } } }, { - "regionTag": "networksecurity_v1_generated_NetworkSecurity_UpdateServerTlsPolicy_async", - "title": "AddressGroupService updateServerTlsPolicy Sample", + "regionTag": "networksecurity_v1_generated_FirewallActivation_DeleteFirewallEndpoint_async", + "title": "AddressGroupService deleteFirewallEndpoint Sample", "origin": "API_DEFINITION", - "description": " Updates the parameters of a single ServerTlsPolicy.", + "description": " Deletes a single org Endpoint.", "canonical": true, - "file": "network_security.update_server_tls_policy.js", + "file": "firewall_activation.delete_firewall_endpoint.js", "language": "JAVASCRIPT", "segments": [ { "start": 25, - "end": 63, + "end": 68, "type": "FULL" } ], "clientMethod": { - "shortName": "UpdateServerTlsPolicy", - "fullName": "google.cloud.networksecurity.v1.NetworkSecurity.UpdateServerTlsPolicy", + "shortName": "DeleteFirewallEndpoint", + "fullName": "google.cloud.networksecurity.v1.FirewallActivation.DeleteFirewallEndpoint", "async": true, "parameters": [ { - "name": "update_mask", - "type": ".google.protobuf.FieldMask" + "name": "name", + "type": "TYPE_STRING" }, { - "name": "server_tls_policy", - "type": ".google.cloud.networksecurity.v1.ServerTlsPolicy" + "name": "request_id", + "type": "TYPE_STRING" } ], "resultType": ".google.longrunning.Operation", "client": { - "shortName": "NetworkSecurityClient", - "fullName": "google.cloud.networksecurity.v1.NetworkSecurityClient" + "shortName": "FirewallActivationClient", + "fullName": "google.cloud.networksecurity.v1.FirewallActivationClient" }, "method": { - "shortName": "UpdateServerTlsPolicy", - "fullName": "google.cloud.networksecurity.v1.NetworkSecurity.UpdateServerTlsPolicy", + "shortName": "DeleteFirewallEndpoint", + "fullName": "google.cloud.networksecurity.v1.FirewallActivation.DeleteFirewallEndpoint", "service": { - "shortName": "NetworkSecurity", - "fullName": "google.cloud.networksecurity.v1.NetworkSecurity" + "shortName": "FirewallActivation", + "fullName": "google.cloud.networksecurity.v1.FirewallActivation" } } } }, { - "regionTag": "networksecurity_v1_generated_NetworkSecurity_DeleteServerTlsPolicy_async", - "title": "AddressGroupService deleteServerTlsPolicy Sample", + "regionTag": "networksecurity_v1_generated_FirewallActivation_UpdateFirewallEndpoint_async", + "title": "AddressGroupService updateFirewallEndpoint Sample", "origin": "API_DEFINITION", - "description": " Deletes a single ServerTlsPolicy.", + "description": " Update a single org Endpoint.", "canonical": true, - "file": "network_security.delete_server_tls_policy.js", + "file": "firewall_activation.update_firewall_endpoint.js", "language": "JAVASCRIPT", "segments": [ { "start": 25, - "end": 55, + "end": 77, "type": "FULL" } ], "clientMethod": { - "shortName": "DeleteServerTlsPolicy", - "fullName": "google.cloud.networksecurity.v1.NetworkSecurity.DeleteServerTlsPolicy", + "shortName": "UpdateFirewallEndpoint", + "fullName": "google.cloud.networksecurity.v1.FirewallActivation.UpdateFirewallEndpoint", "async": true, "parameters": [ { - "name": "name", + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + }, + { + "name": "firewall_endpoint", + "type": ".google.cloud.networksecurity.v1.FirewallEndpoint" + }, + { + "name": "request_id", "type": "TYPE_STRING" } ], "resultType": ".google.longrunning.Operation", "client": { - "shortName": "NetworkSecurityClient", - "fullName": "google.cloud.networksecurity.v1.NetworkSecurityClient" + "shortName": "FirewallActivationClient", + "fullName": "google.cloud.networksecurity.v1.FirewallActivationClient" }, "method": { - "shortName": "DeleteServerTlsPolicy", - "fullName": "google.cloud.networksecurity.v1.NetworkSecurity.DeleteServerTlsPolicy", + "shortName": "UpdateFirewallEndpoint", + "fullName": "google.cloud.networksecurity.v1.FirewallActivation.UpdateFirewallEndpoint", "service": { - "shortName": "NetworkSecurity", - "fullName": "google.cloud.networksecurity.v1.NetworkSecurity" + "shortName": "FirewallActivation", + "fullName": "google.cloud.networksecurity.v1.FirewallActivation" } } } }, { - "regionTag": "networksecurity_v1_generated_NetworkSecurity_ListClientTlsPolicies_async", - "title": "AddressGroupService listClientTlsPolicies Sample", + "regionTag": "networksecurity_v1_generated_FirewallActivation_ListFirewallEndpointAssociations_async", + "title": "AddressGroupService listFirewallEndpointAssociations Sample", "origin": "API_DEFINITION", - "description": " Lists ClientTlsPolicies in a given project and location.", + "description": " Lists Associations in a given project and location.", "canonical": true, - "file": "network_security.list_client_tls_policies.js", + "file": "firewall_activation.list_firewall_endpoint_associations.js", "language": "JAVASCRIPT", "segments": [ { "start": 25, - "end": 67, + "end": 72, "type": "FULL" } ], "clientMethod": { - "shortName": "ListClientTlsPolicies", - "fullName": "google.cloud.networksecurity.v1.NetworkSecurity.ListClientTlsPolicies", + "shortName": "ListFirewallEndpointAssociations", + "fullName": "google.cloud.networksecurity.v1.FirewallActivation.ListFirewallEndpointAssociations", "async": true, "parameters": [ { @@ -910,41 +930,49 @@ { "name": "page_token", "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + }, + { + "name": "order_by", + "type": "TYPE_STRING" } ], - "resultType": ".google.cloud.networksecurity.v1.ListClientTlsPoliciesResponse", + "resultType": ".google.cloud.networksecurity.v1.ListFirewallEndpointAssociationsResponse", "client": { - "shortName": "NetworkSecurityClient", - "fullName": "google.cloud.networksecurity.v1.NetworkSecurityClient" + "shortName": "FirewallActivationClient", + "fullName": "google.cloud.networksecurity.v1.FirewallActivationClient" }, "method": { - "shortName": "ListClientTlsPolicies", - "fullName": "google.cloud.networksecurity.v1.NetworkSecurity.ListClientTlsPolicies", + "shortName": "ListFirewallEndpointAssociations", + "fullName": "google.cloud.networksecurity.v1.FirewallActivation.ListFirewallEndpointAssociations", "service": { - "shortName": "NetworkSecurity", - "fullName": "google.cloud.networksecurity.v1.NetworkSecurity" + "shortName": "FirewallActivation", + "fullName": "google.cloud.networksecurity.v1.FirewallActivation" } } } }, { - "regionTag": "networksecurity_v1_generated_NetworkSecurity_GetClientTlsPolicy_async", - "title": "AddressGroupService getClientTlsPolicy Sample", + "regionTag": "networksecurity_v1_generated_FirewallActivation_GetFirewallEndpointAssociation_async", + "title": "AddressGroupService getFirewallEndpointAssociation Sample", "origin": "API_DEFINITION", - "description": " Gets details of a single ClientTlsPolicy.", + "description": " Gets details of a single FirewallEndpointAssociation.", "canonical": true, - "file": "network_security.get_client_tls_policy.js", + "file": "firewall_activation.get_firewall_endpoint_association.js", "language": "JAVASCRIPT", "segments": [ { "start": 25, - "end": 54, + "end": 53, "type": "FULL" } ], "clientMethod": { - "shortName": "GetClientTlsPolicy", - "fullName": "google.cloud.networksecurity.v1.NetworkSecurity.GetClientTlsPolicy", + "shortName": "GetFirewallEndpointAssociation", + "fullName": "google.cloud.networksecurity.v1.FirewallActivation.GetFirewallEndpointAssociation", "async": true, "parameters": [ { @@ -952,39 +980,39 @@ "type": "TYPE_STRING" } ], - "resultType": ".google.cloud.networksecurity.v1.ClientTlsPolicy", + "resultType": ".google.cloud.networksecurity.v1.FirewallEndpointAssociation", "client": { - "shortName": "NetworkSecurityClient", - "fullName": "google.cloud.networksecurity.v1.NetworkSecurityClient" + "shortName": "FirewallActivationClient", + "fullName": "google.cloud.networksecurity.v1.FirewallActivationClient" }, "method": { - "shortName": "GetClientTlsPolicy", - "fullName": "google.cloud.networksecurity.v1.NetworkSecurity.GetClientTlsPolicy", + "shortName": "GetFirewallEndpointAssociation", + "fullName": "google.cloud.networksecurity.v1.FirewallActivation.GetFirewallEndpointAssociation", "service": { - "shortName": "NetworkSecurity", - "fullName": "google.cloud.networksecurity.v1.NetworkSecurity" + "shortName": "FirewallActivation", + "fullName": "google.cloud.networksecurity.v1.FirewallActivation" } } } }, { - "regionTag": "networksecurity_v1_generated_NetworkSecurity_CreateClientTlsPolicy_async", - "title": "AddressGroupService createClientTlsPolicy Sample", + "regionTag": "networksecurity_v1_generated_FirewallActivation_CreateFirewallEndpointAssociation_async", + "title": "AddressGroupService createFirewallEndpointAssociation Sample", "origin": "API_DEFINITION", - "description": " Creates a new ClientTlsPolicy in a given project and location.", + "description": " Creates a new FirewallEndpointAssociation in a given project and location.", "canonical": true, - "file": "network_security.create_client_tls_policy.js", + "file": "firewall_activation.create_firewall_endpoint_association.js", "language": "JAVASCRIPT", "segments": [ { "start": 25, - "end": 67, + "end": 79, "type": "FULL" } ], "clientMethod": { - "shortName": "CreateClientTlsPolicy", - "fullName": "google.cloud.networksecurity.v1.NetworkSecurity.CreateClientTlsPolicy", + "shortName": "CreateFirewallEndpointAssociation", + "fullName": "google.cloud.networksecurity.v1.FirewallActivation.CreateFirewallEndpointAssociation", "async": true, "parameters": [ { @@ -992,131 +1020,143 @@ "type": "TYPE_STRING" }, { - "name": "client_tls_policy_id", + "name": "firewall_endpoint_association_id", "type": "TYPE_STRING" }, { - "name": "client_tls_policy", - "type": ".google.cloud.networksecurity.v1.ClientTlsPolicy" + "name": "firewall_endpoint_association", + "type": ".google.cloud.networksecurity.v1.FirewallEndpointAssociation" + }, + { + "name": "request_id", + "type": "TYPE_STRING" } ], "resultType": ".google.longrunning.Operation", "client": { - "shortName": "NetworkSecurityClient", - "fullName": "google.cloud.networksecurity.v1.NetworkSecurityClient" + "shortName": "FirewallActivationClient", + "fullName": "google.cloud.networksecurity.v1.FirewallActivationClient" }, "method": { - "shortName": "CreateClientTlsPolicy", - "fullName": "google.cloud.networksecurity.v1.NetworkSecurity.CreateClientTlsPolicy", + "shortName": "CreateFirewallEndpointAssociation", + "fullName": "google.cloud.networksecurity.v1.FirewallActivation.CreateFirewallEndpointAssociation", "service": { - "shortName": "NetworkSecurity", - "fullName": "google.cloud.networksecurity.v1.NetworkSecurity" + "shortName": "FirewallActivation", + "fullName": "google.cloud.networksecurity.v1.FirewallActivation" } } } }, { - "regionTag": "networksecurity_v1_generated_NetworkSecurity_UpdateClientTlsPolicy_async", - "title": "AddressGroupService updateClientTlsPolicy Sample", + "regionTag": "networksecurity_v1_generated_FirewallActivation_DeleteFirewallEndpointAssociation_async", + "title": "AddressGroupService deleteFirewallEndpointAssociation Sample", "origin": "API_DEFINITION", - "description": " Updates the parameters of a single ClientTlsPolicy.", + "description": " Deletes a single FirewallEndpointAssociation.", "canonical": true, - "file": "network_security.update_client_tls_policy.js", + "file": "firewall_activation.delete_firewall_endpoint_association.js", "language": "JAVASCRIPT", "segments": [ { "start": 25, - "end": 63, + "end": 68, "type": "FULL" } ], "clientMethod": { - "shortName": "UpdateClientTlsPolicy", - "fullName": "google.cloud.networksecurity.v1.NetworkSecurity.UpdateClientTlsPolicy", + "shortName": "DeleteFirewallEndpointAssociation", + "fullName": "google.cloud.networksecurity.v1.FirewallActivation.DeleteFirewallEndpointAssociation", "async": true, "parameters": [ { - "name": "update_mask", - "type": ".google.protobuf.FieldMask" + "name": "name", + "type": "TYPE_STRING" }, { - "name": "client_tls_policy", - "type": ".google.cloud.networksecurity.v1.ClientTlsPolicy" + "name": "request_id", + "type": "TYPE_STRING" } ], "resultType": ".google.longrunning.Operation", "client": { - "shortName": "NetworkSecurityClient", - "fullName": "google.cloud.networksecurity.v1.NetworkSecurityClient" + "shortName": "FirewallActivationClient", + "fullName": "google.cloud.networksecurity.v1.FirewallActivationClient" }, "method": { - "shortName": "UpdateClientTlsPolicy", - "fullName": "google.cloud.networksecurity.v1.NetworkSecurity.UpdateClientTlsPolicy", + "shortName": "DeleteFirewallEndpointAssociation", + "fullName": "google.cloud.networksecurity.v1.FirewallActivation.DeleteFirewallEndpointAssociation", "service": { - "shortName": "NetworkSecurity", - "fullName": "google.cloud.networksecurity.v1.NetworkSecurity" + "shortName": "FirewallActivation", + "fullName": "google.cloud.networksecurity.v1.FirewallActivation" } } } }, { - "regionTag": "networksecurity_v1_generated_NetworkSecurity_DeleteClientTlsPolicy_async", - "title": "AddressGroupService deleteClientTlsPolicy Sample", + "regionTag": "networksecurity_v1_generated_FirewallActivation_UpdateFirewallEndpointAssociation_async", + "title": "AddressGroupService updateFirewallEndpointAssociation Sample", "origin": "API_DEFINITION", - "description": " Deletes a single ClientTlsPolicy.", + "description": " Update a single FirewallEndpointAssociation.", "canonical": true, - "file": "network_security.delete_client_tls_policy.js", + "file": "firewall_activation.update_firewall_endpoint_association.js", "language": "JAVASCRIPT", "segments": [ { "start": 25, - "end": 55, + "end": 77, "type": "FULL" } ], "clientMethod": { - "shortName": "DeleteClientTlsPolicy", - "fullName": "google.cloud.networksecurity.v1.NetworkSecurity.DeleteClientTlsPolicy", + "shortName": "UpdateFirewallEndpointAssociation", + "fullName": "google.cloud.networksecurity.v1.FirewallActivation.UpdateFirewallEndpointAssociation", "async": true, "parameters": [ { - "name": "name", + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + }, + { + "name": "firewall_endpoint_association", + "type": ".google.cloud.networksecurity.v1.FirewallEndpointAssociation" + }, + { + "name": "request_id", "type": "TYPE_STRING" } ], "resultType": ".google.longrunning.Operation", "client": { - "shortName": "NetworkSecurityClient", - "fullName": "google.cloud.networksecurity.v1.NetworkSecurityClient" + "shortName": "FirewallActivationClient", + "fullName": "google.cloud.networksecurity.v1.FirewallActivationClient" }, "method": { - "shortName": "DeleteClientTlsPolicy", - "fullName": "google.cloud.networksecurity.v1.NetworkSecurity.DeleteClientTlsPolicy", + "shortName": "UpdateFirewallEndpointAssociation", + "fullName": "google.cloud.networksecurity.v1.FirewallActivation.UpdateFirewallEndpointAssociation", "service": { - "shortName": "NetworkSecurity", - "fullName": "google.cloud.networksecurity.v1.NetworkSecurity" + "shortName": "FirewallActivation", + "fullName": "google.cloud.networksecurity.v1.FirewallActivation" } } } }, { - "regionTag": "networksecurity_v1_generated_OrganizationAddressGroupService_ListAddressGroups_async", - "title": "AddressGroupService listAddressGroups Sample", + "regionTag": "networksecurity_v1_generated_Intercept_ListInterceptEndpointGroups_async", + "title": "AddressGroupService listInterceptEndpointGroups Sample", "origin": "API_DEFINITION", - "description": " Lists address groups in a given project and location.", + "description": " Lists endpoint groups in a given project and location. See https://google.aip.dev/132.", "canonical": true, - "file": "organization_address_group_service.list_address_groups.js", + "file": "intercept.list_intercept_endpoint_groups.js", "language": "JAVASCRIPT", "segments": [ { "start": 25, - "end": 73, + "end": 82, "type": "FULL" } ], "clientMethod": { - "shortName": "ListAddressGroups", - "fullName": "google.cloud.networksecurity.v1.OrganizationAddressGroupService.ListAddressGroups", + "shortName": "ListInterceptEndpointGroups", + "fullName": "google.cloud.networksecurity.v1.Intercept.ListInterceptEndpointGroups", "async": true, "parameters": [ { @@ -1132,43 +1172,47 @@ "type": "TYPE_STRING" }, { - "name": "return_partial_success", - "type": "TYPE_BOOL" + "name": "filter", + "type": "TYPE_STRING" + }, + { + "name": "order_by", + "type": "TYPE_STRING" } ], - "resultType": ".google.cloud.networksecurity.v1.ListAddressGroupsResponse", + "resultType": ".google.cloud.networksecurity.v1.ListInterceptEndpointGroupsResponse", "client": { - "shortName": "OrganizationAddressGroupServiceClient", - "fullName": "google.cloud.networksecurity.v1.OrganizationAddressGroupServiceClient" + "shortName": "InterceptClient", + "fullName": "google.cloud.networksecurity.v1.InterceptClient" }, "method": { - "shortName": "ListAddressGroups", - "fullName": "google.cloud.networksecurity.v1.OrganizationAddressGroupService.ListAddressGroups", + "shortName": "ListInterceptEndpointGroups", + "fullName": "google.cloud.networksecurity.v1.Intercept.ListInterceptEndpointGroups", "service": { - "shortName": "OrganizationAddressGroupService", - "fullName": "google.cloud.networksecurity.v1.OrganizationAddressGroupService" + "shortName": "Intercept", + "fullName": "google.cloud.networksecurity.v1.Intercept" } } } }, { - "regionTag": "networksecurity_v1_generated_OrganizationAddressGroupService_GetAddressGroup_async", - "title": "AddressGroupService getAddressGroup Sample", + "regionTag": "networksecurity_v1_generated_Intercept_GetInterceptEndpointGroup_async", + "title": "AddressGroupService getInterceptEndpointGroup Sample", "origin": "API_DEFINITION", - "description": " Gets details of a single address group.", + "description": " Gets a specific endpoint group. See https://google.aip.dev/131.", "canonical": true, - "file": "organization_address_group_service.get_address_group.js", + "file": "intercept.get_intercept_endpoint_group.js", "language": "JAVASCRIPT", "segments": [ { "start": 25, - "end": 54, + "end": 55, "type": "FULL" } ], "clientMethod": { - "shortName": "GetAddressGroup", - "fullName": "google.cloud.networksecurity.v1.OrganizationAddressGroupService.GetAddressGroup", + "shortName": "GetInterceptEndpointGroup", + "fullName": "google.cloud.networksecurity.v1.Intercept.GetInterceptEndpointGroup", "async": true, "parameters": [ { @@ -1176,39 +1220,39 @@ "type": "TYPE_STRING" } ], - "resultType": ".google.cloud.networksecurity.v1.AddressGroup", + "resultType": ".google.cloud.networksecurity.v1.InterceptEndpointGroup", "client": { - "shortName": "OrganizationAddressGroupServiceClient", - "fullName": "google.cloud.networksecurity.v1.OrganizationAddressGroupServiceClient" + "shortName": "InterceptClient", + "fullName": "google.cloud.networksecurity.v1.InterceptClient" }, "method": { - "shortName": "GetAddressGroup", - "fullName": "google.cloud.networksecurity.v1.OrganizationAddressGroupService.GetAddressGroup", + "shortName": "GetInterceptEndpointGroup", + "fullName": "google.cloud.networksecurity.v1.Intercept.GetInterceptEndpointGroup", "service": { - "shortName": "OrganizationAddressGroupService", - "fullName": "google.cloud.networksecurity.v1.OrganizationAddressGroupService" + "shortName": "Intercept", + "fullName": "google.cloud.networksecurity.v1.Intercept" } } } }, { - "regionTag": "networksecurity_v1_generated_OrganizationAddressGroupService_CreateAddressGroup_async", - "title": "AddressGroupService createAddressGroup Sample", + "regionTag": "networksecurity_v1_generated_Intercept_CreateInterceptEndpointGroup_async", + "title": "AddressGroupService createInterceptEndpointGroup Sample", "origin": "API_DEFINITION", - "description": " Creates a new address group in a given project and location.", + "description": " Creates an endpoint group in a given project and location. See https://google.aip.dev/133.", "canonical": true, - "file": "organization_address_group_service.create_address_group.js", + "file": "intercept.create_intercept_endpoint_group.js", "language": "JAVASCRIPT", "segments": [ { "start": 25, - "end": 82, + "end": 72, "type": "FULL" } ], "clientMethod": { - "shortName": "CreateAddressGroup", - "fullName": "google.cloud.networksecurity.v1.OrganizationAddressGroupService.CreateAddressGroup", + "shortName": "CreateInterceptEndpointGroup", + "fullName": "google.cloud.networksecurity.v1.Intercept.CreateInterceptEndpointGroup", "async": true, "parameters": [ { @@ -1216,12 +1260,12 @@ "type": "TYPE_STRING" }, { - "name": "address_group_id", + "name": "intercept_endpoint_group_id", "type": "TYPE_STRING" }, { - "name": "address_group", - "type": ".google.cloud.networksecurity.v1.AddressGroup" + "name": "intercept_endpoint_group", + "type": ".google.cloud.networksecurity.v1.InterceptEndpointGroup" }, { "name": "request_id", @@ -1230,37 +1274,37 @@ ], "resultType": ".google.longrunning.Operation", "client": { - "shortName": "OrganizationAddressGroupServiceClient", - "fullName": "google.cloud.networksecurity.v1.OrganizationAddressGroupServiceClient" + "shortName": "InterceptClient", + "fullName": "google.cloud.networksecurity.v1.InterceptClient" }, "method": { - "shortName": "CreateAddressGroup", - "fullName": "google.cloud.networksecurity.v1.OrganizationAddressGroupService.CreateAddressGroup", + "shortName": "CreateInterceptEndpointGroup", + "fullName": "google.cloud.networksecurity.v1.Intercept.CreateInterceptEndpointGroup", "service": { - "shortName": "OrganizationAddressGroupService", - "fullName": "google.cloud.networksecurity.v1.OrganizationAddressGroupService" + "shortName": "Intercept", + "fullName": "google.cloud.networksecurity.v1.Intercept" } } } }, { - "regionTag": "networksecurity_v1_generated_OrganizationAddressGroupService_UpdateAddressGroup_async", - "title": "AddressGroupService updateAddressGroup Sample", + "regionTag": "networksecurity_v1_generated_Intercept_UpdateInterceptEndpointGroup_async", + "title": "AddressGroupService updateInterceptEndpointGroup Sample", "origin": "API_DEFINITION", - "description": " Updates parameters of an address group.", + "description": " Updates an endpoint group. See https://google.aip.dev/134.", "canonical": true, - "file": "organization_address_group_service.update_address_group.js", + "file": "intercept.update_intercept_endpoint_group.js", "language": "JAVASCRIPT", "segments": [ { "start": 25, - "end": 76, + "end": 67, "type": "FULL" } ], "clientMethod": { - "shortName": "UpdateAddressGroup", - "fullName": "google.cloud.networksecurity.v1.OrganizationAddressGroupService.UpdateAddressGroup", + "shortName": "UpdateInterceptEndpointGroup", + "fullName": "google.cloud.networksecurity.v1.Intercept.UpdateInterceptEndpointGroup", "async": true, "parameters": [ { @@ -1268,8 +1312,8 @@ "type": ".google.protobuf.FieldMask" }, { - "name": "address_group", - "type": ".google.cloud.networksecurity.v1.AddressGroup" + "name": "intercept_endpoint_group", + "type": ".google.cloud.networksecurity.v1.InterceptEndpointGroup" }, { "name": "request_id", @@ -1278,47 +1322,43 @@ ], "resultType": ".google.longrunning.Operation", "client": { - "shortName": "OrganizationAddressGroupServiceClient", - "fullName": "google.cloud.networksecurity.v1.OrganizationAddressGroupServiceClient" + "shortName": "InterceptClient", + "fullName": "google.cloud.networksecurity.v1.InterceptClient" }, "method": { - "shortName": "UpdateAddressGroup", - "fullName": "google.cloud.networksecurity.v1.OrganizationAddressGroupService.UpdateAddressGroup", + "shortName": "UpdateInterceptEndpointGroup", + "fullName": "google.cloud.networksecurity.v1.Intercept.UpdateInterceptEndpointGroup", "service": { - "shortName": "OrganizationAddressGroupService", - "fullName": "google.cloud.networksecurity.v1.OrganizationAddressGroupService" + "shortName": "Intercept", + "fullName": "google.cloud.networksecurity.v1.Intercept" } } } }, { - "regionTag": "networksecurity_v1_generated_OrganizationAddressGroupService_AddAddressGroupItems_async", - "title": "AddressGroupService addAddressGroupItems Sample", + "regionTag": "networksecurity_v1_generated_Intercept_DeleteInterceptEndpointGroup_async", + "title": "AddressGroupService deleteInterceptEndpointGroup Sample", "origin": "API_DEFINITION", - "description": " Adds items to an address group.", + "description": " Deletes an endpoint group. See https://google.aip.dev/135.", "canonical": true, - "file": "organization_address_group_service.add_address_group_items.js", + "file": "intercept.delete_intercept_endpoint_group.js", "language": "JAVASCRIPT", "segments": [ { "start": 25, - "end": 74, + "end": 60, "type": "FULL" } ], "clientMethod": { - "shortName": "AddAddressGroupItems", - "fullName": "google.cloud.networksecurity.v1.OrganizationAddressGroupService.AddAddressGroupItems", + "shortName": "DeleteInterceptEndpointGroup", + "fullName": "google.cloud.networksecurity.v1.Intercept.DeleteInterceptEndpointGroup", "async": true, "parameters": [ { - "name": "address_group", + "name": "name", "type": "TYPE_STRING" }, - { - "name": "items", - "type": "TYPE_STRING[]" - }, { "name": "request_id", "type": "TYPE_STRING" @@ -1326,95 +1366,147 @@ ], "resultType": ".google.longrunning.Operation", "client": { - "shortName": "OrganizationAddressGroupServiceClient", - "fullName": "google.cloud.networksecurity.v1.OrganizationAddressGroupServiceClient" + "shortName": "InterceptClient", + "fullName": "google.cloud.networksecurity.v1.InterceptClient" }, "method": { - "shortName": "AddAddressGroupItems", - "fullName": "google.cloud.networksecurity.v1.OrganizationAddressGroupService.AddAddressGroupItems", + "shortName": "DeleteInterceptEndpointGroup", + "fullName": "google.cloud.networksecurity.v1.Intercept.DeleteInterceptEndpointGroup", "service": { - "shortName": "OrganizationAddressGroupService", - "fullName": "google.cloud.networksecurity.v1.OrganizationAddressGroupService" + "shortName": "Intercept", + "fullName": "google.cloud.networksecurity.v1.Intercept" } } } }, { - "regionTag": "networksecurity_v1_generated_OrganizationAddressGroupService_RemoveAddressGroupItems_async", - "title": "AddressGroupService removeAddressGroupItems Sample", + "regionTag": "networksecurity_v1_generated_Intercept_ListInterceptEndpointGroupAssociations_async", + "title": "AddressGroupService listInterceptEndpointGroupAssociations Sample", "origin": "API_DEFINITION", - "description": " Removes items from an address group.", + "description": " Lists associations in a given project and location. See https://google.aip.dev/132.", "canonical": true, - "file": "organization_address_group_service.remove_address_group_items.js", + "file": "intercept.list_intercept_endpoint_group_associations.js", "language": "JAVASCRIPT", "segments": [ { "start": 25, - "end": 74, + "end": 81, "type": "FULL" } ], "clientMethod": { - "shortName": "RemoveAddressGroupItems", - "fullName": "google.cloud.networksecurity.v1.OrganizationAddressGroupService.RemoveAddressGroupItems", + "shortName": "ListInterceptEndpointGroupAssociations", + "fullName": "google.cloud.networksecurity.v1.Intercept.ListInterceptEndpointGroupAssociations", "async": true, "parameters": [ { - "name": "address_group", + "name": "parent", "type": "TYPE_STRING" }, { - "name": "items", - "type": "TYPE_STRING[]" + "name": "page_size", + "type": "TYPE_INT32" }, { - "name": "request_id", + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + }, + { + "name": "order_by", "type": "TYPE_STRING" } ], - "resultType": ".google.longrunning.Operation", + "resultType": ".google.cloud.networksecurity.v1.ListInterceptEndpointGroupAssociationsResponse", "client": { - "shortName": "OrganizationAddressGroupServiceClient", - "fullName": "google.cloud.networksecurity.v1.OrganizationAddressGroupServiceClient" + "shortName": "InterceptClient", + "fullName": "google.cloud.networksecurity.v1.InterceptClient" }, "method": { - "shortName": "RemoveAddressGroupItems", - "fullName": "google.cloud.networksecurity.v1.OrganizationAddressGroupService.RemoveAddressGroupItems", + "shortName": "ListInterceptEndpointGroupAssociations", + "fullName": "google.cloud.networksecurity.v1.Intercept.ListInterceptEndpointGroupAssociations", "service": { - "shortName": "OrganizationAddressGroupService", - "fullName": "google.cloud.networksecurity.v1.OrganizationAddressGroupService" + "shortName": "Intercept", + "fullName": "google.cloud.networksecurity.v1.Intercept" } } } }, { - "regionTag": "networksecurity_v1_generated_OrganizationAddressGroupService_CloneAddressGroupItems_async", - "title": "AddressGroupService cloneAddressGroupItems Sample", + "regionTag": "networksecurity_v1_generated_Intercept_GetInterceptEndpointGroupAssociation_async", + "title": "AddressGroupService getInterceptEndpointGroupAssociation Sample", "origin": "API_DEFINITION", - "description": " Clones items from one address group to another.", + "description": " Gets a specific association. See https://google.aip.dev/131.", "canonical": true, - "file": "organization_address_group_service.clone_address_group_items.js", + "file": "intercept.get_intercept_endpoint_group_association.js", "language": "JAVASCRIPT", "segments": [ { "start": 25, - "end": 74, + "end": 55, "type": "FULL" } ], "clientMethod": { - "shortName": "CloneAddressGroupItems", - "fullName": "google.cloud.networksecurity.v1.OrganizationAddressGroupService.CloneAddressGroupItems", + "shortName": "GetInterceptEndpointGroupAssociation", + "fullName": "google.cloud.networksecurity.v1.Intercept.GetInterceptEndpointGroupAssociation", "async": true, "parameters": [ { - "name": "address_group", + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.networksecurity.v1.InterceptEndpointGroupAssociation", + "client": { + "shortName": "InterceptClient", + "fullName": "google.cloud.networksecurity.v1.InterceptClient" + }, + "method": { + "shortName": "GetInterceptEndpointGroupAssociation", + "fullName": "google.cloud.networksecurity.v1.Intercept.GetInterceptEndpointGroupAssociation", + "service": { + "shortName": "Intercept", + "fullName": "google.cloud.networksecurity.v1.Intercept" + } + } + } + }, + { + "regionTag": "networksecurity_v1_generated_Intercept_CreateInterceptEndpointGroupAssociation_async", + "title": "AddressGroupService createInterceptEndpointGroupAssociation Sample", + "origin": "API_DEFINITION", + "description": " Creates an association in a given project and location. See https://google.aip.dev/133.", + "canonical": true, + "file": "intercept.create_intercept_endpoint_group_association.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 72, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateInterceptEndpointGroupAssociation", + "fullName": "google.cloud.networksecurity.v1.Intercept.CreateInterceptEndpointGroupAssociation", + "async": true, + "parameters": [ + { + "name": "parent", "type": "TYPE_STRING" }, { - "name": "source_address_group", + "name": "intercept_endpoint_group_association_id", "type": "TYPE_STRING" }, + { + "name": "intercept_endpoint_group_association", + "type": ".google.cloud.networksecurity.v1.InterceptEndpointGroupAssociation" + }, { "name": "request_id", "type": "TYPE_STRING" @@ -1422,37 +1514,85 @@ ], "resultType": ".google.longrunning.Operation", "client": { - "shortName": "OrganizationAddressGroupServiceClient", - "fullName": "google.cloud.networksecurity.v1.OrganizationAddressGroupServiceClient" + "shortName": "InterceptClient", + "fullName": "google.cloud.networksecurity.v1.InterceptClient" }, "method": { - "shortName": "CloneAddressGroupItems", - "fullName": "google.cloud.networksecurity.v1.OrganizationAddressGroupService.CloneAddressGroupItems", + "shortName": "CreateInterceptEndpointGroupAssociation", + "fullName": "google.cloud.networksecurity.v1.Intercept.CreateInterceptEndpointGroupAssociation", "service": { - "shortName": "OrganizationAddressGroupService", - "fullName": "google.cloud.networksecurity.v1.OrganizationAddressGroupService" + "shortName": "Intercept", + "fullName": "google.cloud.networksecurity.v1.Intercept" } } } }, { - "regionTag": "networksecurity_v1_generated_OrganizationAddressGroupService_DeleteAddressGroup_async", - "title": "AddressGroupService deleteAddressGroup Sample", + "regionTag": "networksecurity_v1_generated_Intercept_UpdateInterceptEndpointGroupAssociation_async", + "title": "AddressGroupService updateInterceptEndpointGroupAssociation Sample", "origin": "API_DEFINITION", - "description": " Deletes an address group.", + "description": " Updates an association. See https://google.aip.dev/134.", "canonical": true, - "file": "organization_address_group_service.delete_address_group.js", + "file": "intercept.update_intercept_endpoint_group_association.js", "language": "JAVASCRIPT", "segments": [ { "start": 25, - "end": 69, + "end": 68, "type": "FULL" } ], "clientMethod": { - "shortName": "DeleteAddressGroup", - "fullName": "google.cloud.networksecurity.v1.OrganizationAddressGroupService.DeleteAddressGroup", + "shortName": "UpdateInterceptEndpointGroupAssociation", + "fullName": "google.cloud.networksecurity.v1.Intercept.UpdateInterceptEndpointGroupAssociation", + "async": true, + "parameters": [ + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + }, + { + "name": "intercept_endpoint_group_association", + "type": ".google.cloud.networksecurity.v1.InterceptEndpointGroupAssociation" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "InterceptClient", + "fullName": "google.cloud.networksecurity.v1.InterceptClient" + }, + "method": { + "shortName": "UpdateInterceptEndpointGroupAssociation", + "fullName": "google.cloud.networksecurity.v1.Intercept.UpdateInterceptEndpointGroupAssociation", + "service": { + "shortName": "Intercept", + "fullName": "google.cloud.networksecurity.v1.Intercept" + } + } + } + }, + { + "regionTag": "networksecurity_v1_generated_Intercept_DeleteInterceptEndpointGroupAssociation_async", + "title": "AddressGroupService deleteInterceptEndpointGroupAssociation Sample", + "origin": "API_DEFINITION", + "description": " Deletes an association. See https://google.aip.dev/135.", + "canonical": true, + "file": "intercept.delete_intercept_endpoint_group_association.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 60, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteInterceptEndpointGroupAssociation", + "fullName": "google.cloud.networksecurity.v1.Intercept.DeleteInterceptEndpointGroupAssociation", "async": true, "parameters": [ { @@ -1466,41 +1606,41 @@ ], "resultType": ".google.longrunning.Operation", "client": { - "shortName": "OrganizationAddressGroupServiceClient", - "fullName": "google.cloud.networksecurity.v1.OrganizationAddressGroupServiceClient" + "shortName": "InterceptClient", + "fullName": "google.cloud.networksecurity.v1.InterceptClient" }, "method": { - "shortName": "DeleteAddressGroup", - "fullName": "google.cloud.networksecurity.v1.OrganizationAddressGroupService.DeleteAddressGroup", + "shortName": "DeleteInterceptEndpointGroupAssociation", + "fullName": "google.cloud.networksecurity.v1.Intercept.DeleteInterceptEndpointGroupAssociation", "service": { - "shortName": "OrganizationAddressGroupService", - "fullName": "google.cloud.networksecurity.v1.OrganizationAddressGroupService" + "shortName": "Intercept", + "fullName": "google.cloud.networksecurity.v1.Intercept" } } } }, { - "regionTag": "networksecurity_v1_generated_OrganizationAddressGroupService_ListAddressGroupReferences_async", - "title": "AddressGroupService listAddressGroupReferences Sample", + "regionTag": "networksecurity_v1_generated_Intercept_ListInterceptDeploymentGroups_async", + "title": "AddressGroupService listInterceptDeploymentGroups Sample", "origin": "API_DEFINITION", - "description": " Lists references of an address group.", + "description": " Lists deployment groups in a given project and location. See https://google.aip.dev/132.", "canonical": true, - "file": "organization_address_group_service.list_address_group_references.js", + "file": "intercept.list_intercept_deployment_groups.js", "language": "JAVASCRIPT", "segments": [ { "start": 25, - "end": 69, + "end": 81, "type": "FULL" } ], "clientMethod": { - "shortName": "ListAddressGroupReferences", - "fullName": "google.cloud.networksecurity.v1.OrganizationAddressGroupService.ListAddressGroupReferences", + "shortName": "ListInterceptDeploymentGroups", + "fullName": "google.cloud.networksecurity.v1.Intercept.ListInterceptDeploymentGroups", "async": true, "parameters": [ { - "name": "address_group", + "name": "parent", "type": "TYPE_STRING" }, { @@ -1510,19 +1650,4299 @@ { "name": "page_token", "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + }, + { + "name": "order_by", + "type": "TYPE_STRING" } ], - "resultType": ".google.cloud.networksecurity.v1.ListAddressGroupReferencesResponse", + "resultType": ".google.cloud.networksecurity.v1.ListInterceptDeploymentGroupsResponse", "client": { - "shortName": "OrganizationAddressGroupServiceClient", - "fullName": "google.cloud.networksecurity.v1.OrganizationAddressGroupServiceClient" + "shortName": "InterceptClient", + "fullName": "google.cloud.networksecurity.v1.InterceptClient" }, "method": { - "shortName": "ListAddressGroupReferences", - "fullName": "google.cloud.networksecurity.v1.OrganizationAddressGroupService.ListAddressGroupReferences", + "shortName": "ListInterceptDeploymentGroups", + "fullName": "google.cloud.networksecurity.v1.Intercept.ListInterceptDeploymentGroups", "service": { - "shortName": "OrganizationAddressGroupService", - "fullName": "google.cloud.networksecurity.v1.OrganizationAddressGroupService" + "shortName": "Intercept", + "fullName": "google.cloud.networksecurity.v1.Intercept" + } + } + } + }, + { + "regionTag": "networksecurity_v1_generated_Intercept_GetInterceptDeploymentGroup_async", + "title": "AddressGroupService getInterceptDeploymentGroup Sample", + "origin": "API_DEFINITION", + "description": " Gets a specific deployment group. See https://google.aip.dev/131.", + "canonical": true, + "file": "intercept.get_intercept_deployment_group.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 55, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetInterceptDeploymentGroup", + "fullName": "google.cloud.networksecurity.v1.Intercept.GetInterceptDeploymentGroup", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.networksecurity.v1.InterceptDeploymentGroup", + "client": { + "shortName": "InterceptClient", + "fullName": "google.cloud.networksecurity.v1.InterceptClient" + }, + "method": { + "shortName": "GetInterceptDeploymentGroup", + "fullName": "google.cloud.networksecurity.v1.Intercept.GetInterceptDeploymentGroup", + "service": { + "shortName": "Intercept", + "fullName": "google.cloud.networksecurity.v1.Intercept" + } + } + } + }, + { + "regionTag": "networksecurity_v1_generated_Intercept_CreateInterceptDeploymentGroup_async", + "title": "AddressGroupService createInterceptDeploymentGroup Sample", + "origin": "API_DEFINITION", + "description": " Creates a deployment group in a given project and location. See https://google.aip.dev/133.", + "canonical": true, + "file": "intercept.create_intercept_deployment_group.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 72, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateInterceptDeploymentGroup", + "fullName": "google.cloud.networksecurity.v1.Intercept.CreateInterceptDeploymentGroup", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "intercept_deployment_group_id", + "type": "TYPE_STRING" + }, + { + "name": "intercept_deployment_group", + "type": ".google.cloud.networksecurity.v1.InterceptDeploymentGroup" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "InterceptClient", + "fullName": "google.cloud.networksecurity.v1.InterceptClient" + }, + "method": { + "shortName": "CreateInterceptDeploymentGroup", + "fullName": "google.cloud.networksecurity.v1.Intercept.CreateInterceptDeploymentGroup", + "service": { + "shortName": "Intercept", + "fullName": "google.cloud.networksecurity.v1.Intercept" + } + } + } + }, + { + "regionTag": "networksecurity_v1_generated_Intercept_UpdateInterceptDeploymentGroup_async", + "title": "AddressGroupService updateInterceptDeploymentGroup Sample", + "origin": "API_DEFINITION", + "description": " Updates a deployment group. See https://google.aip.dev/134.", + "canonical": true, + "file": "intercept.update_intercept_deployment_group.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 68, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateInterceptDeploymentGroup", + "fullName": "google.cloud.networksecurity.v1.Intercept.UpdateInterceptDeploymentGroup", + "async": true, + "parameters": [ + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + }, + { + "name": "intercept_deployment_group", + "type": ".google.cloud.networksecurity.v1.InterceptDeploymentGroup" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "InterceptClient", + "fullName": "google.cloud.networksecurity.v1.InterceptClient" + }, + "method": { + "shortName": "UpdateInterceptDeploymentGroup", + "fullName": "google.cloud.networksecurity.v1.Intercept.UpdateInterceptDeploymentGroup", + "service": { + "shortName": "Intercept", + "fullName": "google.cloud.networksecurity.v1.Intercept" + } + } + } + }, + { + "regionTag": "networksecurity_v1_generated_Intercept_DeleteInterceptDeploymentGroup_async", + "title": "AddressGroupService deleteInterceptDeploymentGroup Sample", + "origin": "API_DEFINITION", + "description": " Deletes a deployment group. See https://google.aip.dev/135.", + "canonical": true, + "file": "intercept.delete_intercept_deployment_group.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 60, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteInterceptDeploymentGroup", + "fullName": "google.cloud.networksecurity.v1.Intercept.DeleteInterceptDeploymentGroup", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "InterceptClient", + "fullName": "google.cloud.networksecurity.v1.InterceptClient" + }, + "method": { + "shortName": "DeleteInterceptDeploymentGroup", + "fullName": "google.cloud.networksecurity.v1.Intercept.DeleteInterceptDeploymentGroup", + "service": { + "shortName": "Intercept", + "fullName": "google.cloud.networksecurity.v1.Intercept" + } + } + } + }, + { + "regionTag": "networksecurity_v1_generated_Intercept_ListInterceptDeployments_async", + "title": "AddressGroupService listInterceptDeployments Sample", + "origin": "API_DEFINITION", + "description": " Lists deployments in a given project and location. See https://google.aip.dev/132.", + "canonical": true, + "file": "intercept.list_intercept_deployments.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 81, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListInterceptDeployments", + "fullName": "google.cloud.networksecurity.v1.Intercept.ListInterceptDeployments", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + }, + { + "name": "order_by", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.networksecurity.v1.ListInterceptDeploymentsResponse", + "client": { + "shortName": "InterceptClient", + "fullName": "google.cloud.networksecurity.v1.InterceptClient" + }, + "method": { + "shortName": "ListInterceptDeployments", + "fullName": "google.cloud.networksecurity.v1.Intercept.ListInterceptDeployments", + "service": { + "shortName": "Intercept", + "fullName": "google.cloud.networksecurity.v1.Intercept" + } + } + } + }, + { + "regionTag": "networksecurity_v1_generated_Intercept_GetInterceptDeployment_async", + "title": "AddressGroupService getInterceptDeployment Sample", + "origin": "API_DEFINITION", + "description": " Gets a specific deployment. See https://google.aip.dev/131.", + "canonical": true, + "file": "intercept.get_intercept_deployment.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 55, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetInterceptDeployment", + "fullName": "google.cloud.networksecurity.v1.Intercept.GetInterceptDeployment", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.networksecurity.v1.InterceptDeployment", + "client": { + "shortName": "InterceptClient", + "fullName": "google.cloud.networksecurity.v1.InterceptClient" + }, + "method": { + "shortName": "GetInterceptDeployment", + "fullName": "google.cloud.networksecurity.v1.Intercept.GetInterceptDeployment", + "service": { + "shortName": "Intercept", + "fullName": "google.cloud.networksecurity.v1.Intercept" + } + } + } + }, + { + "regionTag": "networksecurity_v1_generated_Intercept_CreateInterceptDeployment_async", + "title": "AddressGroupService createInterceptDeployment Sample", + "origin": "API_DEFINITION", + "description": " Creates a deployment in a given project and location. See https://google.aip.dev/133.", + "canonical": true, + "file": "intercept.create_intercept_deployment.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 72, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateInterceptDeployment", + "fullName": "google.cloud.networksecurity.v1.Intercept.CreateInterceptDeployment", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "intercept_deployment_id", + "type": "TYPE_STRING" + }, + { + "name": "intercept_deployment", + "type": ".google.cloud.networksecurity.v1.InterceptDeployment" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "InterceptClient", + "fullName": "google.cloud.networksecurity.v1.InterceptClient" + }, + "method": { + "shortName": "CreateInterceptDeployment", + "fullName": "google.cloud.networksecurity.v1.Intercept.CreateInterceptDeployment", + "service": { + "shortName": "Intercept", + "fullName": "google.cloud.networksecurity.v1.Intercept" + } + } + } + }, + { + "regionTag": "networksecurity_v1_generated_Intercept_UpdateInterceptDeployment_async", + "title": "AddressGroupService updateInterceptDeployment Sample", + "origin": "API_DEFINITION", + "description": " Updates a deployment. See https://google.aip.dev/134.", + "canonical": true, + "file": "intercept.update_intercept_deployment.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 67, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateInterceptDeployment", + "fullName": "google.cloud.networksecurity.v1.Intercept.UpdateInterceptDeployment", + "async": true, + "parameters": [ + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + }, + { + "name": "intercept_deployment", + "type": ".google.cloud.networksecurity.v1.InterceptDeployment" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "InterceptClient", + "fullName": "google.cloud.networksecurity.v1.InterceptClient" + }, + "method": { + "shortName": "UpdateInterceptDeployment", + "fullName": "google.cloud.networksecurity.v1.Intercept.UpdateInterceptDeployment", + "service": { + "shortName": "Intercept", + "fullName": "google.cloud.networksecurity.v1.Intercept" + } + } + } + }, + { + "regionTag": "networksecurity_v1_generated_Intercept_DeleteInterceptDeployment_async", + "title": "AddressGroupService deleteInterceptDeployment Sample", + "origin": "API_DEFINITION", + "description": " Deletes a deployment. See https://google.aip.dev/135.", + "canonical": true, + "file": "intercept.delete_intercept_deployment.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 60, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteInterceptDeployment", + "fullName": "google.cloud.networksecurity.v1.Intercept.DeleteInterceptDeployment", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "InterceptClient", + "fullName": "google.cloud.networksecurity.v1.InterceptClient" + }, + "method": { + "shortName": "DeleteInterceptDeployment", + "fullName": "google.cloud.networksecurity.v1.Intercept.DeleteInterceptDeployment", + "service": { + "shortName": "Intercept", + "fullName": "google.cloud.networksecurity.v1.Intercept" + } + } + } + }, + { + "regionTag": "networksecurity_v1_generated_Mirroring_ListMirroringEndpointGroups_async", + "title": "AddressGroupService listMirroringEndpointGroups Sample", + "origin": "API_DEFINITION", + "description": " Lists endpoint groups in a given project and location. See https://google.aip.dev/132.", + "canonical": true, + "file": "mirroring.list_mirroring_endpoint_groups.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 82, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListMirroringEndpointGroups", + "fullName": "google.cloud.networksecurity.v1.Mirroring.ListMirroringEndpointGroups", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + }, + { + "name": "order_by", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.networksecurity.v1.ListMirroringEndpointGroupsResponse", + "client": { + "shortName": "MirroringClient", + "fullName": "google.cloud.networksecurity.v1.MirroringClient" + }, + "method": { + "shortName": "ListMirroringEndpointGroups", + "fullName": "google.cloud.networksecurity.v1.Mirroring.ListMirroringEndpointGroups", + "service": { + "shortName": "Mirroring", + "fullName": "google.cloud.networksecurity.v1.Mirroring" + } + } + } + }, + { + "regionTag": "networksecurity_v1_generated_Mirroring_GetMirroringEndpointGroup_async", + "title": "AddressGroupService getMirroringEndpointGroup Sample", + "origin": "API_DEFINITION", + "description": " Gets a specific endpoint group. See https://google.aip.dev/131.", + "canonical": true, + "file": "mirroring.get_mirroring_endpoint_group.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 55, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetMirroringEndpointGroup", + "fullName": "google.cloud.networksecurity.v1.Mirroring.GetMirroringEndpointGroup", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.networksecurity.v1.MirroringEndpointGroup", + "client": { + "shortName": "MirroringClient", + "fullName": "google.cloud.networksecurity.v1.MirroringClient" + }, + "method": { + "shortName": "GetMirroringEndpointGroup", + "fullName": "google.cloud.networksecurity.v1.Mirroring.GetMirroringEndpointGroup", + "service": { + "shortName": "Mirroring", + "fullName": "google.cloud.networksecurity.v1.Mirroring" + } + } + } + }, + { + "regionTag": "networksecurity_v1_generated_Mirroring_CreateMirroringEndpointGroup_async", + "title": "AddressGroupService createMirroringEndpointGroup Sample", + "origin": "API_DEFINITION", + "description": " Creates an endpoint group in a given project and location. See https://google.aip.dev/133.", + "canonical": true, + "file": "mirroring.create_mirroring_endpoint_group.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 72, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateMirroringEndpointGroup", + "fullName": "google.cloud.networksecurity.v1.Mirroring.CreateMirroringEndpointGroup", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "mirroring_endpoint_group_id", + "type": "TYPE_STRING" + }, + { + "name": "mirroring_endpoint_group", + "type": ".google.cloud.networksecurity.v1.MirroringEndpointGroup" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "MirroringClient", + "fullName": "google.cloud.networksecurity.v1.MirroringClient" + }, + "method": { + "shortName": "CreateMirroringEndpointGroup", + "fullName": "google.cloud.networksecurity.v1.Mirroring.CreateMirroringEndpointGroup", + "service": { + "shortName": "Mirroring", + "fullName": "google.cloud.networksecurity.v1.Mirroring" + } + } + } + }, + { + "regionTag": "networksecurity_v1_generated_Mirroring_UpdateMirroringEndpointGroup_async", + "title": "AddressGroupService updateMirroringEndpointGroup Sample", + "origin": "API_DEFINITION", + "description": " Updates an endpoint group. See https://google.aip.dev/134.", + "canonical": true, + "file": "mirroring.update_mirroring_endpoint_group.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 67, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateMirroringEndpointGroup", + "fullName": "google.cloud.networksecurity.v1.Mirroring.UpdateMirroringEndpointGroup", + "async": true, + "parameters": [ + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + }, + { + "name": "mirroring_endpoint_group", + "type": ".google.cloud.networksecurity.v1.MirroringEndpointGroup" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "MirroringClient", + "fullName": "google.cloud.networksecurity.v1.MirroringClient" + }, + "method": { + "shortName": "UpdateMirroringEndpointGroup", + "fullName": "google.cloud.networksecurity.v1.Mirroring.UpdateMirroringEndpointGroup", + "service": { + "shortName": "Mirroring", + "fullName": "google.cloud.networksecurity.v1.Mirroring" + } + } + } + }, + { + "regionTag": "networksecurity_v1_generated_Mirroring_DeleteMirroringEndpointGroup_async", + "title": "AddressGroupService deleteMirroringEndpointGroup Sample", + "origin": "API_DEFINITION", + "description": " Deletes an endpoint group. See https://google.aip.dev/135.", + "canonical": true, + "file": "mirroring.delete_mirroring_endpoint_group.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 60, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteMirroringEndpointGroup", + "fullName": "google.cloud.networksecurity.v1.Mirroring.DeleteMirroringEndpointGroup", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "MirroringClient", + "fullName": "google.cloud.networksecurity.v1.MirroringClient" + }, + "method": { + "shortName": "DeleteMirroringEndpointGroup", + "fullName": "google.cloud.networksecurity.v1.Mirroring.DeleteMirroringEndpointGroup", + "service": { + "shortName": "Mirroring", + "fullName": "google.cloud.networksecurity.v1.Mirroring" + } + } + } + }, + { + "regionTag": "networksecurity_v1_generated_Mirroring_ListMirroringEndpointGroupAssociations_async", + "title": "AddressGroupService listMirroringEndpointGroupAssociations Sample", + "origin": "API_DEFINITION", + "description": " Lists associations in a given project and location. See https://google.aip.dev/132.", + "canonical": true, + "file": "mirroring.list_mirroring_endpoint_group_associations.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 81, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListMirroringEndpointGroupAssociations", + "fullName": "google.cloud.networksecurity.v1.Mirroring.ListMirroringEndpointGroupAssociations", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + }, + { + "name": "order_by", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.networksecurity.v1.ListMirroringEndpointGroupAssociationsResponse", + "client": { + "shortName": "MirroringClient", + "fullName": "google.cloud.networksecurity.v1.MirroringClient" + }, + "method": { + "shortName": "ListMirroringEndpointGroupAssociations", + "fullName": "google.cloud.networksecurity.v1.Mirroring.ListMirroringEndpointGroupAssociations", + "service": { + "shortName": "Mirroring", + "fullName": "google.cloud.networksecurity.v1.Mirroring" + } + } + } + }, + { + "regionTag": "networksecurity_v1_generated_Mirroring_GetMirroringEndpointGroupAssociation_async", + "title": "AddressGroupService getMirroringEndpointGroupAssociation Sample", + "origin": "API_DEFINITION", + "description": " Gets a specific association. See https://google.aip.dev/131.", + "canonical": true, + "file": "mirroring.get_mirroring_endpoint_group_association.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 55, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetMirroringEndpointGroupAssociation", + "fullName": "google.cloud.networksecurity.v1.Mirroring.GetMirroringEndpointGroupAssociation", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.networksecurity.v1.MirroringEndpointGroupAssociation", + "client": { + "shortName": "MirroringClient", + "fullName": "google.cloud.networksecurity.v1.MirroringClient" + }, + "method": { + "shortName": "GetMirroringEndpointGroupAssociation", + "fullName": "google.cloud.networksecurity.v1.Mirroring.GetMirroringEndpointGroupAssociation", + "service": { + "shortName": "Mirroring", + "fullName": "google.cloud.networksecurity.v1.Mirroring" + } + } + } + }, + { + "regionTag": "networksecurity_v1_generated_Mirroring_CreateMirroringEndpointGroupAssociation_async", + "title": "AddressGroupService createMirroringEndpointGroupAssociation Sample", + "origin": "API_DEFINITION", + "description": " Creates an association in a given project and location. See https://google.aip.dev/133.", + "canonical": true, + "file": "mirroring.create_mirroring_endpoint_group_association.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 72, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateMirroringEndpointGroupAssociation", + "fullName": "google.cloud.networksecurity.v1.Mirroring.CreateMirroringEndpointGroupAssociation", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "mirroring_endpoint_group_association_id", + "type": "TYPE_STRING" + }, + { + "name": "mirroring_endpoint_group_association", + "type": ".google.cloud.networksecurity.v1.MirroringEndpointGroupAssociation" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "MirroringClient", + "fullName": "google.cloud.networksecurity.v1.MirroringClient" + }, + "method": { + "shortName": "CreateMirroringEndpointGroupAssociation", + "fullName": "google.cloud.networksecurity.v1.Mirroring.CreateMirroringEndpointGroupAssociation", + "service": { + "shortName": "Mirroring", + "fullName": "google.cloud.networksecurity.v1.Mirroring" + } + } + } + }, + { + "regionTag": "networksecurity_v1_generated_Mirroring_UpdateMirroringEndpointGroupAssociation_async", + "title": "AddressGroupService updateMirroringEndpointGroupAssociation Sample", + "origin": "API_DEFINITION", + "description": " Updates an association. See https://google.aip.dev/134.", + "canonical": true, + "file": "mirroring.update_mirroring_endpoint_group_association.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 68, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateMirroringEndpointGroupAssociation", + "fullName": "google.cloud.networksecurity.v1.Mirroring.UpdateMirroringEndpointGroupAssociation", + "async": true, + "parameters": [ + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + }, + { + "name": "mirroring_endpoint_group_association", + "type": ".google.cloud.networksecurity.v1.MirroringEndpointGroupAssociation" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "MirroringClient", + "fullName": "google.cloud.networksecurity.v1.MirroringClient" + }, + "method": { + "shortName": "UpdateMirroringEndpointGroupAssociation", + "fullName": "google.cloud.networksecurity.v1.Mirroring.UpdateMirroringEndpointGroupAssociation", + "service": { + "shortName": "Mirroring", + "fullName": "google.cloud.networksecurity.v1.Mirroring" + } + } + } + }, + { + "regionTag": "networksecurity_v1_generated_Mirroring_DeleteMirroringEndpointGroupAssociation_async", + "title": "AddressGroupService deleteMirroringEndpointGroupAssociation Sample", + "origin": "API_DEFINITION", + "description": " Deletes an association. See https://google.aip.dev/135.", + "canonical": true, + "file": "mirroring.delete_mirroring_endpoint_group_association.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 60, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteMirroringEndpointGroupAssociation", + "fullName": "google.cloud.networksecurity.v1.Mirroring.DeleteMirroringEndpointGroupAssociation", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "MirroringClient", + "fullName": "google.cloud.networksecurity.v1.MirroringClient" + }, + "method": { + "shortName": "DeleteMirroringEndpointGroupAssociation", + "fullName": "google.cloud.networksecurity.v1.Mirroring.DeleteMirroringEndpointGroupAssociation", + "service": { + "shortName": "Mirroring", + "fullName": "google.cloud.networksecurity.v1.Mirroring" + } + } + } + }, + { + "regionTag": "networksecurity_v1_generated_Mirroring_ListMirroringDeploymentGroups_async", + "title": "AddressGroupService listMirroringDeploymentGroups Sample", + "origin": "API_DEFINITION", + "description": " Lists deployment groups in a given project and location. See https://google.aip.dev/132.", + "canonical": true, + "file": "mirroring.list_mirroring_deployment_groups.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 81, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListMirroringDeploymentGroups", + "fullName": "google.cloud.networksecurity.v1.Mirroring.ListMirroringDeploymentGroups", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + }, + { + "name": "order_by", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.networksecurity.v1.ListMirroringDeploymentGroupsResponse", + "client": { + "shortName": "MirroringClient", + "fullName": "google.cloud.networksecurity.v1.MirroringClient" + }, + "method": { + "shortName": "ListMirroringDeploymentGroups", + "fullName": "google.cloud.networksecurity.v1.Mirroring.ListMirroringDeploymentGroups", + "service": { + "shortName": "Mirroring", + "fullName": "google.cloud.networksecurity.v1.Mirroring" + } + } + } + }, + { + "regionTag": "networksecurity_v1_generated_Mirroring_GetMirroringDeploymentGroup_async", + "title": "AddressGroupService getMirroringDeploymentGroup Sample", + "origin": "API_DEFINITION", + "description": " Gets a specific deployment group. See https://google.aip.dev/131.", + "canonical": true, + "file": "mirroring.get_mirroring_deployment_group.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 55, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetMirroringDeploymentGroup", + "fullName": "google.cloud.networksecurity.v1.Mirroring.GetMirroringDeploymentGroup", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.networksecurity.v1.MirroringDeploymentGroup", + "client": { + "shortName": "MirroringClient", + "fullName": "google.cloud.networksecurity.v1.MirroringClient" + }, + "method": { + "shortName": "GetMirroringDeploymentGroup", + "fullName": "google.cloud.networksecurity.v1.Mirroring.GetMirroringDeploymentGroup", + "service": { + "shortName": "Mirroring", + "fullName": "google.cloud.networksecurity.v1.Mirroring" + } + } + } + }, + { + "regionTag": "networksecurity_v1_generated_Mirroring_CreateMirroringDeploymentGroup_async", + "title": "AddressGroupService createMirroringDeploymentGroup Sample", + "origin": "API_DEFINITION", + "description": " Creates a deployment group in a given project and location. See https://google.aip.dev/133.", + "canonical": true, + "file": "mirroring.create_mirroring_deployment_group.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 72, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateMirroringDeploymentGroup", + "fullName": "google.cloud.networksecurity.v1.Mirroring.CreateMirroringDeploymentGroup", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "mirroring_deployment_group_id", + "type": "TYPE_STRING" + }, + { + "name": "mirroring_deployment_group", + "type": ".google.cloud.networksecurity.v1.MirroringDeploymentGroup" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "MirroringClient", + "fullName": "google.cloud.networksecurity.v1.MirroringClient" + }, + "method": { + "shortName": "CreateMirroringDeploymentGroup", + "fullName": "google.cloud.networksecurity.v1.Mirroring.CreateMirroringDeploymentGroup", + "service": { + "shortName": "Mirroring", + "fullName": "google.cloud.networksecurity.v1.Mirroring" + } + } + } + }, + { + "regionTag": "networksecurity_v1_generated_Mirroring_UpdateMirroringDeploymentGroup_async", + "title": "AddressGroupService updateMirroringDeploymentGroup Sample", + "origin": "API_DEFINITION", + "description": " Updates a deployment group. See https://google.aip.dev/134.", + "canonical": true, + "file": "mirroring.update_mirroring_deployment_group.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 68, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateMirroringDeploymentGroup", + "fullName": "google.cloud.networksecurity.v1.Mirroring.UpdateMirroringDeploymentGroup", + "async": true, + "parameters": [ + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + }, + { + "name": "mirroring_deployment_group", + "type": ".google.cloud.networksecurity.v1.MirroringDeploymentGroup" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "MirroringClient", + "fullName": "google.cloud.networksecurity.v1.MirroringClient" + }, + "method": { + "shortName": "UpdateMirroringDeploymentGroup", + "fullName": "google.cloud.networksecurity.v1.Mirroring.UpdateMirroringDeploymentGroup", + "service": { + "shortName": "Mirroring", + "fullName": "google.cloud.networksecurity.v1.Mirroring" + } + } + } + }, + { + "regionTag": "networksecurity_v1_generated_Mirroring_DeleteMirroringDeploymentGroup_async", + "title": "AddressGroupService deleteMirroringDeploymentGroup Sample", + "origin": "API_DEFINITION", + "description": " Deletes a deployment group. See https://google.aip.dev/135.", + "canonical": true, + "file": "mirroring.delete_mirroring_deployment_group.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 60, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteMirroringDeploymentGroup", + "fullName": "google.cloud.networksecurity.v1.Mirroring.DeleteMirroringDeploymentGroup", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "MirroringClient", + "fullName": "google.cloud.networksecurity.v1.MirroringClient" + }, + "method": { + "shortName": "DeleteMirroringDeploymentGroup", + "fullName": "google.cloud.networksecurity.v1.Mirroring.DeleteMirroringDeploymentGroup", + "service": { + "shortName": "Mirroring", + "fullName": "google.cloud.networksecurity.v1.Mirroring" + } + } + } + }, + { + "regionTag": "networksecurity_v1_generated_Mirroring_ListMirroringDeployments_async", + "title": "AddressGroupService listMirroringDeployments Sample", + "origin": "API_DEFINITION", + "description": " Lists deployments in a given project and location. See https://google.aip.dev/132.", + "canonical": true, + "file": "mirroring.list_mirroring_deployments.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 81, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListMirroringDeployments", + "fullName": "google.cloud.networksecurity.v1.Mirroring.ListMirroringDeployments", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + }, + { + "name": "order_by", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.networksecurity.v1.ListMirroringDeploymentsResponse", + "client": { + "shortName": "MirroringClient", + "fullName": "google.cloud.networksecurity.v1.MirroringClient" + }, + "method": { + "shortName": "ListMirroringDeployments", + "fullName": "google.cloud.networksecurity.v1.Mirroring.ListMirroringDeployments", + "service": { + "shortName": "Mirroring", + "fullName": "google.cloud.networksecurity.v1.Mirroring" + } + } + } + }, + { + "regionTag": "networksecurity_v1_generated_Mirroring_GetMirroringDeployment_async", + "title": "AddressGroupService getMirroringDeployment Sample", + "origin": "API_DEFINITION", + "description": " Gets a specific deployment. See https://google.aip.dev/131.", + "canonical": true, + "file": "mirroring.get_mirroring_deployment.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 55, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetMirroringDeployment", + "fullName": "google.cloud.networksecurity.v1.Mirroring.GetMirroringDeployment", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.networksecurity.v1.MirroringDeployment", + "client": { + "shortName": "MirroringClient", + "fullName": "google.cloud.networksecurity.v1.MirroringClient" + }, + "method": { + "shortName": "GetMirroringDeployment", + "fullName": "google.cloud.networksecurity.v1.Mirroring.GetMirroringDeployment", + "service": { + "shortName": "Mirroring", + "fullName": "google.cloud.networksecurity.v1.Mirroring" + } + } + } + }, + { + "regionTag": "networksecurity_v1_generated_Mirroring_CreateMirroringDeployment_async", + "title": "AddressGroupService createMirroringDeployment Sample", + "origin": "API_DEFINITION", + "description": " Creates a deployment in a given project and location. See https://google.aip.dev/133.", + "canonical": true, + "file": "mirroring.create_mirroring_deployment.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 72, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateMirroringDeployment", + "fullName": "google.cloud.networksecurity.v1.Mirroring.CreateMirroringDeployment", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "mirroring_deployment_id", + "type": "TYPE_STRING" + }, + { + "name": "mirroring_deployment", + "type": ".google.cloud.networksecurity.v1.MirroringDeployment" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "MirroringClient", + "fullName": "google.cloud.networksecurity.v1.MirroringClient" + }, + "method": { + "shortName": "CreateMirroringDeployment", + "fullName": "google.cloud.networksecurity.v1.Mirroring.CreateMirroringDeployment", + "service": { + "shortName": "Mirroring", + "fullName": "google.cloud.networksecurity.v1.Mirroring" + } + } + } + }, + { + "regionTag": "networksecurity_v1_generated_Mirroring_UpdateMirroringDeployment_async", + "title": "AddressGroupService updateMirroringDeployment Sample", + "origin": "API_DEFINITION", + "description": " Updates a deployment. See https://google.aip.dev/134.", + "canonical": true, + "file": "mirroring.update_mirroring_deployment.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 67, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateMirroringDeployment", + "fullName": "google.cloud.networksecurity.v1.Mirroring.UpdateMirroringDeployment", + "async": true, + "parameters": [ + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + }, + { + "name": "mirroring_deployment", + "type": ".google.cloud.networksecurity.v1.MirroringDeployment" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "MirroringClient", + "fullName": "google.cloud.networksecurity.v1.MirroringClient" + }, + "method": { + "shortName": "UpdateMirroringDeployment", + "fullName": "google.cloud.networksecurity.v1.Mirroring.UpdateMirroringDeployment", + "service": { + "shortName": "Mirroring", + "fullName": "google.cloud.networksecurity.v1.Mirroring" + } + } + } + }, + { + "regionTag": "networksecurity_v1_generated_Mirroring_DeleteMirroringDeployment_async", + "title": "AddressGroupService deleteMirroringDeployment Sample", + "origin": "API_DEFINITION", + "description": " Deletes a deployment. See https://google.aip.dev/135.", + "canonical": true, + "file": "mirroring.delete_mirroring_deployment.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 60, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteMirroringDeployment", + "fullName": "google.cloud.networksecurity.v1.Mirroring.DeleteMirroringDeployment", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "MirroringClient", + "fullName": "google.cloud.networksecurity.v1.MirroringClient" + }, + "method": { + "shortName": "DeleteMirroringDeployment", + "fullName": "google.cloud.networksecurity.v1.Mirroring.DeleteMirroringDeployment", + "service": { + "shortName": "Mirroring", + "fullName": "google.cloud.networksecurity.v1.Mirroring" + } + } + } + }, + { + "regionTag": "networksecurity_v1_generated_NetworkSecurity_ListAuthorizationPolicies_async", + "title": "AddressGroupService listAuthorizationPolicies Sample", + "origin": "API_DEFINITION", + "description": " Lists AuthorizationPolicies in a given project and location.", + "canonical": true, + "file": "network_security.list_authorization_policies.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 68, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListAuthorizationPolicies", + "fullName": "google.cloud.networksecurity.v1.NetworkSecurity.ListAuthorizationPolicies", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.networksecurity.v1.ListAuthorizationPoliciesResponse", + "client": { + "shortName": "NetworkSecurityClient", + "fullName": "google.cloud.networksecurity.v1.NetworkSecurityClient" + }, + "method": { + "shortName": "ListAuthorizationPolicies", + "fullName": "google.cloud.networksecurity.v1.NetworkSecurity.ListAuthorizationPolicies", + "service": { + "shortName": "NetworkSecurity", + "fullName": "google.cloud.networksecurity.v1.NetworkSecurity" + } + } + } + }, + { + "regionTag": "networksecurity_v1_generated_NetworkSecurity_GetAuthorizationPolicy_async", + "title": "AddressGroupService getAuthorizationPolicy Sample", + "origin": "API_DEFINITION", + "description": " Gets details of a single AuthorizationPolicy.", + "canonical": true, + "file": "network_security.get_authorization_policy.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetAuthorizationPolicy", + "fullName": "google.cloud.networksecurity.v1.NetworkSecurity.GetAuthorizationPolicy", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.networksecurity.v1.AuthorizationPolicy", + "client": { + "shortName": "NetworkSecurityClient", + "fullName": "google.cloud.networksecurity.v1.NetworkSecurityClient" + }, + "method": { + "shortName": "GetAuthorizationPolicy", + "fullName": "google.cloud.networksecurity.v1.NetworkSecurity.GetAuthorizationPolicy", + "service": { + "shortName": "NetworkSecurity", + "fullName": "google.cloud.networksecurity.v1.NetworkSecurity" + } + } + } + }, + { + "regionTag": "networksecurity_v1_generated_NetworkSecurity_CreateAuthorizationPolicy_async", + "title": "AddressGroupService createAuthorizationPolicy Sample", + "origin": "API_DEFINITION", + "description": " Creates a new AuthorizationPolicy in a given project and location.", + "canonical": true, + "file": "network_security.create_authorization_policy.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 68, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateAuthorizationPolicy", + "fullName": "google.cloud.networksecurity.v1.NetworkSecurity.CreateAuthorizationPolicy", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "authorization_policy_id", + "type": "TYPE_STRING" + }, + { + "name": "authorization_policy", + "type": ".google.cloud.networksecurity.v1.AuthorizationPolicy" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "NetworkSecurityClient", + "fullName": "google.cloud.networksecurity.v1.NetworkSecurityClient" + }, + "method": { + "shortName": "CreateAuthorizationPolicy", + "fullName": "google.cloud.networksecurity.v1.NetworkSecurity.CreateAuthorizationPolicy", + "service": { + "shortName": "NetworkSecurity", + "fullName": "google.cloud.networksecurity.v1.NetworkSecurity" + } + } + } + }, + { + "regionTag": "networksecurity_v1_generated_NetworkSecurity_UpdateAuthorizationPolicy_async", + "title": "AddressGroupService updateAuthorizationPolicy Sample", + "origin": "API_DEFINITION", + "description": " Updates the parameters of a single AuthorizationPolicy.", + "canonical": true, + "file": "network_security.update_authorization_policy.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 62, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateAuthorizationPolicy", + "fullName": "google.cloud.networksecurity.v1.NetworkSecurity.UpdateAuthorizationPolicy", + "async": true, + "parameters": [ + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + }, + { + "name": "authorization_policy", + "type": ".google.cloud.networksecurity.v1.AuthorizationPolicy" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "NetworkSecurityClient", + "fullName": "google.cloud.networksecurity.v1.NetworkSecurityClient" + }, + "method": { + "shortName": "UpdateAuthorizationPolicy", + "fullName": "google.cloud.networksecurity.v1.NetworkSecurity.UpdateAuthorizationPolicy", + "service": { + "shortName": "NetworkSecurity", + "fullName": "google.cloud.networksecurity.v1.NetworkSecurity" + } + } + } + }, + { + "regionTag": "networksecurity_v1_generated_NetworkSecurity_DeleteAuthorizationPolicy_async", + "title": "AddressGroupService deleteAuthorizationPolicy Sample", + "origin": "API_DEFINITION", + "description": " Deletes a single AuthorizationPolicy.", + "canonical": true, + "file": "network_security.delete_authorization_policy.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 55, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteAuthorizationPolicy", + "fullName": "google.cloud.networksecurity.v1.NetworkSecurity.DeleteAuthorizationPolicy", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "NetworkSecurityClient", + "fullName": "google.cloud.networksecurity.v1.NetworkSecurityClient" + }, + "method": { + "shortName": "DeleteAuthorizationPolicy", + "fullName": "google.cloud.networksecurity.v1.NetworkSecurity.DeleteAuthorizationPolicy", + "service": { + "shortName": "NetworkSecurity", + "fullName": "google.cloud.networksecurity.v1.NetworkSecurity" + } + } + } + }, + { + "regionTag": "networksecurity_v1_generated_NetworkSecurity_ListBackendAuthenticationConfigs_async", + "title": "AddressGroupService listBackendAuthenticationConfigs Sample", + "origin": "API_DEFINITION", + "description": " Lists BackendAuthenticationConfigs in a given project and location.", + "canonical": true, + "file": "network_security.list_backend_authentication_configs.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 68, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListBackendAuthenticationConfigs", + "fullName": "google.cloud.networksecurity.v1.NetworkSecurity.ListBackendAuthenticationConfigs", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.networksecurity.v1.ListBackendAuthenticationConfigsResponse", + "client": { + "shortName": "NetworkSecurityClient", + "fullName": "google.cloud.networksecurity.v1.NetworkSecurityClient" + }, + "method": { + "shortName": "ListBackendAuthenticationConfigs", + "fullName": "google.cloud.networksecurity.v1.NetworkSecurity.ListBackendAuthenticationConfigs", + "service": { + "shortName": "NetworkSecurity", + "fullName": "google.cloud.networksecurity.v1.NetworkSecurity" + } + } + } + }, + { + "regionTag": "networksecurity_v1_generated_NetworkSecurity_GetBackendAuthenticationConfig_async", + "title": "AddressGroupService getBackendAuthenticationConfig Sample", + "origin": "API_DEFINITION", + "description": " Gets details of a single BackendAuthenticationConfig to BackendAuthenticationConfig.", + "canonical": true, + "file": "network_security.get_backend_authentication_config.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetBackendAuthenticationConfig", + "fullName": "google.cloud.networksecurity.v1.NetworkSecurity.GetBackendAuthenticationConfig", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.networksecurity.v1.BackendAuthenticationConfig", + "client": { + "shortName": "NetworkSecurityClient", + "fullName": "google.cloud.networksecurity.v1.NetworkSecurityClient" + }, + "method": { + "shortName": "GetBackendAuthenticationConfig", + "fullName": "google.cloud.networksecurity.v1.NetworkSecurity.GetBackendAuthenticationConfig", + "service": { + "shortName": "NetworkSecurity", + "fullName": "google.cloud.networksecurity.v1.NetworkSecurity" + } + } + } + }, + { + "regionTag": "networksecurity_v1_generated_NetworkSecurity_CreateBackendAuthenticationConfig_async", + "title": "AddressGroupService createBackendAuthenticationConfig Sample", + "origin": "API_DEFINITION", + "description": " Creates a new BackendAuthenticationConfig in a given project and location.", + "canonical": true, + "file": "network_security.create_backend_authentication_config.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 68, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateBackendAuthenticationConfig", + "fullName": "google.cloud.networksecurity.v1.NetworkSecurity.CreateBackendAuthenticationConfig", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "backend_authentication_config_id", + "type": "TYPE_STRING" + }, + { + "name": "backend_authentication_config", + "type": ".google.cloud.networksecurity.v1.BackendAuthenticationConfig" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "NetworkSecurityClient", + "fullName": "google.cloud.networksecurity.v1.NetworkSecurityClient" + }, + "method": { + "shortName": "CreateBackendAuthenticationConfig", + "fullName": "google.cloud.networksecurity.v1.NetworkSecurity.CreateBackendAuthenticationConfig", + "service": { + "shortName": "NetworkSecurity", + "fullName": "google.cloud.networksecurity.v1.NetworkSecurity" + } + } + } + }, + { + "regionTag": "networksecurity_v1_generated_NetworkSecurity_UpdateBackendAuthenticationConfig_async", + "title": "AddressGroupService updateBackendAuthenticationConfig Sample", + "origin": "API_DEFINITION", + "description": " Updates the parameters of a single BackendAuthenticationConfig to BackendAuthenticationConfig.", + "canonical": true, + "file": "network_security.update_backend_authentication_config.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 63, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateBackendAuthenticationConfig", + "fullName": "google.cloud.networksecurity.v1.NetworkSecurity.UpdateBackendAuthenticationConfig", + "async": true, + "parameters": [ + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + }, + { + "name": "backend_authentication_config", + "type": ".google.cloud.networksecurity.v1.BackendAuthenticationConfig" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "NetworkSecurityClient", + "fullName": "google.cloud.networksecurity.v1.NetworkSecurityClient" + }, + "method": { + "shortName": "UpdateBackendAuthenticationConfig", + "fullName": "google.cloud.networksecurity.v1.NetworkSecurity.UpdateBackendAuthenticationConfig", + "service": { + "shortName": "NetworkSecurity", + "fullName": "google.cloud.networksecurity.v1.NetworkSecurity" + } + } + } + }, + { + "regionTag": "networksecurity_v1_generated_NetworkSecurity_DeleteBackendAuthenticationConfig_async", + "title": "AddressGroupService deleteBackendAuthenticationConfig Sample", + "origin": "API_DEFINITION", + "description": " Deletes a single BackendAuthenticationConfig to BackendAuthenticationConfig.", + "canonical": true, + "file": "network_security.delete_backend_authentication_config.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 61, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteBackendAuthenticationConfig", + "fullName": "google.cloud.networksecurity.v1.NetworkSecurity.DeleteBackendAuthenticationConfig", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "etag", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "NetworkSecurityClient", + "fullName": "google.cloud.networksecurity.v1.NetworkSecurityClient" + }, + "method": { + "shortName": "DeleteBackendAuthenticationConfig", + "fullName": "google.cloud.networksecurity.v1.NetworkSecurity.DeleteBackendAuthenticationConfig", + "service": { + "shortName": "NetworkSecurity", + "fullName": "google.cloud.networksecurity.v1.NetworkSecurity" + } + } + } + }, + { + "regionTag": "networksecurity_v1_generated_NetworkSecurity_ListServerTlsPolicies_async", + "title": "AddressGroupService listServerTlsPolicies Sample", + "origin": "API_DEFINITION", + "description": " Lists ServerTlsPolicies in a given project and location.", + "canonical": true, + "file": "network_security.list_server_tls_policies.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 75, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListServerTlsPolicies", + "fullName": "google.cloud.networksecurity.v1.NetworkSecurity.ListServerTlsPolicies", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "return_partial_success", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.cloud.networksecurity.v1.ListServerTlsPoliciesResponse", + "client": { + "shortName": "NetworkSecurityClient", + "fullName": "google.cloud.networksecurity.v1.NetworkSecurityClient" + }, + "method": { + "shortName": "ListServerTlsPolicies", + "fullName": "google.cloud.networksecurity.v1.NetworkSecurity.ListServerTlsPolicies", + "service": { + "shortName": "NetworkSecurity", + "fullName": "google.cloud.networksecurity.v1.NetworkSecurity" + } + } + } + }, + { + "regionTag": "networksecurity_v1_generated_NetworkSecurity_GetServerTlsPolicy_async", + "title": "AddressGroupService getServerTlsPolicy Sample", + "origin": "API_DEFINITION", + "description": " Gets details of a single ServerTlsPolicy.", + "canonical": true, + "file": "network_security.get_server_tls_policy.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetServerTlsPolicy", + "fullName": "google.cloud.networksecurity.v1.NetworkSecurity.GetServerTlsPolicy", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.networksecurity.v1.ServerTlsPolicy", + "client": { + "shortName": "NetworkSecurityClient", + "fullName": "google.cloud.networksecurity.v1.NetworkSecurityClient" + }, + "method": { + "shortName": "GetServerTlsPolicy", + "fullName": "google.cloud.networksecurity.v1.NetworkSecurity.GetServerTlsPolicy", + "service": { + "shortName": "NetworkSecurity", + "fullName": "google.cloud.networksecurity.v1.NetworkSecurity" + } + } + } + }, + { + "regionTag": "networksecurity_v1_generated_NetworkSecurity_CreateServerTlsPolicy_async", + "title": "AddressGroupService createServerTlsPolicy Sample", + "origin": "API_DEFINITION", + "description": " Creates a new ServerTlsPolicy in a given project and location.", + "canonical": true, + "file": "network_security.create_server_tls_policy.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 68, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateServerTlsPolicy", + "fullName": "google.cloud.networksecurity.v1.NetworkSecurity.CreateServerTlsPolicy", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "server_tls_policy_id", + "type": "TYPE_STRING" + }, + { + "name": "server_tls_policy", + "type": ".google.cloud.networksecurity.v1.ServerTlsPolicy" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "NetworkSecurityClient", + "fullName": "google.cloud.networksecurity.v1.NetworkSecurityClient" + }, + "method": { + "shortName": "CreateServerTlsPolicy", + "fullName": "google.cloud.networksecurity.v1.NetworkSecurity.CreateServerTlsPolicy", + "service": { + "shortName": "NetworkSecurity", + "fullName": "google.cloud.networksecurity.v1.NetworkSecurity" + } + } + } + }, + { + "regionTag": "networksecurity_v1_generated_NetworkSecurity_UpdateServerTlsPolicy_async", + "title": "AddressGroupService updateServerTlsPolicy Sample", + "origin": "API_DEFINITION", + "description": " Updates the parameters of a single ServerTlsPolicy.", + "canonical": true, + "file": "network_security.update_server_tls_policy.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 63, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateServerTlsPolicy", + "fullName": "google.cloud.networksecurity.v1.NetworkSecurity.UpdateServerTlsPolicy", + "async": true, + "parameters": [ + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + }, + { + "name": "server_tls_policy", + "type": ".google.cloud.networksecurity.v1.ServerTlsPolicy" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "NetworkSecurityClient", + "fullName": "google.cloud.networksecurity.v1.NetworkSecurityClient" + }, + "method": { + "shortName": "UpdateServerTlsPolicy", + "fullName": "google.cloud.networksecurity.v1.NetworkSecurity.UpdateServerTlsPolicy", + "service": { + "shortName": "NetworkSecurity", + "fullName": "google.cloud.networksecurity.v1.NetworkSecurity" + } + } + } + }, + { + "regionTag": "networksecurity_v1_generated_NetworkSecurity_DeleteServerTlsPolicy_async", + "title": "AddressGroupService deleteServerTlsPolicy Sample", + "origin": "API_DEFINITION", + "description": " Deletes a single ServerTlsPolicy.", + "canonical": true, + "file": "network_security.delete_server_tls_policy.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 55, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteServerTlsPolicy", + "fullName": "google.cloud.networksecurity.v1.NetworkSecurity.DeleteServerTlsPolicy", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "NetworkSecurityClient", + "fullName": "google.cloud.networksecurity.v1.NetworkSecurityClient" + }, + "method": { + "shortName": "DeleteServerTlsPolicy", + "fullName": "google.cloud.networksecurity.v1.NetworkSecurity.DeleteServerTlsPolicy", + "service": { + "shortName": "NetworkSecurity", + "fullName": "google.cloud.networksecurity.v1.NetworkSecurity" + } + } + } + }, + { + "regionTag": "networksecurity_v1_generated_NetworkSecurity_ListClientTlsPolicies_async", + "title": "AddressGroupService listClientTlsPolicies Sample", + "origin": "API_DEFINITION", + "description": " Lists ClientTlsPolicies in a given project and location.", + "canonical": true, + "file": "network_security.list_client_tls_policies.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 67, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListClientTlsPolicies", + "fullName": "google.cloud.networksecurity.v1.NetworkSecurity.ListClientTlsPolicies", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.networksecurity.v1.ListClientTlsPoliciesResponse", + "client": { + "shortName": "NetworkSecurityClient", + "fullName": "google.cloud.networksecurity.v1.NetworkSecurityClient" + }, + "method": { + "shortName": "ListClientTlsPolicies", + "fullName": "google.cloud.networksecurity.v1.NetworkSecurity.ListClientTlsPolicies", + "service": { + "shortName": "NetworkSecurity", + "fullName": "google.cloud.networksecurity.v1.NetworkSecurity" + } + } + } + }, + { + "regionTag": "networksecurity_v1_generated_NetworkSecurity_GetClientTlsPolicy_async", + "title": "AddressGroupService getClientTlsPolicy Sample", + "origin": "API_DEFINITION", + "description": " Gets details of a single ClientTlsPolicy.", + "canonical": true, + "file": "network_security.get_client_tls_policy.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetClientTlsPolicy", + "fullName": "google.cloud.networksecurity.v1.NetworkSecurity.GetClientTlsPolicy", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.networksecurity.v1.ClientTlsPolicy", + "client": { + "shortName": "NetworkSecurityClient", + "fullName": "google.cloud.networksecurity.v1.NetworkSecurityClient" + }, + "method": { + "shortName": "GetClientTlsPolicy", + "fullName": "google.cloud.networksecurity.v1.NetworkSecurity.GetClientTlsPolicy", + "service": { + "shortName": "NetworkSecurity", + "fullName": "google.cloud.networksecurity.v1.NetworkSecurity" + } + } + } + }, + { + "regionTag": "networksecurity_v1_generated_NetworkSecurity_CreateClientTlsPolicy_async", + "title": "AddressGroupService createClientTlsPolicy Sample", + "origin": "API_DEFINITION", + "description": " Creates a new ClientTlsPolicy in a given project and location.", + "canonical": true, + "file": "network_security.create_client_tls_policy.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 68, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateClientTlsPolicy", + "fullName": "google.cloud.networksecurity.v1.NetworkSecurity.CreateClientTlsPolicy", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "client_tls_policy_id", + "type": "TYPE_STRING" + }, + { + "name": "client_tls_policy", + "type": ".google.cloud.networksecurity.v1.ClientTlsPolicy" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "NetworkSecurityClient", + "fullName": "google.cloud.networksecurity.v1.NetworkSecurityClient" + }, + "method": { + "shortName": "CreateClientTlsPolicy", + "fullName": "google.cloud.networksecurity.v1.NetworkSecurity.CreateClientTlsPolicy", + "service": { + "shortName": "NetworkSecurity", + "fullName": "google.cloud.networksecurity.v1.NetworkSecurity" + } + } + } + }, + { + "regionTag": "networksecurity_v1_generated_NetworkSecurity_UpdateClientTlsPolicy_async", + "title": "AddressGroupService updateClientTlsPolicy Sample", + "origin": "API_DEFINITION", + "description": " Updates the parameters of a single ClientTlsPolicy.", + "canonical": true, + "file": "network_security.update_client_tls_policy.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 63, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateClientTlsPolicy", + "fullName": "google.cloud.networksecurity.v1.NetworkSecurity.UpdateClientTlsPolicy", + "async": true, + "parameters": [ + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + }, + { + "name": "client_tls_policy", + "type": ".google.cloud.networksecurity.v1.ClientTlsPolicy" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "NetworkSecurityClient", + "fullName": "google.cloud.networksecurity.v1.NetworkSecurityClient" + }, + "method": { + "shortName": "UpdateClientTlsPolicy", + "fullName": "google.cloud.networksecurity.v1.NetworkSecurity.UpdateClientTlsPolicy", + "service": { + "shortName": "NetworkSecurity", + "fullName": "google.cloud.networksecurity.v1.NetworkSecurity" + } + } + } + }, + { + "regionTag": "networksecurity_v1_generated_NetworkSecurity_DeleteClientTlsPolicy_async", + "title": "AddressGroupService deleteClientTlsPolicy Sample", + "origin": "API_DEFINITION", + "description": " Deletes a single ClientTlsPolicy.", + "canonical": true, + "file": "network_security.delete_client_tls_policy.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 55, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteClientTlsPolicy", + "fullName": "google.cloud.networksecurity.v1.NetworkSecurity.DeleteClientTlsPolicy", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "NetworkSecurityClient", + "fullName": "google.cloud.networksecurity.v1.NetworkSecurityClient" + }, + "method": { + "shortName": "DeleteClientTlsPolicy", + "fullName": "google.cloud.networksecurity.v1.NetworkSecurity.DeleteClientTlsPolicy", + "service": { + "shortName": "NetworkSecurity", + "fullName": "google.cloud.networksecurity.v1.NetworkSecurity" + } + } + } + }, + { + "regionTag": "networksecurity_v1_generated_NetworkSecurity_ListGatewaySecurityPolicies_async", + "title": "AddressGroupService listGatewaySecurityPolicies Sample", + "origin": "API_DEFINITION", + "description": " Lists GatewaySecurityPolicies in a given project and location.", + "canonical": true, + "file": "network_security.list_gateway_security_policies.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 68, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListGatewaySecurityPolicies", + "fullName": "google.cloud.networksecurity.v1.NetworkSecurity.ListGatewaySecurityPolicies", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.networksecurity.v1.ListGatewaySecurityPoliciesResponse", + "client": { + "shortName": "NetworkSecurityClient", + "fullName": "google.cloud.networksecurity.v1.NetworkSecurityClient" + }, + "method": { + "shortName": "ListGatewaySecurityPolicies", + "fullName": "google.cloud.networksecurity.v1.NetworkSecurity.ListGatewaySecurityPolicies", + "service": { + "shortName": "NetworkSecurity", + "fullName": "google.cloud.networksecurity.v1.NetworkSecurity" + } + } + } + }, + { + "regionTag": "networksecurity_v1_generated_NetworkSecurity_GetGatewaySecurityPolicy_async", + "title": "AddressGroupService getGatewaySecurityPolicy Sample", + "origin": "API_DEFINITION", + "description": " Gets details of a single GatewaySecurityPolicy.", + "canonical": true, + "file": "network_security.get_gateway_security_policy.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetGatewaySecurityPolicy", + "fullName": "google.cloud.networksecurity.v1.NetworkSecurity.GetGatewaySecurityPolicy", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.networksecurity.v1.GatewaySecurityPolicy", + "client": { + "shortName": "NetworkSecurityClient", + "fullName": "google.cloud.networksecurity.v1.NetworkSecurityClient" + }, + "method": { + "shortName": "GetGatewaySecurityPolicy", + "fullName": "google.cloud.networksecurity.v1.NetworkSecurity.GetGatewaySecurityPolicy", + "service": { + "shortName": "NetworkSecurity", + "fullName": "google.cloud.networksecurity.v1.NetworkSecurity" + } + } + } + }, + { + "regionTag": "networksecurity_v1_generated_NetworkSecurity_CreateGatewaySecurityPolicy_async", + "title": "AddressGroupService createGatewaySecurityPolicy Sample", + "origin": "API_DEFINITION", + "description": " Creates a new GatewaySecurityPolicy in a given project and location.", + "canonical": true, + "file": "network_security.create_gateway_security_policy.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 68, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateGatewaySecurityPolicy", + "fullName": "google.cloud.networksecurity.v1.NetworkSecurity.CreateGatewaySecurityPolicy", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "gateway_security_policy_id", + "type": "TYPE_STRING" + }, + { + "name": "gateway_security_policy", + "type": ".google.cloud.networksecurity.v1.GatewaySecurityPolicy" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "NetworkSecurityClient", + "fullName": "google.cloud.networksecurity.v1.NetworkSecurityClient" + }, + "method": { + "shortName": "CreateGatewaySecurityPolicy", + "fullName": "google.cloud.networksecurity.v1.NetworkSecurity.CreateGatewaySecurityPolicy", + "service": { + "shortName": "NetworkSecurity", + "fullName": "google.cloud.networksecurity.v1.NetworkSecurity" + } + } + } + }, + { + "regionTag": "networksecurity_v1_generated_NetworkSecurity_UpdateGatewaySecurityPolicy_async", + "title": "AddressGroupService updateGatewaySecurityPolicy Sample", + "origin": "API_DEFINITION", + "description": " Updates the parameters of a single GatewaySecurityPolicy.", + "canonical": true, + "file": "network_security.update_gateway_security_policy.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 62, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateGatewaySecurityPolicy", + "fullName": "google.cloud.networksecurity.v1.NetworkSecurity.UpdateGatewaySecurityPolicy", + "async": true, + "parameters": [ + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + }, + { + "name": "gateway_security_policy", + "type": ".google.cloud.networksecurity.v1.GatewaySecurityPolicy" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "NetworkSecurityClient", + "fullName": "google.cloud.networksecurity.v1.NetworkSecurityClient" + }, + "method": { + "shortName": "UpdateGatewaySecurityPolicy", + "fullName": "google.cloud.networksecurity.v1.NetworkSecurity.UpdateGatewaySecurityPolicy", + "service": { + "shortName": "NetworkSecurity", + "fullName": "google.cloud.networksecurity.v1.NetworkSecurity" + } + } + } + }, + { + "regionTag": "networksecurity_v1_generated_NetworkSecurity_DeleteGatewaySecurityPolicy_async", + "title": "AddressGroupService deleteGatewaySecurityPolicy Sample", + "origin": "API_DEFINITION", + "description": " Deletes a single GatewaySecurityPolicy.", + "canonical": true, + "file": "network_security.delete_gateway_security_policy.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 55, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteGatewaySecurityPolicy", + "fullName": "google.cloud.networksecurity.v1.NetworkSecurity.DeleteGatewaySecurityPolicy", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "NetworkSecurityClient", + "fullName": "google.cloud.networksecurity.v1.NetworkSecurityClient" + }, + "method": { + "shortName": "DeleteGatewaySecurityPolicy", + "fullName": "google.cloud.networksecurity.v1.NetworkSecurity.DeleteGatewaySecurityPolicy", + "service": { + "shortName": "NetworkSecurity", + "fullName": "google.cloud.networksecurity.v1.NetworkSecurity" + } + } + } + }, + { + "regionTag": "networksecurity_v1_generated_NetworkSecurity_ListGatewaySecurityPolicyRules_async", + "title": "AddressGroupService listGatewaySecurityPolicyRules Sample", + "origin": "API_DEFINITION", + "description": " Lists GatewaySecurityPolicyRules in a given project and location.", + "canonical": true, + "file": "network_security.list_gateway_security_policy_rules.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 68, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListGatewaySecurityPolicyRules", + "fullName": "google.cloud.networksecurity.v1.NetworkSecurity.ListGatewaySecurityPolicyRules", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.networksecurity.v1.ListGatewaySecurityPolicyRulesResponse", + "client": { + "shortName": "NetworkSecurityClient", + "fullName": "google.cloud.networksecurity.v1.NetworkSecurityClient" + }, + "method": { + "shortName": "ListGatewaySecurityPolicyRules", + "fullName": "google.cloud.networksecurity.v1.NetworkSecurity.ListGatewaySecurityPolicyRules", + "service": { + "shortName": "NetworkSecurity", + "fullName": "google.cloud.networksecurity.v1.NetworkSecurity" + } + } + } + }, + { + "regionTag": "networksecurity_v1_generated_NetworkSecurity_GetGatewaySecurityPolicyRule_async", + "title": "AddressGroupService getGatewaySecurityPolicyRule Sample", + "origin": "API_DEFINITION", + "description": " Gets details of a single GatewaySecurityPolicyRule.", + "canonical": true, + "file": "network_security.get_gateway_security_policy_rule.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 55, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetGatewaySecurityPolicyRule", + "fullName": "google.cloud.networksecurity.v1.NetworkSecurity.GetGatewaySecurityPolicyRule", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.networksecurity.v1.GatewaySecurityPolicyRule", + "client": { + "shortName": "NetworkSecurityClient", + "fullName": "google.cloud.networksecurity.v1.NetworkSecurityClient" + }, + "method": { + "shortName": "GetGatewaySecurityPolicyRule", + "fullName": "google.cloud.networksecurity.v1.NetworkSecurity.GetGatewaySecurityPolicyRule", + "service": { + "shortName": "NetworkSecurity", + "fullName": "google.cloud.networksecurity.v1.NetworkSecurity" + } + } + } + }, + { + "regionTag": "networksecurity_v1_generated_NetworkSecurity_CreateGatewaySecurityPolicyRule_async", + "title": "AddressGroupService createGatewaySecurityPolicyRule Sample", + "origin": "API_DEFINITION", + "description": " Creates a new GatewaySecurityPolicy in a given project and location.", + "canonical": true, + "file": "network_security.create_gateway_security_policy_rule.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 68, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateGatewaySecurityPolicyRule", + "fullName": "google.cloud.networksecurity.v1.NetworkSecurity.CreateGatewaySecurityPolicyRule", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "gateway_security_policy_rule", + "type": ".google.cloud.networksecurity.v1.GatewaySecurityPolicyRule" + }, + { + "name": "gateway_security_policy_rule_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "NetworkSecurityClient", + "fullName": "google.cloud.networksecurity.v1.NetworkSecurityClient" + }, + "method": { + "shortName": "CreateGatewaySecurityPolicyRule", + "fullName": "google.cloud.networksecurity.v1.NetworkSecurity.CreateGatewaySecurityPolicyRule", + "service": { + "shortName": "NetworkSecurity", + "fullName": "google.cloud.networksecurity.v1.NetworkSecurity" + } + } + } + }, + { + "regionTag": "networksecurity_v1_generated_NetworkSecurity_UpdateGatewaySecurityPolicyRule_async", + "title": "AddressGroupService updateGatewaySecurityPolicyRule Sample", + "origin": "API_DEFINITION", + "description": " Updates the parameters of a single GatewaySecurityPolicyRule.", + "canonical": true, + "file": "network_security.update_gateway_security_policy_rule.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 62, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateGatewaySecurityPolicyRule", + "fullName": "google.cloud.networksecurity.v1.NetworkSecurity.UpdateGatewaySecurityPolicyRule", + "async": true, + "parameters": [ + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + }, + { + "name": "gateway_security_policy_rule", + "type": ".google.cloud.networksecurity.v1.GatewaySecurityPolicyRule" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "NetworkSecurityClient", + "fullName": "google.cloud.networksecurity.v1.NetworkSecurityClient" + }, + "method": { + "shortName": "UpdateGatewaySecurityPolicyRule", + "fullName": "google.cloud.networksecurity.v1.NetworkSecurity.UpdateGatewaySecurityPolicyRule", + "service": { + "shortName": "NetworkSecurity", + "fullName": "google.cloud.networksecurity.v1.NetworkSecurity" + } + } + } + }, + { + "regionTag": "networksecurity_v1_generated_NetworkSecurity_DeleteGatewaySecurityPolicyRule_async", + "title": "AddressGroupService deleteGatewaySecurityPolicyRule Sample", + "origin": "API_DEFINITION", + "description": " Deletes a single GatewaySecurityPolicyRule.", + "canonical": true, + "file": "network_security.delete_gateway_security_policy_rule.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 56, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteGatewaySecurityPolicyRule", + "fullName": "google.cloud.networksecurity.v1.NetworkSecurity.DeleteGatewaySecurityPolicyRule", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "NetworkSecurityClient", + "fullName": "google.cloud.networksecurity.v1.NetworkSecurityClient" + }, + "method": { + "shortName": "DeleteGatewaySecurityPolicyRule", + "fullName": "google.cloud.networksecurity.v1.NetworkSecurity.DeleteGatewaySecurityPolicyRule", + "service": { + "shortName": "NetworkSecurity", + "fullName": "google.cloud.networksecurity.v1.NetworkSecurity" + } + } + } + }, + { + "regionTag": "networksecurity_v1_generated_NetworkSecurity_ListUrlLists_async", + "title": "AddressGroupService listUrlLists Sample", + "origin": "API_DEFINITION", + "description": " Lists UrlLists in a given project and location.", + "canonical": true, + "file": "network_security.list_url_lists.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 68, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListUrlLists", + "fullName": "google.cloud.networksecurity.v1.NetworkSecurity.ListUrlLists", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.networksecurity.v1.ListUrlListsResponse", + "client": { + "shortName": "NetworkSecurityClient", + "fullName": "google.cloud.networksecurity.v1.NetworkSecurityClient" + }, + "method": { + "shortName": "ListUrlLists", + "fullName": "google.cloud.networksecurity.v1.NetworkSecurity.ListUrlLists", + "service": { + "shortName": "NetworkSecurity", + "fullName": "google.cloud.networksecurity.v1.NetworkSecurity" + } + } + } + }, + { + "regionTag": "networksecurity_v1_generated_NetworkSecurity_GetUrlList_async", + "title": "AddressGroupService getUrlList Sample", + "origin": "API_DEFINITION", + "description": " Gets details of a single UrlList.", + "canonical": true, + "file": "network_security.get_url_list.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetUrlList", + "fullName": "google.cloud.networksecurity.v1.NetworkSecurity.GetUrlList", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.networksecurity.v1.UrlList", + "client": { + "shortName": "NetworkSecurityClient", + "fullName": "google.cloud.networksecurity.v1.NetworkSecurityClient" + }, + "method": { + "shortName": "GetUrlList", + "fullName": "google.cloud.networksecurity.v1.NetworkSecurity.GetUrlList", + "service": { + "shortName": "NetworkSecurity", + "fullName": "google.cloud.networksecurity.v1.NetworkSecurity" + } + } + } + }, + { + "regionTag": "networksecurity_v1_generated_NetworkSecurity_CreateUrlList_async", + "title": "AddressGroupService createUrlList Sample", + "origin": "API_DEFINITION", + "description": " Creates a new UrlList in a given project and location.", + "canonical": true, + "file": "network_security.create_url_list.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 67, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateUrlList", + "fullName": "google.cloud.networksecurity.v1.NetworkSecurity.CreateUrlList", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "url_list_id", + "type": "TYPE_STRING" + }, + { + "name": "url_list", + "type": ".google.cloud.networksecurity.v1.UrlList" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "NetworkSecurityClient", + "fullName": "google.cloud.networksecurity.v1.NetworkSecurityClient" + }, + "method": { + "shortName": "CreateUrlList", + "fullName": "google.cloud.networksecurity.v1.NetworkSecurity.CreateUrlList", + "service": { + "shortName": "NetworkSecurity", + "fullName": "google.cloud.networksecurity.v1.NetworkSecurity" + } + } + } + }, + { + "regionTag": "networksecurity_v1_generated_NetworkSecurity_UpdateUrlList_async", + "title": "AddressGroupService updateUrlList Sample", + "origin": "API_DEFINITION", + "description": " Updates the parameters of a single UrlList.", + "canonical": true, + "file": "network_security.update_url_list.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 63, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateUrlList", + "fullName": "google.cloud.networksecurity.v1.NetworkSecurity.UpdateUrlList", + "async": true, + "parameters": [ + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + }, + { + "name": "url_list", + "type": ".google.cloud.networksecurity.v1.UrlList" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "NetworkSecurityClient", + "fullName": "google.cloud.networksecurity.v1.NetworkSecurityClient" + }, + "method": { + "shortName": "UpdateUrlList", + "fullName": "google.cloud.networksecurity.v1.NetworkSecurity.UpdateUrlList", + "service": { + "shortName": "NetworkSecurity", + "fullName": "google.cloud.networksecurity.v1.NetworkSecurity" + } + } + } + }, + { + "regionTag": "networksecurity_v1_generated_NetworkSecurity_DeleteUrlList_async", + "title": "AddressGroupService deleteUrlList Sample", + "origin": "API_DEFINITION", + "description": " Deletes a single UrlList.", + "canonical": true, + "file": "network_security.delete_url_list.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 55, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteUrlList", + "fullName": "google.cloud.networksecurity.v1.NetworkSecurity.DeleteUrlList", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "NetworkSecurityClient", + "fullName": "google.cloud.networksecurity.v1.NetworkSecurityClient" + }, + "method": { + "shortName": "DeleteUrlList", + "fullName": "google.cloud.networksecurity.v1.NetworkSecurity.DeleteUrlList", + "service": { + "shortName": "NetworkSecurity", + "fullName": "google.cloud.networksecurity.v1.NetworkSecurity" + } + } + } + }, + { + "regionTag": "networksecurity_v1_generated_NetworkSecurity_ListTlsInspectionPolicies_async", + "title": "AddressGroupService listTlsInspectionPolicies Sample", + "origin": "API_DEFINITION", + "description": " Lists TlsInspectionPolicies in a given project and location.", + "canonical": true, + "file": "network_security.list_tls_inspection_policies.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 68, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListTlsInspectionPolicies", + "fullName": "google.cloud.networksecurity.v1.NetworkSecurity.ListTlsInspectionPolicies", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.networksecurity.v1.ListTlsInspectionPoliciesResponse", + "client": { + "shortName": "NetworkSecurityClient", + "fullName": "google.cloud.networksecurity.v1.NetworkSecurityClient" + }, + "method": { + "shortName": "ListTlsInspectionPolicies", + "fullName": "google.cloud.networksecurity.v1.NetworkSecurity.ListTlsInspectionPolicies", + "service": { + "shortName": "NetworkSecurity", + "fullName": "google.cloud.networksecurity.v1.NetworkSecurity" + } + } + } + }, + { + "regionTag": "networksecurity_v1_generated_NetworkSecurity_GetTlsInspectionPolicy_async", + "title": "AddressGroupService getTlsInspectionPolicy Sample", + "origin": "API_DEFINITION", + "description": " Gets details of a single TlsInspectionPolicy.", + "canonical": true, + "file": "network_security.get_tls_inspection_policy.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetTlsInspectionPolicy", + "fullName": "google.cloud.networksecurity.v1.NetworkSecurity.GetTlsInspectionPolicy", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.networksecurity.v1.TlsInspectionPolicy", + "client": { + "shortName": "NetworkSecurityClient", + "fullName": "google.cloud.networksecurity.v1.NetworkSecurityClient" + }, + "method": { + "shortName": "GetTlsInspectionPolicy", + "fullName": "google.cloud.networksecurity.v1.NetworkSecurity.GetTlsInspectionPolicy", + "service": { + "shortName": "NetworkSecurity", + "fullName": "google.cloud.networksecurity.v1.NetworkSecurity" + } + } + } + }, + { + "regionTag": "networksecurity_v1_generated_NetworkSecurity_CreateTlsInspectionPolicy_async", + "title": "AddressGroupService createTlsInspectionPolicy Sample", + "origin": "API_DEFINITION", + "description": " Creates a new TlsInspectionPolicy in a given project and location.", + "canonical": true, + "file": "network_security.create_tls_inspection_policy.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 68, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateTlsInspectionPolicy", + "fullName": "google.cloud.networksecurity.v1.NetworkSecurity.CreateTlsInspectionPolicy", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "tls_inspection_policy_id", + "type": "TYPE_STRING" + }, + { + "name": "tls_inspection_policy", + "type": ".google.cloud.networksecurity.v1.TlsInspectionPolicy" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "NetworkSecurityClient", + "fullName": "google.cloud.networksecurity.v1.NetworkSecurityClient" + }, + "method": { + "shortName": "CreateTlsInspectionPolicy", + "fullName": "google.cloud.networksecurity.v1.NetworkSecurity.CreateTlsInspectionPolicy", + "service": { + "shortName": "NetworkSecurity", + "fullName": "google.cloud.networksecurity.v1.NetworkSecurity" + } + } + } + }, + { + "regionTag": "networksecurity_v1_generated_NetworkSecurity_UpdateTlsInspectionPolicy_async", + "title": "AddressGroupService updateTlsInspectionPolicy Sample", + "origin": "API_DEFINITION", + "description": " Updates the parameters of a single TlsInspectionPolicy.", + "canonical": true, + "file": "network_security.update_tls_inspection_policy.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 62, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateTlsInspectionPolicy", + "fullName": "google.cloud.networksecurity.v1.NetworkSecurity.UpdateTlsInspectionPolicy", + "async": true, + "parameters": [ + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + }, + { + "name": "tls_inspection_policy", + "type": ".google.cloud.networksecurity.v1.TlsInspectionPolicy" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "NetworkSecurityClient", + "fullName": "google.cloud.networksecurity.v1.NetworkSecurityClient" + }, + "method": { + "shortName": "UpdateTlsInspectionPolicy", + "fullName": "google.cloud.networksecurity.v1.NetworkSecurity.UpdateTlsInspectionPolicy", + "service": { + "shortName": "NetworkSecurity", + "fullName": "google.cloud.networksecurity.v1.NetworkSecurity" + } + } + } + }, + { + "regionTag": "networksecurity_v1_generated_NetworkSecurity_DeleteTlsInspectionPolicy_async", + "title": "AddressGroupService deleteTlsInspectionPolicy Sample", + "origin": "API_DEFINITION", + "description": " Deletes a single TlsInspectionPolicy.", + "canonical": true, + "file": "network_security.delete_tls_inspection_policy.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 62, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteTlsInspectionPolicy", + "fullName": "google.cloud.networksecurity.v1.NetworkSecurity.DeleteTlsInspectionPolicy", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "force", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "NetworkSecurityClient", + "fullName": "google.cloud.networksecurity.v1.NetworkSecurityClient" + }, + "method": { + "shortName": "DeleteTlsInspectionPolicy", + "fullName": "google.cloud.networksecurity.v1.NetworkSecurity.DeleteTlsInspectionPolicy", + "service": { + "shortName": "NetworkSecurity", + "fullName": "google.cloud.networksecurity.v1.NetworkSecurity" + } + } + } + }, + { + "regionTag": "networksecurity_v1_generated_NetworkSecurity_ListAuthzPolicies_async", + "title": "AddressGroupService listAuthzPolicies Sample", + "origin": "API_DEFINITION", + "description": " Lists AuthzPolicies in a given project and location.", + "canonical": true, + "file": "network_security.list_authz_policies.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 74, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListAuthzPolicies", + "fullName": "google.cloud.networksecurity.v1.NetworkSecurity.ListAuthzPolicies", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + }, + { + "name": "order_by", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.networksecurity.v1.ListAuthzPoliciesResponse", + "client": { + "shortName": "NetworkSecurityClient", + "fullName": "google.cloud.networksecurity.v1.NetworkSecurityClient" + }, + "method": { + "shortName": "ListAuthzPolicies", + "fullName": "google.cloud.networksecurity.v1.NetworkSecurity.ListAuthzPolicies", + "service": { + "shortName": "NetworkSecurity", + "fullName": "google.cloud.networksecurity.v1.NetworkSecurity" + } + } + } + }, + { + "regionTag": "networksecurity_v1_generated_NetworkSecurity_GetAuthzPolicy_async", + "title": "AddressGroupService getAuthzPolicy Sample", + "origin": "API_DEFINITION", + "description": " Gets details of a single AuthzPolicy.", + "canonical": true, + "file": "network_security.get_authz_policy.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 55, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetAuthzPolicy", + "fullName": "google.cloud.networksecurity.v1.NetworkSecurity.GetAuthzPolicy", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.networksecurity.v1.AuthzPolicy", + "client": { + "shortName": "NetworkSecurityClient", + "fullName": "google.cloud.networksecurity.v1.NetworkSecurityClient" + }, + "method": { + "shortName": "GetAuthzPolicy", + "fullName": "google.cloud.networksecurity.v1.NetworkSecurity.GetAuthzPolicy", + "service": { + "shortName": "NetworkSecurity", + "fullName": "google.cloud.networksecurity.v1.NetworkSecurity" + } + } + } + }, + { + "regionTag": "networksecurity_v1_generated_NetworkSecurity_CreateAuthzPolicy_async", + "title": "AddressGroupService createAuthzPolicy Sample", + "origin": "API_DEFINITION", + "description": " Creates a new AuthzPolicy in a given project and location.", + "canonical": true, + "file": "network_security.create_authz_policy.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 79, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateAuthzPolicy", + "fullName": "google.cloud.networksecurity.v1.NetworkSecurity.CreateAuthzPolicy", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "authz_policy_id", + "type": "TYPE_STRING" + }, + { + "name": "authz_policy", + "type": ".google.cloud.networksecurity.v1.AuthzPolicy" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "NetworkSecurityClient", + "fullName": "google.cloud.networksecurity.v1.NetworkSecurityClient" + }, + "method": { + "shortName": "CreateAuthzPolicy", + "fullName": "google.cloud.networksecurity.v1.NetworkSecurity.CreateAuthzPolicy", + "service": { + "shortName": "NetworkSecurity", + "fullName": "google.cloud.networksecurity.v1.NetworkSecurity" + } + } + } + }, + { + "regionTag": "networksecurity_v1_generated_NetworkSecurity_UpdateAuthzPolicy_async", + "title": "AddressGroupService updateAuthzPolicy Sample", + "origin": "API_DEFINITION", + "description": " Updates the parameters of a single AuthzPolicy.", + "canonical": true, + "file": "network_security.update_authz_policy.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 77, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateAuthzPolicy", + "fullName": "google.cloud.networksecurity.v1.NetworkSecurity.UpdateAuthzPolicy", + "async": true, + "parameters": [ + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + }, + { + "name": "authz_policy", + "type": ".google.cloud.networksecurity.v1.AuthzPolicy" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "NetworkSecurityClient", + "fullName": "google.cloud.networksecurity.v1.NetworkSecurityClient" + }, + "method": { + "shortName": "UpdateAuthzPolicy", + "fullName": "google.cloud.networksecurity.v1.NetworkSecurity.UpdateAuthzPolicy", + "service": { + "shortName": "NetworkSecurity", + "fullName": "google.cloud.networksecurity.v1.NetworkSecurity" + } + } + } + }, + { + "regionTag": "networksecurity_v1_generated_NetworkSecurity_DeleteAuthzPolicy_async", + "title": "AddressGroupService deleteAuthzPolicy Sample", + "origin": "API_DEFINITION", + "description": " Deletes a single AuthzPolicy.", + "canonical": true, + "file": "network_security.delete_authz_policy.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 70, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteAuthzPolicy", + "fullName": "google.cloud.networksecurity.v1.NetworkSecurity.DeleteAuthzPolicy", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "NetworkSecurityClient", + "fullName": "google.cloud.networksecurity.v1.NetworkSecurityClient" + }, + "method": { + "shortName": "DeleteAuthzPolicy", + "fullName": "google.cloud.networksecurity.v1.NetworkSecurity.DeleteAuthzPolicy", + "service": { + "shortName": "NetworkSecurity", + "fullName": "google.cloud.networksecurity.v1.NetworkSecurity" + } + } + } + }, + { + "regionTag": "networksecurity_v1_generated_OrganizationAddressGroupService_ListAddressGroups_async", + "title": "AddressGroupService listAddressGroups Sample", + "origin": "API_DEFINITION", + "description": " Lists address groups in a given project and location.", + "canonical": true, + "file": "organization_address_group_service.list_address_groups.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 73, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListAddressGroups", + "fullName": "google.cloud.networksecurity.v1.OrganizationAddressGroupService.ListAddressGroups", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "return_partial_success", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.cloud.networksecurity.v1.ListAddressGroupsResponse", + "client": { + "shortName": "OrganizationAddressGroupServiceClient", + "fullName": "google.cloud.networksecurity.v1.OrganizationAddressGroupServiceClient" + }, + "method": { + "shortName": "ListAddressGroups", + "fullName": "google.cloud.networksecurity.v1.OrganizationAddressGroupService.ListAddressGroups", + "service": { + "shortName": "OrganizationAddressGroupService", + "fullName": "google.cloud.networksecurity.v1.OrganizationAddressGroupService" + } + } + } + }, + { + "regionTag": "networksecurity_v1_generated_OrganizationAddressGroupService_GetAddressGroup_async", + "title": "AddressGroupService getAddressGroup Sample", + "origin": "API_DEFINITION", + "description": " Gets details of a single address group.", + "canonical": true, + "file": "organization_address_group_service.get_address_group.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetAddressGroup", + "fullName": "google.cloud.networksecurity.v1.OrganizationAddressGroupService.GetAddressGroup", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.networksecurity.v1.AddressGroup", + "client": { + "shortName": "OrganizationAddressGroupServiceClient", + "fullName": "google.cloud.networksecurity.v1.OrganizationAddressGroupServiceClient" + }, + "method": { + "shortName": "GetAddressGroup", + "fullName": "google.cloud.networksecurity.v1.OrganizationAddressGroupService.GetAddressGroup", + "service": { + "shortName": "OrganizationAddressGroupService", + "fullName": "google.cloud.networksecurity.v1.OrganizationAddressGroupService" + } + } + } + }, + { + "regionTag": "networksecurity_v1_generated_OrganizationAddressGroupService_CreateAddressGroup_async", + "title": "AddressGroupService createAddressGroup Sample", + "origin": "API_DEFINITION", + "description": " Creates a new address group in a given project and location.", + "canonical": true, + "file": "organization_address_group_service.create_address_group.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 82, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateAddressGroup", + "fullName": "google.cloud.networksecurity.v1.OrganizationAddressGroupService.CreateAddressGroup", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "address_group_id", + "type": "TYPE_STRING" + }, + { + "name": "address_group", + "type": ".google.cloud.networksecurity.v1.AddressGroup" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "OrganizationAddressGroupServiceClient", + "fullName": "google.cloud.networksecurity.v1.OrganizationAddressGroupServiceClient" + }, + "method": { + "shortName": "CreateAddressGroup", + "fullName": "google.cloud.networksecurity.v1.OrganizationAddressGroupService.CreateAddressGroup", + "service": { + "shortName": "OrganizationAddressGroupService", + "fullName": "google.cloud.networksecurity.v1.OrganizationAddressGroupService" + } + } + } + }, + { + "regionTag": "networksecurity_v1_generated_OrganizationAddressGroupService_UpdateAddressGroup_async", + "title": "AddressGroupService updateAddressGroup Sample", + "origin": "API_DEFINITION", + "description": " Updates parameters of an address group.", + "canonical": true, + "file": "organization_address_group_service.update_address_group.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 76, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateAddressGroup", + "fullName": "google.cloud.networksecurity.v1.OrganizationAddressGroupService.UpdateAddressGroup", + "async": true, + "parameters": [ + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + }, + { + "name": "address_group", + "type": ".google.cloud.networksecurity.v1.AddressGroup" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "OrganizationAddressGroupServiceClient", + "fullName": "google.cloud.networksecurity.v1.OrganizationAddressGroupServiceClient" + }, + "method": { + "shortName": "UpdateAddressGroup", + "fullName": "google.cloud.networksecurity.v1.OrganizationAddressGroupService.UpdateAddressGroup", + "service": { + "shortName": "OrganizationAddressGroupService", + "fullName": "google.cloud.networksecurity.v1.OrganizationAddressGroupService" + } + } + } + }, + { + "regionTag": "networksecurity_v1_generated_OrganizationAddressGroupService_AddAddressGroupItems_async", + "title": "AddressGroupService addAddressGroupItems Sample", + "origin": "API_DEFINITION", + "description": " Adds items to an address group.", + "canonical": true, + "file": "organization_address_group_service.add_address_group_items.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 74, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "AddAddressGroupItems", + "fullName": "google.cloud.networksecurity.v1.OrganizationAddressGroupService.AddAddressGroupItems", + "async": true, + "parameters": [ + { + "name": "address_group", + "type": "TYPE_STRING" + }, + { + "name": "items", + "type": "TYPE_STRING[]" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "OrganizationAddressGroupServiceClient", + "fullName": "google.cloud.networksecurity.v1.OrganizationAddressGroupServiceClient" + }, + "method": { + "shortName": "AddAddressGroupItems", + "fullName": "google.cloud.networksecurity.v1.OrganizationAddressGroupService.AddAddressGroupItems", + "service": { + "shortName": "OrganizationAddressGroupService", + "fullName": "google.cloud.networksecurity.v1.OrganizationAddressGroupService" + } + } + } + }, + { + "regionTag": "networksecurity_v1_generated_OrganizationAddressGroupService_RemoveAddressGroupItems_async", + "title": "AddressGroupService removeAddressGroupItems Sample", + "origin": "API_DEFINITION", + "description": " Removes items from an address group.", + "canonical": true, + "file": "organization_address_group_service.remove_address_group_items.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 74, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "RemoveAddressGroupItems", + "fullName": "google.cloud.networksecurity.v1.OrganizationAddressGroupService.RemoveAddressGroupItems", + "async": true, + "parameters": [ + { + "name": "address_group", + "type": "TYPE_STRING" + }, + { + "name": "items", + "type": "TYPE_STRING[]" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "OrganizationAddressGroupServiceClient", + "fullName": "google.cloud.networksecurity.v1.OrganizationAddressGroupServiceClient" + }, + "method": { + "shortName": "RemoveAddressGroupItems", + "fullName": "google.cloud.networksecurity.v1.OrganizationAddressGroupService.RemoveAddressGroupItems", + "service": { + "shortName": "OrganizationAddressGroupService", + "fullName": "google.cloud.networksecurity.v1.OrganizationAddressGroupService" + } + } + } + }, + { + "regionTag": "networksecurity_v1_generated_OrganizationAddressGroupService_CloneAddressGroupItems_async", + "title": "AddressGroupService cloneAddressGroupItems Sample", + "origin": "API_DEFINITION", + "description": " Clones items from one address group to another.", + "canonical": true, + "file": "organization_address_group_service.clone_address_group_items.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 74, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CloneAddressGroupItems", + "fullName": "google.cloud.networksecurity.v1.OrganizationAddressGroupService.CloneAddressGroupItems", + "async": true, + "parameters": [ + { + "name": "address_group", + "type": "TYPE_STRING" + }, + { + "name": "source_address_group", + "type": "TYPE_STRING" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "OrganizationAddressGroupServiceClient", + "fullName": "google.cloud.networksecurity.v1.OrganizationAddressGroupServiceClient" + }, + "method": { + "shortName": "CloneAddressGroupItems", + "fullName": "google.cloud.networksecurity.v1.OrganizationAddressGroupService.CloneAddressGroupItems", + "service": { + "shortName": "OrganizationAddressGroupService", + "fullName": "google.cloud.networksecurity.v1.OrganizationAddressGroupService" + } + } + } + }, + { + "regionTag": "networksecurity_v1_generated_OrganizationAddressGroupService_DeleteAddressGroup_async", + "title": "AddressGroupService deleteAddressGroup Sample", + "origin": "API_DEFINITION", + "description": " Deletes an address group.", + "canonical": true, + "file": "organization_address_group_service.delete_address_group.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 69, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteAddressGroup", + "fullName": "google.cloud.networksecurity.v1.OrganizationAddressGroupService.DeleteAddressGroup", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "OrganizationAddressGroupServiceClient", + "fullName": "google.cloud.networksecurity.v1.OrganizationAddressGroupServiceClient" + }, + "method": { + "shortName": "DeleteAddressGroup", + "fullName": "google.cloud.networksecurity.v1.OrganizationAddressGroupService.DeleteAddressGroup", + "service": { + "shortName": "OrganizationAddressGroupService", + "fullName": "google.cloud.networksecurity.v1.OrganizationAddressGroupService" + } + } + } + }, + { + "regionTag": "networksecurity_v1_generated_OrganizationAddressGroupService_ListAddressGroupReferences_async", + "title": "AddressGroupService listAddressGroupReferences Sample", + "origin": "API_DEFINITION", + "description": " Lists references of an address group.", + "canonical": true, + "file": "organization_address_group_service.list_address_group_references.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 69, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListAddressGroupReferences", + "fullName": "google.cloud.networksecurity.v1.OrganizationAddressGroupService.ListAddressGroupReferences", + "async": true, + "parameters": [ + { + "name": "address_group", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.networksecurity.v1.ListAddressGroupReferencesResponse", + "client": { + "shortName": "OrganizationAddressGroupServiceClient", + "fullName": "google.cloud.networksecurity.v1.OrganizationAddressGroupServiceClient" + }, + "method": { + "shortName": "ListAddressGroupReferences", + "fullName": "google.cloud.networksecurity.v1.OrganizationAddressGroupService.ListAddressGroupReferences", + "service": { + "shortName": "OrganizationAddressGroupService", + "fullName": "google.cloud.networksecurity.v1.OrganizationAddressGroupService" + } + } + } + }, + { + "regionTag": "networksecurity_v1_generated_OrganizationSecurityProfileGroupService_ListSecurityProfileGroups_async", + "title": "AddressGroupService listSecurityProfileGroups Sample", + "origin": "API_DEFINITION", + "description": " Lists SecurityProfileGroups in a given organization and location.", + "canonical": true, + "file": "organization_security_profile_group_service.list_security_profile_groups.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 68, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListSecurityProfileGroups", + "fullName": "google.cloud.networksecurity.v1.OrganizationSecurityProfileGroupService.ListSecurityProfileGroups", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.networksecurity.v1.ListSecurityProfileGroupsResponse", + "client": { + "shortName": "OrganizationSecurityProfileGroupServiceClient", + "fullName": "google.cloud.networksecurity.v1.OrganizationSecurityProfileGroupServiceClient" + }, + "method": { + "shortName": "ListSecurityProfileGroups", + "fullName": "google.cloud.networksecurity.v1.OrganizationSecurityProfileGroupService.ListSecurityProfileGroups", + "service": { + "shortName": "OrganizationSecurityProfileGroupService", + "fullName": "google.cloud.networksecurity.v1.OrganizationSecurityProfileGroupService" + } + } + } + }, + { + "regionTag": "networksecurity_v1_generated_OrganizationSecurityProfileGroupService_GetSecurityProfileGroup_async", + "title": "AddressGroupService getSecurityProfileGroup Sample", + "origin": "API_DEFINITION", + "description": " Gets details of a single SecurityProfileGroup.", + "canonical": true, + "file": "organization_security_profile_group_service.get_security_profile_group.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetSecurityProfileGroup", + "fullName": "google.cloud.networksecurity.v1.OrganizationSecurityProfileGroupService.GetSecurityProfileGroup", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.networksecurity.v1.SecurityProfileGroup", + "client": { + "shortName": "OrganizationSecurityProfileGroupServiceClient", + "fullName": "google.cloud.networksecurity.v1.OrganizationSecurityProfileGroupServiceClient" + }, + "method": { + "shortName": "GetSecurityProfileGroup", + "fullName": "google.cloud.networksecurity.v1.OrganizationSecurityProfileGroupService.GetSecurityProfileGroup", + "service": { + "shortName": "OrganizationSecurityProfileGroupService", + "fullName": "google.cloud.networksecurity.v1.OrganizationSecurityProfileGroupService" + } + } + } + }, + { + "regionTag": "networksecurity_v1_generated_OrganizationSecurityProfileGroupService_CreateSecurityProfileGroup_async", + "title": "AddressGroupService createSecurityProfileGroup Sample", + "origin": "API_DEFINITION", + "description": " Creates a new SecurityProfileGroup in a given organization and location.", + "canonical": true, + "file": "organization_security_profile_group_service.create_security_profile_group.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 68, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateSecurityProfileGroup", + "fullName": "google.cloud.networksecurity.v1.OrganizationSecurityProfileGroupService.CreateSecurityProfileGroup", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "security_profile_group_id", + "type": "TYPE_STRING" + }, + { + "name": "security_profile_group", + "type": ".google.cloud.networksecurity.v1.SecurityProfileGroup" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "OrganizationSecurityProfileGroupServiceClient", + "fullName": "google.cloud.networksecurity.v1.OrganizationSecurityProfileGroupServiceClient" + }, + "method": { + "shortName": "CreateSecurityProfileGroup", + "fullName": "google.cloud.networksecurity.v1.OrganizationSecurityProfileGroupService.CreateSecurityProfileGroup", + "service": { + "shortName": "OrganizationSecurityProfileGroupService", + "fullName": "google.cloud.networksecurity.v1.OrganizationSecurityProfileGroupService" + } + } + } + }, + { + "regionTag": "networksecurity_v1_generated_OrganizationSecurityProfileGroupService_UpdateSecurityProfileGroup_async", + "title": "AddressGroupService updateSecurityProfileGroup Sample", + "origin": "API_DEFINITION", + "description": " Updates the parameters of a single SecurityProfileGroup.", + "canonical": true, + "file": "organization_security_profile_group_service.update_security_profile_group.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 62, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateSecurityProfileGroup", + "fullName": "google.cloud.networksecurity.v1.OrganizationSecurityProfileGroupService.UpdateSecurityProfileGroup", + "async": true, + "parameters": [ + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + }, + { + "name": "security_profile_group", + "type": ".google.cloud.networksecurity.v1.SecurityProfileGroup" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "OrganizationSecurityProfileGroupServiceClient", + "fullName": "google.cloud.networksecurity.v1.OrganizationSecurityProfileGroupServiceClient" + }, + "method": { + "shortName": "UpdateSecurityProfileGroup", + "fullName": "google.cloud.networksecurity.v1.OrganizationSecurityProfileGroupService.UpdateSecurityProfileGroup", + "service": { + "shortName": "OrganizationSecurityProfileGroupService", + "fullName": "google.cloud.networksecurity.v1.OrganizationSecurityProfileGroupService" + } + } + } + }, + { + "regionTag": "networksecurity_v1_generated_OrganizationSecurityProfileGroupService_DeleteSecurityProfileGroup_async", + "title": "AddressGroupService deleteSecurityProfileGroup Sample", + "origin": "API_DEFINITION", + "description": " Deletes a single SecurityProfileGroup.", + "canonical": true, + "file": "organization_security_profile_group_service.delete_security_profile_group.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 61, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteSecurityProfileGroup", + "fullName": "google.cloud.networksecurity.v1.OrganizationSecurityProfileGroupService.DeleteSecurityProfileGroup", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "etag", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "OrganizationSecurityProfileGroupServiceClient", + "fullName": "google.cloud.networksecurity.v1.OrganizationSecurityProfileGroupServiceClient" + }, + "method": { + "shortName": "DeleteSecurityProfileGroup", + "fullName": "google.cloud.networksecurity.v1.OrganizationSecurityProfileGroupService.DeleteSecurityProfileGroup", + "service": { + "shortName": "OrganizationSecurityProfileGroupService", + "fullName": "google.cloud.networksecurity.v1.OrganizationSecurityProfileGroupService" + } + } + } + }, + { + "regionTag": "networksecurity_v1_generated_OrganizationSecurityProfileGroupService_ListSecurityProfiles_async", + "title": "AddressGroupService listSecurityProfiles Sample", + "origin": "API_DEFINITION", + "description": " Lists SecurityProfiles in a given organization and location.", + "canonical": true, + "file": "organization_security_profile_group_service.list_security_profiles.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 68, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListSecurityProfiles", + "fullName": "google.cloud.networksecurity.v1.OrganizationSecurityProfileGroupService.ListSecurityProfiles", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.networksecurity.v1.ListSecurityProfilesResponse", + "client": { + "shortName": "OrganizationSecurityProfileGroupServiceClient", + "fullName": "google.cloud.networksecurity.v1.OrganizationSecurityProfileGroupServiceClient" + }, + "method": { + "shortName": "ListSecurityProfiles", + "fullName": "google.cloud.networksecurity.v1.OrganizationSecurityProfileGroupService.ListSecurityProfiles", + "service": { + "shortName": "OrganizationSecurityProfileGroupService", + "fullName": "google.cloud.networksecurity.v1.OrganizationSecurityProfileGroupService" + } + } + } + }, + { + "regionTag": "networksecurity_v1_generated_OrganizationSecurityProfileGroupService_GetSecurityProfile_async", + "title": "AddressGroupService getSecurityProfile Sample", + "origin": "API_DEFINITION", + "description": " Gets details of a single SecurityProfile.", + "canonical": true, + "file": "organization_security_profile_group_service.get_security_profile.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetSecurityProfile", + "fullName": "google.cloud.networksecurity.v1.OrganizationSecurityProfileGroupService.GetSecurityProfile", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.networksecurity.v1.SecurityProfile", + "client": { + "shortName": "OrganizationSecurityProfileGroupServiceClient", + "fullName": "google.cloud.networksecurity.v1.OrganizationSecurityProfileGroupServiceClient" + }, + "method": { + "shortName": "GetSecurityProfile", + "fullName": "google.cloud.networksecurity.v1.OrganizationSecurityProfileGroupService.GetSecurityProfile", + "service": { + "shortName": "OrganizationSecurityProfileGroupService", + "fullName": "google.cloud.networksecurity.v1.OrganizationSecurityProfileGroupService" + } + } + } + }, + { + "regionTag": "networksecurity_v1_generated_OrganizationSecurityProfileGroupService_CreateSecurityProfile_async", + "title": "AddressGroupService createSecurityProfile Sample", + "origin": "API_DEFINITION", + "description": " Creates a new SecurityProfile in a given organization and location.", + "canonical": true, + "file": "organization_security_profile_group_service.create_security_profile.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 68, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateSecurityProfile", + "fullName": "google.cloud.networksecurity.v1.OrganizationSecurityProfileGroupService.CreateSecurityProfile", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "security_profile_id", + "type": "TYPE_STRING" + }, + { + "name": "security_profile", + "type": ".google.cloud.networksecurity.v1.SecurityProfile" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "OrganizationSecurityProfileGroupServiceClient", + "fullName": "google.cloud.networksecurity.v1.OrganizationSecurityProfileGroupServiceClient" + }, + "method": { + "shortName": "CreateSecurityProfile", + "fullName": "google.cloud.networksecurity.v1.OrganizationSecurityProfileGroupService.CreateSecurityProfile", + "service": { + "shortName": "OrganizationSecurityProfileGroupService", + "fullName": "google.cloud.networksecurity.v1.OrganizationSecurityProfileGroupService" + } + } + } + }, + { + "regionTag": "networksecurity_v1_generated_OrganizationSecurityProfileGroupService_UpdateSecurityProfile_async", + "title": "AddressGroupService updateSecurityProfile Sample", + "origin": "API_DEFINITION", + "description": " Updates the parameters of a single SecurityProfile.", + "canonical": true, + "file": "organization_security_profile_group_service.update_security_profile.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 62, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateSecurityProfile", + "fullName": "google.cloud.networksecurity.v1.OrganizationSecurityProfileGroupService.UpdateSecurityProfile", + "async": true, + "parameters": [ + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + }, + { + "name": "security_profile", + "type": ".google.cloud.networksecurity.v1.SecurityProfile" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "OrganizationSecurityProfileGroupServiceClient", + "fullName": "google.cloud.networksecurity.v1.OrganizationSecurityProfileGroupServiceClient" + }, + "method": { + "shortName": "UpdateSecurityProfile", + "fullName": "google.cloud.networksecurity.v1.OrganizationSecurityProfileGroupService.UpdateSecurityProfile", + "service": { + "shortName": "OrganizationSecurityProfileGroupService", + "fullName": "google.cloud.networksecurity.v1.OrganizationSecurityProfileGroupService" + } + } + } + }, + { + "regionTag": "networksecurity_v1_generated_OrganizationSecurityProfileGroupService_DeleteSecurityProfile_async", + "title": "AddressGroupService deleteSecurityProfile Sample", + "origin": "API_DEFINITION", + "description": " Deletes a single SecurityProfile.", + "canonical": true, + "file": "organization_security_profile_group_service.delete_security_profile.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 60, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteSecurityProfile", + "fullName": "google.cloud.networksecurity.v1.OrganizationSecurityProfileGroupService.DeleteSecurityProfile", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "etag", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "OrganizationSecurityProfileGroupServiceClient", + "fullName": "google.cloud.networksecurity.v1.OrganizationSecurityProfileGroupServiceClient" + }, + "method": { + "shortName": "DeleteSecurityProfile", + "fullName": "google.cloud.networksecurity.v1.OrganizationSecurityProfileGroupService.DeleteSecurityProfile", + "service": { + "shortName": "OrganizationSecurityProfileGroupService", + "fullName": "google.cloud.networksecurity.v1.OrganizationSecurityProfileGroupService" } } } diff --git a/packages/google-cloud-networksecurity/src/v1/address_group_service_client.ts b/packages/google-cloud-networksecurity/src/v1/address_group_service_client.ts index 8a43e8c81e7..ba46c54c2dd 100644 --- a/packages/google-cloud-networksecurity/src/v1/address_group_service_client.ts +++ b/packages/google-cloud-networksecurity/src/v1/address_group_service_client.ts @@ -192,24 +192,90 @@ export class AddressGroupServiceClient { authorizationPolicyPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/authorizationPolicies/{authorization_policy}' ), + authzPolicyPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/authzPolicies/{authz_policy}' + ), + backendAuthenticationConfigPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/backendAuthenticationConfigs/{backend_authentication_config}' + ), clientTlsPolicyPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/clientTlsPolicies/{client_tls_policy}' ), + dnsThreatDetectorPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/dnsThreatDetectors/{dns_threat_detector}' + ), + firewallEndpointAssociationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/firewallEndpointAssociations/{firewall_endpoint_association}' + ), + gatewaySecurityPolicyPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/gatewaySecurityPolicies/{gateway_security_policy}' + ), + gatewaySecurityPolicyRulePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/gatewaySecurityPolicies/{gateway_security_policy}/rules/{rule}' + ), + interceptDeploymentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/interceptDeployments/{intercept_deployment}' + ), + interceptDeploymentGroupPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/interceptDeploymentGroups/{intercept_deployment_group}' + ), + interceptEndpointGroupPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/interceptEndpointGroups/{intercept_endpoint_group}' + ), + interceptEndpointGroupAssociationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/interceptEndpointGroupAssociations/{intercept_endpoint_group_association}' + ), locationPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}' ), + mirroringDeploymentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/mirroringDeployments/{mirroring_deployment}' + ), + mirroringDeploymentGroupPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/mirroringDeploymentGroups/{mirroring_deployment_group}' + ), + mirroringEndpointGroupPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/mirroringEndpointGroups/{mirroring_endpoint_group}' + ), + mirroringEndpointGroupAssociationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/mirroringEndpointGroupAssociations/{mirroring_endpoint_group_association}' + ), organizationLocationAddressGroupPathTemplate: new this._gaxModule.PathTemplate( 'organizations/{organization}/locations/{location}/addressGroups/{address_group}' ), + organizationLocationFirewallEndpointsPathTemplate: new this._gaxModule.PathTemplate( + 'organizations/{organization}/locations/{location}/firewallEndpoints/{firewall_endpoint}' + ), + organizationLocationSecurityProfilePathTemplate: new this._gaxModule.PathTemplate( + 'organizations/{organization}/locations/{location}/securityProfiles/{security_profile}' + ), + organizationLocationSecurityProfileGroupPathTemplate: new this._gaxModule.PathTemplate( + 'organizations/{organization}/locations/{location}/securityProfileGroups/{security_profile_group}' + ), projectPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}' ), projectLocationAddressGroupPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/addressGroups/{address_group}' ), + projectLocationFirewallEndpointsPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/firewallEndpoints/{firewall_endpoint}' + ), + projectLocationSecurityProfilePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/securityProfiles/{security_profile}' + ), + projectLocationSecurityProfileGroupPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/securityProfileGroups/{security_profile_group}' + ), serverTlsPolicyPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/serverTlsPolicies/{server_tls_policy}' ), + tlsInspectionPolicyPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/tlsInspectionPolicies/{tls_inspection_policy}' + ), + urlListPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/urlLists/{url_list}' + ), }; // Some of the methods on this service return "paged" results, @@ -234,9 +300,9 @@ export class AddressGroupServiceClient { lroOptions.protoJson = protoFilesRoot; lroOptions.httpRules = [{selector: 'google.cloud.location.Locations.GetLocation',get: '/v1/{name=projects/*/locations/*}',additional_bindings: [{get: '/v1/{name=organizations/*/locations/*}',}], },{selector: 'google.cloud.location.Locations.ListLocations',get: '/v1/{name=projects/*}/locations',additional_bindings: [{get: '/v1/{name=organizations/*/locations/*}',}], - },{selector: 'google.iam.v1.IAMPolicy.GetIamPolicy',get: '/v1/{resource=projects/*/locations/*/authorizationPolicies/*}:getIamPolicy',additional_bindings: [{get: '/v1/{resource=projects/*/locations/*/addressGroups/*}:getIamPolicy',},{get: '/v1/{resource=organizations/*/locations/*/addressGroups/*}:getIamPolicy',},{get: '/v1/{resource=projects/*/locations/*/serverTlsPolicies/*}:getIamPolicy',},{get: '/v1/{resource=projects/*/locations/*/clientTlsPolicies/*}:getIamPolicy',}], - },{selector: 'google.iam.v1.IAMPolicy.SetIamPolicy',post: '/v1/{resource=projects/*/locations/*/authorizationPolicies/*}:setIamPolicy',body: '*',additional_bindings: [{post: '/v1/{resource=projects/*/locations/*/addressGroups/*}:setIamPolicy',body: '*',},{post: '/v1/{resource=organizations/*/locations/*/addressGroups/*}:setIamPolicy',body: '*',},{post: '/v1/{resource=projects/*/locations/*/serverTlsPolicies/*}:setIamPolicy',body: '*',},{post: '/v1/{resource=projects/*/locations/*/clientTlsPolicies/*}:setIamPolicy',body: '*',}], - },{selector: 'google.iam.v1.IAMPolicy.TestIamPermissions',post: '/v1/{resource=projects/*/locations/*/authorizationPolicies/*}:testIamPermissions',body: '*',additional_bindings: [{post: '/v1/{resource=projects/*/locations/*/addressGroups/*}:testIamPermissions',body: '*',},{post: '/v1/{resource=organizations/*/locations/*/addressGroups/*}:testIamPermissions',body: '*',},{post: '/v1/{resource=projects/*/locations/*/serverTlsPolicies/*}:testIamPermissions',body: '*',},{post: '/v1/{resource=projects/*/locations/*/clientTlsPolicies/*}:testIamPermissions',body: '*',}], + },{selector: 'google.iam.v1.IAMPolicy.GetIamPolicy',get: '/v1/{resource=projects/*/locations/*/addressGroups/*}:getIamPolicy',additional_bindings: [{get: '/v1/{resource=projects/*/locations/*/authorizationPolicies/*}:getIamPolicy',},{get: '/v1/{resource=organizations/*/locations/*/addressGroups/*}:getIamPolicy',},{get: '/v1/{resource=projects/*/locations/*/serverTlsPolicies/*}:getIamPolicy',},{get: '/v1/{resource=projects/*/locations/*/clientTlsPolicies/*}:getIamPolicy',},{get: '/v1/{resource=projects/*/locations/*/authzPolicies/*}:getIamPolicy',}], + },{selector: 'google.iam.v1.IAMPolicy.SetIamPolicy',post: '/v1/{resource=projects/*/locations/*/addressGroups/*}:setIamPolicy',body: '*',additional_bindings: [{post: '/v1/{resource=projects/*/locations/*/authorizationPolicies/*}:setIamPolicy',body: '*',},{post: '/v1/{resource=organizations/*/locations/*/addressGroups/*}:setIamPolicy',body: '*',},{post: '/v1/{resource=projects/*/locations/*/serverTlsPolicies/*}:setIamPolicy',body: '*',},{post: '/v1/{resource=projects/*/locations/*/clientTlsPolicies/*}:setIamPolicy',body: '*',},{post: '/v1/{resource=projects/*/locations/*/authzPolicies/*}:setIamPolicy',body: '*',}], + },{selector: 'google.iam.v1.IAMPolicy.TestIamPermissions',post: '/v1/{resource=projects/*/locations/*/addressGroups/*}:testIamPermissions',body: '*',additional_bindings: [{post: '/v1/{resource=projects/*/locations/*/authorizationPolicies/*}:testIamPermissions',body: '*',},{post: '/v1/{resource=organizations/*/locations/*/addressGroups/*}:testIamPermissions',body: '*',},{post: '/v1/{resource=projects/*/locations/*/serverTlsPolicies/*}:testIamPermissions',body: '*',},{post: '/v1/{resource=projects/*/locations/*/clientTlsPolicies/*}:testIamPermissions',body: '*',},{post: '/v1/{resource=projects/*/locations/*/authzPolicies/*}:testIamPermissions',body: '*',}], },{selector: 'google.longrunning.Operations.CancelOperation',post: '/v1/{name=projects/*/locations/*/operations/*}:cancel',body: '*',additional_bindings: [{post: '/v1/{name=organizations/*/locations/*/operations/*}:cancel',body: '*',}], },{selector: 'google.longrunning.Operations.DeleteOperation',delete: '/v1/{name=projects/*/locations/*/operations/*}',additional_bindings: [{delete: '/v1/{name=organizations/*/locations/*/operations/*}',}], },{selector: 'google.longrunning.Operations.GetOperation',get: '/v1/{name=projects/*/locations/*/operations/*}',additional_bindings: [{get: '/v1/{name=organizations/*/locations/*/operations/*}',}], @@ -2206,6 +2272,104 @@ export class AddressGroupServiceClient { return this.pathTemplates.authorizationPolicyPathTemplate.match(authorizationPolicyName).authorization_policy; } + /** + * Return a fully-qualified authzPolicy resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} authz_policy + * @returns {string} Resource name string. + */ + authzPolicyPath(project:string,location:string,authzPolicy:string) { + return this.pathTemplates.authzPolicyPathTemplate.render({ + project: project, + location: location, + authz_policy: authzPolicy, + }); + } + + /** + * Parse the project from AuthzPolicy resource. + * + * @param {string} authzPolicyName + * A fully-qualified path representing AuthzPolicy resource. + * @returns {string} A string representing the project. + */ + matchProjectFromAuthzPolicyName(authzPolicyName: string) { + return this.pathTemplates.authzPolicyPathTemplate.match(authzPolicyName).project; + } + + /** + * Parse the location from AuthzPolicy resource. + * + * @param {string} authzPolicyName + * A fully-qualified path representing AuthzPolicy resource. + * @returns {string} A string representing the location. + */ + matchLocationFromAuthzPolicyName(authzPolicyName: string) { + return this.pathTemplates.authzPolicyPathTemplate.match(authzPolicyName).location; + } + + /** + * Parse the authz_policy from AuthzPolicy resource. + * + * @param {string} authzPolicyName + * A fully-qualified path representing AuthzPolicy resource. + * @returns {string} A string representing the authz_policy. + */ + matchAuthzPolicyFromAuthzPolicyName(authzPolicyName: string) { + return this.pathTemplates.authzPolicyPathTemplate.match(authzPolicyName).authz_policy; + } + + /** + * Return a fully-qualified backendAuthenticationConfig resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} backend_authentication_config + * @returns {string} Resource name string. + */ + backendAuthenticationConfigPath(project:string,location:string,backendAuthenticationConfig:string) { + return this.pathTemplates.backendAuthenticationConfigPathTemplate.render({ + project: project, + location: location, + backend_authentication_config: backendAuthenticationConfig, + }); + } + + /** + * Parse the project from BackendAuthenticationConfig resource. + * + * @param {string} backendAuthenticationConfigName + * A fully-qualified path representing BackendAuthenticationConfig resource. + * @returns {string} A string representing the project. + */ + matchProjectFromBackendAuthenticationConfigName(backendAuthenticationConfigName: string) { + return this.pathTemplates.backendAuthenticationConfigPathTemplate.match(backendAuthenticationConfigName).project; + } + + /** + * Parse the location from BackendAuthenticationConfig resource. + * + * @param {string} backendAuthenticationConfigName + * A fully-qualified path representing BackendAuthenticationConfig resource. + * @returns {string} A string representing the location. + */ + matchLocationFromBackendAuthenticationConfigName(backendAuthenticationConfigName: string) { + return this.pathTemplates.backendAuthenticationConfigPathTemplate.match(backendAuthenticationConfigName).location; + } + + /** + * Parse the backend_authentication_config from BackendAuthenticationConfig resource. + * + * @param {string} backendAuthenticationConfigName + * A fully-qualified path representing BackendAuthenticationConfig resource. + * @returns {string} A string representing the backend_authentication_config. + */ + matchBackendAuthenticationConfigFromBackendAuthenticationConfigName(backendAuthenticationConfigName: string) { + return this.pathTemplates.backendAuthenticationConfigPathTemplate.match(backendAuthenticationConfigName).backend_authentication_config; + } + /** * Return a fully-qualified clientTlsPolicy resource name string. * @@ -2256,209 +2420,1202 @@ export class AddressGroupServiceClient { } /** - * Return a fully-qualified location resource name string. + * Return a fully-qualified dnsThreatDetector resource name string. * * @param {string} project * @param {string} location + * @param {string} dns_threat_detector * @returns {string} Resource name string. */ - locationPath(project:string,location:string) { - return this.pathTemplates.locationPathTemplate.render({ + dnsThreatDetectorPath(project:string,location:string,dnsThreatDetector:string) { + return this.pathTemplates.dnsThreatDetectorPathTemplate.render({ project: project, location: location, + dns_threat_detector: dnsThreatDetector, }); } /** - * Parse the project from Location resource. + * Parse the project from DnsThreatDetector resource. * - * @param {string} locationName - * A fully-qualified path representing Location resource. + * @param {string} dnsThreatDetectorName + * A fully-qualified path representing DnsThreatDetector resource. * @returns {string} A string representing the project. */ - matchProjectFromLocationName(locationName: string) { - return this.pathTemplates.locationPathTemplate.match(locationName).project; + matchProjectFromDnsThreatDetectorName(dnsThreatDetectorName: string) { + return this.pathTemplates.dnsThreatDetectorPathTemplate.match(dnsThreatDetectorName).project; } /** - * Parse the location from Location resource. + * Parse the location from DnsThreatDetector resource. * - * @param {string} locationName - * A fully-qualified path representing Location resource. + * @param {string} dnsThreatDetectorName + * A fully-qualified path representing DnsThreatDetector resource. * @returns {string} A string representing the location. */ - matchLocationFromLocationName(locationName: string) { - return this.pathTemplates.locationPathTemplate.match(locationName).location; + matchLocationFromDnsThreatDetectorName(dnsThreatDetectorName: string) { + return this.pathTemplates.dnsThreatDetectorPathTemplate.match(dnsThreatDetectorName).location; } /** - * Return a fully-qualified organizationLocationAddressGroup resource name string. + * Parse the dns_threat_detector from DnsThreatDetector resource. * - * @param {string} organization + * @param {string} dnsThreatDetectorName + * A fully-qualified path representing DnsThreatDetector resource. + * @returns {string} A string representing the dns_threat_detector. + */ + matchDnsThreatDetectorFromDnsThreatDetectorName(dnsThreatDetectorName: string) { + return this.pathTemplates.dnsThreatDetectorPathTemplate.match(dnsThreatDetectorName).dns_threat_detector; + } + + /** + * Return a fully-qualified firewallEndpointAssociation resource name string. + * + * @param {string} project * @param {string} location - * @param {string} address_group + * @param {string} firewall_endpoint_association * @returns {string} Resource name string. */ - organizationLocationAddressGroupPath(organization:string,location:string,addressGroup:string) { - return this.pathTemplates.organizationLocationAddressGroupPathTemplate.render({ - organization: organization, + firewallEndpointAssociationPath(project:string,location:string,firewallEndpointAssociation:string) { + return this.pathTemplates.firewallEndpointAssociationPathTemplate.render({ + project: project, location: location, - address_group: addressGroup, + firewall_endpoint_association: firewallEndpointAssociation, }); } /** - * Parse the organization from OrganizationLocationAddressGroup resource. + * Parse the project from FirewallEndpointAssociation resource. * - * @param {string} organizationLocationAddressGroupName - * A fully-qualified path representing organization_location_address_group resource. - * @returns {string} A string representing the organization. + * @param {string} firewallEndpointAssociationName + * A fully-qualified path representing FirewallEndpointAssociation resource. + * @returns {string} A string representing the project. */ - matchOrganizationFromOrganizationLocationAddressGroupName(organizationLocationAddressGroupName: string) { - return this.pathTemplates.organizationLocationAddressGroupPathTemplate.match(organizationLocationAddressGroupName).organization; + matchProjectFromFirewallEndpointAssociationName(firewallEndpointAssociationName: string) { + return this.pathTemplates.firewallEndpointAssociationPathTemplate.match(firewallEndpointAssociationName).project; } /** - * Parse the location from OrganizationLocationAddressGroup resource. + * Parse the location from FirewallEndpointAssociation resource. * - * @param {string} organizationLocationAddressGroupName - * A fully-qualified path representing organization_location_address_group resource. + * @param {string} firewallEndpointAssociationName + * A fully-qualified path representing FirewallEndpointAssociation resource. * @returns {string} A string representing the location. */ - matchLocationFromOrganizationLocationAddressGroupName(organizationLocationAddressGroupName: string) { - return this.pathTemplates.organizationLocationAddressGroupPathTemplate.match(organizationLocationAddressGroupName).location; + matchLocationFromFirewallEndpointAssociationName(firewallEndpointAssociationName: string) { + return this.pathTemplates.firewallEndpointAssociationPathTemplate.match(firewallEndpointAssociationName).location; } /** - * Parse the address_group from OrganizationLocationAddressGroup resource. + * Parse the firewall_endpoint_association from FirewallEndpointAssociation resource. * - * @param {string} organizationLocationAddressGroupName - * A fully-qualified path representing organization_location_address_group resource. - * @returns {string} A string representing the address_group. + * @param {string} firewallEndpointAssociationName + * A fully-qualified path representing FirewallEndpointAssociation resource. + * @returns {string} A string representing the firewall_endpoint_association. */ - matchAddressGroupFromOrganizationLocationAddressGroupName(organizationLocationAddressGroupName: string) { - return this.pathTemplates.organizationLocationAddressGroupPathTemplate.match(organizationLocationAddressGroupName).address_group; + matchFirewallEndpointAssociationFromFirewallEndpointAssociationName(firewallEndpointAssociationName: string) { + return this.pathTemplates.firewallEndpointAssociationPathTemplate.match(firewallEndpointAssociationName).firewall_endpoint_association; } /** - * Return a fully-qualified project resource name string. + * Return a fully-qualified gatewaySecurityPolicy resource name string. * * @param {string} project + * @param {string} location + * @param {string} gateway_security_policy * @returns {string} Resource name string. */ - projectPath(project:string) { - return this.pathTemplates.projectPathTemplate.render({ + gatewaySecurityPolicyPath(project:string,location:string,gatewaySecurityPolicy:string) { + return this.pathTemplates.gatewaySecurityPolicyPathTemplate.render({ + project: project, + location: location, + gateway_security_policy: gatewaySecurityPolicy, + }); + } + + /** + * Parse the project from GatewaySecurityPolicy resource. + * + * @param {string} gatewaySecurityPolicyName + * A fully-qualified path representing GatewaySecurityPolicy resource. + * @returns {string} A string representing the project. + */ + matchProjectFromGatewaySecurityPolicyName(gatewaySecurityPolicyName: string) { + return this.pathTemplates.gatewaySecurityPolicyPathTemplate.match(gatewaySecurityPolicyName).project; + } + + /** + * Parse the location from GatewaySecurityPolicy resource. + * + * @param {string} gatewaySecurityPolicyName + * A fully-qualified path representing GatewaySecurityPolicy resource. + * @returns {string} A string representing the location. + */ + matchLocationFromGatewaySecurityPolicyName(gatewaySecurityPolicyName: string) { + return this.pathTemplates.gatewaySecurityPolicyPathTemplate.match(gatewaySecurityPolicyName).location; + } + + /** + * Parse the gateway_security_policy from GatewaySecurityPolicy resource. + * + * @param {string} gatewaySecurityPolicyName + * A fully-qualified path representing GatewaySecurityPolicy resource. + * @returns {string} A string representing the gateway_security_policy. + */ + matchGatewaySecurityPolicyFromGatewaySecurityPolicyName(gatewaySecurityPolicyName: string) { + return this.pathTemplates.gatewaySecurityPolicyPathTemplate.match(gatewaySecurityPolicyName).gateway_security_policy; + } + + /** + * Return a fully-qualified gatewaySecurityPolicyRule resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} gateway_security_policy + * @param {string} rule + * @returns {string} Resource name string. + */ + gatewaySecurityPolicyRulePath(project:string,location:string,gatewaySecurityPolicy:string,rule:string) { + return this.pathTemplates.gatewaySecurityPolicyRulePathTemplate.render({ project: project, + location: location, + gateway_security_policy: gatewaySecurityPolicy, + rule: rule, }); } /** - * Parse the project from Project resource. + * Parse the project from GatewaySecurityPolicyRule resource. * - * @param {string} projectName - * A fully-qualified path representing Project resource. + * @param {string} gatewaySecurityPolicyRuleName + * A fully-qualified path representing GatewaySecurityPolicyRule resource. * @returns {string} A string representing the project. */ - matchProjectFromProjectName(projectName: string) { - return this.pathTemplates.projectPathTemplate.match(projectName).project; + matchProjectFromGatewaySecurityPolicyRuleName(gatewaySecurityPolicyRuleName: string) { + return this.pathTemplates.gatewaySecurityPolicyRulePathTemplate.match(gatewaySecurityPolicyRuleName).project; } /** - * Return a fully-qualified projectLocationAddressGroup resource name string. + * Parse the location from GatewaySecurityPolicyRule resource. + * + * @param {string} gatewaySecurityPolicyRuleName + * A fully-qualified path representing GatewaySecurityPolicyRule resource. + * @returns {string} A string representing the location. + */ + matchLocationFromGatewaySecurityPolicyRuleName(gatewaySecurityPolicyRuleName: string) { + return this.pathTemplates.gatewaySecurityPolicyRulePathTemplate.match(gatewaySecurityPolicyRuleName).location; + } + + /** + * Parse the gateway_security_policy from GatewaySecurityPolicyRule resource. + * + * @param {string} gatewaySecurityPolicyRuleName + * A fully-qualified path representing GatewaySecurityPolicyRule resource. + * @returns {string} A string representing the gateway_security_policy. + */ + matchGatewaySecurityPolicyFromGatewaySecurityPolicyRuleName(gatewaySecurityPolicyRuleName: string) { + return this.pathTemplates.gatewaySecurityPolicyRulePathTemplate.match(gatewaySecurityPolicyRuleName).gateway_security_policy; + } + + /** + * Parse the rule from GatewaySecurityPolicyRule resource. + * + * @param {string} gatewaySecurityPolicyRuleName + * A fully-qualified path representing GatewaySecurityPolicyRule resource. + * @returns {string} A string representing the rule. + */ + matchRuleFromGatewaySecurityPolicyRuleName(gatewaySecurityPolicyRuleName: string) { + return this.pathTemplates.gatewaySecurityPolicyRulePathTemplate.match(gatewaySecurityPolicyRuleName).rule; + } + + /** + * Return a fully-qualified interceptDeployment resource name string. * * @param {string} project * @param {string} location - * @param {string} address_group + * @param {string} intercept_deployment * @returns {string} Resource name string. */ - projectLocationAddressGroupPath(project:string,location:string,addressGroup:string) { - return this.pathTemplates.projectLocationAddressGroupPathTemplate.render({ + interceptDeploymentPath(project:string,location:string,interceptDeployment:string) { + return this.pathTemplates.interceptDeploymentPathTemplate.render({ project: project, location: location, - address_group: addressGroup, + intercept_deployment: interceptDeployment, }); } /** - * Parse the project from ProjectLocationAddressGroup resource. + * Parse the project from InterceptDeployment resource. * - * @param {string} projectLocationAddressGroupName - * A fully-qualified path representing project_location_address_group resource. + * @param {string} interceptDeploymentName + * A fully-qualified path representing InterceptDeployment resource. * @returns {string} A string representing the project. */ - matchProjectFromProjectLocationAddressGroupName(projectLocationAddressGroupName: string) { - return this.pathTemplates.projectLocationAddressGroupPathTemplate.match(projectLocationAddressGroupName).project; + matchProjectFromInterceptDeploymentName(interceptDeploymentName: string) { + return this.pathTemplates.interceptDeploymentPathTemplate.match(interceptDeploymentName).project; } /** - * Parse the location from ProjectLocationAddressGroup resource. + * Parse the location from InterceptDeployment resource. * - * @param {string} projectLocationAddressGroupName - * A fully-qualified path representing project_location_address_group resource. + * @param {string} interceptDeploymentName + * A fully-qualified path representing InterceptDeployment resource. * @returns {string} A string representing the location. */ - matchLocationFromProjectLocationAddressGroupName(projectLocationAddressGroupName: string) { - return this.pathTemplates.projectLocationAddressGroupPathTemplate.match(projectLocationAddressGroupName).location; + matchLocationFromInterceptDeploymentName(interceptDeploymentName: string) { + return this.pathTemplates.interceptDeploymentPathTemplate.match(interceptDeploymentName).location; } /** - * Parse the address_group from ProjectLocationAddressGroup resource. + * Parse the intercept_deployment from InterceptDeployment resource. * - * @param {string} projectLocationAddressGroupName - * A fully-qualified path representing project_location_address_group resource. - * @returns {string} A string representing the address_group. + * @param {string} interceptDeploymentName + * A fully-qualified path representing InterceptDeployment resource. + * @returns {string} A string representing the intercept_deployment. */ - matchAddressGroupFromProjectLocationAddressGroupName(projectLocationAddressGroupName: string) { - return this.pathTemplates.projectLocationAddressGroupPathTemplate.match(projectLocationAddressGroupName).address_group; + matchInterceptDeploymentFromInterceptDeploymentName(interceptDeploymentName: string) { + return this.pathTemplates.interceptDeploymentPathTemplate.match(interceptDeploymentName).intercept_deployment; } /** - * Return a fully-qualified serverTlsPolicy resource name string. + * Return a fully-qualified interceptDeploymentGroup resource name string. * * @param {string} project * @param {string} location - * @param {string} server_tls_policy + * @param {string} intercept_deployment_group * @returns {string} Resource name string. */ - serverTlsPolicyPath(project:string,location:string,serverTlsPolicy:string) { - return this.pathTemplates.serverTlsPolicyPathTemplate.render({ + interceptDeploymentGroupPath(project:string,location:string,interceptDeploymentGroup:string) { + return this.pathTemplates.interceptDeploymentGroupPathTemplate.render({ project: project, location: location, - server_tls_policy: serverTlsPolicy, + intercept_deployment_group: interceptDeploymentGroup, }); } /** - * Parse the project from ServerTlsPolicy resource. + * Parse the project from InterceptDeploymentGroup resource. * - * @param {string} serverTlsPolicyName - * A fully-qualified path representing ServerTlsPolicy resource. + * @param {string} interceptDeploymentGroupName + * A fully-qualified path representing InterceptDeploymentGroup resource. * @returns {string} A string representing the project. */ - matchProjectFromServerTlsPolicyName(serverTlsPolicyName: string) { - return this.pathTemplates.serverTlsPolicyPathTemplate.match(serverTlsPolicyName).project; + matchProjectFromInterceptDeploymentGroupName(interceptDeploymentGroupName: string) { + return this.pathTemplates.interceptDeploymentGroupPathTemplate.match(interceptDeploymentGroupName).project; } /** - * Parse the location from ServerTlsPolicy resource. + * Parse the location from InterceptDeploymentGroup resource. * - * @param {string} serverTlsPolicyName - * A fully-qualified path representing ServerTlsPolicy resource. + * @param {string} interceptDeploymentGroupName + * A fully-qualified path representing InterceptDeploymentGroup resource. * @returns {string} A string representing the location. */ - matchLocationFromServerTlsPolicyName(serverTlsPolicyName: string) { - return this.pathTemplates.serverTlsPolicyPathTemplate.match(serverTlsPolicyName).location; + matchLocationFromInterceptDeploymentGroupName(interceptDeploymentGroupName: string) { + return this.pathTemplates.interceptDeploymentGroupPathTemplate.match(interceptDeploymentGroupName).location; } /** - * Parse the server_tls_policy from ServerTlsPolicy resource. + * Parse the intercept_deployment_group from InterceptDeploymentGroup resource. * - * @param {string} serverTlsPolicyName - * A fully-qualified path representing ServerTlsPolicy resource. - * @returns {string} A string representing the server_tls_policy. + * @param {string} interceptDeploymentGroupName + * A fully-qualified path representing InterceptDeploymentGroup resource. + * @returns {string} A string representing the intercept_deployment_group. */ - matchServerTlsPolicyFromServerTlsPolicyName(serverTlsPolicyName: string) { - return this.pathTemplates.serverTlsPolicyPathTemplate.match(serverTlsPolicyName).server_tls_policy; + matchInterceptDeploymentGroupFromInterceptDeploymentGroupName(interceptDeploymentGroupName: string) { + return this.pathTemplates.interceptDeploymentGroupPathTemplate.match(interceptDeploymentGroupName).intercept_deployment_group; + } + + /** + * Return a fully-qualified interceptEndpointGroup resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} intercept_endpoint_group + * @returns {string} Resource name string. + */ + interceptEndpointGroupPath(project:string,location:string,interceptEndpointGroup:string) { + return this.pathTemplates.interceptEndpointGroupPathTemplate.render({ + project: project, + location: location, + intercept_endpoint_group: interceptEndpointGroup, + }); + } + + /** + * Parse the project from InterceptEndpointGroup resource. + * + * @param {string} interceptEndpointGroupName + * A fully-qualified path representing InterceptEndpointGroup resource. + * @returns {string} A string representing the project. + */ + matchProjectFromInterceptEndpointGroupName(interceptEndpointGroupName: string) { + return this.pathTemplates.interceptEndpointGroupPathTemplate.match(interceptEndpointGroupName).project; + } + + /** + * Parse the location from InterceptEndpointGroup resource. + * + * @param {string} interceptEndpointGroupName + * A fully-qualified path representing InterceptEndpointGroup resource. + * @returns {string} A string representing the location. + */ + matchLocationFromInterceptEndpointGroupName(interceptEndpointGroupName: string) { + return this.pathTemplates.interceptEndpointGroupPathTemplate.match(interceptEndpointGroupName).location; + } + + /** + * Parse the intercept_endpoint_group from InterceptEndpointGroup resource. + * + * @param {string} interceptEndpointGroupName + * A fully-qualified path representing InterceptEndpointGroup resource. + * @returns {string} A string representing the intercept_endpoint_group. + */ + matchInterceptEndpointGroupFromInterceptEndpointGroupName(interceptEndpointGroupName: string) { + return this.pathTemplates.interceptEndpointGroupPathTemplate.match(interceptEndpointGroupName).intercept_endpoint_group; + } + + /** + * Return a fully-qualified interceptEndpointGroupAssociation resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} intercept_endpoint_group_association + * @returns {string} Resource name string. + */ + interceptEndpointGroupAssociationPath(project:string,location:string,interceptEndpointGroupAssociation:string) { + return this.pathTemplates.interceptEndpointGroupAssociationPathTemplate.render({ + project: project, + location: location, + intercept_endpoint_group_association: interceptEndpointGroupAssociation, + }); + } + + /** + * Parse the project from InterceptEndpointGroupAssociation resource. + * + * @param {string} interceptEndpointGroupAssociationName + * A fully-qualified path representing InterceptEndpointGroupAssociation resource. + * @returns {string} A string representing the project. + */ + matchProjectFromInterceptEndpointGroupAssociationName(interceptEndpointGroupAssociationName: string) { + return this.pathTemplates.interceptEndpointGroupAssociationPathTemplate.match(interceptEndpointGroupAssociationName).project; + } + + /** + * Parse the location from InterceptEndpointGroupAssociation resource. + * + * @param {string} interceptEndpointGroupAssociationName + * A fully-qualified path representing InterceptEndpointGroupAssociation resource. + * @returns {string} A string representing the location. + */ + matchLocationFromInterceptEndpointGroupAssociationName(interceptEndpointGroupAssociationName: string) { + return this.pathTemplates.interceptEndpointGroupAssociationPathTemplate.match(interceptEndpointGroupAssociationName).location; + } + + /** + * Parse the intercept_endpoint_group_association from InterceptEndpointGroupAssociation resource. + * + * @param {string} interceptEndpointGroupAssociationName + * A fully-qualified path representing InterceptEndpointGroupAssociation resource. + * @returns {string} A string representing the intercept_endpoint_group_association. + */ + matchInterceptEndpointGroupAssociationFromInterceptEndpointGroupAssociationName(interceptEndpointGroupAssociationName: string) { + return this.pathTemplates.interceptEndpointGroupAssociationPathTemplate.match(interceptEndpointGroupAssociationName).intercept_endpoint_group_association; + } + + /** + * Return a fully-qualified location resource name string. + * + * @param {string} project + * @param {string} location + * @returns {string} Resource name string. + */ + locationPath(project:string,location:string) { + return this.pathTemplates.locationPathTemplate.render({ + project: project, + location: location, + }); + } + + /** + * Parse the project from Location resource. + * + * @param {string} locationName + * A fully-qualified path representing Location resource. + * @returns {string} A string representing the project. + */ + matchProjectFromLocationName(locationName: string) { + return this.pathTemplates.locationPathTemplate.match(locationName).project; + } + + /** + * Parse the location from Location resource. + * + * @param {string} locationName + * A fully-qualified path representing Location resource. + * @returns {string} A string representing the location. + */ + matchLocationFromLocationName(locationName: string) { + return this.pathTemplates.locationPathTemplate.match(locationName).location; + } + + /** + * Return a fully-qualified mirroringDeployment resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} mirroring_deployment + * @returns {string} Resource name string. + */ + mirroringDeploymentPath(project:string,location:string,mirroringDeployment:string) { + return this.pathTemplates.mirroringDeploymentPathTemplate.render({ + project: project, + location: location, + mirroring_deployment: mirroringDeployment, + }); + } + + /** + * Parse the project from MirroringDeployment resource. + * + * @param {string} mirroringDeploymentName + * A fully-qualified path representing MirroringDeployment resource. + * @returns {string} A string representing the project. + */ + matchProjectFromMirroringDeploymentName(mirroringDeploymentName: string) { + return this.pathTemplates.mirroringDeploymentPathTemplate.match(mirroringDeploymentName).project; + } + + /** + * Parse the location from MirroringDeployment resource. + * + * @param {string} mirroringDeploymentName + * A fully-qualified path representing MirroringDeployment resource. + * @returns {string} A string representing the location. + */ + matchLocationFromMirroringDeploymentName(mirroringDeploymentName: string) { + return this.pathTemplates.mirroringDeploymentPathTemplate.match(mirroringDeploymentName).location; + } + + /** + * Parse the mirroring_deployment from MirroringDeployment resource. + * + * @param {string} mirroringDeploymentName + * A fully-qualified path representing MirroringDeployment resource. + * @returns {string} A string representing the mirroring_deployment. + */ + matchMirroringDeploymentFromMirroringDeploymentName(mirroringDeploymentName: string) { + return this.pathTemplates.mirroringDeploymentPathTemplate.match(mirroringDeploymentName).mirroring_deployment; + } + + /** + * Return a fully-qualified mirroringDeploymentGroup resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} mirroring_deployment_group + * @returns {string} Resource name string. + */ + mirroringDeploymentGroupPath(project:string,location:string,mirroringDeploymentGroup:string) { + return this.pathTemplates.mirroringDeploymentGroupPathTemplate.render({ + project: project, + location: location, + mirroring_deployment_group: mirroringDeploymentGroup, + }); + } + + /** + * Parse the project from MirroringDeploymentGroup resource. + * + * @param {string} mirroringDeploymentGroupName + * A fully-qualified path representing MirroringDeploymentGroup resource. + * @returns {string} A string representing the project. + */ + matchProjectFromMirroringDeploymentGroupName(mirroringDeploymentGroupName: string) { + return this.pathTemplates.mirroringDeploymentGroupPathTemplate.match(mirroringDeploymentGroupName).project; + } + + /** + * Parse the location from MirroringDeploymentGroup resource. + * + * @param {string} mirroringDeploymentGroupName + * A fully-qualified path representing MirroringDeploymentGroup resource. + * @returns {string} A string representing the location. + */ + matchLocationFromMirroringDeploymentGroupName(mirroringDeploymentGroupName: string) { + return this.pathTemplates.mirroringDeploymentGroupPathTemplate.match(mirroringDeploymentGroupName).location; + } + + /** + * Parse the mirroring_deployment_group from MirroringDeploymentGroup resource. + * + * @param {string} mirroringDeploymentGroupName + * A fully-qualified path representing MirroringDeploymentGroup resource. + * @returns {string} A string representing the mirroring_deployment_group. + */ + matchMirroringDeploymentGroupFromMirroringDeploymentGroupName(mirroringDeploymentGroupName: string) { + return this.pathTemplates.mirroringDeploymentGroupPathTemplate.match(mirroringDeploymentGroupName).mirroring_deployment_group; + } + + /** + * Return a fully-qualified mirroringEndpointGroup resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} mirroring_endpoint_group + * @returns {string} Resource name string. + */ + mirroringEndpointGroupPath(project:string,location:string,mirroringEndpointGroup:string) { + return this.pathTemplates.mirroringEndpointGroupPathTemplate.render({ + project: project, + location: location, + mirroring_endpoint_group: mirroringEndpointGroup, + }); + } + + /** + * Parse the project from MirroringEndpointGroup resource. + * + * @param {string} mirroringEndpointGroupName + * A fully-qualified path representing MirroringEndpointGroup resource. + * @returns {string} A string representing the project. + */ + matchProjectFromMirroringEndpointGroupName(mirroringEndpointGroupName: string) { + return this.pathTemplates.mirroringEndpointGroupPathTemplate.match(mirroringEndpointGroupName).project; + } + + /** + * Parse the location from MirroringEndpointGroup resource. + * + * @param {string} mirroringEndpointGroupName + * A fully-qualified path representing MirroringEndpointGroup resource. + * @returns {string} A string representing the location. + */ + matchLocationFromMirroringEndpointGroupName(mirroringEndpointGroupName: string) { + return this.pathTemplates.mirroringEndpointGroupPathTemplate.match(mirroringEndpointGroupName).location; + } + + /** + * Parse the mirroring_endpoint_group from MirroringEndpointGroup resource. + * + * @param {string} mirroringEndpointGroupName + * A fully-qualified path representing MirroringEndpointGroup resource. + * @returns {string} A string representing the mirroring_endpoint_group. + */ + matchMirroringEndpointGroupFromMirroringEndpointGroupName(mirroringEndpointGroupName: string) { + return this.pathTemplates.mirroringEndpointGroupPathTemplate.match(mirroringEndpointGroupName).mirroring_endpoint_group; + } + + /** + * Return a fully-qualified mirroringEndpointGroupAssociation resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} mirroring_endpoint_group_association + * @returns {string} Resource name string. + */ + mirroringEndpointGroupAssociationPath(project:string,location:string,mirroringEndpointGroupAssociation:string) { + return this.pathTemplates.mirroringEndpointGroupAssociationPathTemplate.render({ + project: project, + location: location, + mirroring_endpoint_group_association: mirroringEndpointGroupAssociation, + }); + } + + /** + * Parse the project from MirroringEndpointGroupAssociation resource. + * + * @param {string} mirroringEndpointGroupAssociationName + * A fully-qualified path representing MirroringEndpointGroupAssociation resource. + * @returns {string} A string representing the project. + */ + matchProjectFromMirroringEndpointGroupAssociationName(mirroringEndpointGroupAssociationName: string) { + return this.pathTemplates.mirroringEndpointGroupAssociationPathTemplate.match(mirroringEndpointGroupAssociationName).project; + } + + /** + * Parse the location from MirroringEndpointGroupAssociation resource. + * + * @param {string} mirroringEndpointGroupAssociationName + * A fully-qualified path representing MirroringEndpointGroupAssociation resource. + * @returns {string} A string representing the location. + */ + matchLocationFromMirroringEndpointGroupAssociationName(mirroringEndpointGroupAssociationName: string) { + return this.pathTemplates.mirroringEndpointGroupAssociationPathTemplate.match(mirroringEndpointGroupAssociationName).location; + } + + /** + * Parse the mirroring_endpoint_group_association from MirroringEndpointGroupAssociation resource. + * + * @param {string} mirroringEndpointGroupAssociationName + * A fully-qualified path representing MirroringEndpointGroupAssociation resource. + * @returns {string} A string representing the mirroring_endpoint_group_association. + */ + matchMirroringEndpointGroupAssociationFromMirroringEndpointGroupAssociationName(mirroringEndpointGroupAssociationName: string) { + return this.pathTemplates.mirroringEndpointGroupAssociationPathTemplate.match(mirroringEndpointGroupAssociationName).mirroring_endpoint_group_association; + } + + /** + * Return a fully-qualified organizationLocationAddressGroup resource name string. + * + * @param {string} organization + * @param {string} location + * @param {string} address_group + * @returns {string} Resource name string. + */ + organizationLocationAddressGroupPath(organization:string,location:string,addressGroup:string) { + return this.pathTemplates.organizationLocationAddressGroupPathTemplate.render({ + organization: organization, + location: location, + address_group: addressGroup, + }); + } + + /** + * Parse the organization from OrganizationLocationAddressGroup resource. + * + * @param {string} organizationLocationAddressGroupName + * A fully-qualified path representing organization_location_address_group resource. + * @returns {string} A string representing the organization. + */ + matchOrganizationFromOrganizationLocationAddressGroupName(organizationLocationAddressGroupName: string) { + return this.pathTemplates.organizationLocationAddressGroupPathTemplate.match(organizationLocationAddressGroupName).organization; + } + + /** + * Parse the location from OrganizationLocationAddressGroup resource. + * + * @param {string} organizationLocationAddressGroupName + * A fully-qualified path representing organization_location_address_group resource. + * @returns {string} A string representing the location. + */ + matchLocationFromOrganizationLocationAddressGroupName(organizationLocationAddressGroupName: string) { + return this.pathTemplates.organizationLocationAddressGroupPathTemplate.match(organizationLocationAddressGroupName).location; + } + + /** + * Parse the address_group from OrganizationLocationAddressGroup resource. + * + * @param {string} organizationLocationAddressGroupName + * A fully-qualified path representing organization_location_address_group resource. + * @returns {string} A string representing the address_group. + */ + matchAddressGroupFromOrganizationLocationAddressGroupName(organizationLocationAddressGroupName: string) { + return this.pathTemplates.organizationLocationAddressGroupPathTemplate.match(organizationLocationAddressGroupName).address_group; + } + + /** + * Return a fully-qualified organizationLocationFirewallEndpoints resource name string. + * + * @param {string} organization + * @param {string} location + * @param {string} firewall_endpoint + * @returns {string} Resource name string. + */ + organizationLocationFirewallEndpointsPath(organization:string,location:string,firewallEndpoint:string) { + return this.pathTemplates.organizationLocationFirewallEndpointsPathTemplate.render({ + organization: organization, + location: location, + firewall_endpoint: firewallEndpoint, + }); + } + + /** + * Parse the organization from OrganizationLocationFirewallEndpoints resource. + * + * @param {string} organizationLocationFirewallEndpointsName + * A fully-qualified path representing organization_location_firewallEndpoints resource. + * @returns {string} A string representing the organization. + */ + matchOrganizationFromOrganizationLocationFirewallEndpointsName(organizationLocationFirewallEndpointsName: string) { + return this.pathTemplates.organizationLocationFirewallEndpointsPathTemplate.match(organizationLocationFirewallEndpointsName).organization; + } + + /** + * Parse the location from OrganizationLocationFirewallEndpoints resource. + * + * @param {string} organizationLocationFirewallEndpointsName + * A fully-qualified path representing organization_location_firewallEndpoints resource. + * @returns {string} A string representing the location. + */ + matchLocationFromOrganizationLocationFirewallEndpointsName(organizationLocationFirewallEndpointsName: string) { + return this.pathTemplates.organizationLocationFirewallEndpointsPathTemplate.match(organizationLocationFirewallEndpointsName).location; + } + + /** + * Parse the firewall_endpoint from OrganizationLocationFirewallEndpoints resource. + * + * @param {string} organizationLocationFirewallEndpointsName + * A fully-qualified path representing organization_location_firewallEndpoints resource. + * @returns {string} A string representing the firewall_endpoint. + */ + matchFirewallEndpointFromOrganizationLocationFirewallEndpointsName(organizationLocationFirewallEndpointsName: string) { + return this.pathTemplates.organizationLocationFirewallEndpointsPathTemplate.match(organizationLocationFirewallEndpointsName).firewall_endpoint; + } + + /** + * Return a fully-qualified organizationLocationSecurityProfile resource name string. + * + * @param {string} organization + * @param {string} location + * @param {string} security_profile + * @returns {string} Resource name string. + */ + organizationLocationSecurityProfilePath(organization:string,location:string,securityProfile:string) { + return this.pathTemplates.organizationLocationSecurityProfilePathTemplate.render({ + organization: organization, + location: location, + security_profile: securityProfile, + }); + } + + /** + * Parse the organization from OrganizationLocationSecurityProfile resource. + * + * @param {string} organizationLocationSecurityProfileName + * A fully-qualified path representing organization_location_security_profile resource. + * @returns {string} A string representing the organization. + */ + matchOrganizationFromOrganizationLocationSecurityProfileName(organizationLocationSecurityProfileName: string) { + return this.pathTemplates.organizationLocationSecurityProfilePathTemplate.match(organizationLocationSecurityProfileName).organization; + } + + /** + * Parse the location from OrganizationLocationSecurityProfile resource. + * + * @param {string} organizationLocationSecurityProfileName + * A fully-qualified path representing organization_location_security_profile resource. + * @returns {string} A string representing the location. + */ + matchLocationFromOrganizationLocationSecurityProfileName(organizationLocationSecurityProfileName: string) { + return this.pathTemplates.organizationLocationSecurityProfilePathTemplate.match(organizationLocationSecurityProfileName).location; + } + + /** + * Parse the security_profile from OrganizationLocationSecurityProfile resource. + * + * @param {string} organizationLocationSecurityProfileName + * A fully-qualified path representing organization_location_security_profile resource. + * @returns {string} A string representing the security_profile. + */ + matchSecurityProfileFromOrganizationLocationSecurityProfileName(organizationLocationSecurityProfileName: string) { + return this.pathTemplates.organizationLocationSecurityProfilePathTemplate.match(organizationLocationSecurityProfileName).security_profile; + } + + /** + * Return a fully-qualified organizationLocationSecurityProfileGroup resource name string. + * + * @param {string} organization + * @param {string} location + * @param {string} security_profile_group + * @returns {string} Resource name string. + */ + organizationLocationSecurityProfileGroupPath(organization:string,location:string,securityProfileGroup:string) { + return this.pathTemplates.organizationLocationSecurityProfileGroupPathTemplate.render({ + organization: organization, + location: location, + security_profile_group: securityProfileGroup, + }); + } + + /** + * Parse the organization from OrganizationLocationSecurityProfileGroup resource. + * + * @param {string} organizationLocationSecurityProfileGroupName + * A fully-qualified path representing organization_location_security_profile_group resource. + * @returns {string} A string representing the organization. + */ + matchOrganizationFromOrganizationLocationSecurityProfileGroupName(organizationLocationSecurityProfileGroupName: string) { + return this.pathTemplates.organizationLocationSecurityProfileGroupPathTemplate.match(organizationLocationSecurityProfileGroupName).organization; + } + + /** + * Parse the location from OrganizationLocationSecurityProfileGroup resource. + * + * @param {string} organizationLocationSecurityProfileGroupName + * A fully-qualified path representing organization_location_security_profile_group resource. + * @returns {string} A string representing the location. + */ + matchLocationFromOrganizationLocationSecurityProfileGroupName(organizationLocationSecurityProfileGroupName: string) { + return this.pathTemplates.organizationLocationSecurityProfileGroupPathTemplate.match(organizationLocationSecurityProfileGroupName).location; + } + + /** + * Parse the security_profile_group from OrganizationLocationSecurityProfileGroup resource. + * + * @param {string} organizationLocationSecurityProfileGroupName + * A fully-qualified path representing organization_location_security_profile_group resource. + * @returns {string} A string representing the security_profile_group. + */ + matchSecurityProfileGroupFromOrganizationLocationSecurityProfileGroupName(organizationLocationSecurityProfileGroupName: string) { + return this.pathTemplates.organizationLocationSecurityProfileGroupPathTemplate.match(organizationLocationSecurityProfileGroupName).security_profile_group; + } + + /** + * Return a fully-qualified project resource name string. + * + * @param {string} project + * @returns {string} Resource name string. + */ + projectPath(project:string) { + return this.pathTemplates.projectPathTemplate.render({ + project: project, + }); + } + + /** + * Parse the project from Project resource. + * + * @param {string} projectName + * A fully-qualified path representing Project resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectName(projectName: string) { + return this.pathTemplates.projectPathTemplate.match(projectName).project; + } + + /** + * Return a fully-qualified projectLocationAddressGroup resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} address_group + * @returns {string} Resource name string. + */ + projectLocationAddressGroupPath(project:string,location:string,addressGroup:string) { + return this.pathTemplates.projectLocationAddressGroupPathTemplate.render({ + project: project, + location: location, + address_group: addressGroup, + }); + } + + /** + * Parse the project from ProjectLocationAddressGroup resource. + * + * @param {string} projectLocationAddressGroupName + * A fully-qualified path representing project_location_address_group resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationAddressGroupName(projectLocationAddressGroupName: string) { + return this.pathTemplates.projectLocationAddressGroupPathTemplate.match(projectLocationAddressGroupName).project; + } + + /** + * Parse the location from ProjectLocationAddressGroup resource. + * + * @param {string} projectLocationAddressGroupName + * A fully-qualified path representing project_location_address_group resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationAddressGroupName(projectLocationAddressGroupName: string) { + return this.pathTemplates.projectLocationAddressGroupPathTemplate.match(projectLocationAddressGroupName).location; + } + + /** + * Parse the address_group from ProjectLocationAddressGroup resource. + * + * @param {string} projectLocationAddressGroupName + * A fully-qualified path representing project_location_address_group resource. + * @returns {string} A string representing the address_group. + */ + matchAddressGroupFromProjectLocationAddressGroupName(projectLocationAddressGroupName: string) { + return this.pathTemplates.projectLocationAddressGroupPathTemplate.match(projectLocationAddressGroupName).address_group; + } + + /** + * Return a fully-qualified projectLocationFirewallEndpoints resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} firewall_endpoint + * @returns {string} Resource name string. + */ + projectLocationFirewallEndpointsPath(project:string,location:string,firewallEndpoint:string) { + return this.pathTemplates.projectLocationFirewallEndpointsPathTemplate.render({ + project: project, + location: location, + firewall_endpoint: firewallEndpoint, + }); + } + + /** + * Parse the project from ProjectLocationFirewallEndpoints resource. + * + * @param {string} projectLocationFirewallEndpointsName + * A fully-qualified path representing project_location_firewallEndpoints resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationFirewallEndpointsName(projectLocationFirewallEndpointsName: string) { + return this.pathTemplates.projectLocationFirewallEndpointsPathTemplate.match(projectLocationFirewallEndpointsName).project; + } + + /** + * Parse the location from ProjectLocationFirewallEndpoints resource. + * + * @param {string} projectLocationFirewallEndpointsName + * A fully-qualified path representing project_location_firewallEndpoints resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationFirewallEndpointsName(projectLocationFirewallEndpointsName: string) { + return this.pathTemplates.projectLocationFirewallEndpointsPathTemplate.match(projectLocationFirewallEndpointsName).location; + } + + /** + * Parse the firewall_endpoint from ProjectLocationFirewallEndpoints resource. + * + * @param {string} projectLocationFirewallEndpointsName + * A fully-qualified path representing project_location_firewallEndpoints resource. + * @returns {string} A string representing the firewall_endpoint. + */ + matchFirewallEndpointFromProjectLocationFirewallEndpointsName(projectLocationFirewallEndpointsName: string) { + return this.pathTemplates.projectLocationFirewallEndpointsPathTemplate.match(projectLocationFirewallEndpointsName).firewall_endpoint; + } + + /** + * Return a fully-qualified projectLocationSecurityProfile resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} security_profile + * @returns {string} Resource name string. + */ + projectLocationSecurityProfilePath(project:string,location:string,securityProfile:string) { + return this.pathTemplates.projectLocationSecurityProfilePathTemplate.render({ + project: project, + location: location, + security_profile: securityProfile, + }); + } + + /** + * Parse the project from ProjectLocationSecurityProfile resource. + * + * @param {string} projectLocationSecurityProfileName + * A fully-qualified path representing project_location_security_profile resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationSecurityProfileName(projectLocationSecurityProfileName: string) { + return this.pathTemplates.projectLocationSecurityProfilePathTemplate.match(projectLocationSecurityProfileName).project; + } + + /** + * Parse the location from ProjectLocationSecurityProfile resource. + * + * @param {string} projectLocationSecurityProfileName + * A fully-qualified path representing project_location_security_profile resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationSecurityProfileName(projectLocationSecurityProfileName: string) { + return this.pathTemplates.projectLocationSecurityProfilePathTemplate.match(projectLocationSecurityProfileName).location; + } + + /** + * Parse the security_profile from ProjectLocationSecurityProfile resource. + * + * @param {string} projectLocationSecurityProfileName + * A fully-qualified path representing project_location_security_profile resource. + * @returns {string} A string representing the security_profile. + */ + matchSecurityProfileFromProjectLocationSecurityProfileName(projectLocationSecurityProfileName: string) { + return this.pathTemplates.projectLocationSecurityProfilePathTemplate.match(projectLocationSecurityProfileName).security_profile; + } + + /** + * Return a fully-qualified projectLocationSecurityProfileGroup resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} security_profile_group + * @returns {string} Resource name string. + */ + projectLocationSecurityProfileGroupPath(project:string,location:string,securityProfileGroup:string) { + return this.pathTemplates.projectLocationSecurityProfileGroupPathTemplate.render({ + project: project, + location: location, + security_profile_group: securityProfileGroup, + }); + } + + /** + * Parse the project from ProjectLocationSecurityProfileGroup resource. + * + * @param {string} projectLocationSecurityProfileGroupName + * A fully-qualified path representing project_location_security_profile_group resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationSecurityProfileGroupName(projectLocationSecurityProfileGroupName: string) { + return this.pathTemplates.projectLocationSecurityProfileGroupPathTemplate.match(projectLocationSecurityProfileGroupName).project; + } + + /** + * Parse the location from ProjectLocationSecurityProfileGroup resource. + * + * @param {string} projectLocationSecurityProfileGroupName + * A fully-qualified path representing project_location_security_profile_group resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationSecurityProfileGroupName(projectLocationSecurityProfileGroupName: string) { + return this.pathTemplates.projectLocationSecurityProfileGroupPathTemplate.match(projectLocationSecurityProfileGroupName).location; + } + + /** + * Parse the security_profile_group from ProjectLocationSecurityProfileGroup resource. + * + * @param {string} projectLocationSecurityProfileGroupName + * A fully-qualified path representing project_location_security_profile_group resource. + * @returns {string} A string representing the security_profile_group. + */ + matchSecurityProfileGroupFromProjectLocationSecurityProfileGroupName(projectLocationSecurityProfileGroupName: string) { + return this.pathTemplates.projectLocationSecurityProfileGroupPathTemplate.match(projectLocationSecurityProfileGroupName).security_profile_group; + } + + /** + * Return a fully-qualified serverTlsPolicy resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} server_tls_policy + * @returns {string} Resource name string. + */ + serverTlsPolicyPath(project:string,location:string,serverTlsPolicy:string) { + return this.pathTemplates.serverTlsPolicyPathTemplate.render({ + project: project, + location: location, + server_tls_policy: serverTlsPolicy, + }); + } + + /** + * Parse the project from ServerTlsPolicy resource. + * + * @param {string} serverTlsPolicyName + * A fully-qualified path representing ServerTlsPolicy resource. + * @returns {string} A string representing the project. + */ + matchProjectFromServerTlsPolicyName(serverTlsPolicyName: string) { + return this.pathTemplates.serverTlsPolicyPathTemplate.match(serverTlsPolicyName).project; + } + + /** + * Parse the location from ServerTlsPolicy resource. + * + * @param {string} serverTlsPolicyName + * A fully-qualified path representing ServerTlsPolicy resource. + * @returns {string} A string representing the location. + */ + matchLocationFromServerTlsPolicyName(serverTlsPolicyName: string) { + return this.pathTemplates.serverTlsPolicyPathTemplate.match(serverTlsPolicyName).location; + } + + /** + * Parse the server_tls_policy from ServerTlsPolicy resource. + * + * @param {string} serverTlsPolicyName + * A fully-qualified path representing ServerTlsPolicy resource. + * @returns {string} A string representing the server_tls_policy. + */ + matchServerTlsPolicyFromServerTlsPolicyName(serverTlsPolicyName: string) { + return this.pathTemplates.serverTlsPolicyPathTemplate.match(serverTlsPolicyName).server_tls_policy; + } + + /** + * Return a fully-qualified tlsInspectionPolicy resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} tls_inspection_policy + * @returns {string} Resource name string. + */ + tlsInspectionPolicyPath(project:string,location:string,tlsInspectionPolicy:string) { + return this.pathTemplates.tlsInspectionPolicyPathTemplate.render({ + project: project, + location: location, + tls_inspection_policy: tlsInspectionPolicy, + }); + } + + /** + * Parse the project from TlsInspectionPolicy resource. + * + * @param {string} tlsInspectionPolicyName + * A fully-qualified path representing TlsInspectionPolicy resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTlsInspectionPolicyName(tlsInspectionPolicyName: string) { + return this.pathTemplates.tlsInspectionPolicyPathTemplate.match(tlsInspectionPolicyName).project; + } + + /** + * Parse the location from TlsInspectionPolicy resource. + * + * @param {string} tlsInspectionPolicyName + * A fully-qualified path representing TlsInspectionPolicy resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTlsInspectionPolicyName(tlsInspectionPolicyName: string) { + return this.pathTemplates.tlsInspectionPolicyPathTemplate.match(tlsInspectionPolicyName).location; + } + + /** + * Parse the tls_inspection_policy from TlsInspectionPolicy resource. + * + * @param {string} tlsInspectionPolicyName + * A fully-qualified path representing TlsInspectionPolicy resource. + * @returns {string} A string representing the tls_inspection_policy. + */ + matchTlsInspectionPolicyFromTlsInspectionPolicyName(tlsInspectionPolicyName: string) { + return this.pathTemplates.tlsInspectionPolicyPathTemplate.match(tlsInspectionPolicyName).tls_inspection_policy; + } + + /** + * Return a fully-qualified urlList resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} url_list + * @returns {string} Resource name string. + */ + urlListPath(project:string,location:string,urlList:string) { + return this.pathTemplates.urlListPathTemplate.render({ + project: project, + location: location, + url_list: urlList, + }); + } + + /** + * Parse the project from UrlList resource. + * + * @param {string} urlListName + * A fully-qualified path representing UrlList resource. + * @returns {string} A string representing the project. + */ + matchProjectFromUrlListName(urlListName: string) { + return this.pathTemplates.urlListPathTemplate.match(urlListName).project; + } + + /** + * Parse the location from UrlList resource. + * + * @param {string} urlListName + * A fully-qualified path representing UrlList resource. + * @returns {string} A string representing the location. + */ + matchLocationFromUrlListName(urlListName: string) { + return this.pathTemplates.urlListPathTemplate.match(urlListName).location; + } + + /** + * Parse the url_list from UrlList resource. + * + * @param {string} urlListName + * A fully-qualified path representing UrlList resource. + * @returns {string} A string representing the url_list. + */ + matchUrlListFromUrlListName(urlListName: string) { + return this.pathTemplates.urlListPathTemplate.match(urlListName).url_list; } /** diff --git a/packages/google-cloud-networksecurity/src/v1/address_group_service_proto_list.json b/packages/google-cloud-networksecurity/src/v1/address_group_service_proto_list.json index c43ec4cef17..1451adf6674 100644 --- a/packages/google-cloud-networksecurity/src/v1/address_group_service_proto_list.json +++ b/packages/google-cloud-networksecurity/src/v1/address_group_service_proto_list.json @@ -1,9 +1,25 @@ [ "../../protos/google/cloud/networksecurity/v1/address_group.proto", "../../protos/google/cloud/networksecurity/v1/authorization_policy.proto", + "../../protos/google/cloud/networksecurity/v1/authz_policy.proto", + "../../protos/google/cloud/networksecurity/v1/backend_authentication_config.proto", "../../protos/google/cloud/networksecurity/v1/client_tls_policy.proto", "../../protos/google/cloud/networksecurity/v1/common.proto", + "../../protos/google/cloud/networksecurity/v1/dns_threat_detector.proto", + "../../protos/google/cloud/networksecurity/v1/firewall_activation.proto", + "../../protos/google/cloud/networksecurity/v1/gateway_security_policy.proto", + "../../protos/google/cloud/networksecurity/v1/gateway_security_policy_rule.proto", + "../../protos/google/cloud/networksecurity/v1/intercept.proto", + "../../protos/google/cloud/networksecurity/v1/mirroring.proto", "../../protos/google/cloud/networksecurity/v1/network_security.proto", + "../../protos/google/cloud/networksecurity/v1/security_profile_group.proto", + "../../protos/google/cloud/networksecurity/v1/security_profile_group_intercept.proto", + "../../protos/google/cloud/networksecurity/v1/security_profile_group_mirroring.proto", + "../../protos/google/cloud/networksecurity/v1/security_profile_group_service.proto", + "../../protos/google/cloud/networksecurity/v1/security_profile_group_threatprevention.proto", + "../../protos/google/cloud/networksecurity/v1/security_profile_group_urlfiltering.proto", "../../protos/google/cloud/networksecurity/v1/server_tls_policy.proto", - "../../protos/google/cloud/networksecurity/v1/tls.proto" + "../../protos/google/cloud/networksecurity/v1/tls.proto", + "../../protos/google/cloud/networksecurity/v1/tls_inspection_policy.proto", + "../../protos/google/cloud/networksecurity/v1/url_list.proto" ] diff --git a/packages/google-cloud-networksecurity/src/v1/dns_threat_detector_service_client.ts b/packages/google-cloud-networksecurity/src/v1/dns_threat_detector_service_client.ts new file mode 100644 index 00000000000..b95e05099e6 --- /dev/null +++ b/packages/google-cloud-networksecurity/src/v1/dns_threat_detector_service_client.ts @@ -0,0 +1,2692 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +/* global window */ +import type * as gax from 'google-gax'; +import type {Callback, CallOptions, Descriptors, ClientOptions, PaginationCallback, GaxCall, IamClient, IamProtos, LocationsClient, LocationProtos} from 'google-gax'; +import {Transform} from 'stream'; +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +import {loggingUtils as logging, decodeAnyProtosInArray} from 'google-gax'; + +/** + * Client JSON configuration object, loaded from + * `src/v1/dns_threat_detector_service_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './dns_threat_detector_service_client_config.json'; +const version = require('../../../package.json').version; + +/** + * The Network Security API for DNS Threat Detectors. + * @class + * @memberof v1 + */ +export class DnsThreatDetectorServiceClient { + private _terminated = false; + private _opts: ClientOptions; + private _providedCustomServicePath: boolean; + private _gaxModule: typeof gax | typeof gax.fallback; + private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; + private _protos: {}; + private _defaults: {[method: string]: gax.CallSettings}; + private _universeDomain: string; + private _servicePath: string; + private _log = logging.log('network-security'); + + auth: gax.GoogleAuth; + descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; + warn: (code: string, message: string, warnType?: string) => void; + innerApiCalls: {[name: string]: Function}; + iamClient: IamClient; + locationsClient: LocationsClient; + pathTemplates: {[name: string]: gax.PathTemplate}; + dnsThreatDetectorServiceStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of DnsThreatDetectorServiceClient. + * + * @param {object} [options] - The configuration object. + * The options accepted by the constructor are described in detail + * in [this document](https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#creating-the-client-instance). + * The common options are: + * @param {object} [options.credentials] - Credentials object. + * @param {string} [options.credentials.client_email] + * @param {string} [options.credentials.private_key] + * @param {string} [options.email] - Account email address. Required when + * using a .pem or .p12 keyFilename. + * @param {string} [options.keyFilename] - Full path to the a .json, .pem, or + * .p12 key downloaded from the Google Developers Console. If you provide + * a path to a JSON file, the projectId option below is not necessary. + * NOTE: .pem and .p12 require you to specify options.email as well. + * @param {number} [options.port] - The port on which to connect to + * the remote host. + * @param {string} [options.projectId] - The project ID from the Google + * Developer's Console, e.g. 'grape-spaceship-123'. We will also check + * the environment variable GCLOUD_PROJECT for your project ID. If your + * app is running in an environment which supports + * {@link https://cloud.google.com/docs/authentication/application-default-credentials Application Default Credentials}, + * your project ID will be detected automatically. + * @param {string} [options.apiEndpoint] - The domain name of the + * API remote host. + * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. + * Follows the structure of {@link gapicConfig}. + * @param {boolean} [options.fallback] - Use HTTP/1.1 REST mode. + * For more information, please check the + * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. + * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you + * need to avoid loading the default gRPC version and want to use the fallback + * HTTP implementation. Load only fallback version and pass it to the constructor: + * ``` + * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC + * const client = new DnsThreatDetectorServiceClient({fallback: true}, gax); + * ``` + */ + constructor(opts?: ClientOptions, gaxInstance?: typeof gax | typeof gax.fallback) { + // Ensure that options include all the required fields. + const staticMembers = this.constructor as typeof DnsThreatDetectorServiceClient; + if (opts?.universe_domain && opts?.universeDomain && opts?.universe_domain !== opts?.universeDomain) { + throw new Error('Please set either universe_domain or universeDomain, but not both.'); + } + const universeDomainEnvVar = (typeof process === 'object' && typeof process.env === 'object') ? process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] : undefined; + this._universeDomain = opts?.universeDomain ?? opts?.universe_domain ?? universeDomainEnvVar ?? 'googleapis.com'; + this._servicePath = 'networksecurity.' + this._universeDomain; + const servicePath = opts?.servicePath || opts?.apiEndpoint || this._servicePath; + this._providedCustomServicePath = !!(opts?.servicePath || opts?.apiEndpoint); + const port = opts?.port || staticMembers.port; + const clientConfig = opts?.clientConfig ?? {}; + const fallback = opts?.fallback ?? (typeof window !== 'undefined' && typeof window?.fetch === 'function'); + opts = Object.assign({servicePath, port, clientConfig, fallback}, opts); + + // Request numeric enum values if REST transport is used. + opts.numericEnums = true; + + // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. + if (servicePath !== this._servicePath && !('scopes' in opts)) { + opts['scopes'] = staticMembers.scopes; + } + + // Load google-gax module synchronously if needed + if (!gaxInstance) { + gaxInstance = require('google-gax') as typeof gax; + } + + // Choose either gRPC or proto-over-HTTP implementation of google-gax. + this._gaxModule = opts.fallback ? gaxInstance.fallback : gaxInstance; + + // Create a `gaxGrpc` object, with any grpc-specific options sent to the client. + this._gaxGrpc = new this._gaxModule.GrpcClient(opts); + + // Save options to use in initialize() method. + this._opts = opts; + + // Save the auth object to the client, for use by other methods. + this.auth = (this._gaxGrpc.auth as gax.GoogleAuth); + + // Set useJWTAccessWithScope on the auth object. + this.auth.useJWTAccessWithScope = true; + + // Set defaultServicePath on the auth object. + this.auth.defaultServicePath = this._servicePath; + + // Set the default scopes in auth client if needed. + if (servicePath === this._servicePath) { + this.auth.defaultScopes = staticMembers.scopes; + } + this.iamClient = new this._gaxModule.IamClient(this._gaxGrpc, opts); + + this.locationsClient = new this._gaxModule.LocationsClient( + this._gaxGrpc, + opts + ); + + + // Determine the client header string. + const clientHeader = [ + `gax/${this._gaxModule.version}`, + `gapic/${version}`, + ]; + if (typeof process === 'object' && 'versions' in process) { + clientHeader.push(`gl-node/${process.versions.node}`); + } else { + clientHeader.push(`gl-web/${this._gaxModule.version}`); + } + if (!opts.fallback) { + clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); + } else { + clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); + } + if (opts.libName && opts.libVersion) { + clientHeader.push(`${opts.libName}/${opts.libVersion}`); + } + // Load the applicable protos. + this._protos = this._gaxGrpc.loadProtoJSON(jsonProtos); + + // This API contains "path templates"; forward-slash-separated + // identifiers to uniquely identify resources within the API. + // Create useful helper objects for these. + this.pathTemplates = { + authorizationPolicyPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/authorizationPolicies/{authorization_policy}' + ), + authzPolicyPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/authzPolicies/{authz_policy}' + ), + backendAuthenticationConfigPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/backendAuthenticationConfigs/{backend_authentication_config}' + ), + clientTlsPolicyPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/clientTlsPolicies/{client_tls_policy}' + ), + dnsThreatDetectorPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/dnsThreatDetectors/{dns_threat_detector}' + ), + firewallEndpointAssociationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/firewallEndpointAssociations/{firewall_endpoint_association}' + ), + gatewaySecurityPolicyPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/gatewaySecurityPolicies/{gateway_security_policy}' + ), + gatewaySecurityPolicyRulePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/gatewaySecurityPolicies/{gateway_security_policy}/rules/{rule}' + ), + interceptDeploymentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/interceptDeployments/{intercept_deployment}' + ), + interceptDeploymentGroupPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/interceptDeploymentGroups/{intercept_deployment_group}' + ), + interceptEndpointGroupPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/interceptEndpointGroups/{intercept_endpoint_group}' + ), + interceptEndpointGroupAssociationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/interceptEndpointGroupAssociations/{intercept_endpoint_group_association}' + ), + locationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}' + ), + mirroringDeploymentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/mirroringDeployments/{mirroring_deployment}' + ), + mirroringDeploymentGroupPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/mirroringDeploymentGroups/{mirroring_deployment_group}' + ), + mirroringEndpointGroupPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/mirroringEndpointGroups/{mirroring_endpoint_group}' + ), + mirroringEndpointGroupAssociationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/mirroringEndpointGroupAssociations/{mirroring_endpoint_group_association}' + ), + networkPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/global/networks/{network}' + ), + organizationLocationAddressGroupPathTemplate: new this._gaxModule.PathTemplate( + 'organizations/{organization}/locations/{location}/addressGroups/{address_group}' + ), + organizationLocationFirewallEndpointsPathTemplate: new this._gaxModule.PathTemplate( + 'organizations/{organization}/locations/{location}/firewallEndpoints/{firewall_endpoint}' + ), + organizationLocationSecurityProfilePathTemplate: new this._gaxModule.PathTemplate( + 'organizations/{organization}/locations/{location}/securityProfiles/{security_profile}' + ), + organizationLocationSecurityProfileGroupPathTemplate: new this._gaxModule.PathTemplate( + 'organizations/{organization}/locations/{location}/securityProfileGroups/{security_profile_group}' + ), + projectPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}' + ), + projectLocationAddressGroupPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/addressGroups/{address_group}' + ), + projectLocationFirewallEndpointsPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/firewallEndpoints/{firewall_endpoint}' + ), + projectLocationSecurityProfilePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/securityProfiles/{security_profile}' + ), + projectLocationSecurityProfileGroupPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/securityProfileGroups/{security_profile_group}' + ), + serverTlsPolicyPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/serverTlsPolicies/{server_tls_policy}' + ), + tlsInspectionPolicyPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/tlsInspectionPolicies/{tls_inspection_policy}' + ), + urlListPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/urlLists/{url_list}' + ), + }; + + // Some of the methods on this service return "paged" results, + // (e.g. 50 results at a time, with tokens to get subsequent + // pages). Denote the keys used for pagination and results. + this.descriptors.page = { + listDnsThreatDetectors: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'dnsThreatDetectors') + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.networksecurity.v1.DnsThreatDetectorService', gapicConfig as gax.ClientConfig, + opts.clientConfig || {}, {'x-goog-api-client': clientHeader.join(' ')}); + + // Set up a dictionary of "inner API calls"; the core implementation + // of calling the API is handled in `google-gax`, with this code + // merely providing the destination and request information. + this.innerApiCalls = {}; + + // Add a warn function to the client constructor so it can be easily tested. + this.warn = this._gaxModule.warn; + } + + /** + * Initialize the client. + * Performs asynchronous operations (such as authentication) and prepares the client. + * This function will be called automatically when any class method is called for the + * first time, but if you need to initialize it before calling an actual method, + * feel free to call initialize() directly. + * + * You can await on this method if you want to make sure the client is initialized. + * + * @returns {Promise} A promise that resolves to an authenticated service stub. + */ + initialize() { + // If the client stub promise is already initialized, return immediately. + if (this.dnsThreatDetectorServiceStub) { + return this.dnsThreatDetectorServiceStub; + } + + // Put together the "service stub" for + // google.cloud.networksecurity.v1.DnsThreatDetectorService. + this.dnsThreatDetectorServiceStub = this._gaxGrpc.createStub( + this._opts.fallback ? + (this._protos as protobuf.Root).lookupService('google.cloud.networksecurity.v1.DnsThreatDetectorService') : + // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.networksecurity.v1.DnsThreatDetectorService, + this._opts, this._providedCustomServicePath) as Promise<{[method: string]: Function}>; + + // Iterate over each of the methods that the service provides + // and create an API call method for each. + const dnsThreatDetectorServiceStubMethods = + ['listDnsThreatDetectors', 'getDnsThreatDetector', 'createDnsThreatDetector', 'updateDnsThreatDetector', 'deleteDnsThreatDetector']; + for (const methodName of dnsThreatDetectorServiceStubMethods) { + const callPromise = this.dnsThreatDetectorServiceStub.then( + stub => (...args: Array<{}>) => { + if (this._terminated) { + return Promise.reject('The client has already been closed.'); + } + const func = stub[methodName]; + return func.apply(stub, args); + }, + (err: Error|null|undefined) => () => { + throw err; + }); + + const descriptor = + this.descriptors.page[methodName] || + undefined; + const apiCall = this._gaxModule.createApiCall( + callPromise, + this._defaults[methodName], + descriptor, + this._opts.fallback + ); + + this.innerApiCalls[methodName] = apiCall; + } + + return this.dnsThreatDetectorServiceStub; + } + + /** + * The DNS address for this API service. + * @deprecated Use the apiEndpoint method of the client instance. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + if (typeof process === 'object' && typeof process.emitWarning === 'function') { + process.emitWarning('Static servicePath is deprecated, please use the instance method instead.', 'DeprecationWarning'); + } + return 'networksecurity.googleapis.com'; + } + + /** + * The DNS address for this API service - same as servicePath. + * @deprecated Use the apiEndpoint method of the client instance. + * @returns {string} The DNS address for this service. + */ + static get apiEndpoint() { + if (typeof process === 'object' && typeof process.emitWarning === 'function') { + process.emitWarning('Static apiEndpoint is deprecated, please use the instance method instead.', 'DeprecationWarning'); + } + return 'networksecurity.googleapis.com'; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + get apiEndpoint() { + return this._servicePath; + } + + get universeDomain() { + return this._universeDomain; + } + + /** + * The port for this API service. + * @returns {number} The default port for this service. + */ + static get port() { + return 443; + } + + /** + * The scopes needed to make gRPC calls for every method defined + * in this service. + * @returns {string[]} List of default scopes. + */ + static get scopes() { + return [ + 'https://www.googleapis.com/auth/cloud-platform' + ]; + } + + getProjectId(): Promise; + getProjectId(callback: Callback): void; + /** + * Return the project ID used by this class. + * @returns {Promise} A promise that resolves to string containing the project ID. + */ + getProjectId(callback?: Callback): + Promise|void { + if (callback) { + this.auth.getProjectId(callback); + return; + } + return this.auth.getProjectId(); + } + + // ------------------- + // -- Service calls -- + // ------------------- +/** + * Gets the details of a single DnsThreatDetector. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Name of the DnsThreatDetector resource. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.cloud.networksecurity.v1.DnsThreatDetector|DnsThreatDetector}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1/dns_threat_detector_service.get_dns_threat_detector.js + * region_tag:networksecurity_v1_generated_DnsThreatDetectorService_GetDnsThreatDetector_async + */ + getDnsThreatDetector( + request?: protos.google.cloud.networksecurity.v1.IGetDnsThreatDetectorRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.networksecurity.v1.IDnsThreatDetector, + protos.google.cloud.networksecurity.v1.IGetDnsThreatDetectorRequest|undefined, {}|undefined + ]>; + getDnsThreatDetector( + request: protos.google.cloud.networksecurity.v1.IGetDnsThreatDetectorRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.networksecurity.v1.IDnsThreatDetector, + protos.google.cloud.networksecurity.v1.IGetDnsThreatDetectorRequest|null|undefined, + {}|null|undefined>): void; + getDnsThreatDetector( + request: protos.google.cloud.networksecurity.v1.IGetDnsThreatDetectorRequest, + callback: Callback< + protos.google.cloud.networksecurity.v1.IDnsThreatDetector, + protos.google.cloud.networksecurity.v1.IGetDnsThreatDetectorRequest|null|undefined, + {}|null|undefined>): void; + getDnsThreatDetector( + request?: protos.google.cloud.networksecurity.v1.IGetDnsThreatDetectorRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.networksecurity.v1.IDnsThreatDetector, + protos.google.cloud.networksecurity.v1.IGetDnsThreatDetectorRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.networksecurity.v1.IDnsThreatDetector, + protos.google.cloud.networksecurity.v1.IGetDnsThreatDetectorRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.networksecurity.v1.IDnsThreatDetector, + protos.google.cloud.networksecurity.v1.IGetDnsThreatDetectorRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('getDnsThreatDetector request %j', request); + const wrappedCallback: Callback< + protos.google.cloud.networksecurity.v1.IDnsThreatDetector, + protos.google.cloud.networksecurity.v1.IGetDnsThreatDetectorRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getDnsThreatDetector response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.getDnsThreatDetector(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.cloud.networksecurity.v1.IDnsThreatDetector, + protos.google.cloud.networksecurity.v1.IGetDnsThreatDetectorRequest|undefined, + {}|undefined + ]) => { + this._log.info('getDnsThreatDetector response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * Creates a new DnsThreatDetector in a given project and location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The value for the parent of the DnsThreatDetector resource. + * @param {string} [request.dnsThreatDetectorId] + * Optional. The ID of the requesting DnsThreatDetector object. + * If this field is not supplied, the service generates an identifier. + * @param {google.cloud.networksecurity.v1.DnsThreatDetector} request.dnsThreatDetector + * Required. The `DnsThreatDetector` resource to create. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.cloud.networksecurity.v1.DnsThreatDetector|DnsThreatDetector}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1/dns_threat_detector_service.create_dns_threat_detector.js + * region_tag:networksecurity_v1_generated_DnsThreatDetectorService_CreateDnsThreatDetector_async + */ + createDnsThreatDetector( + request?: protos.google.cloud.networksecurity.v1.ICreateDnsThreatDetectorRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.networksecurity.v1.IDnsThreatDetector, + protos.google.cloud.networksecurity.v1.ICreateDnsThreatDetectorRequest|undefined, {}|undefined + ]>; + createDnsThreatDetector( + request: protos.google.cloud.networksecurity.v1.ICreateDnsThreatDetectorRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.networksecurity.v1.IDnsThreatDetector, + protos.google.cloud.networksecurity.v1.ICreateDnsThreatDetectorRequest|null|undefined, + {}|null|undefined>): void; + createDnsThreatDetector( + request: protos.google.cloud.networksecurity.v1.ICreateDnsThreatDetectorRequest, + callback: Callback< + protos.google.cloud.networksecurity.v1.IDnsThreatDetector, + protos.google.cloud.networksecurity.v1.ICreateDnsThreatDetectorRequest|null|undefined, + {}|null|undefined>): void; + createDnsThreatDetector( + request?: protos.google.cloud.networksecurity.v1.ICreateDnsThreatDetectorRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.networksecurity.v1.IDnsThreatDetector, + protos.google.cloud.networksecurity.v1.ICreateDnsThreatDetectorRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.networksecurity.v1.IDnsThreatDetector, + protos.google.cloud.networksecurity.v1.ICreateDnsThreatDetectorRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.networksecurity.v1.IDnsThreatDetector, + protos.google.cloud.networksecurity.v1.ICreateDnsThreatDetectorRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('createDnsThreatDetector request %j', request); + const wrappedCallback: Callback< + protos.google.cloud.networksecurity.v1.IDnsThreatDetector, + protos.google.cloud.networksecurity.v1.ICreateDnsThreatDetectorRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('createDnsThreatDetector response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.createDnsThreatDetector(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.cloud.networksecurity.v1.IDnsThreatDetector, + protos.google.cloud.networksecurity.v1.ICreateDnsThreatDetectorRequest|undefined, + {}|undefined + ]) => { + this._log.info('createDnsThreatDetector response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * Updates a single DnsThreatDetector. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.protobuf.FieldMask} [request.updateMask] + * Optional. The field mask is used to specify the fields to be overwritten in + * the DnsThreatDetector resource by the update. The fields specified in the + * update_mask are relative to the resource, not the full request. A field + * will be overwritten if it is in the mask. If the mask is not provided then + * all fields present in the request will be overwritten. + * @param {google.cloud.networksecurity.v1.DnsThreatDetector} request.dnsThreatDetector + * Required. The DnsThreatDetector resource being updated. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.cloud.networksecurity.v1.DnsThreatDetector|DnsThreatDetector}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1/dns_threat_detector_service.update_dns_threat_detector.js + * region_tag:networksecurity_v1_generated_DnsThreatDetectorService_UpdateDnsThreatDetector_async + */ + updateDnsThreatDetector( + request?: protos.google.cloud.networksecurity.v1.IUpdateDnsThreatDetectorRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.networksecurity.v1.IDnsThreatDetector, + protos.google.cloud.networksecurity.v1.IUpdateDnsThreatDetectorRequest|undefined, {}|undefined + ]>; + updateDnsThreatDetector( + request: protos.google.cloud.networksecurity.v1.IUpdateDnsThreatDetectorRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.networksecurity.v1.IDnsThreatDetector, + protos.google.cloud.networksecurity.v1.IUpdateDnsThreatDetectorRequest|null|undefined, + {}|null|undefined>): void; + updateDnsThreatDetector( + request: protos.google.cloud.networksecurity.v1.IUpdateDnsThreatDetectorRequest, + callback: Callback< + protos.google.cloud.networksecurity.v1.IDnsThreatDetector, + protos.google.cloud.networksecurity.v1.IUpdateDnsThreatDetectorRequest|null|undefined, + {}|null|undefined>): void; + updateDnsThreatDetector( + request?: protos.google.cloud.networksecurity.v1.IUpdateDnsThreatDetectorRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.networksecurity.v1.IDnsThreatDetector, + protos.google.cloud.networksecurity.v1.IUpdateDnsThreatDetectorRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.networksecurity.v1.IDnsThreatDetector, + protos.google.cloud.networksecurity.v1.IUpdateDnsThreatDetectorRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.networksecurity.v1.IDnsThreatDetector, + protos.google.cloud.networksecurity.v1.IUpdateDnsThreatDetectorRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'dns_threat_detector.name': request.dnsThreatDetector!.name ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('updateDnsThreatDetector request %j', request); + const wrappedCallback: Callback< + protos.google.cloud.networksecurity.v1.IDnsThreatDetector, + protos.google.cloud.networksecurity.v1.IUpdateDnsThreatDetectorRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('updateDnsThreatDetector response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.updateDnsThreatDetector(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.cloud.networksecurity.v1.IDnsThreatDetector, + protos.google.cloud.networksecurity.v1.IUpdateDnsThreatDetectorRequest|undefined, + {}|undefined + ]) => { + this._log.info('updateDnsThreatDetector response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * Deletes a single DnsThreatDetector. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Name of the DnsThreatDetector resource. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.protobuf.Empty|Empty}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1/dns_threat_detector_service.delete_dns_threat_detector.js + * region_tag:networksecurity_v1_generated_DnsThreatDetectorService_DeleteDnsThreatDetector_async + */ + deleteDnsThreatDetector( + request?: protos.google.cloud.networksecurity.v1.IDeleteDnsThreatDetectorRequest, + options?: CallOptions): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.cloud.networksecurity.v1.IDeleteDnsThreatDetectorRequest|undefined, {}|undefined + ]>; + deleteDnsThreatDetector( + request: protos.google.cloud.networksecurity.v1.IDeleteDnsThreatDetectorRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.networksecurity.v1.IDeleteDnsThreatDetectorRequest|null|undefined, + {}|null|undefined>): void; + deleteDnsThreatDetector( + request: protos.google.cloud.networksecurity.v1.IDeleteDnsThreatDetectorRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.networksecurity.v1.IDeleteDnsThreatDetectorRequest|null|undefined, + {}|null|undefined>): void; + deleteDnsThreatDetector( + request?: protos.google.cloud.networksecurity.v1.IDeleteDnsThreatDetectorRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.networksecurity.v1.IDeleteDnsThreatDetectorRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.networksecurity.v1.IDeleteDnsThreatDetectorRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.cloud.networksecurity.v1.IDeleteDnsThreatDetectorRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('deleteDnsThreatDetector request %j', request); + const wrappedCallback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.networksecurity.v1.IDeleteDnsThreatDetectorRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('deleteDnsThreatDetector response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.deleteDnsThreatDetector(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.protobuf.IEmpty, + protos.google.cloud.networksecurity.v1.IDeleteDnsThreatDetectorRequest|undefined, + {}|undefined + ]) => { + this._log.info('deleteDnsThreatDetector response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } + + /** + * Lists DnsThreatDetectors in a given project and location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent value for `ListDnsThreatDetectorsRequest`. + * @param {number} [request.pageSize] + * Optional. The requested page size. The server may return fewer items than + * requested. If unspecified, the server picks an appropriate default. + * @param {string} [request.pageToken] + * Optional. A page token received from a previous + * `ListDnsThreatDetectorsRequest` call. Provide this to retrieve the + * subsequent page. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of {@link protos.google.cloud.networksecurity.v1.DnsThreatDetector|DnsThreatDetector}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listDnsThreatDetectorsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listDnsThreatDetectors( + request?: protos.google.cloud.networksecurity.v1.IListDnsThreatDetectorsRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.networksecurity.v1.IDnsThreatDetector[], + protos.google.cloud.networksecurity.v1.IListDnsThreatDetectorsRequest|null, + protos.google.cloud.networksecurity.v1.IListDnsThreatDetectorsResponse + ]>; + listDnsThreatDetectors( + request: protos.google.cloud.networksecurity.v1.IListDnsThreatDetectorsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.networksecurity.v1.IListDnsThreatDetectorsRequest, + protos.google.cloud.networksecurity.v1.IListDnsThreatDetectorsResponse|null|undefined, + protos.google.cloud.networksecurity.v1.IDnsThreatDetector>): void; + listDnsThreatDetectors( + request: protos.google.cloud.networksecurity.v1.IListDnsThreatDetectorsRequest, + callback: PaginationCallback< + protos.google.cloud.networksecurity.v1.IListDnsThreatDetectorsRequest, + protos.google.cloud.networksecurity.v1.IListDnsThreatDetectorsResponse|null|undefined, + protos.google.cloud.networksecurity.v1.IDnsThreatDetector>): void; + listDnsThreatDetectors( + request?: protos.google.cloud.networksecurity.v1.IListDnsThreatDetectorsRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.cloud.networksecurity.v1.IListDnsThreatDetectorsRequest, + protos.google.cloud.networksecurity.v1.IListDnsThreatDetectorsResponse|null|undefined, + protos.google.cloud.networksecurity.v1.IDnsThreatDetector>, + callback?: PaginationCallback< + protos.google.cloud.networksecurity.v1.IListDnsThreatDetectorsRequest, + protos.google.cloud.networksecurity.v1.IListDnsThreatDetectorsResponse|null|undefined, + protos.google.cloud.networksecurity.v1.IDnsThreatDetector>): + Promise<[ + protos.google.cloud.networksecurity.v1.IDnsThreatDetector[], + protos.google.cloud.networksecurity.v1.IListDnsThreatDetectorsRequest|null, + protos.google.cloud.networksecurity.v1.IListDnsThreatDetectorsResponse + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize().catch(err => {throw err}); + const wrappedCallback: PaginationCallback< + protos.google.cloud.networksecurity.v1.IListDnsThreatDetectorsRequest, + protos.google.cloud.networksecurity.v1.IListDnsThreatDetectorsResponse|null|undefined, + protos.google.cloud.networksecurity.v1.IDnsThreatDetector>|undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listDnsThreatDetectors values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listDnsThreatDetectors request %j', request); + return this.innerApiCalls + .listDnsThreatDetectors(request, options, wrappedCallback) + ?.then(([response, input, output]: [ + protos.google.cloud.networksecurity.v1.IDnsThreatDetector[], + protos.google.cloud.networksecurity.v1.IListDnsThreatDetectorsRequest|null, + protos.google.cloud.networksecurity.v1.IListDnsThreatDetectorsResponse + ]) => { + this._log.info('listDnsThreatDetectors values %j', response); + return [response, input, output]; + }); + } + +/** + * Equivalent to `listDnsThreatDetectors`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent value for `ListDnsThreatDetectorsRequest`. + * @param {number} [request.pageSize] + * Optional. The requested page size. The server may return fewer items than + * requested. If unspecified, the server picks an appropriate default. + * @param {string} [request.pageToken] + * Optional. A page token received from a previous + * `ListDnsThreatDetectorsRequest` call. Provide this to retrieve the + * subsequent page. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing {@link protos.google.cloud.networksecurity.v1.DnsThreatDetector|DnsThreatDetector} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `listDnsThreatDetectorsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listDnsThreatDetectorsStream( + request?: protos.google.cloud.networksecurity.v1.IListDnsThreatDetectorsRequest, + options?: CallOptions): + Transform{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listDnsThreatDetectors']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listDnsThreatDetectors stream %j', request); + return this.descriptors.page.listDnsThreatDetectors.createStream( + this.innerApiCalls.listDnsThreatDetectors as GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listDnsThreatDetectors`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent value for `ListDnsThreatDetectorsRequest`. + * @param {number} [request.pageSize] + * Optional. The requested page size. The server may return fewer items than + * requested. If unspecified, the server picks an appropriate default. + * @param {string} [request.pageToken] + * Optional. A page token received from a previous + * `ListDnsThreatDetectorsRequest` call. Provide this to retrieve the + * subsequent page. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link protos.google.cloud.networksecurity.v1.DnsThreatDetector|DnsThreatDetector}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example include:samples/generated/v1/dns_threat_detector_service.list_dns_threat_detectors.js + * region_tag:networksecurity_v1_generated_DnsThreatDetectorService_ListDnsThreatDetectors_async + */ + listDnsThreatDetectorsAsync( + request?: protos.google.cloud.networksecurity.v1.IListDnsThreatDetectorsRequest, + options?: CallOptions): + AsyncIterable{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listDnsThreatDetectors']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listDnsThreatDetectors iterate %j', request); + return this.descriptors.page.listDnsThreatDetectors.asyncIterate( + this.innerApiCalls['listDnsThreatDetectors'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } +/** + * Gets the access control policy for a resource. Returns an empty policy + * if the resource exists and does not have a policy set. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.resource + * REQUIRED: The resource for which the policy is being requested. + * See the operation documentation for the appropriate value for this field. + * @param {Object} [request.options] + * OPTIONAL: A `GetPolicyOptions` object for specifying options to + * `GetIamPolicy`. This field is only used by Cloud IAM. + * + * This object should have the same structure as {@link google.iam.v1.GetPolicyOptions | GetPolicyOptions}. + * @param {Object} [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.CallOptions} for the details. + * @param {function(?Error, ?Object)} [callback] + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing {@link google.iam.v1.Policy | Policy}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.iam.v1.Policy | Policy}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + getIamPolicy( + request: IamProtos.google.iam.v1.GetIamPolicyRequest, + options?: + | gax.CallOptions + | Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.GetIamPolicyRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.GetIamPolicyRequest | null | undefined, + {} | null | undefined + > + ):Promise<[IamProtos.google.iam.v1.Policy]> { + return this.iamClient.getIamPolicy(request, options, callback); + } + +/** + * Returns permissions that a caller has on the specified resource. If the + * resource does not exist, this will return an empty set of + * permissions, not a NOT_FOUND error. + * + * Note: This operation is designed to be used for building + * permission-aware UIs and command-line tools, not for authorization + * checking. This operation may "fail open" without warning. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.resource + * REQUIRED: The resource for which the policy detail is being requested. + * See the operation documentation for the appropriate value for this field. + * @param {string[]} request.permissions + * The set of permissions to check for the `resource`. Permissions with + * wildcards (such as '*' or 'storage.*') are not allowed. For more + * information see {@link https://cloud.google.com/iam/docs/overview#permissions | IAM Overview }. + * @param {Object} [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.CallOptions} for the details. + * @param {function(?Error, ?Object)} [callback] + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + setIamPolicy( + request: IamProtos.google.iam.v1.SetIamPolicyRequest, + options?: + | gax.CallOptions + | Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.SetIamPolicyRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.SetIamPolicyRequest | null | undefined, + {} | null | undefined + > + ):Promise<[IamProtos.google.iam.v1.Policy]> { + return this.iamClient.setIamPolicy(request, options, callback); + } + +/** + * Returns permissions that a caller has on the specified resource. If the + * resource does not exist, this will return an empty set of + * permissions, not a NOT_FOUND error. + * + * Note: This operation is designed to be used for building + * permission-aware UIs and command-line tools, not for authorization + * checking. This operation may "fail open" without warning. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.resource + * REQUIRED: The resource for which the policy detail is being requested. + * See the operation documentation for the appropriate value for this field. + * @param {string[]} request.permissions + * The set of permissions to check for the `resource`. Permissions with + * wildcards (such as '*' or 'storage.*') are not allowed. For more + * information see {@link https://cloud.google.com/iam/docs/overview#permissions | IAM Overview }. + * @param {Object} [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.CallOptions} for the details. + * @param {function(?Error, ?Object)} [callback] + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. + * The promise has a method named "cancel" which cancels the ongoing API call. + * + */ + testIamPermissions( + request: IamProtos.google.iam.v1.TestIamPermissionsRequest, + options?: + | gax.CallOptions + | Callback< + IamProtos.google.iam.v1.TestIamPermissionsResponse, + IamProtos.google.iam.v1.TestIamPermissionsRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + IamProtos.google.iam.v1.TestIamPermissionsResponse, + IamProtos.google.iam.v1.TestIamPermissionsRequest | null | undefined, + {} | null | undefined + > + ):Promise<[IamProtos.google.iam.v1.TestIamPermissionsResponse]> { + return this.iamClient.testIamPermissions(request, options, callback); + } + +/** + * Gets information about a location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Resource name for the location. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html | CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.cloud.location.Location | Location}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example + * ``` + * const [response] = await client.getLocation(request); + * ``` + */ + getLocation( + request: LocationProtos.google.cloud.location.IGetLocationRequest, + options?: + | gax.CallOptions + | Callback< + LocationProtos.google.cloud.location.ILocation, + | LocationProtos.google.cloud.location.IGetLocationRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + LocationProtos.google.cloud.location.ILocation, + | LocationProtos.google.cloud.location.IGetLocationRequest + | null + | undefined, + {} | null | undefined + > + ): Promise { + return this.locationsClient.getLocation(request, options, callback); + } + +/** + * Lists information about the supported locations for this service. Returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * The resource that owns the locations collection, if applicable. + * @param {string} request.filter + * The standard list filter. + * @param {number} request.pageSize + * The standard list page size. + * @param {string} request.pageToken + * The standard list page token. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link google.cloud.location.Location | Location}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example + * ``` + * const iterable = client.listLocationsAsync(request); + * for await (const response of iterable) { + * // process response + * } + * ``` + */ + listLocationsAsync( + request: LocationProtos.google.cloud.location.IListLocationsRequest, + options?: CallOptions + ): AsyncIterable { + return this.locationsClient.listLocationsAsync(request, options); + } + + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified authorizationPolicy resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} authorization_policy + * @returns {string} Resource name string. + */ + authorizationPolicyPath(project:string,location:string,authorizationPolicy:string) { + return this.pathTemplates.authorizationPolicyPathTemplate.render({ + project: project, + location: location, + authorization_policy: authorizationPolicy, + }); + } + + /** + * Parse the project from AuthorizationPolicy resource. + * + * @param {string} authorizationPolicyName + * A fully-qualified path representing AuthorizationPolicy resource. + * @returns {string} A string representing the project. + */ + matchProjectFromAuthorizationPolicyName(authorizationPolicyName: string) { + return this.pathTemplates.authorizationPolicyPathTemplate.match(authorizationPolicyName).project; + } + + /** + * Parse the location from AuthorizationPolicy resource. + * + * @param {string} authorizationPolicyName + * A fully-qualified path representing AuthorizationPolicy resource. + * @returns {string} A string representing the location. + */ + matchLocationFromAuthorizationPolicyName(authorizationPolicyName: string) { + return this.pathTemplates.authorizationPolicyPathTemplate.match(authorizationPolicyName).location; + } + + /** + * Parse the authorization_policy from AuthorizationPolicy resource. + * + * @param {string} authorizationPolicyName + * A fully-qualified path representing AuthorizationPolicy resource. + * @returns {string} A string representing the authorization_policy. + */ + matchAuthorizationPolicyFromAuthorizationPolicyName(authorizationPolicyName: string) { + return this.pathTemplates.authorizationPolicyPathTemplate.match(authorizationPolicyName).authorization_policy; + } + + /** + * Return a fully-qualified authzPolicy resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} authz_policy + * @returns {string} Resource name string. + */ + authzPolicyPath(project:string,location:string,authzPolicy:string) { + return this.pathTemplates.authzPolicyPathTemplate.render({ + project: project, + location: location, + authz_policy: authzPolicy, + }); + } + + /** + * Parse the project from AuthzPolicy resource. + * + * @param {string} authzPolicyName + * A fully-qualified path representing AuthzPolicy resource. + * @returns {string} A string representing the project. + */ + matchProjectFromAuthzPolicyName(authzPolicyName: string) { + return this.pathTemplates.authzPolicyPathTemplate.match(authzPolicyName).project; + } + + /** + * Parse the location from AuthzPolicy resource. + * + * @param {string} authzPolicyName + * A fully-qualified path representing AuthzPolicy resource. + * @returns {string} A string representing the location. + */ + matchLocationFromAuthzPolicyName(authzPolicyName: string) { + return this.pathTemplates.authzPolicyPathTemplate.match(authzPolicyName).location; + } + + /** + * Parse the authz_policy from AuthzPolicy resource. + * + * @param {string} authzPolicyName + * A fully-qualified path representing AuthzPolicy resource. + * @returns {string} A string representing the authz_policy. + */ + matchAuthzPolicyFromAuthzPolicyName(authzPolicyName: string) { + return this.pathTemplates.authzPolicyPathTemplate.match(authzPolicyName).authz_policy; + } + + /** + * Return a fully-qualified backendAuthenticationConfig resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} backend_authentication_config + * @returns {string} Resource name string. + */ + backendAuthenticationConfigPath(project:string,location:string,backendAuthenticationConfig:string) { + return this.pathTemplates.backendAuthenticationConfigPathTemplate.render({ + project: project, + location: location, + backend_authentication_config: backendAuthenticationConfig, + }); + } + + /** + * Parse the project from BackendAuthenticationConfig resource. + * + * @param {string} backendAuthenticationConfigName + * A fully-qualified path representing BackendAuthenticationConfig resource. + * @returns {string} A string representing the project. + */ + matchProjectFromBackendAuthenticationConfigName(backendAuthenticationConfigName: string) { + return this.pathTemplates.backendAuthenticationConfigPathTemplate.match(backendAuthenticationConfigName).project; + } + + /** + * Parse the location from BackendAuthenticationConfig resource. + * + * @param {string} backendAuthenticationConfigName + * A fully-qualified path representing BackendAuthenticationConfig resource. + * @returns {string} A string representing the location. + */ + matchLocationFromBackendAuthenticationConfigName(backendAuthenticationConfigName: string) { + return this.pathTemplates.backendAuthenticationConfigPathTemplate.match(backendAuthenticationConfigName).location; + } + + /** + * Parse the backend_authentication_config from BackendAuthenticationConfig resource. + * + * @param {string} backendAuthenticationConfigName + * A fully-qualified path representing BackendAuthenticationConfig resource. + * @returns {string} A string representing the backend_authentication_config. + */ + matchBackendAuthenticationConfigFromBackendAuthenticationConfigName(backendAuthenticationConfigName: string) { + return this.pathTemplates.backendAuthenticationConfigPathTemplate.match(backendAuthenticationConfigName).backend_authentication_config; + } + + /** + * Return a fully-qualified clientTlsPolicy resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} client_tls_policy + * @returns {string} Resource name string. + */ + clientTlsPolicyPath(project:string,location:string,clientTlsPolicy:string) { + return this.pathTemplates.clientTlsPolicyPathTemplate.render({ + project: project, + location: location, + client_tls_policy: clientTlsPolicy, + }); + } + + /** + * Parse the project from ClientTlsPolicy resource. + * + * @param {string} clientTlsPolicyName + * A fully-qualified path representing ClientTlsPolicy resource. + * @returns {string} A string representing the project. + */ + matchProjectFromClientTlsPolicyName(clientTlsPolicyName: string) { + return this.pathTemplates.clientTlsPolicyPathTemplate.match(clientTlsPolicyName).project; + } + + /** + * Parse the location from ClientTlsPolicy resource. + * + * @param {string} clientTlsPolicyName + * A fully-qualified path representing ClientTlsPolicy resource. + * @returns {string} A string representing the location. + */ + matchLocationFromClientTlsPolicyName(clientTlsPolicyName: string) { + return this.pathTemplates.clientTlsPolicyPathTemplate.match(clientTlsPolicyName).location; + } + + /** + * Parse the client_tls_policy from ClientTlsPolicy resource. + * + * @param {string} clientTlsPolicyName + * A fully-qualified path representing ClientTlsPolicy resource. + * @returns {string} A string representing the client_tls_policy. + */ + matchClientTlsPolicyFromClientTlsPolicyName(clientTlsPolicyName: string) { + return this.pathTemplates.clientTlsPolicyPathTemplate.match(clientTlsPolicyName).client_tls_policy; + } + + /** + * Return a fully-qualified dnsThreatDetector resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} dns_threat_detector + * @returns {string} Resource name string. + */ + dnsThreatDetectorPath(project:string,location:string,dnsThreatDetector:string) { + return this.pathTemplates.dnsThreatDetectorPathTemplate.render({ + project: project, + location: location, + dns_threat_detector: dnsThreatDetector, + }); + } + + /** + * Parse the project from DnsThreatDetector resource. + * + * @param {string} dnsThreatDetectorName + * A fully-qualified path representing DnsThreatDetector resource. + * @returns {string} A string representing the project. + */ + matchProjectFromDnsThreatDetectorName(dnsThreatDetectorName: string) { + return this.pathTemplates.dnsThreatDetectorPathTemplate.match(dnsThreatDetectorName).project; + } + + /** + * Parse the location from DnsThreatDetector resource. + * + * @param {string} dnsThreatDetectorName + * A fully-qualified path representing DnsThreatDetector resource. + * @returns {string} A string representing the location. + */ + matchLocationFromDnsThreatDetectorName(dnsThreatDetectorName: string) { + return this.pathTemplates.dnsThreatDetectorPathTemplate.match(dnsThreatDetectorName).location; + } + + /** + * Parse the dns_threat_detector from DnsThreatDetector resource. + * + * @param {string} dnsThreatDetectorName + * A fully-qualified path representing DnsThreatDetector resource. + * @returns {string} A string representing the dns_threat_detector. + */ + matchDnsThreatDetectorFromDnsThreatDetectorName(dnsThreatDetectorName: string) { + return this.pathTemplates.dnsThreatDetectorPathTemplate.match(dnsThreatDetectorName).dns_threat_detector; + } + + /** + * Return a fully-qualified firewallEndpointAssociation resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} firewall_endpoint_association + * @returns {string} Resource name string. + */ + firewallEndpointAssociationPath(project:string,location:string,firewallEndpointAssociation:string) { + return this.pathTemplates.firewallEndpointAssociationPathTemplate.render({ + project: project, + location: location, + firewall_endpoint_association: firewallEndpointAssociation, + }); + } + + /** + * Parse the project from FirewallEndpointAssociation resource. + * + * @param {string} firewallEndpointAssociationName + * A fully-qualified path representing FirewallEndpointAssociation resource. + * @returns {string} A string representing the project. + */ + matchProjectFromFirewallEndpointAssociationName(firewallEndpointAssociationName: string) { + return this.pathTemplates.firewallEndpointAssociationPathTemplate.match(firewallEndpointAssociationName).project; + } + + /** + * Parse the location from FirewallEndpointAssociation resource. + * + * @param {string} firewallEndpointAssociationName + * A fully-qualified path representing FirewallEndpointAssociation resource. + * @returns {string} A string representing the location. + */ + matchLocationFromFirewallEndpointAssociationName(firewallEndpointAssociationName: string) { + return this.pathTemplates.firewallEndpointAssociationPathTemplate.match(firewallEndpointAssociationName).location; + } + + /** + * Parse the firewall_endpoint_association from FirewallEndpointAssociation resource. + * + * @param {string} firewallEndpointAssociationName + * A fully-qualified path representing FirewallEndpointAssociation resource. + * @returns {string} A string representing the firewall_endpoint_association. + */ + matchFirewallEndpointAssociationFromFirewallEndpointAssociationName(firewallEndpointAssociationName: string) { + return this.pathTemplates.firewallEndpointAssociationPathTemplate.match(firewallEndpointAssociationName).firewall_endpoint_association; + } + + /** + * Return a fully-qualified gatewaySecurityPolicy resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} gateway_security_policy + * @returns {string} Resource name string. + */ + gatewaySecurityPolicyPath(project:string,location:string,gatewaySecurityPolicy:string) { + return this.pathTemplates.gatewaySecurityPolicyPathTemplate.render({ + project: project, + location: location, + gateway_security_policy: gatewaySecurityPolicy, + }); + } + + /** + * Parse the project from GatewaySecurityPolicy resource. + * + * @param {string} gatewaySecurityPolicyName + * A fully-qualified path representing GatewaySecurityPolicy resource. + * @returns {string} A string representing the project. + */ + matchProjectFromGatewaySecurityPolicyName(gatewaySecurityPolicyName: string) { + return this.pathTemplates.gatewaySecurityPolicyPathTemplate.match(gatewaySecurityPolicyName).project; + } + + /** + * Parse the location from GatewaySecurityPolicy resource. + * + * @param {string} gatewaySecurityPolicyName + * A fully-qualified path representing GatewaySecurityPolicy resource. + * @returns {string} A string representing the location. + */ + matchLocationFromGatewaySecurityPolicyName(gatewaySecurityPolicyName: string) { + return this.pathTemplates.gatewaySecurityPolicyPathTemplate.match(gatewaySecurityPolicyName).location; + } + + /** + * Parse the gateway_security_policy from GatewaySecurityPolicy resource. + * + * @param {string} gatewaySecurityPolicyName + * A fully-qualified path representing GatewaySecurityPolicy resource. + * @returns {string} A string representing the gateway_security_policy. + */ + matchGatewaySecurityPolicyFromGatewaySecurityPolicyName(gatewaySecurityPolicyName: string) { + return this.pathTemplates.gatewaySecurityPolicyPathTemplate.match(gatewaySecurityPolicyName).gateway_security_policy; + } + + /** + * Return a fully-qualified gatewaySecurityPolicyRule resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} gateway_security_policy + * @param {string} rule + * @returns {string} Resource name string. + */ + gatewaySecurityPolicyRulePath(project:string,location:string,gatewaySecurityPolicy:string,rule:string) { + return this.pathTemplates.gatewaySecurityPolicyRulePathTemplate.render({ + project: project, + location: location, + gateway_security_policy: gatewaySecurityPolicy, + rule: rule, + }); + } + + /** + * Parse the project from GatewaySecurityPolicyRule resource. + * + * @param {string} gatewaySecurityPolicyRuleName + * A fully-qualified path representing GatewaySecurityPolicyRule resource. + * @returns {string} A string representing the project. + */ + matchProjectFromGatewaySecurityPolicyRuleName(gatewaySecurityPolicyRuleName: string) { + return this.pathTemplates.gatewaySecurityPolicyRulePathTemplate.match(gatewaySecurityPolicyRuleName).project; + } + + /** + * Parse the location from GatewaySecurityPolicyRule resource. + * + * @param {string} gatewaySecurityPolicyRuleName + * A fully-qualified path representing GatewaySecurityPolicyRule resource. + * @returns {string} A string representing the location. + */ + matchLocationFromGatewaySecurityPolicyRuleName(gatewaySecurityPolicyRuleName: string) { + return this.pathTemplates.gatewaySecurityPolicyRulePathTemplate.match(gatewaySecurityPolicyRuleName).location; + } + + /** + * Parse the gateway_security_policy from GatewaySecurityPolicyRule resource. + * + * @param {string} gatewaySecurityPolicyRuleName + * A fully-qualified path representing GatewaySecurityPolicyRule resource. + * @returns {string} A string representing the gateway_security_policy. + */ + matchGatewaySecurityPolicyFromGatewaySecurityPolicyRuleName(gatewaySecurityPolicyRuleName: string) { + return this.pathTemplates.gatewaySecurityPolicyRulePathTemplate.match(gatewaySecurityPolicyRuleName).gateway_security_policy; + } + + /** + * Parse the rule from GatewaySecurityPolicyRule resource. + * + * @param {string} gatewaySecurityPolicyRuleName + * A fully-qualified path representing GatewaySecurityPolicyRule resource. + * @returns {string} A string representing the rule. + */ + matchRuleFromGatewaySecurityPolicyRuleName(gatewaySecurityPolicyRuleName: string) { + return this.pathTemplates.gatewaySecurityPolicyRulePathTemplate.match(gatewaySecurityPolicyRuleName).rule; + } + + /** + * Return a fully-qualified interceptDeployment resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} intercept_deployment + * @returns {string} Resource name string. + */ + interceptDeploymentPath(project:string,location:string,interceptDeployment:string) { + return this.pathTemplates.interceptDeploymentPathTemplate.render({ + project: project, + location: location, + intercept_deployment: interceptDeployment, + }); + } + + /** + * Parse the project from InterceptDeployment resource. + * + * @param {string} interceptDeploymentName + * A fully-qualified path representing InterceptDeployment resource. + * @returns {string} A string representing the project. + */ + matchProjectFromInterceptDeploymentName(interceptDeploymentName: string) { + return this.pathTemplates.interceptDeploymentPathTemplate.match(interceptDeploymentName).project; + } + + /** + * Parse the location from InterceptDeployment resource. + * + * @param {string} interceptDeploymentName + * A fully-qualified path representing InterceptDeployment resource. + * @returns {string} A string representing the location. + */ + matchLocationFromInterceptDeploymentName(interceptDeploymentName: string) { + return this.pathTemplates.interceptDeploymentPathTemplate.match(interceptDeploymentName).location; + } + + /** + * Parse the intercept_deployment from InterceptDeployment resource. + * + * @param {string} interceptDeploymentName + * A fully-qualified path representing InterceptDeployment resource. + * @returns {string} A string representing the intercept_deployment. + */ + matchInterceptDeploymentFromInterceptDeploymentName(interceptDeploymentName: string) { + return this.pathTemplates.interceptDeploymentPathTemplate.match(interceptDeploymentName).intercept_deployment; + } + + /** + * Return a fully-qualified interceptDeploymentGroup resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} intercept_deployment_group + * @returns {string} Resource name string. + */ + interceptDeploymentGroupPath(project:string,location:string,interceptDeploymentGroup:string) { + return this.pathTemplates.interceptDeploymentGroupPathTemplate.render({ + project: project, + location: location, + intercept_deployment_group: interceptDeploymentGroup, + }); + } + + /** + * Parse the project from InterceptDeploymentGroup resource. + * + * @param {string} interceptDeploymentGroupName + * A fully-qualified path representing InterceptDeploymentGroup resource. + * @returns {string} A string representing the project. + */ + matchProjectFromInterceptDeploymentGroupName(interceptDeploymentGroupName: string) { + return this.pathTemplates.interceptDeploymentGroupPathTemplate.match(interceptDeploymentGroupName).project; + } + + /** + * Parse the location from InterceptDeploymentGroup resource. + * + * @param {string} interceptDeploymentGroupName + * A fully-qualified path representing InterceptDeploymentGroup resource. + * @returns {string} A string representing the location. + */ + matchLocationFromInterceptDeploymentGroupName(interceptDeploymentGroupName: string) { + return this.pathTemplates.interceptDeploymentGroupPathTemplate.match(interceptDeploymentGroupName).location; + } + + /** + * Parse the intercept_deployment_group from InterceptDeploymentGroup resource. + * + * @param {string} interceptDeploymentGroupName + * A fully-qualified path representing InterceptDeploymentGroup resource. + * @returns {string} A string representing the intercept_deployment_group. + */ + matchInterceptDeploymentGroupFromInterceptDeploymentGroupName(interceptDeploymentGroupName: string) { + return this.pathTemplates.interceptDeploymentGroupPathTemplate.match(interceptDeploymentGroupName).intercept_deployment_group; + } + + /** + * Return a fully-qualified interceptEndpointGroup resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} intercept_endpoint_group + * @returns {string} Resource name string. + */ + interceptEndpointGroupPath(project:string,location:string,interceptEndpointGroup:string) { + return this.pathTemplates.interceptEndpointGroupPathTemplate.render({ + project: project, + location: location, + intercept_endpoint_group: interceptEndpointGroup, + }); + } + + /** + * Parse the project from InterceptEndpointGroup resource. + * + * @param {string} interceptEndpointGroupName + * A fully-qualified path representing InterceptEndpointGroup resource. + * @returns {string} A string representing the project. + */ + matchProjectFromInterceptEndpointGroupName(interceptEndpointGroupName: string) { + return this.pathTemplates.interceptEndpointGroupPathTemplate.match(interceptEndpointGroupName).project; + } + + /** + * Parse the location from InterceptEndpointGroup resource. + * + * @param {string} interceptEndpointGroupName + * A fully-qualified path representing InterceptEndpointGroup resource. + * @returns {string} A string representing the location. + */ + matchLocationFromInterceptEndpointGroupName(interceptEndpointGroupName: string) { + return this.pathTemplates.interceptEndpointGroupPathTemplate.match(interceptEndpointGroupName).location; + } + + /** + * Parse the intercept_endpoint_group from InterceptEndpointGroup resource. + * + * @param {string} interceptEndpointGroupName + * A fully-qualified path representing InterceptEndpointGroup resource. + * @returns {string} A string representing the intercept_endpoint_group. + */ + matchInterceptEndpointGroupFromInterceptEndpointGroupName(interceptEndpointGroupName: string) { + return this.pathTemplates.interceptEndpointGroupPathTemplate.match(interceptEndpointGroupName).intercept_endpoint_group; + } + + /** + * Return a fully-qualified interceptEndpointGroupAssociation resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} intercept_endpoint_group_association + * @returns {string} Resource name string. + */ + interceptEndpointGroupAssociationPath(project:string,location:string,interceptEndpointGroupAssociation:string) { + return this.pathTemplates.interceptEndpointGroupAssociationPathTemplate.render({ + project: project, + location: location, + intercept_endpoint_group_association: interceptEndpointGroupAssociation, + }); + } + + /** + * Parse the project from InterceptEndpointGroupAssociation resource. + * + * @param {string} interceptEndpointGroupAssociationName + * A fully-qualified path representing InterceptEndpointGroupAssociation resource. + * @returns {string} A string representing the project. + */ + matchProjectFromInterceptEndpointGroupAssociationName(interceptEndpointGroupAssociationName: string) { + return this.pathTemplates.interceptEndpointGroupAssociationPathTemplate.match(interceptEndpointGroupAssociationName).project; + } + + /** + * Parse the location from InterceptEndpointGroupAssociation resource. + * + * @param {string} interceptEndpointGroupAssociationName + * A fully-qualified path representing InterceptEndpointGroupAssociation resource. + * @returns {string} A string representing the location. + */ + matchLocationFromInterceptEndpointGroupAssociationName(interceptEndpointGroupAssociationName: string) { + return this.pathTemplates.interceptEndpointGroupAssociationPathTemplate.match(interceptEndpointGroupAssociationName).location; + } + + /** + * Parse the intercept_endpoint_group_association from InterceptEndpointGroupAssociation resource. + * + * @param {string} interceptEndpointGroupAssociationName + * A fully-qualified path representing InterceptEndpointGroupAssociation resource. + * @returns {string} A string representing the intercept_endpoint_group_association. + */ + matchInterceptEndpointGroupAssociationFromInterceptEndpointGroupAssociationName(interceptEndpointGroupAssociationName: string) { + return this.pathTemplates.interceptEndpointGroupAssociationPathTemplate.match(interceptEndpointGroupAssociationName).intercept_endpoint_group_association; + } + + /** + * Return a fully-qualified location resource name string. + * + * @param {string} project + * @param {string} location + * @returns {string} Resource name string. + */ + locationPath(project:string,location:string) { + return this.pathTemplates.locationPathTemplate.render({ + project: project, + location: location, + }); + } + + /** + * Parse the project from Location resource. + * + * @param {string} locationName + * A fully-qualified path representing Location resource. + * @returns {string} A string representing the project. + */ + matchProjectFromLocationName(locationName: string) { + return this.pathTemplates.locationPathTemplate.match(locationName).project; + } + + /** + * Parse the location from Location resource. + * + * @param {string} locationName + * A fully-qualified path representing Location resource. + * @returns {string} A string representing the location. + */ + matchLocationFromLocationName(locationName: string) { + return this.pathTemplates.locationPathTemplate.match(locationName).location; + } + + /** + * Return a fully-qualified mirroringDeployment resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} mirroring_deployment + * @returns {string} Resource name string. + */ + mirroringDeploymentPath(project:string,location:string,mirroringDeployment:string) { + return this.pathTemplates.mirroringDeploymentPathTemplate.render({ + project: project, + location: location, + mirroring_deployment: mirroringDeployment, + }); + } + + /** + * Parse the project from MirroringDeployment resource. + * + * @param {string} mirroringDeploymentName + * A fully-qualified path representing MirroringDeployment resource. + * @returns {string} A string representing the project. + */ + matchProjectFromMirroringDeploymentName(mirroringDeploymentName: string) { + return this.pathTemplates.mirroringDeploymentPathTemplate.match(mirroringDeploymentName).project; + } + + /** + * Parse the location from MirroringDeployment resource. + * + * @param {string} mirroringDeploymentName + * A fully-qualified path representing MirroringDeployment resource. + * @returns {string} A string representing the location. + */ + matchLocationFromMirroringDeploymentName(mirroringDeploymentName: string) { + return this.pathTemplates.mirroringDeploymentPathTemplate.match(mirroringDeploymentName).location; + } + + /** + * Parse the mirroring_deployment from MirroringDeployment resource. + * + * @param {string} mirroringDeploymentName + * A fully-qualified path representing MirroringDeployment resource. + * @returns {string} A string representing the mirroring_deployment. + */ + matchMirroringDeploymentFromMirroringDeploymentName(mirroringDeploymentName: string) { + return this.pathTemplates.mirroringDeploymentPathTemplate.match(mirroringDeploymentName).mirroring_deployment; + } + + /** + * Return a fully-qualified mirroringDeploymentGroup resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} mirroring_deployment_group + * @returns {string} Resource name string. + */ + mirroringDeploymentGroupPath(project:string,location:string,mirroringDeploymentGroup:string) { + return this.pathTemplates.mirroringDeploymentGroupPathTemplate.render({ + project: project, + location: location, + mirroring_deployment_group: mirroringDeploymentGroup, + }); + } + + /** + * Parse the project from MirroringDeploymentGroup resource. + * + * @param {string} mirroringDeploymentGroupName + * A fully-qualified path representing MirroringDeploymentGroup resource. + * @returns {string} A string representing the project. + */ + matchProjectFromMirroringDeploymentGroupName(mirroringDeploymentGroupName: string) { + return this.pathTemplates.mirroringDeploymentGroupPathTemplate.match(mirroringDeploymentGroupName).project; + } + + /** + * Parse the location from MirroringDeploymentGroup resource. + * + * @param {string} mirroringDeploymentGroupName + * A fully-qualified path representing MirroringDeploymentGroup resource. + * @returns {string} A string representing the location. + */ + matchLocationFromMirroringDeploymentGroupName(mirroringDeploymentGroupName: string) { + return this.pathTemplates.mirroringDeploymentGroupPathTemplate.match(mirroringDeploymentGroupName).location; + } + + /** + * Parse the mirroring_deployment_group from MirroringDeploymentGroup resource. + * + * @param {string} mirroringDeploymentGroupName + * A fully-qualified path representing MirroringDeploymentGroup resource. + * @returns {string} A string representing the mirroring_deployment_group. + */ + matchMirroringDeploymentGroupFromMirroringDeploymentGroupName(mirroringDeploymentGroupName: string) { + return this.pathTemplates.mirroringDeploymentGroupPathTemplate.match(mirroringDeploymentGroupName).mirroring_deployment_group; + } + + /** + * Return a fully-qualified mirroringEndpointGroup resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} mirroring_endpoint_group + * @returns {string} Resource name string. + */ + mirroringEndpointGroupPath(project:string,location:string,mirroringEndpointGroup:string) { + return this.pathTemplates.mirroringEndpointGroupPathTemplate.render({ + project: project, + location: location, + mirroring_endpoint_group: mirroringEndpointGroup, + }); + } + + /** + * Parse the project from MirroringEndpointGroup resource. + * + * @param {string} mirroringEndpointGroupName + * A fully-qualified path representing MirroringEndpointGroup resource. + * @returns {string} A string representing the project. + */ + matchProjectFromMirroringEndpointGroupName(mirroringEndpointGroupName: string) { + return this.pathTemplates.mirroringEndpointGroupPathTemplate.match(mirroringEndpointGroupName).project; + } + + /** + * Parse the location from MirroringEndpointGroup resource. + * + * @param {string} mirroringEndpointGroupName + * A fully-qualified path representing MirroringEndpointGroup resource. + * @returns {string} A string representing the location. + */ + matchLocationFromMirroringEndpointGroupName(mirroringEndpointGroupName: string) { + return this.pathTemplates.mirroringEndpointGroupPathTemplate.match(mirroringEndpointGroupName).location; + } + + /** + * Parse the mirroring_endpoint_group from MirroringEndpointGroup resource. + * + * @param {string} mirroringEndpointGroupName + * A fully-qualified path representing MirroringEndpointGroup resource. + * @returns {string} A string representing the mirroring_endpoint_group. + */ + matchMirroringEndpointGroupFromMirroringEndpointGroupName(mirroringEndpointGroupName: string) { + return this.pathTemplates.mirroringEndpointGroupPathTemplate.match(mirroringEndpointGroupName).mirroring_endpoint_group; + } + + /** + * Return a fully-qualified mirroringEndpointGroupAssociation resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} mirroring_endpoint_group_association + * @returns {string} Resource name string. + */ + mirroringEndpointGroupAssociationPath(project:string,location:string,mirroringEndpointGroupAssociation:string) { + return this.pathTemplates.mirroringEndpointGroupAssociationPathTemplate.render({ + project: project, + location: location, + mirroring_endpoint_group_association: mirroringEndpointGroupAssociation, + }); + } + + /** + * Parse the project from MirroringEndpointGroupAssociation resource. + * + * @param {string} mirroringEndpointGroupAssociationName + * A fully-qualified path representing MirroringEndpointGroupAssociation resource. + * @returns {string} A string representing the project. + */ + matchProjectFromMirroringEndpointGroupAssociationName(mirroringEndpointGroupAssociationName: string) { + return this.pathTemplates.mirroringEndpointGroupAssociationPathTemplate.match(mirroringEndpointGroupAssociationName).project; + } + + /** + * Parse the location from MirroringEndpointGroupAssociation resource. + * + * @param {string} mirroringEndpointGroupAssociationName + * A fully-qualified path representing MirroringEndpointGroupAssociation resource. + * @returns {string} A string representing the location. + */ + matchLocationFromMirroringEndpointGroupAssociationName(mirroringEndpointGroupAssociationName: string) { + return this.pathTemplates.mirroringEndpointGroupAssociationPathTemplate.match(mirroringEndpointGroupAssociationName).location; + } + + /** + * Parse the mirroring_endpoint_group_association from MirroringEndpointGroupAssociation resource. + * + * @param {string} mirroringEndpointGroupAssociationName + * A fully-qualified path representing MirroringEndpointGroupAssociation resource. + * @returns {string} A string representing the mirroring_endpoint_group_association. + */ + matchMirroringEndpointGroupAssociationFromMirroringEndpointGroupAssociationName(mirroringEndpointGroupAssociationName: string) { + return this.pathTemplates.mirroringEndpointGroupAssociationPathTemplate.match(mirroringEndpointGroupAssociationName).mirroring_endpoint_group_association; + } + + /** + * Return a fully-qualified network resource name string. + * + * @param {string} project + * @param {string} network + * @returns {string} Resource name string. + */ + networkPath(project:string,network:string) { + return this.pathTemplates.networkPathTemplate.render({ + project: project, + network: network, + }); + } + + /** + * Parse the project from Network resource. + * + * @param {string} networkName + * A fully-qualified path representing Network resource. + * @returns {string} A string representing the project. + */ + matchProjectFromNetworkName(networkName: string) { + return this.pathTemplates.networkPathTemplate.match(networkName).project; + } + + /** + * Parse the network from Network resource. + * + * @param {string} networkName + * A fully-qualified path representing Network resource. + * @returns {string} A string representing the network. + */ + matchNetworkFromNetworkName(networkName: string) { + return this.pathTemplates.networkPathTemplate.match(networkName).network; + } + + /** + * Return a fully-qualified organizationLocationAddressGroup resource name string. + * + * @param {string} organization + * @param {string} location + * @param {string} address_group + * @returns {string} Resource name string. + */ + organizationLocationAddressGroupPath(organization:string,location:string,addressGroup:string) { + return this.pathTemplates.organizationLocationAddressGroupPathTemplate.render({ + organization: organization, + location: location, + address_group: addressGroup, + }); + } + + /** + * Parse the organization from OrganizationLocationAddressGroup resource. + * + * @param {string} organizationLocationAddressGroupName + * A fully-qualified path representing organization_location_address_group resource. + * @returns {string} A string representing the organization. + */ + matchOrganizationFromOrganizationLocationAddressGroupName(organizationLocationAddressGroupName: string) { + return this.pathTemplates.organizationLocationAddressGroupPathTemplate.match(organizationLocationAddressGroupName).organization; + } + + /** + * Parse the location from OrganizationLocationAddressGroup resource. + * + * @param {string} organizationLocationAddressGroupName + * A fully-qualified path representing organization_location_address_group resource. + * @returns {string} A string representing the location. + */ + matchLocationFromOrganizationLocationAddressGroupName(organizationLocationAddressGroupName: string) { + return this.pathTemplates.organizationLocationAddressGroupPathTemplate.match(organizationLocationAddressGroupName).location; + } + + /** + * Parse the address_group from OrganizationLocationAddressGroup resource. + * + * @param {string} organizationLocationAddressGroupName + * A fully-qualified path representing organization_location_address_group resource. + * @returns {string} A string representing the address_group. + */ + matchAddressGroupFromOrganizationLocationAddressGroupName(organizationLocationAddressGroupName: string) { + return this.pathTemplates.organizationLocationAddressGroupPathTemplate.match(organizationLocationAddressGroupName).address_group; + } + + /** + * Return a fully-qualified organizationLocationFirewallEndpoints resource name string. + * + * @param {string} organization + * @param {string} location + * @param {string} firewall_endpoint + * @returns {string} Resource name string. + */ + organizationLocationFirewallEndpointsPath(organization:string,location:string,firewallEndpoint:string) { + return this.pathTemplates.organizationLocationFirewallEndpointsPathTemplate.render({ + organization: organization, + location: location, + firewall_endpoint: firewallEndpoint, + }); + } + + /** + * Parse the organization from OrganizationLocationFirewallEndpoints resource. + * + * @param {string} organizationLocationFirewallEndpointsName + * A fully-qualified path representing organization_location_firewallEndpoints resource. + * @returns {string} A string representing the organization. + */ + matchOrganizationFromOrganizationLocationFirewallEndpointsName(organizationLocationFirewallEndpointsName: string) { + return this.pathTemplates.organizationLocationFirewallEndpointsPathTemplate.match(organizationLocationFirewallEndpointsName).organization; + } + + /** + * Parse the location from OrganizationLocationFirewallEndpoints resource. + * + * @param {string} organizationLocationFirewallEndpointsName + * A fully-qualified path representing organization_location_firewallEndpoints resource. + * @returns {string} A string representing the location. + */ + matchLocationFromOrganizationLocationFirewallEndpointsName(organizationLocationFirewallEndpointsName: string) { + return this.pathTemplates.organizationLocationFirewallEndpointsPathTemplate.match(organizationLocationFirewallEndpointsName).location; + } + + /** + * Parse the firewall_endpoint from OrganizationLocationFirewallEndpoints resource. + * + * @param {string} organizationLocationFirewallEndpointsName + * A fully-qualified path representing organization_location_firewallEndpoints resource. + * @returns {string} A string representing the firewall_endpoint. + */ + matchFirewallEndpointFromOrganizationLocationFirewallEndpointsName(organizationLocationFirewallEndpointsName: string) { + return this.pathTemplates.organizationLocationFirewallEndpointsPathTemplate.match(organizationLocationFirewallEndpointsName).firewall_endpoint; + } + + /** + * Return a fully-qualified organizationLocationSecurityProfile resource name string. + * + * @param {string} organization + * @param {string} location + * @param {string} security_profile + * @returns {string} Resource name string. + */ + organizationLocationSecurityProfilePath(organization:string,location:string,securityProfile:string) { + return this.pathTemplates.organizationLocationSecurityProfilePathTemplate.render({ + organization: organization, + location: location, + security_profile: securityProfile, + }); + } + + /** + * Parse the organization from OrganizationLocationSecurityProfile resource. + * + * @param {string} organizationLocationSecurityProfileName + * A fully-qualified path representing organization_location_security_profile resource. + * @returns {string} A string representing the organization. + */ + matchOrganizationFromOrganizationLocationSecurityProfileName(organizationLocationSecurityProfileName: string) { + return this.pathTemplates.organizationLocationSecurityProfilePathTemplate.match(organizationLocationSecurityProfileName).organization; + } + + /** + * Parse the location from OrganizationLocationSecurityProfile resource. + * + * @param {string} organizationLocationSecurityProfileName + * A fully-qualified path representing organization_location_security_profile resource. + * @returns {string} A string representing the location. + */ + matchLocationFromOrganizationLocationSecurityProfileName(organizationLocationSecurityProfileName: string) { + return this.pathTemplates.organizationLocationSecurityProfilePathTemplate.match(organizationLocationSecurityProfileName).location; + } + + /** + * Parse the security_profile from OrganizationLocationSecurityProfile resource. + * + * @param {string} organizationLocationSecurityProfileName + * A fully-qualified path representing organization_location_security_profile resource. + * @returns {string} A string representing the security_profile. + */ + matchSecurityProfileFromOrganizationLocationSecurityProfileName(organizationLocationSecurityProfileName: string) { + return this.pathTemplates.organizationLocationSecurityProfilePathTemplate.match(organizationLocationSecurityProfileName).security_profile; + } + + /** + * Return a fully-qualified organizationLocationSecurityProfileGroup resource name string. + * + * @param {string} organization + * @param {string} location + * @param {string} security_profile_group + * @returns {string} Resource name string. + */ + organizationLocationSecurityProfileGroupPath(organization:string,location:string,securityProfileGroup:string) { + return this.pathTemplates.organizationLocationSecurityProfileGroupPathTemplate.render({ + organization: organization, + location: location, + security_profile_group: securityProfileGroup, + }); + } + + /** + * Parse the organization from OrganizationLocationSecurityProfileGroup resource. + * + * @param {string} organizationLocationSecurityProfileGroupName + * A fully-qualified path representing organization_location_security_profile_group resource. + * @returns {string} A string representing the organization. + */ + matchOrganizationFromOrganizationLocationSecurityProfileGroupName(organizationLocationSecurityProfileGroupName: string) { + return this.pathTemplates.organizationLocationSecurityProfileGroupPathTemplate.match(organizationLocationSecurityProfileGroupName).organization; + } + + /** + * Parse the location from OrganizationLocationSecurityProfileGroup resource. + * + * @param {string} organizationLocationSecurityProfileGroupName + * A fully-qualified path representing organization_location_security_profile_group resource. + * @returns {string} A string representing the location. + */ + matchLocationFromOrganizationLocationSecurityProfileGroupName(organizationLocationSecurityProfileGroupName: string) { + return this.pathTemplates.organizationLocationSecurityProfileGroupPathTemplate.match(organizationLocationSecurityProfileGroupName).location; + } + + /** + * Parse the security_profile_group from OrganizationLocationSecurityProfileGroup resource. + * + * @param {string} organizationLocationSecurityProfileGroupName + * A fully-qualified path representing organization_location_security_profile_group resource. + * @returns {string} A string representing the security_profile_group. + */ + matchSecurityProfileGroupFromOrganizationLocationSecurityProfileGroupName(organizationLocationSecurityProfileGroupName: string) { + return this.pathTemplates.organizationLocationSecurityProfileGroupPathTemplate.match(organizationLocationSecurityProfileGroupName).security_profile_group; + } + + /** + * Return a fully-qualified project resource name string. + * + * @param {string} project + * @returns {string} Resource name string. + */ + projectPath(project:string) { + return this.pathTemplates.projectPathTemplate.render({ + project: project, + }); + } + + /** + * Parse the project from Project resource. + * + * @param {string} projectName + * A fully-qualified path representing Project resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectName(projectName: string) { + return this.pathTemplates.projectPathTemplate.match(projectName).project; + } + + /** + * Return a fully-qualified projectLocationAddressGroup resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} address_group + * @returns {string} Resource name string. + */ + projectLocationAddressGroupPath(project:string,location:string,addressGroup:string) { + return this.pathTemplates.projectLocationAddressGroupPathTemplate.render({ + project: project, + location: location, + address_group: addressGroup, + }); + } + + /** + * Parse the project from ProjectLocationAddressGroup resource. + * + * @param {string} projectLocationAddressGroupName + * A fully-qualified path representing project_location_address_group resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationAddressGroupName(projectLocationAddressGroupName: string) { + return this.pathTemplates.projectLocationAddressGroupPathTemplate.match(projectLocationAddressGroupName).project; + } + + /** + * Parse the location from ProjectLocationAddressGroup resource. + * + * @param {string} projectLocationAddressGroupName + * A fully-qualified path representing project_location_address_group resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationAddressGroupName(projectLocationAddressGroupName: string) { + return this.pathTemplates.projectLocationAddressGroupPathTemplate.match(projectLocationAddressGroupName).location; + } + + /** + * Parse the address_group from ProjectLocationAddressGroup resource. + * + * @param {string} projectLocationAddressGroupName + * A fully-qualified path representing project_location_address_group resource. + * @returns {string} A string representing the address_group. + */ + matchAddressGroupFromProjectLocationAddressGroupName(projectLocationAddressGroupName: string) { + return this.pathTemplates.projectLocationAddressGroupPathTemplate.match(projectLocationAddressGroupName).address_group; + } + + /** + * Return a fully-qualified projectLocationFirewallEndpoints resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} firewall_endpoint + * @returns {string} Resource name string. + */ + projectLocationFirewallEndpointsPath(project:string,location:string,firewallEndpoint:string) { + return this.pathTemplates.projectLocationFirewallEndpointsPathTemplate.render({ + project: project, + location: location, + firewall_endpoint: firewallEndpoint, + }); + } + + /** + * Parse the project from ProjectLocationFirewallEndpoints resource. + * + * @param {string} projectLocationFirewallEndpointsName + * A fully-qualified path representing project_location_firewallEndpoints resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationFirewallEndpointsName(projectLocationFirewallEndpointsName: string) { + return this.pathTemplates.projectLocationFirewallEndpointsPathTemplate.match(projectLocationFirewallEndpointsName).project; + } + + /** + * Parse the location from ProjectLocationFirewallEndpoints resource. + * + * @param {string} projectLocationFirewallEndpointsName + * A fully-qualified path representing project_location_firewallEndpoints resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationFirewallEndpointsName(projectLocationFirewallEndpointsName: string) { + return this.pathTemplates.projectLocationFirewallEndpointsPathTemplate.match(projectLocationFirewallEndpointsName).location; + } + + /** + * Parse the firewall_endpoint from ProjectLocationFirewallEndpoints resource. + * + * @param {string} projectLocationFirewallEndpointsName + * A fully-qualified path representing project_location_firewallEndpoints resource. + * @returns {string} A string representing the firewall_endpoint. + */ + matchFirewallEndpointFromProjectLocationFirewallEndpointsName(projectLocationFirewallEndpointsName: string) { + return this.pathTemplates.projectLocationFirewallEndpointsPathTemplate.match(projectLocationFirewallEndpointsName).firewall_endpoint; + } + + /** + * Return a fully-qualified projectLocationSecurityProfile resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} security_profile + * @returns {string} Resource name string. + */ + projectLocationSecurityProfilePath(project:string,location:string,securityProfile:string) { + return this.pathTemplates.projectLocationSecurityProfilePathTemplate.render({ + project: project, + location: location, + security_profile: securityProfile, + }); + } + + /** + * Parse the project from ProjectLocationSecurityProfile resource. + * + * @param {string} projectLocationSecurityProfileName + * A fully-qualified path representing project_location_security_profile resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationSecurityProfileName(projectLocationSecurityProfileName: string) { + return this.pathTemplates.projectLocationSecurityProfilePathTemplate.match(projectLocationSecurityProfileName).project; + } + + /** + * Parse the location from ProjectLocationSecurityProfile resource. + * + * @param {string} projectLocationSecurityProfileName + * A fully-qualified path representing project_location_security_profile resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationSecurityProfileName(projectLocationSecurityProfileName: string) { + return this.pathTemplates.projectLocationSecurityProfilePathTemplate.match(projectLocationSecurityProfileName).location; + } + + /** + * Parse the security_profile from ProjectLocationSecurityProfile resource. + * + * @param {string} projectLocationSecurityProfileName + * A fully-qualified path representing project_location_security_profile resource. + * @returns {string} A string representing the security_profile. + */ + matchSecurityProfileFromProjectLocationSecurityProfileName(projectLocationSecurityProfileName: string) { + return this.pathTemplates.projectLocationSecurityProfilePathTemplate.match(projectLocationSecurityProfileName).security_profile; + } + + /** + * Return a fully-qualified projectLocationSecurityProfileGroup resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} security_profile_group + * @returns {string} Resource name string. + */ + projectLocationSecurityProfileGroupPath(project:string,location:string,securityProfileGroup:string) { + return this.pathTemplates.projectLocationSecurityProfileGroupPathTemplate.render({ + project: project, + location: location, + security_profile_group: securityProfileGroup, + }); + } + + /** + * Parse the project from ProjectLocationSecurityProfileGroup resource. + * + * @param {string} projectLocationSecurityProfileGroupName + * A fully-qualified path representing project_location_security_profile_group resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationSecurityProfileGroupName(projectLocationSecurityProfileGroupName: string) { + return this.pathTemplates.projectLocationSecurityProfileGroupPathTemplate.match(projectLocationSecurityProfileGroupName).project; + } + + /** + * Parse the location from ProjectLocationSecurityProfileGroup resource. + * + * @param {string} projectLocationSecurityProfileGroupName + * A fully-qualified path representing project_location_security_profile_group resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationSecurityProfileGroupName(projectLocationSecurityProfileGroupName: string) { + return this.pathTemplates.projectLocationSecurityProfileGroupPathTemplate.match(projectLocationSecurityProfileGroupName).location; + } + + /** + * Parse the security_profile_group from ProjectLocationSecurityProfileGroup resource. + * + * @param {string} projectLocationSecurityProfileGroupName + * A fully-qualified path representing project_location_security_profile_group resource. + * @returns {string} A string representing the security_profile_group. + */ + matchSecurityProfileGroupFromProjectLocationSecurityProfileGroupName(projectLocationSecurityProfileGroupName: string) { + return this.pathTemplates.projectLocationSecurityProfileGroupPathTemplate.match(projectLocationSecurityProfileGroupName).security_profile_group; + } + + /** + * Return a fully-qualified serverTlsPolicy resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} server_tls_policy + * @returns {string} Resource name string. + */ + serverTlsPolicyPath(project:string,location:string,serverTlsPolicy:string) { + return this.pathTemplates.serverTlsPolicyPathTemplate.render({ + project: project, + location: location, + server_tls_policy: serverTlsPolicy, + }); + } + + /** + * Parse the project from ServerTlsPolicy resource. + * + * @param {string} serverTlsPolicyName + * A fully-qualified path representing ServerTlsPolicy resource. + * @returns {string} A string representing the project. + */ + matchProjectFromServerTlsPolicyName(serverTlsPolicyName: string) { + return this.pathTemplates.serverTlsPolicyPathTemplate.match(serverTlsPolicyName).project; + } + + /** + * Parse the location from ServerTlsPolicy resource. + * + * @param {string} serverTlsPolicyName + * A fully-qualified path representing ServerTlsPolicy resource. + * @returns {string} A string representing the location. + */ + matchLocationFromServerTlsPolicyName(serverTlsPolicyName: string) { + return this.pathTemplates.serverTlsPolicyPathTemplate.match(serverTlsPolicyName).location; + } + + /** + * Parse the server_tls_policy from ServerTlsPolicy resource. + * + * @param {string} serverTlsPolicyName + * A fully-qualified path representing ServerTlsPolicy resource. + * @returns {string} A string representing the server_tls_policy. + */ + matchServerTlsPolicyFromServerTlsPolicyName(serverTlsPolicyName: string) { + return this.pathTemplates.serverTlsPolicyPathTemplate.match(serverTlsPolicyName).server_tls_policy; + } + + /** + * Return a fully-qualified tlsInspectionPolicy resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} tls_inspection_policy + * @returns {string} Resource name string. + */ + tlsInspectionPolicyPath(project:string,location:string,tlsInspectionPolicy:string) { + return this.pathTemplates.tlsInspectionPolicyPathTemplate.render({ + project: project, + location: location, + tls_inspection_policy: tlsInspectionPolicy, + }); + } + + /** + * Parse the project from TlsInspectionPolicy resource. + * + * @param {string} tlsInspectionPolicyName + * A fully-qualified path representing TlsInspectionPolicy resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTlsInspectionPolicyName(tlsInspectionPolicyName: string) { + return this.pathTemplates.tlsInspectionPolicyPathTemplate.match(tlsInspectionPolicyName).project; + } + + /** + * Parse the location from TlsInspectionPolicy resource. + * + * @param {string} tlsInspectionPolicyName + * A fully-qualified path representing TlsInspectionPolicy resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTlsInspectionPolicyName(tlsInspectionPolicyName: string) { + return this.pathTemplates.tlsInspectionPolicyPathTemplate.match(tlsInspectionPolicyName).location; + } + + /** + * Parse the tls_inspection_policy from TlsInspectionPolicy resource. + * + * @param {string} tlsInspectionPolicyName + * A fully-qualified path representing TlsInspectionPolicy resource. + * @returns {string} A string representing the tls_inspection_policy. + */ + matchTlsInspectionPolicyFromTlsInspectionPolicyName(tlsInspectionPolicyName: string) { + return this.pathTemplates.tlsInspectionPolicyPathTemplate.match(tlsInspectionPolicyName).tls_inspection_policy; + } + + /** + * Return a fully-qualified urlList resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} url_list + * @returns {string} Resource name string. + */ + urlListPath(project:string,location:string,urlList:string) { + return this.pathTemplates.urlListPathTemplate.render({ + project: project, + location: location, + url_list: urlList, + }); + } + + /** + * Parse the project from UrlList resource. + * + * @param {string} urlListName + * A fully-qualified path representing UrlList resource. + * @returns {string} A string representing the project. + */ + matchProjectFromUrlListName(urlListName: string) { + return this.pathTemplates.urlListPathTemplate.match(urlListName).project; + } + + /** + * Parse the location from UrlList resource. + * + * @param {string} urlListName + * A fully-qualified path representing UrlList resource. + * @returns {string} A string representing the location. + */ + matchLocationFromUrlListName(urlListName: string) { + return this.pathTemplates.urlListPathTemplate.match(urlListName).location; + } + + /** + * Parse the url_list from UrlList resource. + * + * @param {string} urlListName + * A fully-qualified path representing UrlList resource. + * @returns {string} A string representing the url_list. + */ + matchUrlListFromUrlListName(urlListName: string) { + return this.pathTemplates.urlListPathTemplate.match(urlListName).url_list; + } + + /** + * Terminate the gRPC channel and close the client. + * + * The client will no longer be usable and all future behavior is undefined. + * @returns {Promise} A promise that resolves when the client is closed. + */ + close(): Promise { + if (this.dnsThreatDetectorServiceStub && !this._terminated) { + return this.dnsThreatDetectorServiceStub.then(stub => { + this._log.info('ending gRPC channel'); + this._terminated = true; + stub.close(); + this.iamClient.close().catch(err => {throw err}); + this.locationsClient.close().catch(err => {throw err}); + }); + } + return Promise.resolve(); + } +} \ No newline at end of file diff --git a/packages/google-cloud-networksecurity/src/v1/dns_threat_detector_service_client_config.json b/packages/google-cloud-networksecurity/src/v1/dns_threat_detector_service_client_config.json new file mode 100644 index 00000000000..46d9e27c2e7 --- /dev/null +++ b/packages/google-cloud-networksecurity/src/v1/dns_threat_detector_service_client_config.json @@ -0,0 +1,46 @@ +{ + "interfaces": { + "google.cloud.networksecurity.v1.DnsThreatDetectorService": { + "retry_codes": { + "non_idempotent": [], + "idempotent": [ + "DEADLINE_EXCEEDED", + "UNAVAILABLE" + ] + }, + "retry_params": { + "default": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + } + }, + "methods": { + "ListDnsThreatDetectors": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetDnsThreatDetector": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "CreateDnsThreatDetector": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UpdateDnsThreatDetector": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteDnsThreatDetector": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/packages/google-cloud-networksecurity/src/v1/dns_threat_detector_service_proto_list.json b/packages/google-cloud-networksecurity/src/v1/dns_threat_detector_service_proto_list.json new file mode 100644 index 00000000000..1451adf6674 --- /dev/null +++ b/packages/google-cloud-networksecurity/src/v1/dns_threat_detector_service_proto_list.json @@ -0,0 +1,25 @@ +[ + "../../protos/google/cloud/networksecurity/v1/address_group.proto", + "../../protos/google/cloud/networksecurity/v1/authorization_policy.proto", + "../../protos/google/cloud/networksecurity/v1/authz_policy.proto", + "../../protos/google/cloud/networksecurity/v1/backend_authentication_config.proto", + "../../protos/google/cloud/networksecurity/v1/client_tls_policy.proto", + "../../protos/google/cloud/networksecurity/v1/common.proto", + "../../protos/google/cloud/networksecurity/v1/dns_threat_detector.proto", + "../../protos/google/cloud/networksecurity/v1/firewall_activation.proto", + "../../protos/google/cloud/networksecurity/v1/gateway_security_policy.proto", + "../../protos/google/cloud/networksecurity/v1/gateway_security_policy_rule.proto", + "../../protos/google/cloud/networksecurity/v1/intercept.proto", + "../../protos/google/cloud/networksecurity/v1/mirroring.proto", + "../../protos/google/cloud/networksecurity/v1/network_security.proto", + "../../protos/google/cloud/networksecurity/v1/security_profile_group.proto", + "../../protos/google/cloud/networksecurity/v1/security_profile_group_intercept.proto", + "../../protos/google/cloud/networksecurity/v1/security_profile_group_mirroring.proto", + "../../protos/google/cloud/networksecurity/v1/security_profile_group_service.proto", + "../../protos/google/cloud/networksecurity/v1/security_profile_group_threatprevention.proto", + "../../protos/google/cloud/networksecurity/v1/security_profile_group_urlfiltering.proto", + "../../protos/google/cloud/networksecurity/v1/server_tls_policy.proto", + "../../protos/google/cloud/networksecurity/v1/tls.proto", + "../../protos/google/cloud/networksecurity/v1/tls_inspection_policy.proto", + "../../protos/google/cloud/networksecurity/v1/url_list.proto" +] diff --git a/packages/google-cloud-networksecurity/src/v1/firewall_activation_client.ts b/packages/google-cloud-networksecurity/src/v1/firewall_activation_client.ts new file mode 100644 index 00000000000..34c8628adbf --- /dev/null +++ b/packages/google-cloud-networksecurity/src/v1/firewall_activation_client.ts @@ -0,0 +1,3784 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +/* global window */ +import type * as gax from 'google-gax'; +import type {Callback, CallOptions, Descriptors, ClientOptions, GrpcClientOptions, LROperation, PaginationCallback, GaxCall, IamClient, IamProtos, LocationsClient, LocationProtos} from 'google-gax'; +import {Transform} from 'stream'; +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +import {loggingUtils as logging, decodeAnyProtosInArray} from 'google-gax'; + +/** + * Client JSON configuration object, loaded from + * `src/v1/firewall_activation_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './firewall_activation_client_config.json'; +const version = require('../../../package.json').version; + +/** + * Service for managing Firewall Endpoints and Associations. + * @class + * @memberof v1 + */ +export class FirewallActivationClient { + private _terminated = false; + private _opts: ClientOptions; + private _providedCustomServicePath: boolean; + private _gaxModule: typeof gax | typeof gax.fallback; + private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; + private _protos: {}; + private _defaults: {[method: string]: gax.CallSettings}; + private _universeDomain: string; + private _servicePath: string; + private _log = logging.log('network-security'); + + auth: gax.GoogleAuth; + descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; + warn: (code: string, message: string, warnType?: string) => void; + innerApiCalls: {[name: string]: Function}; + iamClient: IamClient; + locationsClient: LocationsClient; + pathTemplates: {[name: string]: gax.PathTemplate}; + operationsClient: gax.OperationsClient; + firewallActivationStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of FirewallActivationClient. + * + * @param {object} [options] - The configuration object. + * The options accepted by the constructor are described in detail + * in [this document](https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#creating-the-client-instance). + * The common options are: + * @param {object} [options.credentials] - Credentials object. + * @param {string} [options.credentials.client_email] + * @param {string} [options.credentials.private_key] + * @param {string} [options.email] - Account email address. Required when + * using a .pem or .p12 keyFilename. + * @param {string} [options.keyFilename] - Full path to the a .json, .pem, or + * .p12 key downloaded from the Google Developers Console. If you provide + * a path to a JSON file, the projectId option below is not necessary. + * NOTE: .pem and .p12 require you to specify options.email as well. + * @param {number} [options.port] - The port on which to connect to + * the remote host. + * @param {string} [options.projectId] - The project ID from the Google + * Developer's Console, e.g. 'grape-spaceship-123'. We will also check + * the environment variable GCLOUD_PROJECT for your project ID. If your + * app is running in an environment which supports + * {@link https://cloud.google.com/docs/authentication/application-default-credentials Application Default Credentials}, + * your project ID will be detected automatically. + * @param {string} [options.apiEndpoint] - The domain name of the + * API remote host. + * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. + * Follows the structure of {@link gapicConfig}. + * @param {boolean} [options.fallback] - Use HTTP/1.1 REST mode. + * For more information, please check the + * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. + * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you + * need to avoid loading the default gRPC version and want to use the fallback + * HTTP implementation. Load only fallback version and pass it to the constructor: + * ``` + * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC + * const client = new FirewallActivationClient({fallback: true}, gax); + * ``` + */ + constructor(opts?: ClientOptions, gaxInstance?: typeof gax | typeof gax.fallback) { + // Ensure that options include all the required fields. + const staticMembers = this.constructor as typeof FirewallActivationClient; + if (opts?.universe_domain && opts?.universeDomain && opts?.universe_domain !== opts?.universeDomain) { + throw new Error('Please set either universe_domain or universeDomain, but not both.'); + } + const universeDomainEnvVar = (typeof process === 'object' && typeof process.env === 'object') ? process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] : undefined; + this._universeDomain = opts?.universeDomain ?? opts?.universe_domain ?? universeDomainEnvVar ?? 'googleapis.com'; + this._servicePath = 'networksecurity.' + this._universeDomain; + const servicePath = opts?.servicePath || opts?.apiEndpoint || this._servicePath; + this._providedCustomServicePath = !!(opts?.servicePath || opts?.apiEndpoint); + const port = opts?.port || staticMembers.port; + const clientConfig = opts?.clientConfig ?? {}; + const fallback = opts?.fallback ?? (typeof window !== 'undefined' && typeof window?.fetch === 'function'); + opts = Object.assign({servicePath, port, clientConfig, fallback}, opts); + + // Request numeric enum values if REST transport is used. + opts.numericEnums = true; + + // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. + if (servicePath !== this._servicePath && !('scopes' in opts)) { + opts['scopes'] = staticMembers.scopes; + } + + // Load google-gax module synchronously if needed + if (!gaxInstance) { + gaxInstance = require('google-gax') as typeof gax; + } + + // Choose either gRPC or proto-over-HTTP implementation of google-gax. + this._gaxModule = opts.fallback ? gaxInstance.fallback : gaxInstance; + + // Create a `gaxGrpc` object, with any grpc-specific options sent to the client. + this._gaxGrpc = new this._gaxModule.GrpcClient(opts); + + // Save options to use in initialize() method. + this._opts = opts; + + // Save the auth object to the client, for use by other methods. + this.auth = (this._gaxGrpc.auth as gax.GoogleAuth); + + // Set useJWTAccessWithScope on the auth object. + this.auth.useJWTAccessWithScope = true; + + // Set defaultServicePath on the auth object. + this.auth.defaultServicePath = this._servicePath; + + // Set the default scopes in auth client if needed. + if (servicePath === this._servicePath) { + this.auth.defaultScopes = staticMembers.scopes; + } + this.iamClient = new this._gaxModule.IamClient(this._gaxGrpc, opts); + + this.locationsClient = new this._gaxModule.LocationsClient( + this._gaxGrpc, + opts + ); + + + // Determine the client header string. + const clientHeader = [ + `gax/${this._gaxModule.version}`, + `gapic/${version}`, + ]; + if (typeof process === 'object' && 'versions' in process) { + clientHeader.push(`gl-node/${process.versions.node}`); + } else { + clientHeader.push(`gl-web/${this._gaxModule.version}`); + } + if (!opts.fallback) { + clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); + } else { + clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); + } + if (opts.libName && opts.libVersion) { + clientHeader.push(`${opts.libName}/${opts.libVersion}`); + } + // Load the applicable protos. + this._protos = this._gaxGrpc.loadProtoJSON(jsonProtos); + + // This API contains "path templates"; forward-slash-separated + // identifiers to uniquely identify resources within the API. + // Create useful helper objects for these. + this.pathTemplates = { + authorizationPolicyPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/authorizationPolicies/{authorization_policy}' + ), + authzPolicyPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/authzPolicies/{authz_policy}' + ), + backendAuthenticationConfigPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/backendAuthenticationConfigs/{backend_authentication_config}' + ), + clientTlsPolicyPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/clientTlsPolicies/{client_tls_policy}' + ), + dnsThreatDetectorPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/dnsThreatDetectors/{dns_threat_detector}' + ), + firewallEndpointAssociationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/firewallEndpointAssociations/{firewall_endpoint_association}' + ), + gatewaySecurityPolicyPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/gatewaySecurityPolicies/{gateway_security_policy}' + ), + gatewaySecurityPolicyRulePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/gatewaySecurityPolicies/{gateway_security_policy}/rules/{rule}' + ), + interceptDeploymentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/interceptDeployments/{intercept_deployment}' + ), + interceptDeploymentGroupPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/interceptDeploymentGroups/{intercept_deployment_group}' + ), + interceptEndpointGroupPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/interceptEndpointGroups/{intercept_endpoint_group}' + ), + interceptEndpointGroupAssociationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/interceptEndpointGroupAssociations/{intercept_endpoint_group_association}' + ), + locationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}' + ), + mirroringDeploymentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/mirroringDeployments/{mirroring_deployment}' + ), + mirroringDeploymentGroupPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/mirroringDeploymentGroups/{mirroring_deployment_group}' + ), + mirroringEndpointGroupPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/mirroringEndpointGroups/{mirroring_endpoint_group}' + ), + mirroringEndpointGroupAssociationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/mirroringEndpointGroupAssociations/{mirroring_endpoint_group_association}' + ), + organizationPathTemplate: new this._gaxModule.PathTemplate( + 'organizations/{organization}' + ), + organizationLocationPathTemplate: new this._gaxModule.PathTemplate( + 'organizations/{organization}/locations/{location}' + ), + organizationLocationAddressGroupPathTemplate: new this._gaxModule.PathTemplate( + 'organizations/{organization}/locations/{location}/addressGroups/{address_group}' + ), + organizationLocationFirewallEndpointsPathTemplate: new this._gaxModule.PathTemplate( + 'organizations/{organization}/locations/{location}/firewallEndpoints/{firewall_endpoint}' + ), + organizationLocationSecurityProfilePathTemplate: new this._gaxModule.PathTemplate( + 'organizations/{organization}/locations/{location}/securityProfiles/{security_profile}' + ), + organizationLocationSecurityProfileGroupPathTemplate: new this._gaxModule.PathTemplate( + 'organizations/{organization}/locations/{location}/securityProfileGroups/{security_profile_group}' + ), + projectPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}' + ), + projectLocationAddressGroupPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/addressGroups/{address_group}' + ), + projectLocationFirewallEndpointsPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/firewallEndpoints/{firewall_endpoint}' + ), + projectLocationSecurityProfilePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/securityProfiles/{security_profile}' + ), + projectLocationSecurityProfileGroupPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/securityProfileGroups/{security_profile_group}' + ), + serverTlsPolicyPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/serverTlsPolicies/{server_tls_policy}' + ), + tlsInspectionPolicyPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/tlsInspectionPolicies/{tls_inspection_policy}' + ), + urlListPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/urlLists/{url_list}' + ), + }; + + // Some of the methods on this service return "paged" results, + // (e.g. 50 results at a time, with tokens to get subsequent + // pages). Denote the keys used for pagination and results. + this.descriptors.page = { + listFirewallEndpoints: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'firewallEndpoints'), + listFirewallEndpointAssociations: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'firewallEndpointAssociations') + }; + + const protoFilesRoot = this._gaxModule.protobufFromJSON(jsonProtos); + // This API contains "long-running operations", which return a + // an Operation object that allows for tracking of the operation, + // rather than holding a request open. + const lroOptions: GrpcClientOptions = { + auth: this.auth, + grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined + }; + if (opts.fallback) { + lroOptions.protoJson = protoFilesRoot; + lroOptions.httpRules = [{selector: 'google.cloud.location.Locations.GetLocation',get: '/v1/{name=projects/*/locations/*}',additional_bindings: [{get: '/v1/{name=organizations/*/locations/*}',}], + },{selector: 'google.cloud.location.Locations.ListLocations',get: '/v1/{name=projects/*}/locations',additional_bindings: [{get: '/v1/{name=organizations/*/locations/*}',}], + },{selector: 'google.iam.v1.IAMPolicy.GetIamPolicy',get: '/v1/{resource=projects/*/locations/*/addressGroups/*}:getIamPolicy',additional_bindings: [{get: '/v1/{resource=projects/*/locations/*/authorizationPolicies/*}:getIamPolicy',},{get: '/v1/{resource=organizations/*/locations/*/addressGroups/*}:getIamPolicy',},{get: '/v1/{resource=projects/*/locations/*/serverTlsPolicies/*}:getIamPolicy',},{get: '/v1/{resource=projects/*/locations/*/clientTlsPolicies/*}:getIamPolicy',},{get: '/v1/{resource=projects/*/locations/*/authzPolicies/*}:getIamPolicy',}], + },{selector: 'google.iam.v1.IAMPolicy.SetIamPolicy',post: '/v1/{resource=projects/*/locations/*/addressGroups/*}:setIamPolicy',body: '*',additional_bindings: [{post: '/v1/{resource=projects/*/locations/*/authorizationPolicies/*}:setIamPolicy',body: '*',},{post: '/v1/{resource=organizations/*/locations/*/addressGroups/*}:setIamPolicy',body: '*',},{post: '/v1/{resource=projects/*/locations/*/serverTlsPolicies/*}:setIamPolicy',body: '*',},{post: '/v1/{resource=projects/*/locations/*/clientTlsPolicies/*}:setIamPolicy',body: '*',},{post: '/v1/{resource=projects/*/locations/*/authzPolicies/*}:setIamPolicy',body: '*',}], + },{selector: 'google.iam.v1.IAMPolicy.TestIamPermissions',post: '/v1/{resource=projects/*/locations/*/addressGroups/*}:testIamPermissions',body: '*',additional_bindings: [{post: '/v1/{resource=projects/*/locations/*/authorizationPolicies/*}:testIamPermissions',body: '*',},{post: '/v1/{resource=organizations/*/locations/*/addressGroups/*}:testIamPermissions',body: '*',},{post: '/v1/{resource=projects/*/locations/*/serverTlsPolicies/*}:testIamPermissions',body: '*',},{post: '/v1/{resource=projects/*/locations/*/clientTlsPolicies/*}:testIamPermissions',body: '*',},{post: '/v1/{resource=projects/*/locations/*/authzPolicies/*}:testIamPermissions',body: '*',}], + },{selector: 'google.longrunning.Operations.CancelOperation',post: '/v1/{name=projects/*/locations/*/operations/*}:cancel',body: '*',additional_bindings: [{post: '/v1/{name=organizations/*/locations/*/operations/*}:cancel',body: '*',}], + },{selector: 'google.longrunning.Operations.DeleteOperation',delete: '/v1/{name=projects/*/locations/*/operations/*}',additional_bindings: [{delete: '/v1/{name=organizations/*/locations/*/operations/*}',}], + },{selector: 'google.longrunning.Operations.GetOperation',get: '/v1/{name=projects/*/locations/*/operations/*}',additional_bindings: [{get: '/v1/{name=organizations/*/locations/*/operations/*}',}], + },{selector: 'google.longrunning.Operations.ListOperations',get: '/v1/{name=projects/*/locations/*}/operations',additional_bindings: [{get: '/v1/{name=organizations/*/locations/*}/operations',}], + }]; + } + this.operationsClient = this._gaxModule.lro(lroOptions).operationsClient(opts); + const createFirewallEndpointResponse = protoFilesRoot.lookup( + '.google.cloud.networksecurity.v1.FirewallEndpoint') as gax.protobuf.Type; + const createFirewallEndpointMetadata = protoFilesRoot.lookup( + '.google.cloud.networksecurity.v1.OperationMetadata') as gax.protobuf.Type; + const deleteFirewallEndpointResponse = protoFilesRoot.lookup( + '.google.protobuf.Empty') as gax.protobuf.Type; + const deleteFirewallEndpointMetadata = protoFilesRoot.lookup( + '.google.cloud.networksecurity.v1.OperationMetadata') as gax.protobuf.Type; + const updateFirewallEndpointResponse = protoFilesRoot.lookup( + '.google.cloud.networksecurity.v1.FirewallEndpoint') as gax.protobuf.Type; + const updateFirewallEndpointMetadata = protoFilesRoot.lookup( + '.google.cloud.networksecurity.v1.OperationMetadata') as gax.protobuf.Type; + const createFirewallEndpointAssociationResponse = protoFilesRoot.lookup( + '.google.cloud.networksecurity.v1.FirewallEndpointAssociation') as gax.protobuf.Type; + const createFirewallEndpointAssociationMetadata = protoFilesRoot.lookup( + '.google.cloud.networksecurity.v1.OperationMetadata') as gax.protobuf.Type; + const deleteFirewallEndpointAssociationResponse = protoFilesRoot.lookup( + '.google.protobuf.Empty') as gax.protobuf.Type; + const deleteFirewallEndpointAssociationMetadata = protoFilesRoot.lookup( + '.google.cloud.networksecurity.v1.OperationMetadata') as gax.protobuf.Type; + const updateFirewallEndpointAssociationResponse = protoFilesRoot.lookup( + '.google.cloud.networksecurity.v1.FirewallEndpointAssociation') as gax.protobuf.Type; + const updateFirewallEndpointAssociationMetadata = protoFilesRoot.lookup( + '.google.cloud.networksecurity.v1.OperationMetadata') as gax.protobuf.Type; + + this.descriptors.longrunning = { + createFirewallEndpoint: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + createFirewallEndpointResponse.decode.bind(createFirewallEndpointResponse), + createFirewallEndpointMetadata.decode.bind(createFirewallEndpointMetadata)), + deleteFirewallEndpoint: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + deleteFirewallEndpointResponse.decode.bind(deleteFirewallEndpointResponse), + deleteFirewallEndpointMetadata.decode.bind(deleteFirewallEndpointMetadata)), + updateFirewallEndpoint: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + updateFirewallEndpointResponse.decode.bind(updateFirewallEndpointResponse), + updateFirewallEndpointMetadata.decode.bind(updateFirewallEndpointMetadata)), + createFirewallEndpointAssociation: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + createFirewallEndpointAssociationResponse.decode.bind(createFirewallEndpointAssociationResponse), + createFirewallEndpointAssociationMetadata.decode.bind(createFirewallEndpointAssociationMetadata)), + deleteFirewallEndpointAssociation: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + deleteFirewallEndpointAssociationResponse.decode.bind(deleteFirewallEndpointAssociationResponse), + deleteFirewallEndpointAssociationMetadata.decode.bind(deleteFirewallEndpointAssociationMetadata)), + updateFirewallEndpointAssociation: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + updateFirewallEndpointAssociationResponse.decode.bind(updateFirewallEndpointAssociationResponse), + updateFirewallEndpointAssociationMetadata.decode.bind(updateFirewallEndpointAssociationMetadata)) + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.networksecurity.v1.FirewallActivation', gapicConfig as gax.ClientConfig, + opts.clientConfig || {}, {'x-goog-api-client': clientHeader.join(' ')}); + + // Set up a dictionary of "inner API calls"; the core implementation + // of calling the API is handled in `google-gax`, with this code + // merely providing the destination and request information. + this.innerApiCalls = {}; + + // Add a warn function to the client constructor so it can be easily tested. + this.warn = this._gaxModule.warn; + } + + /** + * Initialize the client. + * Performs asynchronous operations (such as authentication) and prepares the client. + * This function will be called automatically when any class method is called for the + * first time, but if you need to initialize it before calling an actual method, + * feel free to call initialize() directly. + * + * You can await on this method if you want to make sure the client is initialized. + * + * @returns {Promise} A promise that resolves to an authenticated service stub. + */ + initialize() { + // If the client stub promise is already initialized, return immediately. + if (this.firewallActivationStub) { + return this.firewallActivationStub; + } + + // Put together the "service stub" for + // google.cloud.networksecurity.v1.FirewallActivation. + this.firewallActivationStub = this._gaxGrpc.createStub( + this._opts.fallback ? + (this._protos as protobuf.Root).lookupService('google.cloud.networksecurity.v1.FirewallActivation') : + // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.networksecurity.v1.FirewallActivation, + this._opts, this._providedCustomServicePath) as Promise<{[method: string]: Function}>; + + // Iterate over each of the methods that the service provides + // and create an API call method for each. + const firewallActivationStubMethods = + ['listFirewallEndpoints', 'getFirewallEndpoint', 'createFirewallEndpoint', 'deleteFirewallEndpoint', 'updateFirewallEndpoint', 'listFirewallEndpointAssociations', 'getFirewallEndpointAssociation', 'createFirewallEndpointAssociation', 'deleteFirewallEndpointAssociation', 'updateFirewallEndpointAssociation']; + for (const methodName of firewallActivationStubMethods) { + const callPromise = this.firewallActivationStub.then( + stub => (...args: Array<{}>) => { + if (this._terminated) { + return Promise.reject('The client has already been closed.'); + } + const func = stub[methodName]; + return func.apply(stub, args); + }, + (err: Error|null|undefined) => () => { + throw err; + }); + + const descriptor = + this.descriptors.page[methodName] || + this.descriptors.longrunning[methodName] || + undefined; + const apiCall = this._gaxModule.createApiCall( + callPromise, + this._defaults[methodName], + descriptor, + this._opts.fallback + ); + + this.innerApiCalls[methodName] = apiCall; + } + + return this.firewallActivationStub; + } + + /** + * The DNS address for this API service. + * @deprecated Use the apiEndpoint method of the client instance. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + if (typeof process === 'object' && typeof process.emitWarning === 'function') { + process.emitWarning('Static servicePath is deprecated, please use the instance method instead.', 'DeprecationWarning'); + } + return 'networksecurity.googleapis.com'; + } + + /** + * The DNS address for this API service - same as servicePath. + * @deprecated Use the apiEndpoint method of the client instance. + * @returns {string} The DNS address for this service. + */ + static get apiEndpoint() { + if (typeof process === 'object' && typeof process.emitWarning === 'function') { + process.emitWarning('Static apiEndpoint is deprecated, please use the instance method instead.', 'DeprecationWarning'); + } + return 'networksecurity.googleapis.com'; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + get apiEndpoint() { + return this._servicePath; + } + + get universeDomain() { + return this._universeDomain; + } + + /** + * The port for this API service. + * @returns {number} The default port for this service. + */ + static get port() { + return 443; + } + + /** + * The scopes needed to make gRPC calls for every method defined + * in this service. + * @returns {string[]} List of default scopes. + */ + static get scopes() { + return [ + 'https://www.googleapis.com/auth/cloud-platform' + ]; + } + + getProjectId(): Promise; + getProjectId(callback: Callback): void; + /** + * Return the project ID used by this class. + * @returns {Promise} A promise that resolves to string containing the project ID. + */ + getProjectId(callback?: Callback): + Promise|void { + if (callback) { + this.auth.getProjectId(callback); + return; + } + return this.auth.getProjectId(); + } + + // ------------------- + // -- Service calls -- + // ------------------- +/** + * Gets details of a single org Endpoint. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Name of the resource + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.cloud.networksecurity.v1.FirewallEndpoint|FirewallEndpoint}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1/firewall_activation.get_firewall_endpoint.js + * region_tag:networksecurity_v1_generated_FirewallActivation_GetFirewallEndpoint_async + */ + getFirewallEndpoint( + request?: protos.google.cloud.networksecurity.v1.IGetFirewallEndpointRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.networksecurity.v1.IFirewallEndpoint, + protos.google.cloud.networksecurity.v1.IGetFirewallEndpointRequest|undefined, {}|undefined + ]>; + getFirewallEndpoint( + request: protos.google.cloud.networksecurity.v1.IGetFirewallEndpointRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.networksecurity.v1.IFirewallEndpoint, + protos.google.cloud.networksecurity.v1.IGetFirewallEndpointRequest|null|undefined, + {}|null|undefined>): void; + getFirewallEndpoint( + request: protos.google.cloud.networksecurity.v1.IGetFirewallEndpointRequest, + callback: Callback< + protos.google.cloud.networksecurity.v1.IFirewallEndpoint, + protos.google.cloud.networksecurity.v1.IGetFirewallEndpointRequest|null|undefined, + {}|null|undefined>): void; + getFirewallEndpoint( + request?: protos.google.cloud.networksecurity.v1.IGetFirewallEndpointRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.networksecurity.v1.IFirewallEndpoint, + protos.google.cloud.networksecurity.v1.IGetFirewallEndpointRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.networksecurity.v1.IFirewallEndpoint, + protos.google.cloud.networksecurity.v1.IGetFirewallEndpointRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.networksecurity.v1.IFirewallEndpoint, + protos.google.cloud.networksecurity.v1.IGetFirewallEndpointRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('getFirewallEndpoint request %j', request); + const wrappedCallback: Callback< + protos.google.cloud.networksecurity.v1.IFirewallEndpoint, + protos.google.cloud.networksecurity.v1.IGetFirewallEndpointRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getFirewallEndpoint response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.getFirewallEndpoint(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.cloud.networksecurity.v1.IFirewallEndpoint, + protos.google.cloud.networksecurity.v1.IGetFirewallEndpointRequest|undefined, + {}|undefined + ]) => { + this._log.info('getFirewallEndpoint response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * Gets details of a single FirewallEndpointAssociation. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Name of the resource + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.cloud.networksecurity.v1.FirewallEndpointAssociation|FirewallEndpointAssociation}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1/firewall_activation.get_firewall_endpoint_association.js + * region_tag:networksecurity_v1_generated_FirewallActivation_GetFirewallEndpointAssociation_async + */ + getFirewallEndpointAssociation( + request?: protos.google.cloud.networksecurity.v1.IGetFirewallEndpointAssociationRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.networksecurity.v1.IFirewallEndpointAssociation, + protos.google.cloud.networksecurity.v1.IGetFirewallEndpointAssociationRequest|undefined, {}|undefined + ]>; + getFirewallEndpointAssociation( + request: protos.google.cloud.networksecurity.v1.IGetFirewallEndpointAssociationRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.networksecurity.v1.IFirewallEndpointAssociation, + protos.google.cloud.networksecurity.v1.IGetFirewallEndpointAssociationRequest|null|undefined, + {}|null|undefined>): void; + getFirewallEndpointAssociation( + request: protos.google.cloud.networksecurity.v1.IGetFirewallEndpointAssociationRequest, + callback: Callback< + protos.google.cloud.networksecurity.v1.IFirewallEndpointAssociation, + protos.google.cloud.networksecurity.v1.IGetFirewallEndpointAssociationRequest|null|undefined, + {}|null|undefined>): void; + getFirewallEndpointAssociation( + request?: protos.google.cloud.networksecurity.v1.IGetFirewallEndpointAssociationRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.networksecurity.v1.IFirewallEndpointAssociation, + protos.google.cloud.networksecurity.v1.IGetFirewallEndpointAssociationRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.networksecurity.v1.IFirewallEndpointAssociation, + protos.google.cloud.networksecurity.v1.IGetFirewallEndpointAssociationRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.networksecurity.v1.IFirewallEndpointAssociation, + protos.google.cloud.networksecurity.v1.IGetFirewallEndpointAssociationRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('getFirewallEndpointAssociation request %j', request); + const wrappedCallback: Callback< + protos.google.cloud.networksecurity.v1.IFirewallEndpointAssociation, + protos.google.cloud.networksecurity.v1.IGetFirewallEndpointAssociationRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getFirewallEndpointAssociation response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.getFirewallEndpointAssociation(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.cloud.networksecurity.v1.IFirewallEndpointAssociation, + protos.google.cloud.networksecurity.v1.IGetFirewallEndpointAssociationRequest|undefined, + {}|undefined + ]) => { + this._log.info('getFirewallEndpointAssociation response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } + +/** + * Creates a new FirewallEndpoint in a given organization and location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Value for parent. + * @param {string} request.firewallEndpointId + * Required. Id of the requesting object. + * If auto-generating Id server-side, remove this field and + * firewall_endpoint_id from the method_signature of Create RPC. + * @param {google.cloud.networksecurity.v1.FirewallEndpoint} request.firewallEndpoint + * Required. The resource being created + * @param {string} [request.requestId] + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/firewall_activation.create_firewall_endpoint.js + * region_tag:networksecurity_v1_generated_FirewallActivation_CreateFirewallEndpoint_async + */ + createFirewallEndpoint( + request?: protos.google.cloud.networksecurity.v1.ICreateFirewallEndpointRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + createFirewallEndpoint( + request: protos.google.cloud.networksecurity.v1.ICreateFirewallEndpointRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + createFirewallEndpoint( + request: protos.google.cloud.networksecurity.v1.ICreateFirewallEndpointRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + createFirewallEndpoint( + request?: protos.google.cloud.networksecurity.v1.ICreateFirewallEndpointRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize().catch(err => {throw err}); + const wrappedCallback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('createFirewallEndpoint response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('createFirewallEndpoint request %j', request); + return this.innerApiCalls.createFirewallEndpoint(request, options, wrappedCallback) + ?.then(([response, rawResponse, _]: [ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]) => { + this._log.info('createFirewallEndpoint response %j', rawResponse); + return [response, rawResponse, _]; + }); + } +/** + * Check the status of the long running operation returned by `createFirewallEndpoint()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/firewall_activation.create_firewall_endpoint.js + * region_tag:networksecurity_v1_generated_FirewallActivation_CreateFirewallEndpoint_async + */ + async checkCreateFirewallEndpointProgress(name: string): Promise>{ + this._log.info('createFirewallEndpoint long-running'); + const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.createFirewallEndpoint, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Deletes a single org Endpoint. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Name of the resource + * @param {string} [request.requestId] + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes after the first request. + * + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/firewall_activation.delete_firewall_endpoint.js + * region_tag:networksecurity_v1_generated_FirewallActivation_DeleteFirewallEndpoint_async + */ + deleteFirewallEndpoint( + request?: protos.google.cloud.networksecurity.v1.IDeleteFirewallEndpointRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + deleteFirewallEndpoint( + request: protos.google.cloud.networksecurity.v1.IDeleteFirewallEndpointRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + deleteFirewallEndpoint( + request: protos.google.cloud.networksecurity.v1.IDeleteFirewallEndpointRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + deleteFirewallEndpoint( + request?: protos.google.cloud.networksecurity.v1.IDeleteFirewallEndpointRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize().catch(err => {throw err}); + const wrappedCallback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('deleteFirewallEndpoint response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('deleteFirewallEndpoint request %j', request); + return this.innerApiCalls.deleteFirewallEndpoint(request, options, wrappedCallback) + ?.then(([response, rawResponse, _]: [ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]) => { + this._log.info('deleteFirewallEndpoint response %j', rawResponse); + return [response, rawResponse, _]; + }); + } +/** + * Check the status of the long running operation returned by `deleteFirewallEndpoint()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/firewall_activation.delete_firewall_endpoint.js + * region_tag:networksecurity_v1_generated_FirewallActivation_DeleteFirewallEndpoint_async + */ + async checkDeleteFirewallEndpointProgress(name: string): Promise>{ + this._log.info('deleteFirewallEndpoint long-running'); + const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.deleteFirewallEndpoint, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Update a single org Endpoint. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.protobuf.FieldMask} request.updateMask + * Required. Field mask is used to specify the fields to be overwritten in the + * Endpoint resource by the update. + * The fields specified in the update_mask are relative to the resource, not + * the full request. A field will be overwritten if it is in the mask. If the + * user does not provide a mask then all fields will be overwritten. + * @param {google.cloud.networksecurity.v1.FirewallEndpoint} request.firewallEndpoint + * Required. The resource being updated + * @param {string} [request.requestId] + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/firewall_activation.update_firewall_endpoint.js + * region_tag:networksecurity_v1_generated_FirewallActivation_UpdateFirewallEndpoint_async + */ + updateFirewallEndpoint( + request?: protos.google.cloud.networksecurity.v1.IUpdateFirewallEndpointRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + updateFirewallEndpoint( + request: protos.google.cloud.networksecurity.v1.IUpdateFirewallEndpointRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + updateFirewallEndpoint( + request: protos.google.cloud.networksecurity.v1.IUpdateFirewallEndpointRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + updateFirewallEndpoint( + request?: protos.google.cloud.networksecurity.v1.IUpdateFirewallEndpointRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'firewall_endpoint.name': request.firewallEndpoint!.name ?? '', + }); + this.initialize().catch(err => {throw err}); + const wrappedCallback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('updateFirewallEndpoint response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('updateFirewallEndpoint request %j', request); + return this.innerApiCalls.updateFirewallEndpoint(request, options, wrappedCallback) + ?.then(([response, rawResponse, _]: [ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]) => { + this._log.info('updateFirewallEndpoint response %j', rawResponse); + return [response, rawResponse, _]; + }); + } +/** + * Check the status of the long running operation returned by `updateFirewallEndpoint()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/firewall_activation.update_firewall_endpoint.js + * region_tag:networksecurity_v1_generated_FirewallActivation_UpdateFirewallEndpoint_async + */ + async checkUpdateFirewallEndpointProgress(name: string): Promise>{ + this._log.info('updateFirewallEndpoint long-running'); + const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.updateFirewallEndpoint, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Creates a new FirewallEndpointAssociation in a given project and location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Value for parent. + * @param {string} [request.firewallEndpointAssociationId] + * Optional. Id of the requesting object. + * If auto-generating Id server-side, remove this field and + * firewall_endpoint_association_id from the method_signature of Create RPC. + * @param {google.cloud.networksecurity.v1.FirewallEndpointAssociation} request.firewallEndpointAssociation + * Required. The resource being created + * @param {string} [request.requestId] + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/firewall_activation.create_firewall_endpoint_association.js + * region_tag:networksecurity_v1_generated_FirewallActivation_CreateFirewallEndpointAssociation_async + */ + createFirewallEndpointAssociation( + request?: protos.google.cloud.networksecurity.v1.ICreateFirewallEndpointAssociationRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + createFirewallEndpointAssociation( + request: protos.google.cloud.networksecurity.v1.ICreateFirewallEndpointAssociationRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + createFirewallEndpointAssociation( + request: protos.google.cloud.networksecurity.v1.ICreateFirewallEndpointAssociationRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + createFirewallEndpointAssociation( + request?: protos.google.cloud.networksecurity.v1.ICreateFirewallEndpointAssociationRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize().catch(err => {throw err}); + const wrappedCallback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('createFirewallEndpointAssociation response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('createFirewallEndpointAssociation request %j', request); + return this.innerApiCalls.createFirewallEndpointAssociation(request, options, wrappedCallback) + ?.then(([response, rawResponse, _]: [ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]) => { + this._log.info('createFirewallEndpointAssociation response %j', rawResponse); + return [response, rawResponse, _]; + }); + } +/** + * Check the status of the long running operation returned by `createFirewallEndpointAssociation()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/firewall_activation.create_firewall_endpoint_association.js + * region_tag:networksecurity_v1_generated_FirewallActivation_CreateFirewallEndpointAssociation_async + */ + async checkCreateFirewallEndpointAssociationProgress(name: string): Promise>{ + this._log.info('createFirewallEndpointAssociation long-running'); + const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.createFirewallEndpointAssociation, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Deletes a single FirewallEndpointAssociation. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Name of the resource + * @param {string} [request.requestId] + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes after the first request. + * + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/firewall_activation.delete_firewall_endpoint_association.js + * region_tag:networksecurity_v1_generated_FirewallActivation_DeleteFirewallEndpointAssociation_async + */ + deleteFirewallEndpointAssociation( + request?: protos.google.cloud.networksecurity.v1.IDeleteFirewallEndpointAssociationRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + deleteFirewallEndpointAssociation( + request: protos.google.cloud.networksecurity.v1.IDeleteFirewallEndpointAssociationRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + deleteFirewallEndpointAssociation( + request: protos.google.cloud.networksecurity.v1.IDeleteFirewallEndpointAssociationRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + deleteFirewallEndpointAssociation( + request?: protos.google.cloud.networksecurity.v1.IDeleteFirewallEndpointAssociationRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize().catch(err => {throw err}); + const wrappedCallback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('deleteFirewallEndpointAssociation response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('deleteFirewallEndpointAssociation request %j', request); + return this.innerApiCalls.deleteFirewallEndpointAssociation(request, options, wrappedCallback) + ?.then(([response, rawResponse, _]: [ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]) => { + this._log.info('deleteFirewallEndpointAssociation response %j', rawResponse); + return [response, rawResponse, _]; + }); + } +/** + * Check the status of the long running operation returned by `deleteFirewallEndpointAssociation()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/firewall_activation.delete_firewall_endpoint_association.js + * region_tag:networksecurity_v1_generated_FirewallActivation_DeleteFirewallEndpointAssociation_async + */ + async checkDeleteFirewallEndpointAssociationProgress(name: string): Promise>{ + this._log.info('deleteFirewallEndpointAssociation long-running'); + const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.deleteFirewallEndpointAssociation, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Update a single FirewallEndpointAssociation. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.protobuf.FieldMask} request.updateMask + * Required. Field mask is used to specify the fields to be overwritten in the + * Association resource by the update. + * The fields specified in the update_mask are relative to the resource, not + * the full request. A field will be overwritten if it is in the mask. If the + * user does not provide a mask then all fields will be overwritten. + * @param {google.cloud.networksecurity.v1.FirewallEndpointAssociation} request.firewallEndpointAssociation + * Required. The resource being updated + * @param {string} [request.requestId] + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/firewall_activation.update_firewall_endpoint_association.js + * region_tag:networksecurity_v1_generated_FirewallActivation_UpdateFirewallEndpointAssociation_async + */ + updateFirewallEndpointAssociation( + request?: protos.google.cloud.networksecurity.v1.IUpdateFirewallEndpointAssociationRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + updateFirewallEndpointAssociation( + request: protos.google.cloud.networksecurity.v1.IUpdateFirewallEndpointAssociationRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + updateFirewallEndpointAssociation( + request: protos.google.cloud.networksecurity.v1.IUpdateFirewallEndpointAssociationRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + updateFirewallEndpointAssociation( + request?: protos.google.cloud.networksecurity.v1.IUpdateFirewallEndpointAssociationRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'firewall_endpoint_association.name': request.firewallEndpointAssociation!.name ?? '', + }); + this.initialize().catch(err => {throw err}); + const wrappedCallback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('updateFirewallEndpointAssociation response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('updateFirewallEndpointAssociation request %j', request); + return this.innerApiCalls.updateFirewallEndpointAssociation(request, options, wrappedCallback) + ?.then(([response, rawResponse, _]: [ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]) => { + this._log.info('updateFirewallEndpointAssociation response %j', rawResponse); + return [response, rawResponse, _]; + }); + } +/** + * Check the status of the long running operation returned by `updateFirewallEndpointAssociation()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/firewall_activation.update_firewall_endpoint_association.js + * region_tag:networksecurity_v1_generated_FirewallActivation_UpdateFirewallEndpointAssociation_async + */ + async checkUpdateFirewallEndpointAssociationProgress(name: string): Promise>{ + this._log.info('updateFirewallEndpointAssociation long-running'); + const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.updateFirewallEndpointAssociation, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } + /** + * Lists FirewallEndpoints in a given organization and location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Parent value for ListEndpointsRequest + * @param {number} [request.pageSize] + * Optional. Requested page size. Server may return fewer items than + * requested. If unspecified, server will pick an appropriate default. + * @param {string} request.pageToken + * A token identifying a page of results the server should return. + * @param {string} [request.filter] + * Optional. Filtering results + * @param {string} request.orderBy + * Hint for how to order the results + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of {@link protos.google.cloud.networksecurity.v1.FirewallEndpoint|FirewallEndpoint}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listFirewallEndpointsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listFirewallEndpoints( + request?: protos.google.cloud.networksecurity.v1.IListFirewallEndpointsRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.networksecurity.v1.IFirewallEndpoint[], + protos.google.cloud.networksecurity.v1.IListFirewallEndpointsRequest|null, + protos.google.cloud.networksecurity.v1.IListFirewallEndpointsResponse + ]>; + listFirewallEndpoints( + request: protos.google.cloud.networksecurity.v1.IListFirewallEndpointsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.networksecurity.v1.IListFirewallEndpointsRequest, + protos.google.cloud.networksecurity.v1.IListFirewallEndpointsResponse|null|undefined, + protos.google.cloud.networksecurity.v1.IFirewallEndpoint>): void; + listFirewallEndpoints( + request: protos.google.cloud.networksecurity.v1.IListFirewallEndpointsRequest, + callback: PaginationCallback< + protos.google.cloud.networksecurity.v1.IListFirewallEndpointsRequest, + protos.google.cloud.networksecurity.v1.IListFirewallEndpointsResponse|null|undefined, + protos.google.cloud.networksecurity.v1.IFirewallEndpoint>): void; + listFirewallEndpoints( + request?: protos.google.cloud.networksecurity.v1.IListFirewallEndpointsRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.cloud.networksecurity.v1.IListFirewallEndpointsRequest, + protos.google.cloud.networksecurity.v1.IListFirewallEndpointsResponse|null|undefined, + protos.google.cloud.networksecurity.v1.IFirewallEndpoint>, + callback?: PaginationCallback< + protos.google.cloud.networksecurity.v1.IListFirewallEndpointsRequest, + protos.google.cloud.networksecurity.v1.IListFirewallEndpointsResponse|null|undefined, + protos.google.cloud.networksecurity.v1.IFirewallEndpoint>): + Promise<[ + protos.google.cloud.networksecurity.v1.IFirewallEndpoint[], + protos.google.cloud.networksecurity.v1.IListFirewallEndpointsRequest|null, + protos.google.cloud.networksecurity.v1.IListFirewallEndpointsResponse + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize().catch(err => {throw err}); + const wrappedCallback: PaginationCallback< + protos.google.cloud.networksecurity.v1.IListFirewallEndpointsRequest, + protos.google.cloud.networksecurity.v1.IListFirewallEndpointsResponse|null|undefined, + protos.google.cloud.networksecurity.v1.IFirewallEndpoint>|undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listFirewallEndpoints values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listFirewallEndpoints request %j', request); + return this.innerApiCalls + .listFirewallEndpoints(request, options, wrappedCallback) + ?.then(([response, input, output]: [ + protos.google.cloud.networksecurity.v1.IFirewallEndpoint[], + protos.google.cloud.networksecurity.v1.IListFirewallEndpointsRequest|null, + protos.google.cloud.networksecurity.v1.IListFirewallEndpointsResponse + ]) => { + this._log.info('listFirewallEndpoints values %j', response); + return [response, input, output]; + }); + } + +/** + * Equivalent to `listFirewallEndpoints`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Parent value for ListEndpointsRequest + * @param {number} [request.pageSize] + * Optional. Requested page size. Server may return fewer items than + * requested. If unspecified, server will pick an appropriate default. + * @param {string} request.pageToken + * A token identifying a page of results the server should return. + * @param {string} [request.filter] + * Optional. Filtering results + * @param {string} request.orderBy + * Hint for how to order the results + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing {@link protos.google.cloud.networksecurity.v1.FirewallEndpoint|FirewallEndpoint} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `listFirewallEndpointsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listFirewallEndpointsStream( + request?: protos.google.cloud.networksecurity.v1.IListFirewallEndpointsRequest, + options?: CallOptions): + Transform{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listFirewallEndpoints']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listFirewallEndpoints stream %j', request); + return this.descriptors.page.listFirewallEndpoints.createStream( + this.innerApiCalls.listFirewallEndpoints as GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listFirewallEndpoints`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Parent value for ListEndpointsRequest + * @param {number} [request.pageSize] + * Optional. Requested page size. Server may return fewer items than + * requested. If unspecified, server will pick an appropriate default. + * @param {string} request.pageToken + * A token identifying a page of results the server should return. + * @param {string} [request.filter] + * Optional. Filtering results + * @param {string} request.orderBy + * Hint for how to order the results + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link protos.google.cloud.networksecurity.v1.FirewallEndpoint|FirewallEndpoint}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example include:samples/generated/v1/firewall_activation.list_firewall_endpoints.js + * region_tag:networksecurity_v1_generated_FirewallActivation_ListFirewallEndpoints_async + */ + listFirewallEndpointsAsync( + request?: protos.google.cloud.networksecurity.v1.IListFirewallEndpointsRequest, + options?: CallOptions): + AsyncIterable{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listFirewallEndpoints']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listFirewallEndpoints iterate %j', request); + return this.descriptors.page.listFirewallEndpoints.asyncIterate( + this.innerApiCalls['listFirewallEndpoints'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Lists Associations in a given project and location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Parent value for ListAssociationsRequest + * @param {number} [request.pageSize] + * Optional. Requested page size. Server may return fewer items than + * requested. If unspecified, server will pick an appropriate default. + * @param {string} request.pageToken + * A token identifying a page of results the server should return. + * @param {string} [request.filter] + * Optional. Filtering results + * @param {string} request.orderBy + * Hint for how to order the results + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of {@link protos.google.cloud.networksecurity.v1.FirewallEndpointAssociation|FirewallEndpointAssociation}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listFirewallEndpointAssociationsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listFirewallEndpointAssociations( + request?: protos.google.cloud.networksecurity.v1.IListFirewallEndpointAssociationsRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.networksecurity.v1.IFirewallEndpointAssociation[], + protos.google.cloud.networksecurity.v1.IListFirewallEndpointAssociationsRequest|null, + protos.google.cloud.networksecurity.v1.IListFirewallEndpointAssociationsResponse + ]>; + listFirewallEndpointAssociations( + request: protos.google.cloud.networksecurity.v1.IListFirewallEndpointAssociationsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.networksecurity.v1.IListFirewallEndpointAssociationsRequest, + protos.google.cloud.networksecurity.v1.IListFirewallEndpointAssociationsResponse|null|undefined, + protos.google.cloud.networksecurity.v1.IFirewallEndpointAssociation>): void; + listFirewallEndpointAssociations( + request: protos.google.cloud.networksecurity.v1.IListFirewallEndpointAssociationsRequest, + callback: PaginationCallback< + protos.google.cloud.networksecurity.v1.IListFirewallEndpointAssociationsRequest, + protos.google.cloud.networksecurity.v1.IListFirewallEndpointAssociationsResponse|null|undefined, + protos.google.cloud.networksecurity.v1.IFirewallEndpointAssociation>): void; + listFirewallEndpointAssociations( + request?: protos.google.cloud.networksecurity.v1.IListFirewallEndpointAssociationsRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.cloud.networksecurity.v1.IListFirewallEndpointAssociationsRequest, + protos.google.cloud.networksecurity.v1.IListFirewallEndpointAssociationsResponse|null|undefined, + protos.google.cloud.networksecurity.v1.IFirewallEndpointAssociation>, + callback?: PaginationCallback< + protos.google.cloud.networksecurity.v1.IListFirewallEndpointAssociationsRequest, + protos.google.cloud.networksecurity.v1.IListFirewallEndpointAssociationsResponse|null|undefined, + protos.google.cloud.networksecurity.v1.IFirewallEndpointAssociation>): + Promise<[ + protos.google.cloud.networksecurity.v1.IFirewallEndpointAssociation[], + protos.google.cloud.networksecurity.v1.IListFirewallEndpointAssociationsRequest|null, + protos.google.cloud.networksecurity.v1.IListFirewallEndpointAssociationsResponse + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize().catch(err => {throw err}); + const wrappedCallback: PaginationCallback< + protos.google.cloud.networksecurity.v1.IListFirewallEndpointAssociationsRequest, + protos.google.cloud.networksecurity.v1.IListFirewallEndpointAssociationsResponse|null|undefined, + protos.google.cloud.networksecurity.v1.IFirewallEndpointAssociation>|undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listFirewallEndpointAssociations values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listFirewallEndpointAssociations request %j', request); + return this.innerApiCalls + .listFirewallEndpointAssociations(request, options, wrappedCallback) + ?.then(([response, input, output]: [ + protos.google.cloud.networksecurity.v1.IFirewallEndpointAssociation[], + protos.google.cloud.networksecurity.v1.IListFirewallEndpointAssociationsRequest|null, + protos.google.cloud.networksecurity.v1.IListFirewallEndpointAssociationsResponse + ]) => { + this._log.info('listFirewallEndpointAssociations values %j', response); + return [response, input, output]; + }); + } + +/** + * Equivalent to `listFirewallEndpointAssociations`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Parent value for ListAssociationsRequest + * @param {number} [request.pageSize] + * Optional. Requested page size. Server may return fewer items than + * requested. If unspecified, server will pick an appropriate default. + * @param {string} request.pageToken + * A token identifying a page of results the server should return. + * @param {string} [request.filter] + * Optional. Filtering results + * @param {string} request.orderBy + * Hint for how to order the results + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing {@link protos.google.cloud.networksecurity.v1.FirewallEndpointAssociation|FirewallEndpointAssociation} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `listFirewallEndpointAssociationsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listFirewallEndpointAssociationsStream( + request?: protos.google.cloud.networksecurity.v1.IListFirewallEndpointAssociationsRequest, + options?: CallOptions): + Transform{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listFirewallEndpointAssociations']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listFirewallEndpointAssociations stream %j', request); + return this.descriptors.page.listFirewallEndpointAssociations.createStream( + this.innerApiCalls.listFirewallEndpointAssociations as GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listFirewallEndpointAssociations`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Parent value for ListAssociationsRequest + * @param {number} [request.pageSize] + * Optional. Requested page size. Server may return fewer items than + * requested. If unspecified, server will pick an appropriate default. + * @param {string} request.pageToken + * A token identifying a page of results the server should return. + * @param {string} [request.filter] + * Optional. Filtering results + * @param {string} request.orderBy + * Hint for how to order the results + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link protos.google.cloud.networksecurity.v1.FirewallEndpointAssociation|FirewallEndpointAssociation}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example include:samples/generated/v1/firewall_activation.list_firewall_endpoint_associations.js + * region_tag:networksecurity_v1_generated_FirewallActivation_ListFirewallEndpointAssociations_async + */ + listFirewallEndpointAssociationsAsync( + request?: protos.google.cloud.networksecurity.v1.IListFirewallEndpointAssociationsRequest, + options?: CallOptions): + AsyncIterable{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listFirewallEndpointAssociations']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listFirewallEndpointAssociations iterate %j', request); + return this.descriptors.page.listFirewallEndpointAssociations.asyncIterate( + this.innerApiCalls['listFirewallEndpointAssociations'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } +/** + * Gets the access control policy for a resource. Returns an empty policy + * if the resource exists and does not have a policy set. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.resource + * REQUIRED: The resource for which the policy is being requested. + * See the operation documentation for the appropriate value for this field. + * @param {Object} [request.options] + * OPTIONAL: A `GetPolicyOptions` object for specifying options to + * `GetIamPolicy`. This field is only used by Cloud IAM. + * + * This object should have the same structure as {@link google.iam.v1.GetPolicyOptions | GetPolicyOptions}. + * @param {Object} [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.CallOptions} for the details. + * @param {function(?Error, ?Object)} [callback] + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing {@link google.iam.v1.Policy | Policy}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.iam.v1.Policy | Policy}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + getIamPolicy( + request: IamProtos.google.iam.v1.GetIamPolicyRequest, + options?: + | gax.CallOptions + | Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.GetIamPolicyRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.GetIamPolicyRequest | null | undefined, + {} | null | undefined + > + ):Promise<[IamProtos.google.iam.v1.Policy]> { + return this.iamClient.getIamPolicy(request, options, callback); + } + +/** + * Returns permissions that a caller has on the specified resource. If the + * resource does not exist, this will return an empty set of + * permissions, not a NOT_FOUND error. + * + * Note: This operation is designed to be used for building + * permission-aware UIs and command-line tools, not for authorization + * checking. This operation may "fail open" without warning. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.resource + * REQUIRED: The resource for which the policy detail is being requested. + * See the operation documentation for the appropriate value for this field. + * @param {string[]} request.permissions + * The set of permissions to check for the `resource`. Permissions with + * wildcards (such as '*' or 'storage.*') are not allowed. For more + * information see {@link https://cloud.google.com/iam/docs/overview#permissions | IAM Overview }. + * @param {Object} [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.CallOptions} for the details. + * @param {function(?Error, ?Object)} [callback] + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + setIamPolicy( + request: IamProtos.google.iam.v1.SetIamPolicyRequest, + options?: + | gax.CallOptions + | Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.SetIamPolicyRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.SetIamPolicyRequest | null | undefined, + {} | null | undefined + > + ):Promise<[IamProtos.google.iam.v1.Policy]> { + return this.iamClient.setIamPolicy(request, options, callback); + } + +/** + * Returns permissions that a caller has on the specified resource. If the + * resource does not exist, this will return an empty set of + * permissions, not a NOT_FOUND error. + * + * Note: This operation is designed to be used for building + * permission-aware UIs and command-line tools, not for authorization + * checking. This operation may "fail open" without warning. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.resource + * REQUIRED: The resource for which the policy detail is being requested. + * See the operation documentation for the appropriate value for this field. + * @param {string[]} request.permissions + * The set of permissions to check for the `resource`. Permissions with + * wildcards (such as '*' or 'storage.*') are not allowed. For more + * information see {@link https://cloud.google.com/iam/docs/overview#permissions | IAM Overview }. + * @param {Object} [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.CallOptions} for the details. + * @param {function(?Error, ?Object)} [callback] + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. + * The promise has a method named "cancel" which cancels the ongoing API call. + * + */ + testIamPermissions( + request: IamProtos.google.iam.v1.TestIamPermissionsRequest, + options?: + | gax.CallOptions + | Callback< + IamProtos.google.iam.v1.TestIamPermissionsResponse, + IamProtos.google.iam.v1.TestIamPermissionsRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + IamProtos.google.iam.v1.TestIamPermissionsResponse, + IamProtos.google.iam.v1.TestIamPermissionsRequest | null | undefined, + {} | null | undefined + > + ):Promise<[IamProtos.google.iam.v1.TestIamPermissionsResponse]> { + return this.iamClient.testIamPermissions(request, options, callback); + } + +/** + * Gets information about a location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Resource name for the location. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html | CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.cloud.location.Location | Location}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example + * ``` + * const [response] = await client.getLocation(request); + * ``` + */ + getLocation( + request: LocationProtos.google.cloud.location.IGetLocationRequest, + options?: + | gax.CallOptions + | Callback< + LocationProtos.google.cloud.location.ILocation, + | LocationProtos.google.cloud.location.IGetLocationRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + LocationProtos.google.cloud.location.ILocation, + | LocationProtos.google.cloud.location.IGetLocationRequest + | null + | undefined, + {} | null | undefined + > + ): Promise { + return this.locationsClient.getLocation(request, options, callback); + } + +/** + * Lists information about the supported locations for this service. Returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * The resource that owns the locations collection, if applicable. + * @param {string} request.filter + * The standard list filter. + * @param {number} request.pageSize + * The standard list page size. + * @param {string} request.pageToken + * The standard list page token. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link google.cloud.location.Location | Location}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example + * ``` + * const iterable = client.listLocationsAsync(request); + * for await (const response of iterable) { + * // process response + * } + * ``` + */ + listLocationsAsync( + request: LocationProtos.google.cloud.location.IListLocationsRequest, + options?: CallOptions + ): AsyncIterable { + return this.locationsClient.listLocationsAsync(request, options); + } + +/** + * Gets the latest state of a long-running operation. Clients can use this + * method to poll the operation result at intervals as recommended by the API + * service. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation resource. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions} + * for the details. + * @param {function(?Error, ?Object)=} callback + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing + * {@link google.longrunning.Operation | google.longrunning.Operation}. + * @return {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * {@link google.longrunning.Operation | google.longrunning.Operation}. + * The promise has a method named "cancel" which cancels the ongoing API call. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * const name = ''; + * const [response] = await client.getOperation({name}); + * // doThingsWith(response) + * ``` + */ + getOperation( + request: protos.google.longrunning.GetOperationRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protos.google.longrunning.Operation, + protos.google.longrunning.GetOperationRequest, + {} | null | undefined + >, + callback?: Callback< + protos.google.longrunning.Operation, + protos.google.longrunning.GetOperationRequest, + {} | null | undefined + > + ): Promise<[protos.google.longrunning.Operation]> { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + return this.operationsClient.getOperation(request, options, callback); + } + /** + * Lists operations that match the specified filter in the request. If the + * server doesn't support this method, it returns `UNIMPLEMENTED`. Returns an iterable object. + * + * For-await-of syntax is used with the iterable to recursively get response element on-demand. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation collection. + * @param {string} request.filter - The standard list filter. + * @param {number=} request.pageSize - + * The maximum number of resources contained in the underlying API + * response. If page streaming is performed per-resource, this + * parameter does not affect the return value. If page streaming is + * performed per-page, this determines the maximum number of + * resources in a page. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions} for the + * details. + * @returns {Object} + * An iterable Object that conforms to {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | iteration protocols}. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * for await (const response of client.listOperationsAsync(request)); + * // doThingsWith(response) + * ``` + */ + listOperationsAsync( + request: protos.google.longrunning.ListOperationsRequest, + options?: gax.CallOptions + ): AsyncIterable { + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + return this.operationsClient.listOperationsAsync(request, options); + } + /** + * Starts asynchronous cancellation on a long-running operation. The server + * makes a best effort to cancel the operation, but success is not + * guaranteed. If the server doesn't support this method, it returns + * `google.rpc.Code.UNIMPLEMENTED`. Clients can use + * {@link Operations.GetOperation} or + * other methods to check whether the cancellation succeeded or whether the + * operation completed despite cancellation. On successful cancellation, + * the operation is not deleted; instead, it becomes an operation with + * an {@link Operation.error} value with a {@link google.rpc.Status.code} of + * 1, corresponding to `Code.CANCELLED`. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation resource to be cancelled. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions} for the + * details. + * @param {function(?Error)=} callback + * The function which will be called with the result of the API call. + * @return {Promise} - The promise which resolves when API call finishes. + * The promise has a method named "cancel" which cancels the ongoing API + * call. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * await client.cancelOperation({name: ''}); + * ``` + */ + cancelOperation( + request: protos.google.longrunning.CancelOperationRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protos.google.longrunning.CancelOperationRequest, + protos.google.protobuf.Empty, + {} | undefined | null + >, + callback?: Callback< + protos.google.longrunning.CancelOperationRequest, + protos.google.protobuf.Empty, + {} | undefined | null + > + ): Promise { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + return this.operationsClient.cancelOperation(request, options, callback); + } + + /** + * Deletes a long-running operation. This method indicates that the client is + * no longer interested in the operation result. It does not cancel the + * operation. If the server doesn't support this method, it returns + * `google.rpc.Code.UNIMPLEMENTED`. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation resource to be deleted. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions} + * for the details. + * @param {function(?Error)=} callback + * The function which will be called with the result of the API call. + * @return {Promise} - The promise which resolves when API call finishes. + * The promise has a method named "cancel" which cancels the ongoing API + * call. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * await client.deleteOperation({name: ''}); + * ``` + */ + deleteOperation( + request: protos.google.longrunning.DeleteOperationRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protos.google.protobuf.Empty, + protos.google.longrunning.DeleteOperationRequest, + {} | null | undefined + >, + callback?: Callback< + protos.google.protobuf.Empty, + protos.google.longrunning.DeleteOperationRequest, + {} | null | undefined + > + ): Promise { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + return this.operationsClient.deleteOperation(request, options, callback); + } + + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified authorizationPolicy resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} authorization_policy + * @returns {string} Resource name string. + */ + authorizationPolicyPath(project:string,location:string,authorizationPolicy:string) { + return this.pathTemplates.authorizationPolicyPathTemplate.render({ + project: project, + location: location, + authorization_policy: authorizationPolicy, + }); + } + + /** + * Parse the project from AuthorizationPolicy resource. + * + * @param {string} authorizationPolicyName + * A fully-qualified path representing AuthorizationPolicy resource. + * @returns {string} A string representing the project. + */ + matchProjectFromAuthorizationPolicyName(authorizationPolicyName: string) { + return this.pathTemplates.authorizationPolicyPathTemplate.match(authorizationPolicyName).project; + } + + /** + * Parse the location from AuthorizationPolicy resource. + * + * @param {string} authorizationPolicyName + * A fully-qualified path representing AuthorizationPolicy resource. + * @returns {string} A string representing the location. + */ + matchLocationFromAuthorizationPolicyName(authorizationPolicyName: string) { + return this.pathTemplates.authorizationPolicyPathTemplate.match(authorizationPolicyName).location; + } + + /** + * Parse the authorization_policy from AuthorizationPolicy resource. + * + * @param {string} authorizationPolicyName + * A fully-qualified path representing AuthorizationPolicy resource. + * @returns {string} A string representing the authorization_policy. + */ + matchAuthorizationPolicyFromAuthorizationPolicyName(authorizationPolicyName: string) { + return this.pathTemplates.authorizationPolicyPathTemplate.match(authorizationPolicyName).authorization_policy; + } + + /** + * Return a fully-qualified authzPolicy resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} authz_policy + * @returns {string} Resource name string. + */ + authzPolicyPath(project:string,location:string,authzPolicy:string) { + return this.pathTemplates.authzPolicyPathTemplate.render({ + project: project, + location: location, + authz_policy: authzPolicy, + }); + } + + /** + * Parse the project from AuthzPolicy resource. + * + * @param {string} authzPolicyName + * A fully-qualified path representing AuthzPolicy resource. + * @returns {string} A string representing the project. + */ + matchProjectFromAuthzPolicyName(authzPolicyName: string) { + return this.pathTemplates.authzPolicyPathTemplate.match(authzPolicyName).project; + } + + /** + * Parse the location from AuthzPolicy resource. + * + * @param {string} authzPolicyName + * A fully-qualified path representing AuthzPolicy resource. + * @returns {string} A string representing the location. + */ + matchLocationFromAuthzPolicyName(authzPolicyName: string) { + return this.pathTemplates.authzPolicyPathTemplate.match(authzPolicyName).location; + } + + /** + * Parse the authz_policy from AuthzPolicy resource. + * + * @param {string} authzPolicyName + * A fully-qualified path representing AuthzPolicy resource. + * @returns {string} A string representing the authz_policy. + */ + matchAuthzPolicyFromAuthzPolicyName(authzPolicyName: string) { + return this.pathTemplates.authzPolicyPathTemplate.match(authzPolicyName).authz_policy; + } + + /** + * Return a fully-qualified backendAuthenticationConfig resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} backend_authentication_config + * @returns {string} Resource name string. + */ + backendAuthenticationConfigPath(project:string,location:string,backendAuthenticationConfig:string) { + return this.pathTemplates.backendAuthenticationConfigPathTemplate.render({ + project: project, + location: location, + backend_authentication_config: backendAuthenticationConfig, + }); + } + + /** + * Parse the project from BackendAuthenticationConfig resource. + * + * @param {string} backendAuthenticationConfigName + * A fully-qualified path representing BackendAuthenticationConfig resource. + * @returns {string} A string representing the project. + */ + matchProjectFromBackendAuthenticationConfigName(backendAuthenticationConfigName: string) { + return this.pathTemplates.backendAuthenticationConfigPathTemplate.match(backendAuthenticationConfigName).project; + } + + /** + * Parse the location from BackendAuthenticationConfig resource. + * + * @param {string} backendAuthenticationConfigName + * A fully-qualified path representing BackendAuthenticationConfig resource. + * @returns {string} A string representing the location. + */ + matchLocationFromBackendAuthenticationConfigName(backendAuthenticationConfigName: string) { + return this.pathTemplates.backendAuthenticationConfigPathTemplate.match(backendAuthenticationConfigName).location; + } + + /** + * Parse the backend_authentication_config from BackendAuthenticationConfig resource. + * + * @param {string} backendAuthenticationConfigName + * A fully-qualified path representing BackendAuthenticationConfig resource. + * @returns {string} A string representing the backend_authentication_config. + */ + matchBackendAuthenticationConfigFromBackendAuthenticationConfigName(backendAuthenticationConfigName: string) { + return this.pathTemplates.backendAuthenticationConfigPathTemplate.match(backendAuthenticationConfigName).backend_authentication_config; + } + + /** + * Return a fully-qualified clientTlsPolicy resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} client_tls_policy + * @returns {string} Resource name string. + */ + clientTlsPolicyPath(project:string,location:string,clientTlsPolicy:string) { + return this.pathTemplates.clientTlsPolicyPathTemplate.render({ + project: project, + location: location, + client_tls_policy: clientTlsPolicy, + }); + } + + /** + * Parse the project from ClientTlsPolicy resource. + * + * @param {string} clientTlsPolicyName + * A fully-qualified path representing ClientTlsPolicy resource. + * @returns {string} A string representing the project. + */ + matchProjectFromClientTlsPolicyName(clientTlsPolicyName: string) { + return this.pathTemplates.clientTlsPolicyPathTemplate.match(clientTlsPolicyName).project; + } + + /** + * Parse the location from ClientTlsPolicy resource. + * + * @param {string} clientTlsPolicyName + * A fully-qualified path representing ClientTlsPolicy resource. + * @returns {string} A string representing the location. + */ + matchLocationFromClientTlsPolicyName(clientTlsPolicyName: string) { + return this.pathTemplates.clientTlsPolicyPathTemplate.match(clientTlsPolicyName).location; + } + + /** + * Parse the client_tls_policy from ClientTlsPolicy resource. + * + * @param {string} clientTlsPolicyName + * A fully-qualified path representing ClientTlsPolicy resource. + * @returns {string} A string representing the client_tls_policy. + */ + matchClientTlsPolicyFromClientTlsPolicyName(clientTlsPolicyName: string) { + return this.pathTemplates.clientTlsPolicyPathTemplate.match(clientTlsPolicyName).client_tls_policy; + } + + /** + * Return a fully-qualified dnsThreatDetector resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} dns_threat_detector + * @returns {string} Resource name string. + */ + dnsThreatDetectorPath(project:string,location:string,dnsThreatDetector:string) { + return this.pathTemplates.dnsThreatDetectorPathTemplate.render({ + project: project, + location: location, + dns_threat_detector: dnsThreatDetector, + }); + } + + /** + * Parse the project from DnsThreatDetector resource. + * + * @param {string} dnsThreatDetectorName + * A fully-qualified path representing DnsThreatDetector resource. + * @returns {string} A string representing the project. + */ + matchProjectFromDnsThreatDetectorName(dnsThreatDetectorName: string) { + return this.pathTemplates.dnsThreatDetectorPathTemplate.match(dnsThreatDetectorName).project; + } + + /** + * Parse the location from DnsThreatDetector resource. + * + * @param {string} dnsThreatDetectorName + * A fully-qualified path representing DnsThreatDetector resource. + * @returns {string} A string representing the location. + */ + matchLocationFromDnsThreatDetectorName(dnsThreatDetectorName: string) { + return this.pathTemplates.dnsThreatDetectorPathTemplate.match(dnsThreatDetectorName).location; + } + + /** + * Parse the dns_threat_detector from DnsThreatDetector resource. + * + * @param {string} dnsThreatDetectorName + * A fully-qualified path representing DnsThreatDetector resource. + * @returns {string} A string representing the dns_threat_detector. + */ + matchDnsThreatDetectorFromDnsThreatDetectorName(dnsThreatDetectorName: string) { + return this.pathTemplates.dnsThreatDetectorPathTemplate.match(dnsThreatDetectorName).dns_threat_detector; + } + + /** + * Return a fully-qualified firewallEndpointAssociation resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} firewall_endpoint_association + * @returns {string} Resource name string. + */ + firewallEndpointAssociationPath(project:string,location:string,firewallEndpointAssociation:string) { + return this.pathTemplates.firewallEndpointAssociationPathTemplate.render({ + project: project, + location: location, + firewall_endpoint_association: firewallEndpointAssociation, + }); + } + + /** + * Parse the project from FirewallEndpointAssociation resource. + * + * @param {string} firewallEndpointAssociationName + * A fully-qualified path representing FirewallEndpointAssociation resource. + * @returns {string} A string representing the project. + */ + matchProjectFromFirewallEndpointAssociationName(firewallEndpointAssociationName: string) { + return this.pathTemplates.firewallEndpointAssociationPathTemplate.match(firewallEndpointAssociationName).project; + } + + /** + * Parse the location from FirewallEndpointAssociation resource. + * + * @param {string} firewallEndpointAssociationName + * A fully-qualified path representing FirewallEndpointAssociation resource. + * @returns {string} A string representing the location. + */ + matchLocationFromFirewallEndpointAssociationName(firewallEndpointAssociationName: string) { + return this.pathTemplates.firewallEndpointAssociationPathTemplate.match(firewallEndpointAssociationName).location; + } + + /** + * Parse the firewall_endpoint_association from FirewallEndpointAssociation resource. + * + * @param {string} firewallEndpointAssociationName + * A fully-qualified path representing FirewallEndpointAssociation resource. + * @returns {string} A string representing the firewall_endpoint_association. + */ + matchFirewallEndpointAssociationFromFirewallEndpointAssociationName(firewallEndpointAssociationName: string) { + return this.pathTemplates.firewallEndpointAssociationPathTemplate.match(firewallEndpointAssociationName).firewall_endpoint_association; + } + + /** + * Return a fully-qualified gatewaySecurityPolicy resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} gateway_security_policy + * @returns {string} Resource name string. + */ + gatewaySecurityPolicyPath(project:string,location:string,gatewaySecurityPolicy:string) { + return this.pathTemplates.gatewaySecurityPolicyPathTemplate.render({ + project: project, + location: location, + gateway_security_policy: gatewaySecurityPolicy, + }); + } + + /** + * Parse the project from GatewaySecurityPolicy resource. + * + * @param {string} gatewaySecurityPolicyName + * A fully-qualified path representing GatewaySecurityPolicy resource. + * @returns {string} A string representing the project. + */ + matchProjectFromGatewaySecurityPolicyName(gatewaySecurityPolicyName: string) { + return this.pathTemplates.gatewaySecurityPolicyPathTemplate.match(gatewaySecurityPolicyName).project; + } + + /** + * Parse the location from GatewaySecurityPolicy resource. + * + * @param {string} gatewaySecurityPolicyName + * A fully-qualified path representing GatewaySecurityPolicy resource. + * @returns {string} A string representing the location. + */ + matchLocationFromGatewaySecurityPolicyName(gatewaySecurityPolicyName: string) { + return this.pathTemplates.gatewaySecurityPolicyPathTemplate.match(gatewaySecurityPolicyName).location; + } + + /** + * Parse the gateway_security_policy from GatewaySecurityPolicy resource. + * + * @param {string} gatewaySecurityPolicyName + * A fully-qualified path representing GatewaySecurityPolicy resource. + * @returns {string} A string representing the gateway_security_policy. + */ + matchGatewaySecurityPolicyFromGatewaySecurityPolicyName(gatewaySecurityPolicyName: string) { + return this.pathTemplates.gatewaySecurityPolicyPathTemplate.match(gatewaySecurityPolicyName).gateway_security_policy; + } + + /** + * Return a fully-qualified gatewaySecurityPolicyRule resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} gateway_security_policy + * @param {string} rule + * @returns {string} Resource name string. + */ + gatewaySecurityPolicyRulePath(project:string,location:string,gatewaySecurityPolicy:string,rule:string) { + return this.pathTemplates.gatewaySecurityPolicyRulePathTemplate.render({ + project: project, + location: location, + gateway_security_policy: gatewaySecurityPolicy, + rule: rule, + }); + } + + /** + * Parse the project from GatewaySecurityPolicyRule resource. + * + * @param {string} gatewaySecurityPolicyRuleName + * A fully-qualified path representing GatewaySecurityPolicyRule resource. + * @returns {string} A string representing the project. + */ + matchProjectFromGatewaySecurityPolicyRuleName(gatewaySecurityPolicyRuleName: string) { + return this.pathTemplates.gatewaySecurityPolicyRulePathTemplate.match(gatewaySecurityPolicyRuleName).project; + } + + /** + * Parse the location from GatewaySecurityPolicyRule resource. + * + * @param {string} gatewaySecurityPolicyRuleName + * A fully-qualified path representing GatewaySecurityPolicyRule resource. + * @returns {string} A string representing the location. + */ + matchLocationFromGatewaySecurityPolicyRuleName(gatewaySecurityPolicyRuleName: string) { + return this.pathTemplates.gatewaySecurityPolicyRulePathTemplate.match(gatewaySecurityPolicyRuleName).location; + } + + /** + * Parse the gateway_security_policy from GatewaySecurityPolicyRule resource. + * + * @param {string} gatewaySecurityPolicyRuleName + * A fully-qualified path representing GatewaySecurityPolicyRule resource. + * @returns {string} A string representing the gateway_security_policy. + */ + matchGatewaySecurityPolicyFromGatewaySecurityPolicyRuleName(gatewaySecurityPolicyRuleName: string) { + return this.pathTemplates.gatewaySecurityPolicyRulePathTemplate.match(gatewaySecurityPolicyRuleName).gateway_security_policy; + } + + /** + * Parse the rule from GatewaySecurityPolicyRule resource. + * + * @param {string} gatewaySecurityPolicyRuleName + * A fully-qualified path representing GatewaySecurityPolicyRule resource. + * @returns {string} A string representing the rule. + */ + matchRuleFromGatewaySecurityPolicyRuleName(gatewaySecurityPolicyRuleName: string) { + return this.pathTemplates.gatewaySecurityPolicyRulePathTemplate.match(gatewaySecurityPolicyRuleName).rule; + } + + /** + * Return a fully-qualified interceptDeployment resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} intercept_deployment + * @returns {string} Resource name string. + */ + interceptDeploymentPath(project:string,location:string,interceptDeployment:string) { + return this.pathTemplates.interceptDeploymentPathTemplate.render({ + project: project, + location: location, + intercept_deployment: interceptDeployment, + }); + } + + /** + * Parse the project from InterceptDeployment resource. + * + * @param {string} interceptDeploymentName + * A fully-qualified path representing InterceptDeployment resource. + * @returns {string} A string representing the project. + */ + matchProjectFromInterceptDeploymentName(interceptDeploymentName: string) { + return this.pathTemplates.interceptDeploymentPathTemplate.match(interceptDeploymentName).project; + } + + /** + * Parse the location from InterceptDeployment resource. + * + * @param {string} interceptDeploymentName + * A fully-qualified path representing InterceptDeployment resource. + * @returns {string} A string representing the location. + */ + matchLocationFromInterceptDeploymentName(interceptDeploymentName: string) { + return this.pathTemplates.interceptDeploymentPathTemplate.match(interceptDeploymentName).location; + } + + /** + * Parse the intercept_deployment from InterceptDeployment resource. + * + * @param {string} interceptDeploymentName + * A fully-qualified path representing InterceptDeployment resource. + * @returns {string} A string representing the intercept_deployment. + */ + matchInterceptDeploymentFromInterceptDeploymentName(interceptDeploymentName: string) { + return this.pathTemplates.interceptDeploymentPathTemplate.match(interceptDeploymentName).intercept_deployment; + } + + /** + * Return a fully-qualified interceptDeploymentGroup resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} intercept_deployment_group + * @returns {string} Resource name string. + */ + interceptDeploymentGroupPath(project:string,location:string,interceptDeploymentGroup:string) { + return this.pathTemplates.interceptDeploymentGroupPathTemplate.render({ + project: project, + location: location, + intercept_deployment_group: interceptDeploymentGroup, + }); + } + + /** + * Parse the project from InterceptDeploymentGroup resource. + * + * @param {string} interceptDeploymentGroupName + * A fully-qualified path representing InterceptDeploymentGroup resource. + * @returns {string} A string representing the project. + */ + matchProjectFromInterceptDeploymentGroupName(interceptDeploymentGroupName: string) { + return this.pathTemplates.interceptDeploymentGroupPathTemplate.match(interceptDeploymentGroupName).project; + } + + /** + * Parse the location from InterceptDeploymentGroup resource. + * + * @param {string} interceptDeploymentGroupName + * A fully-qualified path representing InterceptDeploymentGroup resource. + * @returns {string} A string representing the location. + */ + matchLocationFromInterceptDeploymentGroupName(interceptDeploymentGroupName: string) { + return this.pathTemplates.interceptDeploymentGroupPathTemplate.match(interceptDeploymentGroupName).location; + } + + /** + * Parse the intercept_deployment_group from InterceptDeploymentGroup resource. + * + * @param {string} interceptDeploymentGroupName + * A fully-qualified path representing InterceptDeploymentGroup resource. + * @returns {string} A string representing the intercept_deployment_group. + */ + matchInterceptDeploymentGroupFromInterceptDeploymentGroupName(interceptDeploymentGroupName: string) { + return this.pathTemplates.interceptDeploymentGroupPathTemplate.match(interceptDeploymentGroupName).intercept_deployment_group; + } + + /** + * Return a fully-qualified interceptEndpointGroup resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} intercept_endpoint_group + * @returns {string} Resource name string. + */ + interceptEndpointGroupPath(project:string,location:string,interceptEndpointGroup:string) { + return this.pathTemplates.interceptEndpointGroupPathTemplate.render({ + project: project, + location: location, + intercept_endpoint_group: interceptEndpointGroup, + }); + } + + /** + * Parse the project from InterceptEndpointGroup resource. + * + * @param {string} interceptEndpointGroupName + * A fully-qualified path representing InterceptEndpointGroup resource. + * @returns {string} A string representing the project. + */ + matchProjectFromInterceptEndpointGroupName(interceptEndpointGroupName: string) { + return this.pathTemplates.interceptEndpointGroupPathTemplate.match(interceptEndpointGroupName).project; + } + + /** + * Parse the location from InterceptEndpointGroup resource. + * + * @param {string} interceptEndpointGroupName + * A fully-qualified path representing InterceptEndpointGroup resource. + * @returns {string} A string representing the location. + */ + matchLocationFromInterceptEndpointGroupName(interceptEndpointGroupName: string) { + return this.pathTemplates.interceptEndpointGroupPathTemplate.match(interceptEndpointGroupName).location; + } + + /** + * Parse the intercept_endpoint_group from InterceptEndpointGroup resource. + * + * @param {string} interceptEndpointGroupName + * A fully-qualified path representing InterceptEndpointGroup resource. + * @returns {string} A string representing the intercept_endpoint_group. + */ + matchInterceptEndpointGroupFromInterceptEndpointGroupName(interceptEndpointGroupName: string) { + return this.pathTemplates.interceptEndpointGroupPathTemplate.match(interceptEndpointGroupName).intercept_endpoint_group; + } + + /** + * Return a fully-qualified interceptEndpointGroupAssociation resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} intercept_endpoint_group_association + * @returns {string} Resource name string. + */ + interceptEndpointGroupAssociationPath(project:string,location:string,interceptEndpointGroupAssociation:string) { + return this.pathTemplates.interceptEndpointGroupAssociationPathTemplate.render({ + project: project, + location: location, + intercept_endpoint_group_association: interceptEndpointGroupAssociation, + }); + } + + /** + * Parse the project from InterceptEndpointGroupAssociation resource. + * + * @param {string} interceptEndpointGroupAssociationName + * A fully-qualified path representing InterceptEndpointGroupAssociation resource. + * @returns {string} A string representing the project. + */ + matchProjectFromInterceptEndpointGroupAssociationName(interceptEndpointGroupAssociationName: string) { + return this.pathTemplates.interceptEndpointGroupAssociationPathTemplate.match(interceptEndpointGroupAssociationName).project; + } + + /** + * Parse the location from InterceptEndpointGroupAssociation resource. + * + * @param {string} interceptEndpointGroupAssociationName + * A fully-qualified path representing InterceptEndpointGroupAssociation resource. + * @returns {string} A string representing the location. + */ + matchLocationFromInterceptEndpointGroupAssociationName(interceptEndpointGroupAssociationName: string) { + return this.pathTemplates.interceptEndpointGroupAssociationPathTemplate.match(interceptEndpointGroupAssociationName).location; + } + + /** + * Parse the intercept_endpoint_group_association from InterceptEndpointGroupAssociation resource. + * + * @param {string} interceptEndpointGroupAssociationName + * A fully-qualified path representing InterceptEndpointGroupAssociation resource. + * @returns {string} A string representing the intercept_endpoint_group_association. + */ + matchInterceptEndpointGroupAssociationFromInterceptEndpointGroupAssociationName(interceptEndpointGroupAssociationName: string) { + return this.pathTemplates.interceptEndpointGroupAssociationPathTemplate.match(interceptEndpointGroupAssociationName).intercept_endpoint_group_association; + } + + /** + * Return a fully-qualified location resource name string. + * + * @param {string} project + * @param {string} location + * @returns {string} Resource name string. + */ + locationPath(project:string,location:string) { + return this.pathTemplates.locationPathTemplate.render({ + project: project, + location: location, + }); + } + + /** + * Parse the project from Location resource. + * + * @param {string} locationName + * A fully-qualified path representing Location resource. + * @returns {string} A string representing the project. + */ + matchProjectFromLocationName(locationName: string) { + return this.pathTemplates.locationPathTemplate.match(locationName).project; + } + + /** + * Parse the location from Location resource. + * + * @param {string} locationName + * A fully-qualified path representing Location resource. + * @returns {string} A string representing the location. + */ + matchLocationFromLocationName(locationName: string) { + return this.pathTemplates.locationPathTemplate.match(locationName).location; + } + + /** + * Return a fully-qualified mirroringDeployment resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} mirroring_deployment + * @returns {string} Resource name string. + */ + mirroringDeploymentPath(project:string,location:string,mirroringDeployment:string) { + return this.pathTemplates.mirroringDeploymentPathTemplate.render({ + project: project, + location: location, + mirroring_deployment: mirroringDeployment, + }); + } + + /** + * Parse the project from MirroringDeployment resource. + * + * @param {string} mirroringDeploymentName + * A fully-qualified path representing MirroringDeployment resource. + * @returns {string} A string representing the project. + */ + matchProjectFromMirroringDeploymentName(mirroringDeploymentName: string) { + return this.pathTemplates.mirroringDeploymentPathTemplate.match(mirroringDeploymentName).project; + } + + /** + * Parse the location from MirroringDeployment resource. + * + * @param {string} mirroringDeploymentName + * A fully-qualified path representing MirroringDeployment resource. + * @returns {string} A string representing the location. + */ + matchLocationFromMirroringDeploymentName(mirroringDeploymentName: string) { + return this.pathTemplates.mirroringDeploymentPathTemplate.match(mirroringDeploymentName).location; + } + + /** + * Parse the mirroring_deployment from MirroringDeployment resource. + * + * @param {string} mirroringDeploymentName + * A fully-qualified path representing MirroringDeployment resource. + * @returns {string} A string representing the mirroring_deployment. + */ + matchMirroringDeploymentFromMirroringDeploymentName(mirroringDeploymentName: string) { + return this.pathTemplates.mirroringDeploymentPathTemplate.match(mirroringDeploymentName).mirroring_deployment; + } + + /** + * Return a fully-qualified mirroringDeploymentGroup resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} mirroring_deployment_group + * @returns {string} Resource name string. + */ + mirroringDeploymentGroupPath(project:string,location:string,mirroringDeploymentGroup:string) { + return this.pathTemplates.mirroringDeploymentGroupPathTemplate.render({ + project: project, + location: location, + mirroring_deployment_group: mirroringDeploymentGroup, + }); + } + + /** + * Parse the project from MirroringDeploymentGroup resource. + * + * @param {string} mirroringDeploymentGroupName + * A fully-qualified path representing MirroringDeploymentGroup resource. + * @returns {string} A string representing the project. + */ + matchProjectFromMirroringDeploymentGroupName(mirroringDeploymentGroupName: string) { + return this.pathTemplates.mirroringDeploymentGroupPathTemplate.match(mirroringDeploymentGroupName).project; + } + + /** + * Parse the location from MirroringDeploymentGroup resource. + * + * @param {string} mirroringDeploymentGroupName + * A fully-qualified path representing MirroringDeploymentGroup resource. + * @returns {string} A string representing the location. + */ + matchLocationFromMirroringDeploymentGroupName(mirroringDeploymentGroupName: string) { + return this.pathTemplates.mirroringDeploymentGroupPathTemplate.match(mirroringDeploymentGroupName).location; + } + + /** + * Parse the mirroring_deployment_group from MirroringDeploymentGroup resource. + * + * @param {string} mirroringDeploymentGroupName + * A fully-qualified path representing MirroringDeploymentGroup resource. + * @returns {string} A string representing the mirroring_deployment_group. + */ + matchMirroringDeploymentGroupFromMirroringDeploymentGroupName(mirroringDeploymentGroupName: string) { + return this.pathTemplates.mirroringDeploymentGroupPathTemplate.match(mirroringDeploymentGroupName).mirroring_deployment_group; + } + + /** + * Return a fully-qualified mirroringEndpointGroup resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} mirroring_endpoint_group + * @returns {string} Resource name string. + */ + mirroringEndpointGroupPath(project:string,location:string,mirroringEndpointGroup:string) { + return this.pathTemplates.mirroringEndpointGroupPathTemplate.render({ + project: project, + location: location, + mirroring_endpoint_group: mirroringEndpointGroup, + }); + } + + /** + * Parse the project from MirroringEndpointGroup resource. + * + * @param {string} mirroringEndpointGroupName + * A fully-qualified path representing MirroringEndpointGroup resource. + * @returns {string} A string representing the project. + */ + matchProjectFromMirroringEndpointGroupName(mirroringEndpointGroupName: string) { + return this.pathTemplates.mirroringEndpointGroupPathTemplate.match(mirroringEndpointGroupName).project; + } + + /** + * Parse the location from MirroringEndpointGroup resource. + * + * @param {string} mirroringEndpointGroupName + * A fully-qualified path representing MirroringEndpointGroup resource. + * @returns {string} A string representing the location. + */ + matchLocationFromMirroringEndpointGroupName(mirroringEndpointGroupName: string) { + return this.pathTemplates.mirroringEndpointGroupPathTemplate.match(mirroringEndpointGroupName).location; + } + + /** + * Parse the mirroring_endpoint_group from MirroringEndpointGroup resource. + * + * @param {string} mirroringEndpointGroupName + * A fully-qualified path representing MirroringEndpointGroup resource. + * @returns {string} A string representing the mirroring_endpoint_group. + */ + matchMirroringEndpointGroupFromMirroringEndpointGroupName(mirroringEndpointGroupName: string) { + return this.pathTemplates.mirroringEndpointGroupPathTemplate.match(mirroringEndpointGroupName).mirroring_endpoint_group; + } + + /** + * Return a fully-qualified mirroringEndpointGroupAssociation resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} mirroring_endpoint_group_association + * @returns {string} Resource name string. + */ + mirroringEndpointGroupAssociationPath(project:string,location:string,mirroringEndpointGroupAssociation:string) { + return this.pathTemplates.mirroringEndpointGroupAssociationPathTemplate.render({ + project: project, + location: location, + mirroring_endpoint_group_association: mirroringEndpointGroupAssociation, + }); + } + + /** + * Parse the project from MirroringEndpointGroupAssociation resource. + * + * @param {string} mirroringEndpointGroupAssociationName + * A fully-qualified path representing MirroringEndpointGroupAssociation resource. + * @returns {string} A string representing the project. + */ + matchProjectFromMirroringEndpointGroupAssociationName(mirroringEndpointGroupAssociationName: string) { + return this.pathTemplates.mirroringEndpointGroupAssociationPathTemplate.match(mirroringEndpointGroupAssociationName).project; + } + + /** + * Parse the location from MirroringEndpointGroupAssociation resource. + * + * @param {string} mirroringEndpointGroupAssociationName + * A fully-qualified path representing MirroringEndpointGroupAssociation resource. + * @returns {string} A string representing the location. + */ + matchLocationFromMirroringEndpointGroupAssociationName(mirroringEndpointGroupAssociationName: string) { + return this.pathTemplates.mirroringEndpointGroupAssociationPathTemplate.match(mirroringEndpointGroupAssociationName).location; + } + + /** + * Parse the mirroring_endpoint_group_association from MirroringEndpointGroupAssociation resource. + * + * @param {string} mirroringEndpointGroupAssociationName + * A fully-qualified path representing MirroringEndpointGroupAssociation resource. + * @returns {string} A string representing the mirroring_endpoint_group_association. + */ + matchMirroringEndpointGroupAssociationFromMirroringEndpointGroupAssociationName(mirroringEndpointGroupAssociationName: string) { + return this.pathTemplates.mirroringEndpointGroupAssociationPathTemplate.match(mirroringEndpointGroupAssociationName).mirroring_endpoint_group_association; + } + + /** + * Return a fully-qualified organization resource name string. + * + * @param {string} organization + * @returns {string} Resource name string. + */ + organizationPath(organization:string) { + return this.pathTemplates.organizationPathTemplate.render({ + organization: organization, + }); + } + + /** + * Parse the organization from Organization resource. + * + * @param {string} organizationName + * A fully-qualified path representing Organization resource. + * @returns {string} A string representing the organization. + */ + matchOrganizationFromOrganizationName(organizationName: string) { + return this.pathTemplates.organizationPathTemplate.match(organizationName).organization; + } + + /** + * Return a fully-qualified organizationLocation resource name string. + * + * @param {string} organization + * @param {string} location + * @returns {string} Resource name string. + */ + organizationLocationPath(organization:string,location:string) { + return this.pathTemplates.organizationLocationPathTemplate.render({ + organization: organization, + location: location, + }); + } + + /** + * Parse the organization from OrganizationLocation resource. + * + * @param {string} organizationLocationName + * A fully-qualified path representing OrganizationLocation resource. + * @returns {string} A string representing the organization. + */ + matchOrganizationFromOrganizationLocationName(organizationLocationName: string) { + return this.pathTemplates.organizationLocationPathTemplate.match(organizationLocationName).organization; + } + + /** + * Parse the location from OrganizationLocation resource. + * + * @param {string} organizationLocationName + * A fully-qualified path representing OrganizationLocation resource. + * @returns {string} A string representing the location. + */ + matchLocationFromOrganizationLocationName(organizationLocationName: string) { + return this.pathTemplates.organizationLocationPathTemplate.match(organizationLocationName).location; + } + + /** + * Return a fully-qualified organizationLocationAddressGroup resource name string. + * + * @param {string} organization + * @param {string} location + * @param {string} address_group + * @returns {string} Resource name string. + */ + organizationLocationAddressGroupPath(organization:string,location:string,addressGroup:string) { + return this.pathTemplates.organizationLocationAddressGroupPathTemplate.render({ + organization: organization, + location: location, + address_group: addressGroup, + }); + } + + /** + * Parse the organization from OrganizationLocationAddressGroup resource. + * + * @param {string} organizationLocationAddressGroupName + * A fully-qualified path representing organization_location_address_group resource. + * @returns {string} A string representing the organization. + */ + matchOrganizationFromOrganizationLocationAddressGroupName(organizationLocationAddressGroupName: string) { + return this.pathTemplates.organizationLocationAddressGroupPathTemplate.match(organizationLocationAddressGroupName).organization; + } + + /** + * Parse the location from OrganizationLocationAddressGroup resource. + * + * @param {string} organizationLocationAddressGroupName + * A fully-qualified path representing organization_location_address_group resource. + * @returns {string} A string representing the location. + */ + matchLocationFromOrganizationLocationAddressGroupName(organizationLocationAddressGroupName: string) { + return this.pathTemplates.organizationLocationAddressGroupPathTemplate.match(organizationLocationAddressGroupName).location; + } + + /** + * Parse the address_group from OrganizationLocationAddressGroup resource. + * + * @param {string} organizationLocationAddressGroupName + * A fully-qualified path representing organization_location_address_group resource. + * @returns {string} A string representing the address_group. + */ + matchAddressGroupFromOrganizationLocationAddressGroupName(organizationLocationAddressGroupName: string) { + return this.pathTemplates.organizationLocationAddressGroupPathTemplate.match(organizationLocationAddressGroupName).address_group; + } + + /** + * Return a fully-qualified organizationLocationFirewallEndpoints resource name string. + * + * @param {string} organization + * @param {string} location + * @param {string} firewall_endpoint + * @returns {string} Resource name string. + */ + organizationLocationFirewallEndpointsPath(organization:string,location:string,firewallEndpoint:string) { + return this.pathTemplates.organizationLocationFirewallEndpointsPathTemplate.render({ + organization: organization, + location: location, + firewall_endpoint: firewallEndpoint, + }); + } + + /** + * Parse the organization from OrganizationLocationFirewallEndpoints resource. + * + * @param {string} organizationLocationFirewallEndpointsName + * A fully-qualified path representing organization_location_firewallEndpoints resource. + * @returns {string} A string representing the organization. + */ + matchOrganizationFromOrganizationLocationFirewallEndpointsName(organizationLocationFirewallEndpointsName: string) { + return this.pathTemplates.organizationLocationFirewallEndpointsPathTemplate.match(organizationLocationFirewallEndpointsName).organization; + } + + /** + * Parse the location from OrganizationLocationFirewallEndpoints resource. + * + * @param {string} organizationLocationFirewallEndpointsName + * A fully-qualified path representing organization_location_firewallEndpoints resource. + * @returns {string} A string representing the location. + */ + matchLocationFromOrganizationLocationFirewallEndpointsName(organizationLocationFirewallEndpointsName: string) { + return this.pathTemplates.organizationLocationFirewallEndpointsPathTemplate.match(organizationLocationFirewallEndpointsName).location; + } + + /** + * Parse the firewall_endpoint from OrganizationLocationFirewallEndpoints resource. + * + * @param {string} organizationLocationFirewallEndpointsName + * A fully-qualified path representing organization_location_firewallEndpoints resource. + * @returns {string} A string representing the firewall_endpoint. + */ + matchFirewallEndpointFromOrganizationLocationFirewallEndpointsName(organizationLocationFirewallEndpointsName: string) { + return this.pathTemplates.organizationLocationFirewallEndpointsPathTemplate.match(organizationLocationFirewallEndpointsName).firewall_endpoint; + } + + /** + * Return a fully-qualified organizationLocationSecurityProfile resource name string. + * + * @param {string} organization + * @param {string} location + * @param {string} security_profile + * @returns {string} Resource name string. + */ + organizationLocationSecurityProfilePath(organization:string,location:string,securityProfile:string) { + return this.pathTemplates.organizationLocationSecurityProfilePathTemplate.render({ + organization: organization, + location: location, + security_profile: securityProfile, + }); + } + + /** + * Parse the organization from OrganizationLocationSecurityProfile resource. + * + * @param {string} organizationLocationSecurityProfileName + * A fully-qualified path representing organization_location_security_profile resource. + * @returns {string} A string representing the organization. + */ + matchOrganizationFromOrganizationLocationSecurityProfileName(organizationLocationSecurityProfileName: string) { + return this.pathTemplates.organizationLocationSecurityProfilePathTemplate.match(organizationLocationSecurityProfileName).organization; + } + + /** + * Parse the location from OrganizationLocationSecurityProfile resource. + * + * @param {string} organizationLocationSecurityProfileName + * A fully-qualified path representing organization_location_security_profile resource. + * @returns {string} A string representing the location. + */ + matchLocationFromOrganizationLocationSecurityProfileName(organizationLocationSecurityProfileName: string) { + return this.pathTemplates.organizationLocationSecurityProfilePathTemplate.match(organizationLocationSecurityProfileName).location; + } + + /** + * Parse the security_profile from OrganizationLocationSecurityProfile resource. + * + * @param {string} organizationLocationSecurityProfileName + * A fully-qualified path representing organization_location_security_profile resource. + * @returns {string} A string representing the security_profile. + */ + matchSecurityProfileFromOrganizationLocationSecurityProfileName(organizationLocationSecurityProfileName: string) { + return this.pathTemplates.organizationLocationSecurityProfilePathTemplate.match(organizationLocationSecurityProfileName).security_profile; + } + + /** + * Return a fully-qualified organizationLocationSecurityProfileGroup resource name string. + * + * @param {string} organization + * @param {string} location + * @param {string} security_profile_group + * @returns {string} Resource name string. + */ + organizationLocationSecurityProfileGroupPath(organization:string,location:string,securityProfileGroup:string) { + return this.pathTemplates.organizationLocationSecurityProfileGroupPathTemplate.render({ + organization: organization, + location: location, + security_profile_group: securityProfileGroup, + }); + } + + /** + * Parse the organization from OrganizationLocationSecurityProfileGroup resource. + * + * @param {string} organizationLocationSecurityProfileGroupName + * A fully-qualified path representing organization_location_security_profile_group resource. + * @returns {string} A string representing the organization. + */ + matchOrganizationFromOrganizationLocationSecurityProfileGroupName(organizationLocationSecurityProfileGroupName: string) { + return this.pathTemplates.organizationLocationSecurityProfileGroupPathTemplate.match(organizationLocationSecurityProfileGroupName).organization; + } + + /** + * Parse the location from OrganizationLocationSecurityProfileGroup resource. + * + * @param {string} organizationLocationSecurityProfileGroupName + * A fully-qualified path representing organization_location_security_profile_group resource. + * @returns {string} A string representing the location. + */ + matchLocationFromOrganizationLocationSecurityProfileGroupName(organizationLocationSecurityProfileGroupName: string) { + return this.pathTemplates.organizationLocationSecurityProfileGroupPathTemplate.match(organizationLocationSecurityProfileGroupName).location; + } + + /** + * Parse the security_profile_group from OrganizationLocationSecurityProfileGroup resource. + * + * @param {string} organizationLocationSecurityProfileGroupName + * A fully-qualified path representing organization_location_security_profile_group resource. + * @returns {string} A string representing the security_profile_group. + */ + matchSecurityProfileGroupFromOrganizationLocationSecurityProfileGroupName(organizationLocationSecurityProfileGroupName: string) { + return this.pathTemplates.organizationLocationSecurityProfileGroupPathTemplate.match(organizationLocationSecurityProfileGroupName).security_profile_group; + } + + /** + * Return a fully-qualified project resource name string. + * + * @param {string} project + * @returns {string} Resource name string. + */ + projectPath(project:string) { + return this.pathTemplates.projectPathTemplate.render({ + project: project, + }); + } + + /** + * Parse the project from Project resource. + * + * @param {string} projectName + * A fully-qualified path representing Project resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectName(projectName: string) { + return this.pathTemplates.projectPathTemplate.match(projectName).project; + } + + /** + * Return a fully-qualified projectLocationAddressGroup resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} address_group + * @returns {string} Resource name string. + */ + projectLocationAddressGroupPath(project:string,location:string,addressGroup:string) { + return this.pathTemplates.projectLocationAddressGroupPathTemplate.render({ + project: project, + location: location, + address_group: addressGroup, + }); + } + + /** + * Parse the project from ProjectLocationAddressGroup resource. + * + * @param {string} projectLocationAddressGroupName + * A fully-qualified path representing project_location_address_group resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationAddressGroupName(projectLocationAddressGroupName: string) { + return this.pathTemplates.projectLocationAddressGroupPathTemplate.match(projectLocationAddressGroupName).project; + } + + /** + * Parse the location from ProjectLocationAddressGroup resource. + * + * @param {string} projectLocationAddressGroupName + * A fully-qualified path representing project_location_address_group resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationAddressGroupName(projectLocationAddressGroupName: string) { + return this.pathTemplates.projectLocationAddressGroupPathTemplate.match(projectLocationAddressGroupName).location; + } + + /** + * Parse the address_group from ProjectLocationAddressGroup resource. + * + * @param {string} projectLocationAddressGroupName + * A fully-qualified path representing project_location_address_group resource. + * @returns {string} A string representing the address_group. + */ + matchAddressGroupFromProjectLocationAddressGroupName(projectLocationAddressGroupName: string) { + return this.pathTemplates.projectLocationAddressGroupPathTemplate.match(projectLocationAddressGroupName).address_group; + } + + /** + * Return a fully-qualified projectLocationFirewallEndpoints resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} firewall_endpoint + * @returns {string} Resource name string. + */ + projectLocationFirewallEndpointsPath(project:string,location:string,firewallEndpoint:string) { + return this.pathTemplates.projectLocationFirewallEndpointsPathTemplate.render({ + project: project, + location: location, + firewall_endpoint: firewallEndpoint, + }); + } + + /** + * Parse the project from ProjectLocationFirewallEndpoints resource. + * + * @param {string} projectLocationFirewallEndpointsName + * A fully-qualified path representing project_location_firewallEndpoints resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationFirewallEndpointsName(projectLocationFirewallEndpointsName: string) { + return this.pathTemplates.projectLocationFirewallEndpointsPathTemplate.match(projectLocationFirewallEndpointsName).project; + } + + /** + * Parse the location from ProjectLocationFirewallEndpoints resource. + * + * @param {string} projectLocationFirewallEndpointsName + * A fully-qualified path representing project_location_firewallEndpoints resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationFirewallEndpointsName(projectLocationFirewallEndpointsName: string) { + return this.pathTemplates.projectLocationFirewallEndpointsPathTemplate.match(projectLocationFirewallEndpointsName).location; + } + + /** + * Parse the firewall_endpoint from ProjectLocationFirewallEndpoints resource. + * + * @param {string} projectLocationFirewallEndpointsName + * A fully-qualified path representing project_location_firewallEndpoints resource. + * @returns {string} A string representing the firewall_endpoint. + */ + matchFirewallEndpointFromProjectLocationFirewallEndpointsName(projectLocationFirewallEndpointsName: string) { + return this.pathTemplates.projectLocationFirewallEndpointsPathTemplate.match(projectLocationFirewallEndpointsName).firewall_endpoint; + } + + /** + * Return a fully-qualified projectLocationSecurityProfile resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} security_profile + * @returns {string} Resource name string. + */ + projectLocationSecurityProfilePath(project:string,location:string,securityProfile:string) { + return this.pathTemplates.projectLocationSecurityProfilePathTemplate.render({ + project: project, + location: location, + security_profile: securityProfile, + }); + } + + /** + * Parse the project from ProjectLocationSecurityProfile resource. + * + * @param {string} projectLocationSecurityProfileName + * A fully-qualified path representing project_location_security_profile resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationSecurityProfileName(projectLocationSecurityProfileName: string) { + return this.pathTemplates.projectLocationSecurityProfilePathTemplate.match(projectLocationSecurityProfileName).project; + } + + /** + * Parse the location from ProjectLocationSecurityProfile resource. + * + * @param {string} projectLocationSecurityProfileName + * A fully-qualified path representing project_location_security_profile resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationSecurityProfileName(projectLocationSecurityProfileName: string) { + return this.pathTemplates.projectLocationSecurityProfilePathTemplate.match(projectLocationSecurityProfileName).location; + } + + /** + * Parse the security_profile from ProjectLocationSecurityProfile resource. + * + * @param {string} projectLocationSecurityProfileName + * A fully-qualified path representing project_location_security_profile resource. + * @returns {string} A string representing the security_profile. + */ + matchSecurityProfileFromProjectLocationSecurityProfileName(projectLocationSecurityProfileName: string) { + return this.pathTemplates.projectLocationSecurityProfilePathTemplate.match(projectLocationSecurityProfileName).security_profile; + } + + /** + * Return a fully-qualified projectLocationSecurityProfileGroup resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} security_profile_group + * @returns {string} Resource name string. + */ + projectLocationSecurityProfileGroupPath(project:string,location:string,securityProfileGroup:string) { + return this.pathTemplates.projectLocationSecurityProfileGroupPathTemplate.render({ + project: project, + location: location, + security_profile_group: securityProfileGroup, + }); + } + + /** + * Parse the project from ProjectLocationSecurityProfileGroup resource. + * + * @param {string} projectLocationSecurityProfileGroupName + * A fully-qualified path representing project_location_security_profile_group resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationSecurityProfileGroupName(projectLocationSecurityProfileGroupName: string) { + return this.pathTemplates.projectLocationSecurityProfileGroupPathTemplate.match(projectLocationSecurityProfileGroupName).project; + } + + /** + * Parse the location from ProjectLocationSecurityProfileGroup resource. + * + * @param {string} projectLocationSecurityProfileGroupName + * A fully-qualified path representing project_location_security_profile_group resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationSecurityProfileGroupName(projectLocationSecurityProfileGroupName: string) { + return this.pathTemplates.projectLocationSecurityProfileGroupPathTemplate.match(projectLocationSecurityProfileGroupName).location; + } + + /** + * Parse the security_profile_group from ProjectLocationSecurityProfileGroup resource. + * + * @param {string} projectLocationSecurityProfileGroupName + * A fully-qualified path representing project_location_security_profile_group resource. + * @returns {string} A string representing the security_profile_group. + */ + matchSecurityProfileGroupFromProjectLocationSecurityProfileGroupName(projectLocationSecurityProfileGroupName: string) { + return this.pathTemplates.projectLocationSecurityProfileGroupPathTemplate.match(projectLocationSecurityProfileGroupName).security_profile_group; + } + + /** + * Return a fully-qualified serverTlsPolicy resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} server_tls_policy + * @returns {string} Resource name string. + */ + serverTlsPolicyPath(project:string,location:string,serverTlsPolicy:string) { + return this.pathTemplates.serverTlsPolicyPathTemplate.render({ + project: project, + location: location, + server_tls_policy: serverTlsPolicy, + }); + } + + /** + * Parse the project from ServerTlsPolicy resource. + * + * @param {string} serverTlsPolicyName + * A fully-qualified path representing ServerTlsPolicy resource. + * @returns {string} A string representing the project. + */ + matchProjectFromServerTlsPolicyName(serverTlsPolicyName: string) { + return this.pathTemplates.serverTlsPolicyPathTemplate.match(serverTlsPolicyName).project; + } + + /** + * Parse the location from ServerTlsPolicy resource. + * + * @param {string} serverTlsPolicyName + * A fully-qualified path representing ServerTlsPolicy resource. + * @returns {string} A string representing the location. + */ + matchLocationFromServerTlsPolicyName(serverTlsPolicyName: string) { + return this.pathTemplates.serverTlsPolicyPathTemplate.match(serverTlsPolicyName).location; + } + + /** + * Parse the server_tls_policy from ServerTlsPolicy resource. + * + * @param {string} serverTlsPolicyName + * A fully-qualified path representing ServerTlsPolicy resource. + * @returns {string} A string representing the server_tls_policy. + */ + matchServerTlsPolicyFromServerTlsPolicyName(serverTlsPolicyName: string) { + return this.pathTemplates.serverTlsPolicyPathTemplate.match(serverTlsPolicyName).server_tls_policy; + } + + /** + * Return a fully-qualified tlsInspectionPolicy resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} tls_inspection_policy + * @returns {string} Resource name string. + */ + tlsInspectionPolicyPath(project:string,location:string,tlsInspectionPolicy:string) { + return this.pathTemplates.tlsInspectionPolicyPathTemplate.render({ + project: project, + location: location, + tls_inspection_policy: tlsInspectionPolicy, + }); + } + + /** + * Parse the project from TlsInspectionPolicy resource. + * + * @param {string} tlsInspectionPolicyName + * A fully-qualified path representing TlsInspectionPolicy resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTlsInspectionPolicyName(tlsInspectionPolicyName: string) { + return this.pathTemplates.tlsInspectionPolicyPathTemplate.match(tlsInspectionPolicyName).project; + } + + /** + * Parse the location from TlsInspectionPolicy resource. + * + * @param {string} tlsInspectionPolicyName + * A fully-qualified path representing TlsInspectionPolicy resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTlsInspectionPolicyName(tlsInspectionPolicyName: string) { + return this.pathTemplates.tlsInspectionPolicyPathTemplate.match(tlsInspectionPolicyName).location; + } + + /** + * Parse the tls_inspection_policy from TlsInspectionPolicy resource. + * + * @param {string} tlsInspectionPolicyName + * A fully-qualified path representing TlsInspectionPolicy resource. + * @returns {string} A string representing the tls_inspection_policy. + */ + matchTlsInspectionPolicyFromTlsInspectionPolicyName(tlsInspectionPolicyName: string) { + return this.pathTemplates.tlsInspectionPolicyPathTemplate.match(tlsInspectionPolicyName).tls_inspection_policy; + } + + /** + * Return a fully-qualified urlList resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} url_list + * @returns {string} Resource name string. + */ + urlListPath(project:string,location:string,urlList:string) { + return this.pathTemplates.urlListPathTemplate.render({ + project: project, + location: location, + url_list: urlList, + }); + } + + /** + * Parse the project from UrlList resource. + * + * @param {string} urlListName + * A fully-qualified path representing UrlList resource. + * @returns {string} A string representing the project. + */ + matchProjectFromUrlListName(urlListName: string) { + return this.pathTemplates.urlListPathTemplate.match(urlListName).project; + } + + /** + * Parse the location from UrlList resource. + * + * @param {string} urlListName + * A fully-qualified path representing UrlList resource. + * @returns {string} A string representing the location. + */ + matchLocationFromUrlListName(urlListName: string) { + return this.pathTemplates.urlListPathTemplate.match(urlListName).location; + } + + /** + * Parse the url_list from UrlList resource. + * + * @param {string} urlListName + * A fully-qualified path representing UrlList resource. + * @returns {string} A string representing the url_list. + */ + matchUrlListFromUrlListName(urlListName: string) { + return this.pathTemplates.urlListPathTemplate.match(urlListName).url_list; + } + + /** + * Terminate the gRPC channel and close the client. + * + * The client will no longer be usable and all future behavior is undefined. + * @returns {Promise} A promise that resolves when the client is closed. + */ + close(): Promise { + if (this.firewallActivationStub && !this._terminated) { + return this.firewallActivationStub.then(stub => { + this._log.info('ending gRPC channel'); + this._terminated = true; + stub.close(); + this.iamClient.close().catch(err => {throw err}); + this.locationsClient.close().catch(err => {throw err}); + void this.operationsClient.close(); + }); + } + return Promise.resolve(); + } +} \ No newline at end of file diff --git a/packages/google-cloud-networksecurity/src/v1/firewall_activation_client_config.json b/packages/google-cloud-networksecurity/src/v1/firewall_activation_client_config.json new file mode 100644 index 00000000000..703c4399730 --- /dev/null +++ b/packages/google-cloud-networksecurity/src/v1/firewall_activation_client_config.json @@ -0,0 +1,66 @@ +{ + "interfaces": { + "google.cloud.networksecurity.v1.FirewallActivation": { + "retry_codes": { + "non_idempotent": [], + "idempotent": [ + "DEADLINE_EXCEEDED", + "UNAVAILABLE" + ] + }, + "retry_params": { + "default": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + } + }, + "methods": { + "ListFirewallEndpoints": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetFirewallEndpoint": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "CreateFirewallEndpoint": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteFirewallEndpoint": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UpdateFirewallEndpoint": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListFirewallEndpointAssociations": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetFirewallEndpointAssociation": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "CreateFirewallEndpointAssociation": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteFirewallEndpointAssociation": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UpdateFirewallEndpointAssociation": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/packages/google-cloud-networksecurity/src/v1/firewall_activation_proto_list.json b/packages/google-cloud-networksecurity/src/v1/firewall_activation_proto_list.json new file mode 100644 index 00000000000..1451adf6674 --- /dev/null +++ b/packages/google-cloud-networksecurity/src/v1/firewall_activation_proto_list.json @@ -0,0 +1,25 @@ +[ + "../../protos/google/cloud/networksecurity/v1/address_group.proto", + "../../protos/google/cloud/networksecurity/v1/authorization_policy.proto", + "../../protos/google/cloud/networksecurity/v1/authz_policy.proto", + "../../protos/google/cloud/networksecurity/v1/backend_authentication_config.proto", + "../../protos/google/cloud/networksecurity/v1/client_tls_policy.proto", + "../../protos/google/cloud/networksecurity/v1/common.proto", + "../../protos/google/cloud/networksecurity/v1/dns_threat_detector.proto", + "../../protos/google/cloud/networksecurity/v1/firewall_activation.proto", + "../../protos/google/cloud/networksecurity/v1/gateway_security_policy.proto", + "../../protos/google/cloud/networksecurity/v1/gateway_security_policy_rule.proto", + "../../protos/google/cloud/networksecurity/v1/intercept.proto", + "../../protos/google/cloud/networksecurity/v1/mirroring.proto", + "../../protos/google/cloud/networksecurity/v1/network_security.proto", + "../../protos/google/cloud/networksecurity/v1/security_profile_group.proto", + "../../protos/google/cloud/networksecurity/v1/security_profile_group_intercept.proto", + "../../protos/google/cloud/networksecurity/v1/security_profile_group_mirroring.proto", + "../../protos/google/cloud/networksecurity/v1/security_profile_group_service.proto", + "../../protos/google/cloud/networksecurity/v1/security_profile_group_threatprevention.proto", + "../../protos/google/cloud/networksecurity/v1/security_profile_group_urlfiltering.proto", + "../../protos/google/cloud/networksecurity/v1/server_tls_policy.proto", + "../../protos/google/cloud/networksecurity/v1/tls.proto", + "../../protos/google/cloud/networksecurity/v1/tls_inspection_policy.proto", + "../../protos/google/cloud/networksecurity/v1/url_list.proto" +] diff --git a/packages/google-cloud-networksecurity/src/v1/gapic_metadata.json b/packages/google-cloud-networksecurity/src/v1/gapic_metadata.json index d65101cbc8c..cd69548bf87 100644 --- a/packages/google-cloud-networksecurity/src/v1/gapic_metadata.json +++ b/packages/google-cloud-networksecurity/src/v1/gapic_metadata.json @@ -117,6 +117,656 @@ } } }, + "DnsThreatDetectorService": { + "clients": { + "grpc": { + "libraryClient": "DnsThreatDetectorServiceClient", + "rpcs": { + "GetDnsThreatDetector": { + "methods": [ + "getDnsThreatDetector" + ] + }, + "CreateDnsThreatDetector": { + "methods": [ + "createDnsThreatDetector" + ] + }, + "UpdateDnsThreatDetector": { + "methods": [ + "updateDnsThreatDetector" + ] + }, + "DeleteDnsThreatDetector": { + "methods": [ + "deleteDnsThreatDetector" + ] + }, + "ListDnsThreatDetectors": { + "methods": [ + "listDnsThreatDetectors", + "listDnsThreatDetectorsStream", + "listDnsThreatDetectorsAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "DnsThreatDetectorServiceClient", + "rpcs": { + "GetDnsThreatDetector": { + "methods": [ + "getDnsThreatDetector" + ] + }, + "CreateDnsThreatDetector": { + "methods": [ + "createDnsThreatDetector" + ] + }, + "UpdateDnsThreatDetector": { + "methods": [ + "updateDnsThreatDetector" + ] + }, + "DeleteDnsThreatDetector": { + "methods": [ + "deleteDnsThreatDetector" + ] + }, + "ListDnsThreatDetectors": { + "methods": [ + "listDnsThreatDetectors", + "listDnsThreatDetectorsStream", + "listDnsThreatDetectorsAsync" + ] + } + } + } + } + }, + "FirewallActivation": { + "clients": { + "grpc": { + "libraryClient": "FirewallActivationClient", + "rpcs": { + "GetFirewallEndpoint": { + "methods": [ + "getFirewallEndpoint" + ] + }, + "GetFirewallEndpointAssociation": { + "methods": [ + "getFirewallEndpointAssociation" + ] + }, + "CreateFirewallEndpoint": { + "methods": [ + "createFirewallEndpoint" + ] + }, + "DeleteFirewallEndpoint": { + "methods": [ + "deleteFirewallEndpoint" + ] + }, + "UpdateFirewallEndpoint": { + "methods": [ + "updateFirewallEndpoint" + ] + }, + "CreateFirewallEndpointAssociation": { + "methods": [ + "createFirewallEndpointAssociation" + ] + }, + "DeleteFirewallEndpointAssociation": { + "methods": [ + "deleteFirewallEndpointAssociation" + ] + }, + "UpdateFirewallEndpointAssociation": { + "methods": [ + "updateFirewallEndpointAssociation" + ] + }, + "ListFirewallEndpoints": { + "methods": [ + "listFirewallEndpoints", + "listFirewallEndpointsStream", + "listFirewallEndpointsAsync" + ] + }, + "ListFirewallEndpointAssociations": { + "methods": [ + "listFirewallEndpointAssociations", + "listFirewallEndpointAssociationsStream", + "listFirewallEndpointAssociationsAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "FirewallActivationClient", + "rpcs": { + "GetFirewallEndpoint": { + "methods": [ + "getFirewallEndpoint" + ] + }, + "GetFirewallEndpointAssociation": { + "methods": [ + "getFirewallEndpointAssociation" + ] + }, + "CreateFirewallEndpoint": { + "methods": [ + "createFirewallEndpoint" + ] + }, + "DeleteFirewallEndpoint": { + "methods": [ + "deleteFirewallEndpoint" + ] + }, + "UpdateFirewallEndpoint": { + "methods": [ + "updateFirewallEndpoint" + ] + }, + "CreateFirewallEndpointAssociation": { + "methods": [ + "createFirewallEndpointAssociation" + ] + }, + "DeleteFirewallEndpointAssociation": { + "methods": [ + "deleteFirewallEndpointAssociation" + ] + }, + "UpdateFirewallEndpointAssociation": { + "methods": [ + "updateFirewallEndpointAssociation" + ] + }, + "ListFirewallEndpoints": { + "methods": [ + "listFirewallEndpoints", + "listFirewallEndpointsStream", + "listFirewallEndpointsAsync" + ] + }, + "ListFirewallEndpointAssociations": { + "methods": [ + "listFirewallEndpointAssociations", + "listFirewallEndpointAssociationsStream", + "listFirewallEndpointAssociationsAsync" + ] + } + } + } + } + }, + "Intercept": { + "clients": { + "grpc": { + "libraryClient": "InterceptClient", + "rpcs": { + "GetInterceptEndpointGroup": { + "methods": [ + "getInterceptEndpointGroup" + ] + }, + "GetInterceptEndpointGroupAssociation": { + "methods": [ + "getInterceptEndpointGroupAssociation" + ] + }, + "GetInterceptDeploymentGroup": { + "methods": [ + "getInterceptDeploymentGroup" + ] + }, + "GetInterceptDeployment": { + "methods": [ + "getInterceptDeployment" + ] + }, + "CreateInterceptEndpointGroup": { + "methods": [ + "createInterceptEndpointGroup" + ] + }, + "UpdateInterceptEndpointGroup": { + "methods": [ + "updateInterceptEndpointGroup" + ] + }, + "DeleteInterceptEndpointGroup": { + "methods": [ + "deleteInterceptEndpointGroup" + ] + }, + "CreateInterceptEndpointGroupAssociation": { + "methods": [ + "createInterceptEndpointGroupAssociation" + ] + }, + "UpdateInterceptEndpointGroupAssociation": { + "methods": [ + "updateInterceptEndpointGroupAssociation" + ] + }, + "DeleteInterceptEndpointGroupAssociation": { + "methods": [ + "deleteInterceptEndpointGroupAssociation" + ] + }, + "CreateInterceptDeploymentGroup": { + "methods": [ + "createInterceptDeploymentGroup" + ] + }, + "UpdateInterceptDeploymentGroup": { + "methods": [ + "updateInterceptDeploymentGroup" + ] + }, + "DeleteInterceptDeploymentGroup": { + "methods": [ + "deleteInterceptDeploymentGroup" + ] + }, + "CreateInterceptDeployment": { + "methods": [ + "createInterceptDeployment" + ] + }, + "UpdateInterceptDeployment": { + "methods": [ + "updateInterceptDeployment" + ] + }, + "DeleteInterceptDeployment": { + "methods": [ + "deleteInterceptDeployment" + ] + }, + "ListInterceptEndpointGroups": { + "methods": [ + "listInterceptEndpointGroups", + "listInterceptEndpointGroupsStream", + "listInterceptEndpointGroupsAsync" + ] + }, + "ListInterceptEndpointGroupAssociations": { + "methods": [ + "listInterceptEndpointGroupAssociations", + "listInterceptEndpointGroupAssociationsStream", + "listInterceptEndpointGroupAssociationsAsync" + ] + }, + "ListInterceptDeploymentGroups": { + "methods": [ + "listInterceptDeploymentGroups", + "listInterceptDeploymentGroupsStream", + "listInterceptDeploymentGroupsAsync" + ] + }, + "ListInterceptDeployments": { + "methods": [ + "listInterceptDeployments", + "listInterceptDeploymentsStream", + "listInterceptDeploymentsAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "InterceptClient", + "rpcs": { + "GetInterceptEndpointGroup": { + "methods": [ + "getInterceptEndpointGroup" + ] + }, + "GetInterceptEndpointGroupAssociation": { + "methods": [ + "getInterceptEndpointGroupAssociation" + ] + }, + "GetInterceptDeploymentGroup": { + "methods": [ + "getInterceptDeploymentGroup" + ] + }, + "GetInterceptDeployment": { + "methods": [ + "getInterceptDeployment" + ] + }, + "CreateInterceptEndpointGroup": { + "methods": [ + "createInterceptEndpointGroup" + ] + }, + "UpdateInterceptEndpointGroup": { + "methods": [ + "updateInterceptEndpointGroup" + ] + }, + "DeleteInterceptEndpointGroup": { + "methods": [ + "deleteInterceptEndpointGroup" + ] + }, + "CreateInterceptEndpointGroupAssociation": { + "methods": [ + "createInterceptEndpointGroupAssociation" + ] + }, + "UpdateInterceptEndpointGroupAssociation": { + "methods": [ + "updateInterceptEndpointGroupAssociation" + ] + }, + "DeleteInterceptEndpointGroupAssociation": { + "methods": [ + "deleteInterceptEndpointGroupAssociation" + ] + }, + "CreateInterceptDeploymentGroup": { + "methods": [ + "createInterceptDeploymentGroup" + ] + }, + "UpdateInterceptDeploymentGroup": { + "methods": [ + "updateInterceptDeploymentGroup" + ] + }, + "DeleteInterceptDeploymentGroup": { + "methods": [ + "deleteInterceptDeploymentGroup" + ] + }, + "CreateInterceptDeployment": { + "methods": [ + "createInterceptDeployment" + ] + }, + "UpdateInterceptDeployment": { + "methods": [ + "updateInterceptDeployment" + ] + }, + "DeleteInterceptDeployment": { + "methods": [ + "deleteInterceptDeployment" + ] + }, + "ListInterceptEndpointGroups": { + "methods": [ + "listInterceptEndpointGroups", + "listInterceptEndpointGroupsStream", + "listInterceptEndpointGroupsAsync" + ] + }, + "ListInterceptEndpointGroupAssociations": { + "methods": [ + "listInterceptEndpointGroupAssociations", + "listInterceptEndpointGroupAssociationsStream", + "listInterceptEndpointGroupAssociationsAsync" + ] + }, + "ListInterceptDeploymentGroups": { + "methods": [ + "listInterceptDeploymentGroups", + "listInterceptDeploymentGroupsStream", + "listInterceptDeploymentGroupsAsync" + ] + }, + "ListInterceptDeployments": { + "methods": [ + "listInterceptDeployments", + "listInterceptDeploymentsStream", + "listInterceptDeploymentsAsync" + ] + } + } + } + } + }, + "Mirroring": { + "clients": { + "grpc": { + "libraryClient": "MirroringClient", + "rpcs": { + "GetMirroringEndpointGroup": { + "methods": [ + "getMirroringEndpointGroup" + ] + }, + "GetMirroringEndpointGroupAssociation": { + "methods": [ + "getMirroringEndpointGroupAssociation" + ] + }, + "GetMirroringDeploymentGroup": { + "methods": [ + "getMirroringDeploymentGroup" + ] + }, + "GetMirroringDeployment": { + "methods": [ + "getMirroringDeployment" + ] + }, + "CreateMirroringEndpointGroup": { + "methods": [ + "createMirroringEndpointGroup" + ] + }, + "UpdateMirroringEndpointGroup": { + "methods": [ + "updateMirroringEndpointGroup" + ] + }, + "DeleteMirroringEndpointGroup": { + "methods": [ + "deleteMirroringEndpointGroup" + ] + }, + "CreateMirroringEndpointGroupAssociation": { + "methods": [ + "createMirroringEndpointGroupAssociation" + ] + }, + "UpdateMirroringEndpointGroupAssociation": { + "methods": [ + "updateMirroringEndpointGroupAssociation" + ] + }, + "DeleteMirroringEndpointGroupAssociation": { + "methods": [ + "deleteMirroringEndpointGroupAssociation" + ] + }, + "CreateMirroringDeploymentGroup": { + "methods": [ + "createMirroringDeploymentGroup" + ] + }, + "UpdateMirroringDeploymentGroup": { + "methods": [ + "updateMirroringDeploymentGroup" + ] + }, + "DeleteMirroringDeploymentGroup": { + "methods": [ + "deleteMirroringDeploymentGroup" + ] + }, + "CreateMirroringDeployment": { + "methods": [ + "createMirroringDeployment" + ] + }, + "UpdateMirroringDeployment": { + "methods": [ + "updateMirroringDeployment" + ] + }, + "DeleteMirroringDeployment": { + "methods": [ + "deleteMirroringDeployment" + ] + }, + "ListMirroringEndpointGroups": { + "methods": [ + "listMirroringEndpointGroups", + "listMirroringEndpointGroupsStream", + "listMirroringEndpointGroupsAsync" + ] + }, + "ListMirroringEndpointGroupAssociations": { + "methods": [ + "listMirroringEndpointGroupAssociations", + "listMirroringEndpointGroupAssociationsStream", + "listMirroringEndpointGroupAssociationsAsync" + ] + }, + "ListMirroringDeploymentGroups": { + "methods": [ + "listMirroringDeploymentGroups", + "listMirroringDeploymentGroupsStream", + "listMirroringDeploymentGroupsAsync" + ] + }, + "ListMirroringDeployments": { + "methods": [ + "listMirroringDeployments", + "listMirroringDeploymentsStream", + "listMirroringDeploymentsAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "MirroringClient", + "rpcs": { + "GetMirroringEndpointGroup": { + "methods": [ + "getMirroringEndpointGroup" + ] + }, + "GetMirroringEndpointGroupAssociation": { + "methods": [ + "getMirroringEndpointGroupAssociation" + ] + }, + "GetMirroringDeploymentGroup": { + "methods": [ + "getMirroringDeploymentGroup" + ] + }, + "GetMirroringDeployment": { + "methods": [ + "getMirroringDeployment" + ] + }, + "CreateMirroringEndpointGroup": { + "methods": [ + "createMirroringEndpointGroup" + ] + }, + "UpdateMirroringEndpointGroup": { + "methods": [ + "updateMirroringEndpointGroup" + ] + }, + "DeleteMirroringEndpointGroup": { + "methods": [ + "deleteMirroringEndpointGroup" + ] + }, + "CreateMirroringEndpointGroupAssociation": { + "methods": [ + "createMirroringEndpointGroupAssociation" + ] + }, + "UpdateMirroringEndpointGroupAssociation": { + "methods": [ + "updateMirroringEndpointGroupAssociation" + ] + }, + "DeleteMirroringEndpointGroupAssociation": { + "methods": [ + "deleteMirroringEndpointGroupAssociation" + ] + }, + "CreateMirroringDeploymentGroup": { + "methods": [ + "createMirroringDeploymentGroup" + ] + }, + "UpdateMirroringDeploymentGroup": { + "methods": [ + "updateMirroringDeploymentGroup" + ] + }, + "DeleteMirroringDeploymentGroup": { + "methods": [ + "deleteMirroringDeploymentGroup" + ] + }, + "CreateMirroringDeployment": { + "methods": [ + "createMirroringDeployment" + ] + }, + "UpdateMirroringDeployment": { + "methods": [ + "updateMirroringDeployment" + ] + }, + "DeleteMirroringDeployment": { + "methods": [ + "deleteMirroringDeployment" + ] + }, + "ListMirroringEndpointGroups": { + "methods": [ + "listMirroringEndpointGroups", + "listMirroringEndpointGroupsStream", + "listMirroringEndpointGroupsAsync" + ] + }, + "ListMirroringEndpointGroupAssociations": { + "methods": [ + "listMirroringEndpointGroupAssociations", + "listMirroringEndpointGroupAssociationsStream", + "listMirroringEndpointGroupAssociationsAsync" + ] + }, + "ListMirroringDeploymentGroups": { + "methods": [ + "listMirroringDeploymentGroups", + "listMirroringDeploymentGroupsStream", + "listMirroringDeploymentGroupsAsync" + ] + }, + "ListMirroringDeployments": { + "methods": [ + "listMirroringDeployments", + "listMirroringDeploymentsStream", + "listMirroringDeploymentsAsync" + ] + } + } + } + } + }, "NetworkSecurity": { "clients": { "grpc": { @@ -127,6 +777,11 @@ "getAuthorizationPolicy" ] }, + "GetBackendAuthenticationConfig": { + "methods": [ + "getBackendAuthenticationConfig" + ] + }, "GetServerTlsPolicy": { "methods": [ "getServerTlsPolicy" @@ -137,6 +792,31 @@ "getClientTlsPolicy" ] }, + "GetGatewaySecurityPolicy": { + "methods": [ + "getGatewaySecurityPolicy" + ] + }, + "GetGatewaySecurityPolicyRule": { + "methods": [ + "getGatewaySecurityPolicyRule" + ] + }, + "GetUrlList": { + "methods": [ + "getUrlList" + ] + }, + "GetTlsInspectionPolicy": { + "methods": [ + "getTlsInspectionPolicy" + ] + }, + "GetAuthzPolicy": { + "methods": [ + "getAuthzPolicy" + ] + }, "CreateAuthorizationPolicy": { "methods": [ "createAuthorizationPolicy" @@ -152,6 +832,21 @@ "deleteAuthorizationPolicy" ] }, + "CreateBackendAuthenticationConfig": { + "methods": [ + "createBackendAuthenticationConfig" + ] + }, + "UpdateBackendAuthenticationConfig": { + "methods": [ + "updateBackendAuthenticationConfig" + ] + }, + "DeleteBackendAuthenticationConfig": { + "methods": [ + "deleteBackendAuthenticationConfig" + ] + }, "CreateServerTlsPolicy": { "methods": [ "createServerTlsPolicy" @@ -182,6 +877,81 @@ "deleteClientTlsPolicy" ] }, + "CreateGatewaySecurityPolicy": { + "methods": [ + "createGatewaySecurityPolicy" + ] + }, + "UpdateGatewaySecurityPolicy": { + "methods": [ + "updateGatewaySecurityPolicy" + ] + }, + "DeleteGatewaySecurityPolicy": { + "methods": [ + "deleteGatewaySecurityPolicy" + ] + }, + "CreateGatewaySecurityPolicyRule": { + "methods": [ + "createGatewaySecurityPolicyRule" + ] + }, + "UpdateGatewaySecurityPolicyRule": { + "methods": [ + "updateGatewaySecurityPolicyRule" + ] + }, + "DeleteGatewaySecurityPolicyRule": { + "methods": [ + "deleteGatewaySecurityPolicyRule" + ] + }, + "CreateUrlList": { + "methods": [ + "createUrlList" + ] + }, + "UpdateUrlList": { + "methods": [ + "updateUrlList" + ] + }, + "DeleteUrlList": { + "methods": [ + "deleteUrlList" + ] + }, + "CreateTlsInspectionPolicy": { + "methods": [ + "createTlsInspectionPolicy" + ] + }, + "UpdateTlsInspectionPolicy": { + "methods": [ + "updateTlsInspectionPolicy" + ] + }, + "DeleteTlsInspectionPolicy": { + "methods": [ + "deleteTlsInspectionPolicy" + ] + }, + "CreateAuthzPolicy": { + "methods": [ + "createAuthzPolicy" + ] + }, + "UpdateAuthzPolicy": { + "methods": [ + "updateAuthzPolicy" + ] + }, + "DeleteAuthzPolicy": { + "methods": [ + "deleteAuthzPolicy" + ] + }, "ListAuthorizationPolicies": { "methods": [ "listAuthorizationPolicies", @@ -189,6 +959,13 @@ "listAuthorizationPoliciesAsync" ] }, + "ListBackendAuthenticationConfigs": { + "methods": [ + "listBackendAuthenticationConfigs", + "listBackendAuthenticationConfigsStream", + "listBackendAuthenticationConfigsAsync" + ] + }, "ListServerTlsPolicies": { "methods": [ "listServerTlsPolicies", @@ -202,6 +979,41 @@ "listClientTlsPoliciesStream", "listClientTlsPoliciesAsync" ] + }, + "ListGatewaySecurityPolicies": { + "methods": [ + "listGatewaySecurityPolicies", + "listGatewaySecurityPoliciesStream", + "listGatewaySecurityPoliciesAsync" + ] + }, + "ListGatewaySecurityPolicyRules": { + "methods": [ + "listGatewaySecurityPolicyRules", + "listGatewaySecurityPolicyRulesStream", + "listGatewaySecurityPolicyRulesAsync" + ] + }, + "ListUrlLists": { + "methods": [ + "listUrlLists", + "listUrlListsStream", + "listUrlListsAsync" + ] + }, + "ListTlsInspectionPolicies": { + "methods": [ + "listTlsInspectionPolicies", + "listTlsInspectionPoliciesStream", + "listTlsInspectionPoliciesAsync" + ] + }, + "ListAuthzPolicies": { + "methods": [ + "listAuthzPolicies", + "listAuthzPoliciesStream", + "listAuthzPoliciesAsync" + ] } } }, @@ -213,6 +1025,11 @@ "getAuthorizationPolicy" ] }, + "GetBackendAuthenticationConfig": { + "methods": [ + "getBackendAuthenticationConfig" + ] + }, "GetServerTlsPolicy": { "methods": [ "getServerTlsPolicy" @@ -223,6 +1040,31 @@ "getClientTlsPolicy" ] }, + "GetGatewaySecurityPolicy": { + "methods": [ + "getGatewaySecurityPolicy" + ] + }, + "GetGatewaySecurityPolicyRule": { + "methods": [ + "getGatewaySecurityPolicyRule" + ] + }, + "GetUrlList": { + "methods": [ + "getUrlList" + ] + }, + "GetTlsInspectionPolicy": { + "methods": [ + "getTlsInspectionPolicy" + ] + }, + "GetAuthzPolicy": { + "methods": [ + "getAuthzPolicy" + ] + }, "CreateAuthorizationPolicy": { "methods": [ "createAuthorizationPolicy" @@ -238,6 +1080,21 @@ "deleteAuthorizationPolicy" ] }, + "CreateBackendAuthenticationConfig": { + "methods": [ + "createBackendAuthenticationConfig" + ] + }, + "UpdateBackendAuthenticationConfig": { + "methods": [ + "updateBackendAuthenticationConfig" + ] + }, + "DeleteBackendAuthenticationConfig": { + "methods": [ + "deleteBackendAuthenticationConfig" + ] + }, "CreateServerTlsPolicy": { "methods": [ "createServerTlsPolicy" @@ -268,6 +1125,81 @@ "deleteClientTlsPolicy" ] }, + "CreateGatewaySecurityPolicy": { + "methods": [ + "createGatewaySecurityPolicy" + ] + }, + "UpdateGatewaySecurityPolicy": { + "methods": [ + "updateGatewaySecurityPolicy" + ] + }, + "DeleteGatewaySecurityPolicy": { + "methods": [ + "deleteGatewaySecurityPolicy" + ] + }, + "CreateGatewaySecurityPolicyRule": { + "methods": [ + "createGatewaySecurityPolicyRule" + ] + }, + "UpdateGatewaySecurityPolicyRule": { + "methods": [ + "updateGatewaySecurityPolicyRule" + ] + }, + "DeleteGatewaySecurityPolicyRule": { + "methods": [ + "deleteGatewaySecurityPolicyRule" + ] + }, + "CreateUrlList": { + "methods": [ + "createUrlList" + ] + }, + "UpdateUrlList": { + "methods": [ + "updateUrlList" + ] + }, + "DeleteUrlList": { + "methods": [ + "deleteUrlList" + ] + }, + "CreateTlsInspectionPolicy": { + "methods": [ + "createTlsInspectionPolicy" + ] + }, + "UpdateTlsInspectionPolicy": { + "methods": [ + "updateTlsInspectionPolicy" + ] + }, + "DeleteTlsInspectionPolicy": { + "methods": [ + "deleteTlsInspectionPolicy" + ] + }, + "CreateAuthzPolicy": { + "methods": [ + "createAuthzPolicy" + ] + }, + "UpdateAuthzPolicy": { + "methods": [ + "updateAuthzPolicy" + ] + }, + "DeleteAuthzPolicy": { + "methods": [ + "deleteAuthzPolicy" + ] + }, "ListAuthorizationPolicies": { "methods": [ "listAuthorizationPolicies", @@ -275,6 +1207,13 @@ "listAuthorizationPoliciesAsync" ] }, + "ListBackendAuthenticationConfigs": { + "methods": [ + "listBackendAuthenticationConfigs", + "listBackendAuthenticationConfigsStream", + "listBackendAuthenticationConfigsAsync" + ] + }, "ListServerTlsPolicies": { "methods": [ "listServerTlsPolicies", @@ -288,6 +1227,41 @@ "listClientTlsPoliciesStream", "listClientTlsPoliciesAsync" ] + }, + "ListGatewaySecurityPolicies": { + "methods": [ + "listGatewaySecurityPolicies", + "listGatewaySecurityPoliciesStream", + "listGatewaySecurityPoliciesAsync" + ] + }, + "ListGatewaySecurityPolicyRules": { + "methods": [ + "listGatewaySecurityPolicyRules", + "listGatewaySecurityPolicyRulesStream", + "listGatewaySecurityPolicyRulesAsync" + ] + }, + "ListUrlLists": { + "methods": [ + "listUrlLists", + "listUrlListsStream", + "listUrlListsAsync" + ] + }, + "ListTlsInspectionPolicies": { + "methods": [ + "listTlsInspectionPolicies", + "listTlsInspectionPoliciesStream", + "listTlsInspectionPoliciesAsync" + ] + }, + "ListAuthzPolicies": { + "methods": [ + "listAuthzPolicies", + "listAuthzPoliciesStream", + "listAuthzPoliciesAsync" + ] } } } @@ -404,6 +1378,128 @@ } } } + }, + "OrganizationSecurityProfileGroupService": { + "clients": { + "grpc": { + "libraryClient": "OrganizationSecurityProfileGroupServiceClient", + "rpcs": { + "GetSecurityProfileGroup": { + "methods": [ + "getSecurityProfileGroup" + ] + }, + "GetSecurityProfile": { + "methods": [ + "getSecurityProfile" + ] + }, + "CreateSecurityProfileGroup": { + "methods": [ + "createSecurityProfileGroup" + ] + }, + "UpdateSecurityProfileGroup": { + "methods": [ + "updateSecurityProfileGroup" + ] + }, + "DeleteSecurityProfileGroup": { + "methods": [ + "deleteSecurityProfileGroup" + ] + }, + "CreateSecurityProfile": { + "methods": [ + "createSecurityProfile" + ] + }, + "UpdateSecurityProfile": { + "methods": [ + "updateSecurityProfile" + ] + }, + "DeleteSecurityProfile": { + "methods": [ + "deleteSecurityProfile" + ] + }, + "ListSecurityProfileGroups": { + "methods": [ + "listSecurityProfileGroups", + "listSecurityProfileGroupsStream", + "listSecurityProfileGroupsAsync" + ] + }, + "ListSecurityProfiles": { + "methods": [ + "listSecurityProfiles", + "listSecurityProfilesStream", + "listSecurityProfilesAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "OrganizationSecurityProfileGroupServiceClient", + "rpcs": { + "GetSecurityProfileGroup": { + "methods": [ + "getSecurityProfileGroup" + ] + }, + "GetSecurityProfile": { + "methods": [ + "getSecurityProfile" + ] + }, + "CreateSecurityProfileGroup": { + "methods": [ + "createSecurityProfileGroup" + ] + }, + "UpdateSecurityProfileGroup": { + "methods": [ + "updateSecurityProfileGroup" + ] + }, + "DeleteSecurityProfileGroup": { + "methods": [ + "deleteSecurityProfileGroup" + ] + }, + "CreateSecurityProfile": { + "methods": [ + "createSecurityProfile" + ] + }, + "UpdateSecurityProfile": { + "methods": [ + "updateSecurityProfile" + ] + }, + "DeleteSecurityProfile": { + "methods": [ + "deleteSecurityProfile" + ] + }, + "ListSecurityProfileGroups": { + "methods": [ + "listSecurityProfileGroups", + "listSecurityProfileGroupsStream", + "listSecurityProfileGroupsAsync" + ] + }, + "ListSecurityProfiles": { + "methods": [ + "listSecurityProfiles", + "listSecurityProfilesStream", + "listSecurityProfilesAsync" + ] + } + } + } + } } } } diff --git a/packages/google-cloud-networksecurity/src/v1/index.ts b/packages/google-cloud-networksecurity/src/v1/index.ts index b397b384253..b096776375f 100644 --- a/packages/google-cloud-networksecurity/src/v1/index.ts +++ b/packages/google-cloud-networksecurity/src/v1/index.ts @@ -17,5 +17,10 @@ // ** All changes to this file may be overwritten. ** export {AddressGroupServiceClient} from './address_group_service_client'; +export {DnsThreatDetectorServiceClient} from './dns_threat_detector_service_client'; +export {FirewallActivationClient} from './firewall_activation_client'; +export {InterceptClient} from './intercept_client'; +export {MirroringClient} from './mirroring_client'; export {NetworkSecurityClient} from './network_security_client'; export {OrganizationAddressGroupServiceClient} from './organization_address_group_service_client'; +export {OrganizationSecurityProfileGroupServiceClient} from './organization_security_profile_group_service_client'; diff --git a/packages/google-cloud-networksecurity/src/v1/intercept_client.ts b/packages/google-cloud-networksecurity/src/v1/intercept_client.ts new file mode 100644 index 00000000000..5f49df914a2 --- /dev/null +++ b/packages/google-cloud-networksecurity/src/v1/intercept_client.ts @@ -0,0 +1,5218 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +/* global window */ +import type * as gax from 'google-gax'; +import type {Callback, CallOptions, Descriptors, ClientOptions, GrpcClientOptions, LROperation, PaginationCallback, GaxCall, IamClient, IamProtos, LocationsClient, LocationProtos} from 'google-gax'; +import {Transform} from 'stream'; +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +import {loggingUtils as logging, decodeAnyProtosInArray} from 'google-gax'; + +/** + * Client JSON configuration object, loaded from + * `src/v1/intercept_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './intercept_client_config.json'; +const version = require('../../../package.json').version; + +/** + * Service for Third-Party Packet Intercept (TPPI). + * TPPI is the "in-band" flavor of the Network Security Integrations product. + * @class + * @memberof v1 + */ +export class InterceptClient { + private _terminated = false; + private _opts: ClientOptions; + private _providedCustomServicePath: boolean; + private _gaxModule: typeof gax | typeof gax.fallback; + private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; + private _protos: {}; + private _defaults: {[method: string]: gax.CallSettings}; + private _universeDomain: string; + private _servicePath: string; + private _log = logging.log('network-security'); + + auth: gax.GoogleAuth; + descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; + warn: (code: string, message: string, warnType?: string) => void; + innerApiCalls: {[name: string]: Function}; + iamClient: IamClient; + locationsClient: LocationsClient; + pathTemplates: {[name: string]: gax.PathTemplate}; + operationsClient: gax.OperationsClient; + interceptStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of InterceptClient. + * + * @param {object} [options] - The configuration object. + * The options accepted by the constructor are described in detail + * in [this document](https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#creating-the-client-instance). + * The common options are: + * @param {object} [options.credentials] - Credentials object. + * @param {string} [options.credentials.client_email] + * @param {string} [options.credentials.private_key] + * @param {string} [options.email] - Account email address. Required when + * using a .pem or .p12 keyFilename. + * @param {string} [options.keyFilename] - Full path to the a .json, .pem, or + * .p12 key downloaded from the Google Developers Console. If you provide + * a path to a JSON file, the projectId option below is not necessary. + * NOTE: .pem and .p12 require you to specify options.email as well. + * @param {number} [options.port] - The port on which to connect to + * the remote host. + * @param {string} [options.projectId] - The project ID from the Google + * Developer's Console, e.g. 'grape-spaceship-123'. We will also check + * the environment variable GCLOUD_PROJECT for your project ID. If your + * app is running in an environment which supports + * {@link https://cloud.google.com/docs/authentication/application-default-credentials Application Default Credentials}, + * your project ID will be detected automatically. + * @param {string} [options.apiEndpoint] - The domain name of the + * API remote host. + * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. + * Follows the structure of {@link gapicConfig}. + * @param {boolean} [options.fallback] - Use HTTP/1.1 REST mode. + * For more information, please check the + * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. + * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you + * need to avoid loading the default gRPC version and want to use the fallback + * HTTP implementation. Load only fallback version and pass it to the constructor: + * ``` + * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC + * const client = new InterceptClient({fallback: true}, gax); + * ``` + */ + constructor(opts?: ClientOptions, gaxInstance?: typeof gax | typeof gax.fallback) { + // Ensure that options include all the required fields. + const staticMembers = this.constructor as typeof InterceptClient; + if (opts?.universe_domain && opts?.universeDomain && opts?.universe_domain !== opts?.universeDomain) { + throw new Error('Please set either universe_domain or universeDomain, but not both.'); + } + const universeDomainEnvVar = (typeof process === 'object' && typeof process.env === 'object') ? process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] : undefined; + this._universeDomain = opts?.universeDomain ?? opts?.universe_domain ?? universeDomainEnvVar ?? 'googleapis.com'; + this._servicePath = 'networksecurity.' + this._universeDomain; + const servicePath = opts?.servicePath || opts?.apiEndpoint || this._servicePath; + this._providedCustomServicePath = !!(opts?.servicePath || opts?.apiEndpoint); + const port = opts?.port || staticMembers.port; + const clientConfig = opts?.clientConfig ?? {}; + const fallback = opts?.fallback ?? (typeof window !== 'undefined' && typeof window?.fetch === 'function'); + opts = Object.assign({servicePath, port, clientConfig, fallback}, opts); + + // Request numeric enum values if REST transport is used. + opts.numericEnums = true; + + // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. + if (servicePath !== this._servicePath && !('scopes' in opts)) { + opts['scopes'] = staticMembers.scopes; + } + + // Load google-gax module synchronously if needed + if (!gaxInstance) { + gaxInstance = require('google-gax') as typeof gax; + } + + // Choose either gRPC or proto-over-HTTP implementation of google-gax. + this._gaxModule = opts.fallback ? gaxInstance.fallback : gaxInstance; + + // Create a `gaxGrpc` object, with any grpc-specific options sent to the client. + this._gaxGrpc = new this._gaxModule.GrpcClient(opts); + + // Save options to use in initialize() method. + this._opts = opts; + + // Save the auth object to the client, for use by other methods. + this.auth = (this._gaxGrpc.auth as gax.GoogleAuth); + + // Set useJWTAccessWithScope on the auth object. + this.auth.useJWTAccessWithScope = true; + + // Set defaultServicePath on the auth object. + this.auth.defaultServicePath = this._servicePath; + + // Set the default scopes in auth client if needed. + if (servicePath === this._servicePath) { + this.auth.defaultScopes = staticMembers.scopes; + } + this.iamClient = new this._gaxModule.IamClient(this._gaxGrpc, opts); + + this.locationsClient = new this._gaxModule.LocationsClient( + this._gaxGrpc, + opts + ); + + + // Determine the client header string. + const clientHeader = [ + `gax/${this._gaxModule.version}`, + `gapic/${version}`, + ]; + if (typeof process === 'object' && 'versions' in process) { + clientHeader.push(`gl-node/${process.versions.node}`); + } else { + clientHeader.push(`gl-web/${this._gaxModule.version}`); + } + if (!opts.fallback) { + clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); + } else { + clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); + } + if (opts.libName && opts.libVersion) { + clientHeader.push(`${opts.libName}/${opts.libVersion}`); + } + // Load the applicable protos. + this._protos = this._gaxGrpc.loadProtoJSON(jsonProtos); + + // This API contains "path templates"; forward-slash-separated + // identifiers to uniquely identify resources within the API. + // Create useful helper objects for these. + this.pathTemplates = { + authorizationPolicyPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/authorizationPolicies/{authorization_policy}' + ), + authzPolicyPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/authzPolicies/{authz_policy}' + ), + backendAuthenticationConfigPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/backendAuthenticationConfigs/{backend_authentication_config}' + ), + clientTlsPolicyPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/clientTlsPolicies/{client_tls_policy}' + ), + dnsThreatDetectorPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/dnsThreatDetectors/{dns_threat_detector}' + ), + firewallEndpointAssociationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/firewallEndpointAssociations/{firewall_endpoint_association}' + ), + forwardingRulePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/global/forwardingRules/{forwarding_rule}' + ), + gatewaySecurityPolicyPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/gatewaySecurityPolicies/{gateway_security_policy}' + ), + gatewaySecurityPolicyRulePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/gatewaySecurityPolicies/{gateway_security_policy}/rules/{rule}' + ), + interceptDeploymentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/interceptDeployments/{intercept_deployment}' + ), + interceptDeploymentGroupPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/interceptDeploymentGroups/{intercept_deployment_group}' + ), + interceptEndpointGroupPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/interceptEndpointGroups/{intercept_endpoint_group}' + ), + interceptEndpointGroupAssociationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/interceptEndpointGroupAssociations/{intercept_endpoint_group_association}' + ), + locationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}' + ), + mirroringDeploymentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/mirroringDeployments/{mirroring_deployment}' + ), + mirroringDeploymentGroupPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/mirroringDeploymentGroups/{mirroring_deployment_group}' + ), + mirroringEndpointGroupPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/mirroringEndpointGroups/{mirroring_endpoint_group}' + ), + mirroringEndpointGroupAssociationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/mirroringEndpointGroupAssociations/{mirroring_endpoint_group_association}' + ), + networkPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/global/networks/{network}' + ), + organizationLocationAddressGroupPathTemplate: new this._gaxModule.PathTemplate( + 'organizations/{organization}/locations/{location}/addressGroups/{address_group}' + ), + organizationLocationFirewallEndpointsPathTemplate: new this._gaxModule.PathTemplate( + 'organizations/{organization}/locations/{location}/firewallEndpoints/{firewall_endpoint}' + ), + organizationLocationSecurityProfilePathTemplate: new this._gaxModule.PathTemplate( + 'organizations/{organization}/locations/{location}/securityProfiles/{security_profile}' + ), + organizationLocationSecurityProfileGroupPathTemplate: new this._gaxModule.PathTemplate( + 'organizations/{organization}/locations/{location}/securityProfileGroups/{security_profile_group}' + ), + projectPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}' + ), + projectLocationAddressGroupPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/addressGroups/{address_group}' + ), + projectLocationFirewallEndpointsPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/firewallEndpoints/{firewall_endpoint}' + ), + projectLocationSecurityProfilePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/securityProfiles/{security_profile}' + ), + projectLocationSecurityProfileGroupPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/securityProfileGroups/{security_profile_group}' + ), + serverTlsPolicyPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/serverTlsPolicies/{server_tls_policy}' + ), + tlsInspectionPolicyPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/tlsInspectionPolicies/{tls_inspection_policy}' + ), + urlListPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/urlLists/{url_list}' + ), + }; + + // Some of the methods on this service return "paged" results, + // (e.g. 50 results at a time, with tokens to get subsequent + // pages). Denote the keys used for pagination and results. + this.descriptors.page = { + listInterceptEndpointGroups: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'interceptEndpointGroups'), + listInterceptEndpointGroupAssociations: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'interceptEndpointGroupAssociations'), + listInterceptDeploymentGroups: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'interceptDeploymentGroups'), + listInterceptDeployments: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'interceptDeployments') + }; + + const protoFilesRoot = this._gaxModule.protobufFromJSON(jsonProtos); + // This API contains "long-running operations", which return a + // an Operation object that allows for tracking of the operation, + // rather than holding a request open. + const lroOptions: GrpcClientOptions = { + auth: this.auth, + grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined + }; + if (opts.fallback) { + lroOptions.protoJson = protoFilesRoot; + lroOptions.httpRules = [{selector: 'google.cloud.location.Locations.GetLocation',get: '/v1/{name=projects/*/locations/*}',additional_bindings: [{get: '/v1/{name=organizations/*/locations/*}',}], + },{selector: 'google.cloud.location.Locations.ListLocations',get: '/v1/{name=projects/*}/locations',additional_bindings: [{get: '/v1/{name=organizations/*/locations/*}',}], + },{selector: 'google.iam.v1.IAMPolicy.GetIamPolicy',get: '/v1/{resource=projects/*/locations/*/addressGroups/*}:getIamPolicy',additional_bindings: [{get: '/v1/{resource=projects/*/locations/*/authorizationPolicies/*}:getIamPolicy',},{get: '/v1/{resource=organizations/*/locations/*/addressGroups/*}:getIamPolicy',},{get: '/v1/{resource=projects/*/locations/*/serverTlsPolicies/*}:getIamPolicy',},{get: '/v1/{resource=projects/*/locations/*/clientTlsPolicies/*}:getIamPolicy',},{get: '/v1/{resource=projects/*/locations/*/authzPolicies/*}:getIamPolicy',}], + },{selector: 'google.iam.v1.IAMPolicy.SetIamPolicy',post: '/v1/{resource=projects/*/locations/*/addressGroups/*}:setIamPolicy',body: '*',additional_bindings: [{post: '/v1/{resource=projects/*/locations/*/authorizationPolicies/*}:setIamPolicy',body: '*',},{post: '/v1/{resource=organizations/*/locations/*/addressGroups/*}:setIamPolicy',body: '*',},{post: '/v1/{resource=projects/*/locations/*/serverTlsPolicies/*}:setIamPolicy',body: '*',},{post: '/v1/{resource=projects/*/locations/*/clientTlsPolicies/*}:setIamPolicy',body: '*',},{post: '/v1/{resource=projects/*/locations/*/authzPolicies/*}:setIamPolicy',body: '*',}], + },{selector: 'google.iam.v1.IAMPolicy.TestIamPermissions',post: '/v1/{resource=projects/*/locations/*/addressGroups/*}:testIamPermissions',body: '*',additional_bindings: [{post: '/v1/{resource=projects/*/locations/*/authorizationPolicies/*}:testIamPermissions',body: '*',},{post: '/v1/{resource=organizations/*/locations/*/addressGroups/*}:testIamPermissions',body: '*',},{post: '/v1/{resource=projects/*/locations/*/serverTlsPolicies/*}:testIamPermissions',body: '*',},{post: '/v1/{resource=projects/*/locations/*/clientTlsPolicies/*}:testIamPermissions',body: '*',},{post: '/v1/{resource=projects/*/locations/*/authzPolicies/*}:testIamPermissions',body: '*',}], + },{selector: 'google.longrunning.Operations.CancelOperation',post: '/v1/{name=projects/*/locations/*/operations/*}:cancel',body: '*',additional_bindings: [{post: '/v1/{name=organizations/*/locations/*/operations/*}:cancel',body: '*',}], + },{selector: 'google.longrunning.Operations.DeleteOperation',delete: '/v1/{name=projects/*/locations/*/operations/*}',additional_bindings: [{delete: '/v1/{name=organizations/*/locations/*/operations/*}',}], + },{selector: 'google.longrunning.Operations.GetOperation',get: '/v1/{name=projects/*/locations/*/operations/*}',additional_bindings: [{get: '/v1/{name=organizations/*/locations/*/operations/*}',}], + },{selector: 'google.longrunning.Operations.ListOperations',get: '/v1/{name=projects/*/locations/*}/operations',additional_bindings: [{get: '/v1/{name=organizations/*/locations/*}/operations',}], + }]; + } + this.operationsClient = this._gaxModule.lro(lroOptions).operationsClient(opts); + const createInterceptEndpointGroupResponse = protoFilesRoot.lookup( + '.google.cloud.networksecurity.v1.InterceptEndpointGroup') as gax.protobuf.Type; + const createInterceptEndpointGroupMetadata = protoFilesRoot.lookup( + '.google.cloud.networksecurity.v1.OperationMetadata') as gax.protobuf.Type; + const updateInterceptEndpointGroupResponse = protoFilesRoot.lookup( + '.google.cloud.networksecurity.v1.InterceptEndpointGroup') as gax.protobuf.Type; + const updateInterceptEndpointGroupMetadata = protoFilesRoot.lookup( + '.google.cloud.networksecurity.v1.OperationMetadata') as gax.protobuf.Type; + const deleteInterceptEndpointGroupResponse = protoFilesRoot.lookup( + '.google.protobuf.Empty') as gax.protobuf.Type; + const deleteInterceptEndpointGroupMetadata = protoFilesRoot.lookup( + '.google.cloud.networksecurity.v1.OperationMetadata') as gax.protobuf.Type; + const createInterceptEndpointGroupAssociationResponse = protoFilesRoot.lookup( + '.google.cloud.networksecurity.v1.InterceptEndpointGroupAssociation') as gax.protobuf.Type; + const createInterceptEndpointGroupAssociationMetadata = protoFilesRoot.lookup( + '.google.cloud.networksecurity.v1.OperationMetadata') as gax.protobuf.Type; + const updateInterceptEndpointGroupAssociationResponse = protoFilesRoot.lookup( + '.google.cloud.networksecurity.v1.InterceptEndpointGroupAssociation') as gax.protobuf.Type; + const updateInterceptEndpointGroupAssociationMetadata = protoFilesRoot.lookup( + '.google.cloud.networksecurity.v1.OperationMetadata') as gax.protobuf.Type; + const deleteInterceptEndpointGroupAssociationResponse = protoFilesRoot.lookup( + '.google.protobuf.Empty') as gax.protobuf.Type; + const deleteInterceptEndpointGroupAssociationMetadata = protoFilesRoot.lookup( + '.google.cloud.networksecurity.v1.OperationMetadata') as gax.protobuf.Type; + const createInterceptDeploymentGroupResponse = protoFilesRoot.lookup( + '.google.cloud.networksecurity.v1.InterceptDeploymentGroup') as gax.protobuf.Type; + const createInterceptDeploymentGroupMetadata = protoFilesRoot.lookup( + '.google.cloud.networksecurity.v1.OperationMetadata') as gax.protobuf.Type; + const updateInterceptDeploymentGroupResponse = protoFilesRoot.lookup( + '.google.cloud.networksecurity.v1.InterceptDeploymentGroup') as gax.protobuf.Type; + const updateInterceptDeploymentGroupMetadata = protoFilesRoot.lookup( + '.google.cloud.networksecurity.v1.OperationMetadata') as gax.protobuf.Type; + const deleteInterceptDeploymentGroupResponse = protoFilesRoot.lookup( + '.google.protobuf.Empty') as gax.protobuf.Type; + const deleteInterceptDeploymentGroupMetadata = protoFilesRoot.lookup( + '.google.cloud.networksecurity.v1.OperationMetadata') as gax.protobuf.Type; + const createInterceptDeploymentResponse = protoFilesRoot.lookup( + '.google.cloud.networksecurity.v1.InterceptDeployment') as gax.protobuf.Type; + const createInterceptDeploymentMetadata = protoFilesRoot.lookup( + '.google.cloud.networksecurity.v1.OperationMetadata') as gax.protobuf.Type; + const updateInterceptDeploymentResponse = protoFilesRoot.lookup( + '.google.cloud.networksecurity.v1.InterceptDeployment') as gax.protobuf.Type; + const updateInterceptDeploymentMetadata = protoFilesRoot.lookup( + '.google.cloud.networksecurity.v1.OperationMetadata') as gax.protobuf.Type; + const deleteInterceptDeploymentResponse = protoFilesRoot.lookup( + '.google.protobuf.Empty') as gax.protobuf.Type; + const deleteInterceptDeploymentMetadata = protoFilesRoot.lookup( + '.google.cloud.networksecurity.v1.OperationMetadata') as gax.protobuf.Type; + + this.descriptors.longrunning = { + createInterceptEndpointGroup: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + createInterceptEndpointGroupResponse.decode.bind(createInterceptEndpointGroupResponse), + createInterceptEndpointGroupMetadata.decode.bind(createInterceptEndpointGroupMetadata)), + updateInterceptEndpointGroup: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + updateInterceptEndpointGroupResponse.decode.bind(updateInterceptEndpointGroupResponse), + updateInterceptEndpointGroupMetadata.decode.bind(updateInterceptEndpointGroupMetadata)), + deleteInterceptEndpointGroup: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + deleteInterceptEndpointGroupResponse.decode.bind(deleteInterceptEndpointGroupResponse), + deleteInterceptEndpointGroupMetadata.decode.bind(deleteInterceptEndpointGroupMetadata)), + createInterceptEndpointGroupAssociation: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + createInterceptEndpointGroupAssociationResponse.decode.bind(createInterceptEndpointGroupAssociationResponse), + createInterceptEndpointGroupAssociationMetadata.decode.bind(createInterceptEndpointGroupAssociationMetadata)), + updateInterceptEndpointGroupAssociation: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + updateInterceptEndpointGroupAssociationResponse.decode.bind(updateInterceptEndpointGroupAssociationResponse), + updateInterceptEndpointGroupAssociationMetadata.decode.bind(updateInterceptEndpointGroupAssociationMetadata)), + deleteInterceptEndpointGroupAssociation: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + deleteInterceptEndpointGroupAssociationResponse.decode.bind(deleteInterceptEndpointGroupAssociationResponse), + deleteInterceptEndpointGroupAssociationMetadata.decode.bind(deleteInterceptEndpointGroupAssociationMetadata)), + createInterceptDeploymentGroup: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + createInterceptDeploymentGroupResponse.decode.bind(createInterceptDeploymentGroupResponse), + createInterceptDeploymentGroupMetadata.decode.bind(createInterceptDeploymentGroupMetadata)), + updateInterceptDeploymentGroup: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + updateInterceptDeploymentGroupResponse.decode.bind(updateInterceptDeploymentGroupResponse), + updateInterceptDeploymentGroupMetadata.decode.bind(updateInterceptDeploymentGroupMetadata)), + deleteInterceptDeploymentGroup: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + deleteInterceptDeploymentGroupResponse.decode.bind(deleteInterceptDeploymentGroupResponse), + deleteInterceptDeploymentGroupMetadata.decode.bind(deleteInterceptDeploymentGroupMetadata)), + createInterceptDeployment: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + createInterceptDeploymentResponse.decode.bind(createInterceptDeploymentResponse), + createInterceptDeploymentMetadata.decode.bind(createInterceptDeploymentMetadata)), + updateInterceptDeployment: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + updateInterceptDeploymentResponse.decode.bind(updateInterceptDeploymentResponse), + updateInterceptDeploymentMetadata.decode.bind(updateInterceptDeploymentMetadata)), + deleteInterceptDeployment: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + deleteInterceptDeploymentResponse.decode.bind(deleteInterceptDeploymentResponse), + deleteInterceptDeploymentMetadata.decode.bind(deleteInterceptDeploymentMetadata)) + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.networksecurity.v1.Intercept', gapicConfig as gax.ClientConfig, + opts.clientConfig || {}, {'x-goog-api-client': clientHeader.join(' ')}); + + // Set up a dictionary of "inner API calls"; the core implementation + // of calling the API is handled in `google-gax`, with this code + // merely providing the destination and request information. + this.innerApiCalls = {}; + + // Add a warn function to the client constructor so it can be easily tested. + this.warn = this._gaxModule.warn; + } + + /** + * Initialize the client. + * Performs asynchronous operations (such as authentication) and prepares the client. + * This function will be called automatically when any class method is called for the + * first time, but if you need to initialize it before calling an actual method, + * feel free to call initialize() directly. + * + * You can await on this method if you want to make sure the client is initialized. + * + * @returns {Promise} A promise that resolves to an authenticated service stub. + */ + initialize() { + // If the client stub promise is already initialized, return immediately. + if (this.interceptStub) { + return this.interceptStub; + } + + // Put together the "service stub" for + // google.cloud.networksecurity.v1.Intercept. + this.interceptStub = this._gaxGrpc.createStub( + this._opts.fallback ? + (this._protos as protobuf.Root).lookupService('google.cloud.networksecurity.v1.Intercept') : + // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.networksecurity.v1.Intercept, + this._opts, this._providedCustomServicePath) as Promise<{[method: string]: Function}>; + + // Iterate over each of the methods that the service provides + // and create an API call method for each. + const interceptStubMethods = + ['listInterceptEndpointGroups', 'getInterceptEndpointGroup', 'createInterceptEndpointGroup', 'updateInterceptEndpointGroup', 'deleteInterceptEndpointGroup', 'listInterceptEndpointGroupAssociations', 'getInterceptEndpointGroupAssociation', 'createInterceptEndpointGroupAssociation', 'updateInterceptEndpointGroupAssociation', 'deleteInterceptEndpointGroupAssociation', 'listInterceptDeploymentGroups', 'getInterceptDeploymentGroup', 'createInterceptDeploymentGroup', 'updateInterceptDeploymentGroup', 'deleteInterceptDeploymentGroup', 'listInterceptDeployments', 'getInterceptDeployment', 'createInterceptDeployment', 'updateInterceptDeployment', 'deleteInterceptDeployment']; + for (const methodName of interceptStubMethods) { + const callPromise = this.interceptStub.then( + stub => (...args: Array<{}>) => { + if (this._terminated) { + return Promise.reject('The client has already been closed.'); + } + const func = stub[methodName]; + return func.apply(stub, args); + }, + (err: Error|null|undefined) => () => { + throw err; + }); + + const descriptor = + this.descriptors.page[methodName] || + this.descriptors.longrunning[methodName] || + undefined; + const apiCall = this._gaxModule.createApiCall( + callPromise, + this._defaults[methodName], + descriptor, + this._opts.fallback + ); + + this.innerApiCalls[methodName] = apiCall; + } + + return this.interceptStub; + } + + /** + * The DNS address for this API service. + * @deprecated Use the apiEndpoint method of the client instance. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + if (typeof process === 'object' && typeof process.emitWarning === 'function') { + process.emitWarning('Static servicePath is deprecated, please use the instance method instead.', 'DeprecationWarning'); + } + return 'networksecurity.googleapis.com'; + } + + /** + * The DNS address for this API service - same as servicePath. + * @deprecated Use the apiEndpoint method of the client instance. + * @returns {string} The DNS address for this service. + */ + static get apiEndpoint() { + if (typeof process === 'object' && typeof process.emitWarning === 'function') { + process.emitWarning('Static apiEndpoint is deprecated, please use the instance method instead.', 'DeprecationWarning'); + } + return 'networksecurity.googleapis.com'; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + get apiEndpoint() { + return this._servicePath; + } + + get universeDomain() { + return this._universeDomain; + } + + /** + * The port for this API service. + * @returns {number} The default port for this service. + */ + static get port() { + return 443; + } + + /** + * The scopes needed to make gRPC calls for every method defined + * in this service. + * @returns {string[]} List of default scopes. + */ + static get scopes() { + return [ + 'https://www.googleapis.com/auth/cloud-platform' + ]; + } + + getProjectId(): Promise; + getProjectId(callback: Callback): void; + /** + * Return the project ID used by this class. + * @returns {Promise} A promise that resolves to string containing the project ID. + */ + getProjectId(callback?: Callback): + Promise|void { + if (callback) { + this.auth.getProjectId(callback); + return; + } + return this.auth.getProjectId(); + } + + // ------------------- + // -- Service calls -- + // ------------------- +/** + * Gets a specific endpoint group. + * See https://google.aip.dev/131. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the endpoint group to retrieve. + * Format: + * projects/{project}/locations/{location}/interceptEndpointGroups/{intercept_endpoint_group} + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.cloud.networksecurity.v1.InterceptEndpointGroup|InterceptEndpointGroup}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1/intercept.get_intercept_endpoint_group.js + * region_tag:networksecurity_v1_generated_Intercept_GetInterceptEndpointGroup_async + */ + getInterceptEndpointGroup( + request?: protos.google.cloud.networksecurity.v1.IGetInterceptEndpointGroupRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.networksecurity.v1.IInterceptEndpointGroup, + protos.google.cloud.networksecurity.v1.IGetInterceptEndpointGroupRequest|undefined, {}|undefined + ]>; + getInterceptEndpointGroup( + request: protos.google.cloud.networksecurity.v1.IGetInterceptEndpointGroupRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.networksecurity.v1.IInterceptEndpointGroup, + protos.google.cloud.networksecurity.v1.IGetInterceptEndpointGroupRequest|null|undefined, + {}|null|undefined>): void; + getInterceptEndpointGroup( + request: protos.google.cloud.networksecurity.v1.IGetInterceptEndpointGroupRequest, + callback: Callback< + protos.google.cloud.networksecurity.v1.IInterceptEndpointGroup, + protos.google.cloud.networksecurity.v1.IGetInterceptEndpointGroupRequest|null|undefined, + {}|null|undefined>): void; + getInterceptEndpointGroup( + request?: protos.google.cloud.networksecurity.v1.IGetInterceptEndpointGroupRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.networksecurity.v1.IInterceptEndpointGroup, + protos.google.cloud.networksecurity.v1.IGetInterceptEndpointGroupRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.networksecurity.v1.IInterceptEndpointGroup, + protos.google.cloud.networksecurity.v1.IGetInterceptEndpointGroupRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.networksecurity.v1.IInterceptEndpointGroup, + protos.google.cloud.networksecurity.v1.IGetInterceptEndpointGroupRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('getInterceptEndpointGroup request %j', request); + const wrappedCallback: Callback< + protos.google.cloud.networksecurity.v1.IInterceptEndpointGroup, + protos.google.cloud.networksecurity.v1.IGetInterceptEndpointGroupRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getInterceptEndpointGroup response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.getInterceptEndpointGroup(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.cloud.networksecurity.v1.IInterceptEndpointGroup, + protos.google.cloud.networksecurity.v1.IGetInterceptEndpointGroupRequest|undefined, + {}|undefined + ]) => { + this._log.info('getInterceptEndpointGroup response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * Gets a specific association. + * See https://google.aip.dev/131. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the association to retrieve. + * Format: + * projects/{project}/locations/{location}/interceptEndpointGroupAssociations/{intercept_endpoint_group_association} + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.cloud.networksecurity.v1.InterceptEndpointGroupAssociation|InterceptEndpointGroupAssociation}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1/intercept.get_intercept_endpoint_group_association.js + * region_tag:networksecurity_v1_generated_Intercept_GetInterceptEndpointGroupAssociation_async + */ + getInterceptEndpointGroupAssociation( + request?: protos.google.cloud.networksecurity.v1.IGetInterceptEndpointGroupAssociationRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.networksecurity.v1.IInterceptEndpointGroupAssociation, + protos.google.cloud.networksecurity.v1.IGetInterceptEndpointGroupAssociationRequest|undefined, {}|undefined + ]>; + getInterceptEndpointGroupAssociation( + request: protos.google.cloud.networksecurity.v1.IGetInterceptEndpointGroupAssociationRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.networksecurity.v1.IInterceptEndpointGroupAssociation, + protos.google.cloud.networksecurity.v1.IGetInterceptEndpointGroupAssociationRequest|null|undefined, + {}|null|undefined>): void; + getInterceptEndpointGroupAssociation( + request: protos.google.cloud.networksecurity.v1.IGetInterceptEndpointGroupAssociationRequest, + callback: Callback< + protos.google.cloud.networksecurity.v1.IInterceptEndpointGroupAssociation, + protos.google.cloud.networksecurity.v1.IGetInterceptEndpointGroupAssociationRequest|null|undefined, + {}|null|undefined>): void; + getInterceptEndpointGroupAssociation( + request?: protos.google.cloud.networksecurity.v1.IGetInterceptEndpointGroupAssociationRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.networksecurity.v1.IInterceptEndpointGroupAssociation, + protos.google.cloud.networksecurity.v1.IGetInterceptEndpointGroupAssociationRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.networksecurity.v1.IInterceptEndpointGroupAssociation, + protos.google.cloud.networksecurity.v1.IGetInterceptEndpointGroupAssociationRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.networksecurity.v1.IInterceptEndpointGroupAssociation, + protos.google.cloud.networksecurity.v1.IGetInterceptEndpointGroupAssociationRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('getInterceptEndpointGroupAssociation request %j', request); + const wrappedCallback: Callback< + protos.google.cloud.networksecurity.v1.IInterceptEndpointGroupAssociation, + protos.google.cloud.networksecurity.v1.IGetInterceptEndpointGroupAssociationRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getInterceptEndpointGroupAssociation response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.getInterceptEndpointGroupAssociation(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.cloud.networksecurity.v1.IInterceptEndpointGroupAssociation, + protos.google.cloud.networksecurity.v1.IGetInterceptEndpointGroupAssociationRequest|undefined, + {}|undefined + ]) => { + this._log.info('getInterceptEndpointGroupAssociation response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * Gets a specific deployment group. + * See https://google.aip.dev/131. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the deployment group to retrieve. + * Format: + * projects/{project}/locations/{location}/interceptDeploymentGroups/{intercept_deployment_group} + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.cloud.networksecurity.v1.InterceptDeploymentGroup|InterceptDeploymentGroup}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1/intercept.get_intercept_deployment_group.js + * region_tag:networksecurity_v1_generated_Intercept_GetInterceptDeploymentGroup_async + */ + getInterceptDeploymentGroup( + request?: protos.google.cloud.networksecurity.v1.IGetInterceptDeploymentGroupRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.networksecurity.v1.IInterceptDeploymentGroup, + protos.google.cloud.networksecurity.v1.IGetInterceptDeploymentGroupRequest|undefined, {}|undefined + ]>; + getInterceptDeploymentGroup( + request: protos.google.cloud.networksecurity.v1.IGetInterceptDeploymentGroupRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.networksecurity.v1.IInterceptDeploymentGroup, + protos.google.cloud.networksecurity.v1.IGetInterceptDeploymentGroupRequest|null|undefined, + {}|null|undefined>): void; + getInterceptDeploymentGroup( + request: protos.google.cloud.networksecurity.v1.IGetInterceptDeploymentGroupRequest, + callback: Callback< + protos.google.cloud.networksecurity.v1.IInterceptDeploymentGroup, + protos.google.cloud.networksecurity.v1.IGetInterceptDeploymentGroupRequest|null|undefined, + {}|null|undefined>): void; + getInterceptDeploymentGroup( + request?: protos.google.cloud.networksecurity.v1.IGetInterceptDeploymentGroupRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.networksecurity.v1.IInterceptDeploymentGroup, + protos.google.cloud.networksecurity.v1.IGetInterceptDeploymentGroupRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.networksecurity.v1.IInterceptDeploymentGroup, + protos.google.cloud.networksecurity.v1.IGetInterceptDeploymentGroupRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.networksecurity.v1.IInterceptDeploymentGroup, + protos.google.cloud.networksecurity.v1.IGetInterceptDeploymentGroupRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('getInterceptDeploymentGroup request %j', request); + const wrappedCallback: Callback< + protos.google.cloud.networksecurity.v1.IInterceptDeploymentGroup, + protos.google.cloud.networksecurity.v1.IGetInterceptDeploymentGroupRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getInterceptDeploymentGroup response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.getInterceptDeploymentGroup(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.cloud.networksecurity.v1.IInterceptDeploymentGroup, + protos.google.cloud.networksecurity.v1.IGetInterceptDeploymentGroupRequest|undefined, + {}|undefined + ]) => { + this._log.info('getInterceptDeploymentGroup response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * Gets a specific deployment. + * See https://google.aip.dev/131. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the deployment to retrieve. + * Format: + * projects/{project}/locations/{location}/interceptDeployments/{intercept_deployment} + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.cloud.networksecurity.v1.InterceptDeployment|InterceptDeployment}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1/intercept.get_intercept_deployment.js + * region_tag:networksecurity_v1_generated_Intercept_GetInterceptDeployment_async + */ + getInterceptDeployment( + request?: protos.google.cloud.networksecurity.v1.IGetInterceptDeploymentRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.networksecurity.v1.IInterceptDeployment, + protos.google.cloud.networksecurity.v1.IGetInterceptDeploymentRequest|undefined, {}|undefined + ]>; + getInterceptDeployment( + request: protos.google.cloud.networksecurity.v1.IGetInterceptDeploymentRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.networksecurity.v1.IInterceptDeployment, + protos.google.cloud.networksecurity.v1.IGetInterceptDeploymentRequest|null|undefined, + {}|null|undefined>): void; + getInterceptDeployment( + request: protos.google.cloud.networksecurity.v1.IGetInterceptDeploymentRequest, + callback: Callback< + protos.google.cloud.networksecurity.v1.IInterceptDeployment, + protos.google.cloud.networksecurity.v1.IGetInterceptDeploymentRequest|null|undefined, + {}|null|undefined>): void; + getInterceptDeployment( + request?: protos.google.cloud.networksecurity.v1.IGetInterceptDeploymentRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.networksecurity.v1.IInterceptDeployment, + protos.google.cloud.networksecurity.v1.IGetInterceptDeploymentRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.networksecurity.v1.IInterceptDeployment, + protos.google.cloud.networksecurity.v1.IGetInterceptDeploymentRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.networksecurity.v1.IInterceptDeployment, + protos.google.cloud.networksecurity.v1.IGetInterceptDeploymentRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('getInterceptDeployment request %j', request); + const wrappedCallback: Callback< + protos.google.cloud.networksecurity.v1.IInterceptDeployment, + protos.google.cloud.networksecurity.v1.IGetInterceptDeploymentRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getInterceptDeployment response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.getInterceptDeployment(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.cloud.networksecurity.v1.IInterceptDeployment, + protos.google.cloud.networksecurity.v1.IGetInterceptDeploymentRequest|undefined, + {}|undefined + ]) => { + this._log.info('getInterceptDeployment response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } + +/** + * Creates an endpoint group in a given project and location. + * See https://google.aip.dev/133. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent resource where this endpoint group will be created. + * Format: projects/{project}/locations/{location} + * @param {string} request.interceptEndpointGroupId + * Required. The ID to use for the endpoint group, which will become the final + * component of the endpoint group's resource name. + * @param {google.cloud.networksecurity.v1.InterceptEndpointGroup} request.interceptEndpointGroup + * Required. The endpoint group to create. + * @param {string} [request.requestId] + * Optional. A unique identifier for this request. Must be a UUID4. + * This request is only idempotent if a `request_id` is provided. + * See https://google.aip.dev/155 for more details. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/intercept.create_intercept_endpoint_group.js + * region_tag:networksecurity_v1_generated_Intercept_CreateInterceptEndpointGroup_async + */ + createInterceptEndpointGroup( + request?: protos.google.cloud.networksecurity.v1.ICreateInterceptEndpointGroupRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + createInterceptEndpointGroup( + request: protos.google.cloud.networksecurity.v1.ICreateInterceptEndpointGroupRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + createInterceptEndpointGroup( + request: protos.google.cloud.networksecurity.v1.ICreateInterceptEndpointGroupRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + createInterceptEndpointGroup( + request?: protos.google.cloud.networksecurity.v1.ICreateInterceptEndpointGroupRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize().catch(err => {throw err}); + const wrappedCallback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('createInterceptEndpointGroup response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('createInterceptEndpointGroup request %j', request); + return this.innerApiCalls.createInterceptEndpointGroup(request, options, wrappedCallback) + ?.then(([response, rawResponse, _]: [ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]) => { + this._log.info('createInterceptEndpointGroup response %j', rawResponse); + return [response, rawResponse, _]; + }); + } +/** + * Check the status of the long running operation returned by `createInterceptEndpointGroup()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/intercept.create_intercept_endpoint_group.js + * region_tag:networksecurity_v1_generated_Intercept_CreateInterceptEndpointGroup_async + */ + async checkCreateInterceptEndpointGroupProgress(name: string): Promise>{ + this._log.info('createInterceptEndpointGroup long-running'); + const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.createInterceptEndpointGroup, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Updates an endpoint group. + * See https://google.aip.dev/134. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.protobuf.FieldMask} [request.updateMask] + * Optional. The list of fields to update. + * Fields are specified relative to the endpoint group + * (e.g. `description`; *not* `intercept_endpoint_group.description`). + * See https://google.aip.dev/161 for more details. + * @param {google.cloud.networksecurity.v1.InterceptEndpointGroup} request.interceptEndpointGroup + * Required. The endpoint group to update. + * @param {string} [request.requestId] + * Optional. A unique identifier for this request. Must be a UUID4. + * This request is only idempotent if a `request_id` is provided. + * See https://google.aip.dev/155 for more details. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/intercept.update_intercept_endpoint_group.js + * region_tag:networksecurity_v1_generated_Intercept_UpdateInterceptEndpointGroup_async + */ + updateInterceptEndpointGroup( + request?: protos.google.cloud.networksecurity.v1.IUpdateInterceptEndpointGroupRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + updateInterceptEndpointGroup( + request: protos.google.cloud.networksecurity.v1.IUpdateInterceptEndpointGroupRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + updateInterceptEndpointGroup( + request: protos.google.cloud.networksecurity.v1.IUpdateInterceptEndpointGroupRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + updateInterceptEndpointGroup( + request?: protos.google.cloud.networksecurity.v1.IUpdateInterceptEndpointGroupRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'intercept_endpoint_group.name': request.interceptEndpointGroup!.name ?? '', + }); + this.initialize().catch(err => {throw err}); + const wrappedCallback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('updateInterceptEndpointGroup response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('updateInterceptEndpointGroup request %j', request); + return this.innerApiCalls.updateInterceptEndpointGroup(request, options, wrappedCallback) + ?.then(([response, rawResponse, _]: [ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]) => { + this._log.info('updateInterceptEndpointGroup response %j', rawResponse); + return [response, rawResponse, _]; + }); + } +/** + * Check the status of the long running operation returned by `updateInterceptEndpointGroup()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/intercept.update_intercept_endpoint_group.js + * region_tag:networksecurity_v1_generated_Intercept_UpdateInterceptEndpointGroup_async + */ + async checkUpdateInterceptEndpointGroupProgress(name: string): Promise>{ + this._log.info('updateInterceptEndpointGroup long-running'); + const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.updateInterceptEndpointGroup, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Deletes an endpoint group. + * See https://google.aip.dev/135. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The endpoint group to delete. + * @param {string} [request.requestId] + * Optional. A unique identifier for this request. Must be a UUID4. + * This request is only idempotent if a `request_id` is provided. + * See https://google.aip.dev/155 for more details. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/intercept.delete_intercept_endpoint_group.js + * region_tag:networksecurity_v1_generated_Intercept_DeleteInterceptEndpointGroup_async + */ + deleteInterceptEndpointGroup( + request?: protos.google.cloud.networksecurity.v1.IDeleteInterceptEndpointGroupRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + deleteInterceptEndpointGroup( + request: protos.google.cloud.networksecurity.v1.IDeleteInterceptEndpointGroupRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + deleteInterceptEndpointGroup( + request: protos.google.cloud.networksecurity.v1.IDeleteInterceptEndpointGroupRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + deleteInterceptEndpointGroup( + request?: protos.google.cloud.networksecurity.v1.IDeleteInterceptEndpointGroupRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize().catch(err => {throw err}); + const wrappedCallback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('deleteInterceptEndpointGroup response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('deleteInterceptEndpointGroup request %j', request); + return this.innerApiCalls.deleteInterceptEndpointGroup(request, options, wrappedCallback) + ?.then(([response, rawResponse, _]: [ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]) => { + this._log.info('deleteInterceptEndpointGroup response %j', rawResponse); + return [response, rawResponse, _]; + }); + } +/** + * Check the status of the long running operation returned by `deleteInterceptEndpointGroup()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/intercept.delete_intercept_endpoint_group.js + * region_tag:networksecurity_v1_generated_Intercept_DeleteInterceptEndpointGroup_async + */ + async checkDeleteInterceptEndpointGroupProgress(name: string): Promise>{ + this._log.info('deleteInterceptEndpointGroup long-running'); + const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.deleteInterceptEndpointGroup, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Creates an association in a given project and location. + * See https://google.aip.dev/133. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent resource where this association will be created. + * Format: projects/{project}/locations/{location} + * @param {string} [request.interceptEndpointGroupAssociationId] + * Optional. The ID to use for the new association, which will become the + * final component of the endpoint group's resource name. If not provided, the + * server will generate a unique ID. + * @param {google.cloud.networksecurity.v1.InterceptEndpointGroupAssociation} request.interceptEndpointGroupAssociation + * Required. The association to create. + * @param {string} [request.requestId] + * Optional. A unique identifier for this request. Must be a UUID4. + * This request is only idempotent if a `request_id` is provided. + * See https://google.aip.dev/155 for more details. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/intercept.create_intercept_endpoint_group_association.js + * region_tag:networksecurity_v1_generated_Intercept_CreateInterceptEndpointGroupAssociation_async + */ + createInterceptEndpointGroupAssociation( + request?: protos.google.cloud.networksecurity.v1.ICreateInterceptEndpointGroupAssociationRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + createInterceptEndpointGroupAssociation( + request: protos.google.cloud.networksecurity.v1.ICreateInterceptEndpointGroupAssociationRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + createInterceptEndpointGroupAssociation( + request: protos.google.cloud.networksecurity.v1.ICreateInterceptEndpointGroupAssociationRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + createInterceptEndpointGroupAssociation( + request?: protos.google.cloud.networksecurity.v1.ICreateInterceptEndpointGroupAssociationRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize().catch(err => {throw err}); + const wrappedCallback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('createInterceptEndpointGroupAssociation response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('createInterceptEndpointGroupAssociation request %j', request); + return this.innerApiCalls.createInterceptEndpointGroupAssociation(request, options, wrappedCallback) + ?.then(([response, rawResponse, _]: [ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]) => { + this._log.info('createInterceptEndpointGroupAssociation response %j', rawResponse); + return [response, rawResponse, _]; + }); + } +/** + * Check the status of the long running operation returned by `createInterceptEndpointGroupAssociation()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/intercept.create_intercept_endpoint_group_association.js + * region_tag:networksecurity_v1_generated_Intercept_CreateInterceptEndpointGroupAssociation_async + */ + async checkCreateInterceptEndpointGroupAssociationProgress(name: string): Promise>{ + this._log.info('createInterceptEndpointGroupAssociation long-running'); + const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.createInterceptEndpointGroupAssociation, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Updates an association. + * See https://google.aip.dev/134. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.protobuf.FieldMask} [request.updateMask] + * Optional. The list of fields to update. + * Fields are specified relative to the association + * (e.g. `description`; *not* + * `intercept_endpoint_group_association.description`). See + * https://google.aip.dev/161 for more details. + * @param {google.cloud.networksecurity.v1.InterceptEndpointGroupAssociation} request.interceptEndpointGroupAssociation + * Required. The association to update. + * @param {string} [request.requestId] + * Optional. A unique identifier for this request. Must be a UUID4. + * This request is only idempotent if a `request_id` is provided. + * See https://google.aip.dev/155 for more details. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/intercept.update_intercept_endpoint_group_association.js + * region_tag:networksecurity_v1_generated_Intercept_UpdateInterceptEndpointGroupAssociation_async + */ + updateInterceptEndpointGroupAssociation( + request?: protos.google.cloud.networksecurity.v1.IUpdateInterceptEndpointGroupAssociationRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + updateInterceptEndpointGroupAssociation( + request: protos.google.cloud.networksecurity.v1.IUpdateInterceptEndpointGroupAssociationRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + updateInterceptEndpointGroupAssociation( + request: protos.google.cloud.networksecurity.v1.IUpdateInterceptEndpointGroupAssociationRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + updateInterceptEndpointGroupAssociation( + request?: protos.google.cloud.networksecurity.v1.IUpdateInterceptEndpointGroupAssociationRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'intercept_endpoint_group_association.name': request.interceptEndpointGroupAssociation!.name ?? '', + }); + this.initialize().catch(err => {throw err}); + const wrappedCallback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('updateInterceptEndpointGroupAssociation response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('updateInterceptEndpointGroupAssociation request %j', request); + return this.innerApiCalls.updateInterceptEndpointGroupAssociation(request, options, wrappedCallback) + ?.then(([response, rawResponse, _]: [ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]) => { + this._log.info('updateInterceptEndpointGroupAssociation response %j', rawResponse); + return [response, rawResponse, _]; + }); + } +/** + * Check the status of the long running operation returned by `updateInterceptEndpointGroupAssociation()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/intercept.update_intercept_endpoint_group_association.js + * region_tag:networksecurity_v1_generated_Intercept_UpdateInterceptEndpointGroupAssociation_async + */ + async checkUpdateInterceptEndpointGroupAssociationProgress(name: string): Promise>{ + this._log.info('updateInterceptEndpointGroupAssociation long-running'); + const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.updateInterceptEndpointGroupAssociation, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Deletes an association. + * See https://google.aip.dev/135. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The association to delete. + * @param {string} [request.requestId] + * Optional. A unique identifier for this request. Must be a UUID4. + * This request is only idempotent if a `request_id` is provided. + * See https://google.aip.dev/155 for more details. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/intercept.delete_intercept_endpoint_group_association.js + * region_tag:networksecurity_v1_generated_Intercept_DeleteInterceptEndpointGroupAssociation_async + */ + deleteInterceptEndpointGroupAssociation( + request?: protos.google.cloud.networksecurity.v1.IDeleteInterceptEndpointGroupAssociationRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + deleteInterceptEndpointGroupAssociation( + request: protos.google.cloud.networksecurity.v1.IDeleteInterceptEndpointGroupAssociationRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + deleteInterceptEndpointGroupAssociation( + request: protos.google.cloud.networksecurity.v1.IDeleteInterceptEndpointGroupAssociationRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + deleteInterceptEndpointGroupAssociation( + request?: protos.google.cloud.networksecurity.v1.IDeleteInterceptEndpointGroupAssociationRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize().catch(err => {throw err}); + const wrappedCallback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('deleteInterceptEndpointGroupAssociation response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('deleteInterceptEndpointGroupAssociation request %j', request); + return this.innerApiCalls.deleteInterceptEndpointGroupAssociation(request, options, wrappedCallback) + ?.then(([response, rawResponse, _]: [ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]) => { + this._log.info('deleteInterceptEndpointGroupAssociation response %j', rawResponse); + return [response, rawResponse, _]; + }); + } +/** + * Check the status of the long running operation returned by `deleteInterceptEndpointGroupAssociation()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/intercept.delete_intercept_endpoint_group_association.js + * region_tag:networksecurity_v1_generated_Intercept_DeleteInterceptEndpointGroupAssociation_async + */ + async checkDeleteInterceptEndpointGroupAssociationProgress(name: string): Promise>{ + this._log.info('deleteInterceptEndpointGroupAssociation long-running'); + const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.deleteInterceptEndpointGroupAssociation, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Creates a deployment group in a given project and location. + * See https://google.aip.dev/133. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent resource where this deployment group will be created. + * Format: projects/{project}/locations/{location} + * @param {string} request.interceptDeploymentGroupId + * Required. The ID to use for the new deployment group, which will become the + * final component of the deployment group's resource name. + * @param {google.cloud.networksecurity.v1.InterceptDeploymentGroup} request.interceptDeploymentGroup + * Required. The deployment group to create. + * @param {string} [request.requestId] + * Optional. A unique identifier for this request. Must be a UUID4. + * This request is only idempotent if a `request_id` is provided. + * See https://google.aip.dev/155 for more details. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/intercept.create_intercept_deployment_group.js + * region_tag:networksecurity_v1_generated_Intercept_CreateInterceptDeploymentGroup_async + */ + createInterceptDeploymentGroup( + request?: protos.google.cloud.networksecurity.v1.ICreateInterceptDeploymentGroupRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + createInterceptDeploymentGroup( + request: protos.google.cloud.networksecurity.v1.ICreateInterceptDeploymentGroupRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + createInterceptDeploymentGroup( + request: protos.google.cloud.networksecurity.v1.ICreateInterceptDeploymentGroupRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + createInterceptDeploymentGroup( + request?: protos.google.cloud.networksecurity.v1.ICreateInterceptDeploymentGroupRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize().catch(err => {throw err}); + const wrappedCallback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('createInterceptDeploymentGroup response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('createInterceptDeploymentGroup request %j', request); + return this.innerApiCalls.createInterceptDeploymentGroup(request, options, wrappedCallback) + ?.then(([response, rawResponse, _]: [ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]) => { + this._log.info('createInterceptDeploymentGroup response %j', rawResponse); + return [response, rawResponse, _]; + }); + } +/** + * Check the status of the long running operation returned by `createInterceptDeploymentGroup()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/intercept.create_intercept_deployment_group.js + * region_tag:networksecurity_v1_generated_Intercept_CreateInterceptDeploymentGroup_async + */ + async checkCreateInterceptDeploymentGroupProgress(name: string): Promise>{ + this._log.info('createInterceptDeploymentGroup long-running'); + const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.createInterceptDeploymentGroup, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Updates a deployment group. + * See https://google.aip.dev/134. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.protobuf.FieldMask} [request.updateMask] + * Optional. The list of fields to update. + * Fields are specified relative to the deployment group + * (e.g. `description`; *not* + * `intercept_deployment_group.description`). See + * https://google.aip.dev/161 for more details. + * @param {google.cloud.networksecurity.v1.InterceptDeploymentGroup} request.interceptDeploymentGroup + * Required. The deployment group to update. + * @param {string} [request.requestId] + * Optional. A unique identifier for this request. Must be a UUID4. + * This request is only idempotent if a `request_id` is provided. + * See https://google.aip.dev/155 for more details. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/intercept.update_intercept_deployment_group.js + * region_tag:networksecurity_v1_generated_Intercept_UpdateInterceptDeploymentGroup_async + */ + updateInterceptDeploymentGroup( + request?: protos.google.cloud.networksecurity.v1.IUpdateInterceptDeploymentGroupRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + updateInterceptDeploymentGroup( + request: protos.google.cloud.networksecurity.v1.IUpdateInterceptDeploymentGroupRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + updateInterceptDeploymentGroup( + request: protos.google.cloud.networksecurity.v1.IUpdateInterceptDeploymentGroupRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + updateInterceptDeploymentGroup( + request?: protos.google.cloud.networksecurity.v1.IUpdateInterceptDeploymentGroupRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'intercept_deployment_group.name': request.interceptDeploymentGroup!.name ?? '', + }); + this.initialize().catch(err => {throw err}); + const wrappedCallback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('updateInterceptDeploymentGroup response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('updateInterceptDeploymentGroup request %j', request); + return this.innerApiCalls.updateInterceptDeploymentGroup(request, options, wrappedCallback) + ?.then(([response, rawResponse, _]: [ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]) => { + this._log.info('updateInterceptDeploymentGroup response %j', rawResponse); + return [response, rawResponse, _]; + }); + } +/** + * Check the status of the long running operation returned by `updateInterceptDeploymentGroup()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/intercept.update_intercept_deployment_group.js + * region_tag:networksecurity_v1_generated_Intercept_UpdateInterceptDeploymentGroup_async + */ + async checkUpdateInterceptDeploymentGroupProgress(name: string): Promise>{ + this._log.info('updateInterceptDeploymentGroup long-running'); + const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.updateInterceptDeploymentGroup, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Deletes a deployment group. + * See https://google.aip.dev/135. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The deployment group to delete. + * @param {string} [request.requestId] + * Optional. A unique identifier for this request. Must be a UUID4. + * This request is only idempotent if a `request_id` is provided. + * See https://google.aip.dev/155 for more details. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/intercept.delete_intercept_deployment_group.js + * region_tag:networksecurity_v1_generated_Intercept_DeleteInterceptDeploymentGroup_async + */ + deleteInterceptDeploymentGroup( + request?: protos.google.cloud.networksecurity.v1.IDeleteInterceptDeploymentGroupRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + deleteInterceptDeploymentGroup( + request: protos.google.cloud.networksecurity.v1.IDeleteInterceptDeploymentGroupRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + deleteInterceptDeploymentGroup( + request: protos.google.cloud.networksecurity.v1.IDeleteInterceptDeploymentGroupRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + deleteInterceptDeploymentGroup( + request?: protos.google.cloud.networksecurity.v1.IDeleteInterceptDeploymentGroupRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize().catch(err => {throw err}); + const wrappedCallback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('deleteInterceptDeploymentGroup response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('deleteInterceptDeploymentGroup request %j', request); + return this.innerApiCalls.deleteInterceptDeploymentGroup(request, options, wrappedCallback) + ?.then(([response, rawResponse, _]: [ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]) => { + this._log.info('deleteInterceptDeploymentGroup response %j', rawResponse); + return [response, rawResponse, _]; + }); + } +/** + * Check the status of the long running operation returned by `deleteInterceptDeploymentGroup()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/intercept.delete_intercept_deployment_group.js + * region_tag:networksecurity_v1_generated_Intercept_DeleteInterceptDeploymentGroup_async + */ + async checkDeleteInterceptDeploymentGroupProgress(name: string): Promise>{ + this._log.info('deleteInterceptDeploymentGroup long-running'); + const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.deleteInterceptDeploymentGroup, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Creates a deployment in a given project and location. + * See https://google.aip.dev/133. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent resource where this deployment will be created. + * Format: projects/{project}/locations/{location} + * @param {string} request.interceptDeploymentId + * Required. The ID to use for the new deployment, which will become the final + * component of the deployment's resource name. + * @param {google.cloud.networksecurity.v1.InterceptDeployment} request.interceptDeployment + * Required. The deployment to create. + * @param {string} [request.requestId] + * Optional. A unique identifier for this request. Must be a UUID4. + * This request is only idempotent if a `request_id` is provided. + * See https://google.aip.dev/155 for more details. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/intercept.create_intercept_deployment.js + * region_tag:networksecurity_v1_generated_Intercept_CreateInterceptDeployment_async + */ + createInterceptDeployment( + request?: protos.google.cloud.networksecurity.v1.ICreateInterceptDeploymentRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + createInterceptDeployment( + request: protos.google.cloud.networksecurity.v1.ICreateInterceptDeploymentRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + createInterceptDeployment( + request: protos.google.cloud.networksecurity.v1.ICreateInterceptDeploymentRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + createInterceptDeployment( + request?: protos.google.cloud.networksecurity.v1.ICreateInterceptDeploymentRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize().catch(err => {throw err}); + const wrappedCallback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('createInterceptDeployment response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('createInterceptDeployment request %j', request); + return this.innerApiCalls.createInterceptDeployment(request, options, wrappedCallback) + ?.then(([response, rawResponse, _]: [ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]) => { + this._log.info('createInterceptDeployment response %j', rawResponse); + return [response, rawResponse, _]; + }); + } +/** + * Check the status of the long running operation returned by `createInterceptDeployment()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/intercept.create_intercept_deployment.js + * region_tag:networksecurity_v1_generated_Intercept_CreateInterceptDeployment_async + */ + async checkCreateInterceptDeploymentProgress(name: string): Promise>{ + this._log.info('createInterceptDeployment long-running'); + const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.createInterceptDeployment, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Updates a deployment. + * See https://google.aip.dev/134. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.protobuf.FieldMask} [request.updateMask] + * Optional. The list of fields to update. + * Fields are specified relative to the deployment + * (e.g. `description`; *not* `intercept_deployment.description`). + * See https://google.aip.dev/161 for more details. + * @param {google.cloud.networksecurity.v1.InterceptDeployment} request.interceptDeployment + * Required. The deployment to update. + * @param {string} [request.requestId] + * Optional. A unique identifier for this request. Must be a UUID4. + * This request is only idempotent if a `request_id` is provided. + * See https://google.aip.dev/155 for more details. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/intercept.update_intercept_deployment.js + * region_tag:networksecurity_v1_generated_Intercept_UpdateInterceptDeployment_async + */ + updateInterceptDeployment( + request?: protos.google.cloud.networksecurity.v1.IUpdateInterceptDeploymentRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + updateInterceptDeployment( + request: protos.google.cloud.networksecurity.v1.IUpdateInterceptDeploymentRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + updateInterceptDeployment( + request: protos.google.cloud.networksecurity.v1.IUpdateInterceptDeploymentRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + updateInterceptDeployment( + request?: protos.google.cloud.networksecurity.v1.IUpdateInterceptDeploymentRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'intercept_deployment.name': request.interceptDeployment!.name ?? '', + }); + this.initialize().catch(err => {throw err}); + const wrappedCallback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('updateInterceptDeployment response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('updateInterceptDeployment request %j', request); + return this.innerApiCalls.updateInterceptDeployment(request, options, wrappedCallback) + ?.then(([response, rawResponse, _]: [ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]) => { + this._log.info('updateInterceptDeployment response %j', rawResponse); + return [response, rawResponse, _]; + }); + } +/** + * Check the status of the long running operation returned by `updateInterceptDeployment()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/intercept.update_intercept_deployment.js + * region_tag:networksecurity_v1_generated_Intercept_UpdateInterceptDeployment_async + */ + async checkUpdateInterceptDeploymentProgress(name: string): Promise>{ + this._log.info('updateInterceptDeployment long-running'); + const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.updateInterceptDeployment, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Deletes a deployment. + * See https://google.aip.dev/135. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Name of the resource + * @param {string} [request.requestId] + * Optional. A unique identifier for this request. Must be a UUID4. + * This request is only idempotent if a `request_id` is provided. + * See https://google.aip.dev/155 for more details. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/intercept.delete_intercept_deployment.js + * region_tag:networksecurity_v1_generated_Intercept_DeleteInterceptDeployment_async + */ + deleteInterceptDeployment( + request?: protos.google.cloud.networksecurity.v1.IDeleteInterceptDeploymentRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + deleteInterceptDeployment( + request: protos.google.cloud.networksecurity.v1.IDeleteInterceptDeploymentRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + deleteInterceptDeployment( + request: protos.google.cloud.networksecurity.v1.IDeleteInterceptDeploymentRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + deleteInterceptDeployment( + request?: protos.google.cloud.networksecurity.v1.IDeleteInterceptDeploymentRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize().catch(err => {throw err}); + const wrappedCallback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('deleteInterceptDeployment response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('deleteInterceptDeployment request %j', request); + return this.innerApiCalls.deleteInterceptDeployment(request, options, wrappedCallback) + ?.then(([response, rawResponse, _]: [ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]) => { + this._log.info('deleteInterceptDeployment response %j', rawResponse); + return [response, rawResponse, _]; + }); + } +/** + * Check the status of the long running operation returned by `deleteInterceptDeployment()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/intercept.delete_intercept_deployment.js + * region_tag:networksecurity_v1_generated_Intercept_DeleteInterceptDeployment_async + */ + async checkDeleteInterceptDeploymentProgress(name: string): Promise>{ + this._log.info('deleteInterceptDeployment long-running'); + const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.deleteInterceptDeployment, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } + /** + * Lists endpoint groups in a given project and location. + * See https://google.aip.dev/132. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent, which owns this collection of endpoint groups. + * Example: `projects/123456789/locations/global`. + * See https://google.aip.dev/132 for more details. + * @param {number} [request.pageSize] + * Optional. Requested page size. Server may return fewer items than + * requested. If unspecified, server will pick an appropriate default. See + * https://google.aip.dev/158 for more details. + * @param {string} [request.pageToken] + * Optional. A page token, received from a previous + * `ListInterceptEndpointGroups` call. Provide this to retrieve the subsequent + * page. When paginating, all other parameters provided to + * `ListInterceptEndpointGroups` must match the call that provided the page + * token. + * See https://google.aip.dev/158 for more details. + * @param {string} [request.filter] + * Optional. Filter expression. + * See https://google.aip.dev/160#filtering for more details. + * @param {string} [request.orderBy] + * Optional. Sort expression. + * See https://google.aip.dev/132#ordering for more details. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of {@link protos.google.cloud.networksecurity.v1.InterceptEndpointGroup|InterceptEndpointGroup}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listInterceptEndpointGroupsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listInterceptEndpointGroups( + request?: protos.google.cloud.networksecurity.v1.IListInterceptEndpointGroupsRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.networksecurity.v1.IInterceptEndpointGroup[], + protos.google.cloud.networksecurity.v1.IListInterceptEndpointGroupsRequest|null, + protos.google.cloud.networksecurity.v1.IListInterceptEndpointGroupsResponse + ]>; + listInterceptEndpointGroups( + request: protos.google.cloud.networksecurity.v1.IListInterceptEndpointGroupsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.networksecurity.v1.IListInterceptEndpointGroupsRequest, + protos.google.cloud.networksecurity.v1.IListInterceptEndpointGroupsResponse|null|undefined, + protos.google.cloud.networksecurity.v1.IInterceptEndpointGroup>): void; + listInterceptEndpointGroups( + request: protos.google.cloud.networksecurity.v1.IListInterceptEndpointGroupsRequest, + callback: PaginationCallback< + protos.google.cloud.networksecurity.v1.IListInterceptEndpointGroupsRequest, + protos.google.cloud.networksecurity.v1.IListInterceptEndpointGroupsResponse|null|undefined, + protos.google.cloud.networksecurity.v1.IInterceptEndpointGroup>): void; + listInterceptEndpointGroups( + request?: protos.google.cloud.networksecurity.v1.IListInterceptEndpointGroupsRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.cloud.networksecurity.v1.IListInterceptEndpointGroupsRequest, + protos.google.cloud.networksecurity.v1.IListInterceptEndpointGroupsResponse|null|undefined, + protos.google.cloud.networksecurity.v1.IInterceptEndpointGroup>, + callback?: PaginationCallback< + protos.google.cloud.networksecurity.v1.IListInterceptEndpointGroupsRequest, + protos.google.cloud.networksecurity.v1.IListInterceptEndpointGroupsResponse|null|undefined, + protos.google.cloud.networksecurity.v1.IInterceptEndpointGroup>): + Promise<[ + protos.google.cloud.networksecurity.v1.IInterceptEndpointGroup[], + protos.google.cloud.networksecurity.v1.IListInterceptEndpointGroupsRequest|null, + protos.google.cloud.networksecurity.v1.IListInterceptEndpointGroupsResponse + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize().catch(err => {throw err}); + const wrappedCallback: PaginationCallback< + protos.google.cloud.networksecurity.v1.IListInterceptEndpointGroupsRequest, + protos.google.cloud.networksecurity.v1.IListInterceptEndpointGroupsResponse|null|undefined, + protos.google.cloud.networksecurity.v1.IInterceptEndpointGroup>|undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listInterceptEndpointGroups values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listInterceptEndpointGroups request %j', request); + return this.innerApiCalls + .listInterceptEndpointGroups(request, options, wrappedCallback) + ?.then(([response, input, output]: [ + protos.google.cloud.networksecurity.v1.IInterceptEndpointGroup[], + protos.google.cloud.networksecurity.v1.IListInterceptEndpointGroupsRequest|null, + protos.google.cloud.networksecurity.v1.IListInterceptEndpointGroupsResponse + ]) => { + this._log.info('listInterceptEndpointGroups values %j', response); + return [response, input, output]; + }); + } + +/** + * Equivalent to `listInterceptEndpointGroups`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent, which owns this collection of endpoint groups. + * Example: `projects/123456789/locations/global`. + * See https://google.aip.dev/132 for more details. + * @param {number} [request.pageSize] + * Optional. Requested page size. Server may return fewer items than + * requested. If unspecified, server will pick an appropriate default. See + * https://google.aip.dev/158 for more details. + * @param {string} [request.pageToken] + * Optional. A page token, received from a previous + * `ListInterceptEndpointGroups` call. Provide this to retrieve the subsequent + * page. When paginating, all other parameters provided to + * `ListInterceptEndpointGroups` must match the call that provided the page + * token. + * See https://google.aip.dev/158 for more details. + * @param {string} [request.filter] + * Optional. Filter expression. + * See https://google.aip.dev/160#filtering for more details. + * @param {string} [request.orderBy] + * Optional. Sort expression. + * See https://google.aip.dev/132#ordering for more details. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing {@link protos.google.cloud.networksecurity.v1.InterceptEndpointGroup|InterceptEndpointGroup} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `listInterceptEndpointGroupsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listInterceptEndpointGroupsStream( + request?: protos.google.cloud.networksecurity.v1.IListInterceptEndpointGroupsRequest, + options?: CallOptions): + Transform{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listInterceptEndpointGroups']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listInterceptEndpointGroups stream %j', request); + return this.descriptors.page.listInterceptEndpointGroups.createStream( + this.innerApiCalls.listInterceptEndpointGroups as GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listInterceptEndpointGroups`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent, which owns this collection of endpoint groups. + * Example: `projects/123456789/locations/global`. + * See https://google.aip.dev/132 for more details. + * @param {number} [request.pageSize] + * Optional. Requested page size. Server may return fewer items than + * requested. If unspecified, server will pick an appropriate default. See + * https://google.aip.dev/158 for more details. + * @param {string} [request.pageToken] + * Optional. A page token, received from a previous + * `ListInterceptEndpointGroups` call. Provide this to retrieve the subsequent + * page. When paginating, all other parameters provided to + * `ListInterceptEndpointGroups` must match the call that provided the page + * token. + * See https://google.aip.dev/158 for more details. + * @param {string} [request.filter] + * Optional. Filter expression. + * See https://google.aip.dev/160#filtering for more details. + * @param {string} [request.orderBy] + * Optional. Sort expression. + * See https://google.aip.dev/132#ordering for more details. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link protos.google.cloud.networksecurity.v1.InterceptEndpointGroup|InterceptEndpointGroup}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example include:samples/generated/v1/intercept.list_intercept_endpoint_groups.js + * region_tag:networksecurity_v1_generated_Intercept_ListInterceptEndpointGroups_async + */ + listInterceptEndpointGroupsAsync( + request?: protos.google.cloud.networksecurity.v1.IListInterceptEndpointGroupsRequest, + options?: CallOptions): + AsyncIterable{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listInterceptEndpointGroups']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listInterceptEndpointGroups iterate %j', request); + return this.descriptors.page.listInterceptEndpointGroups.asyncIterate( + this.innerApiCalls['listInterceptEndpointGroups'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Lists associations in a given project and location. + * See https://google.aip.dev/132. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent, which owns this collection of associations. + * Example: `projects/123456789/locations/global`. + * See https://google.aip.dev/132 for more details. + * @param {number} [request.pageSize] + * Optional. Requested page size. Server may return fewer items than + * requested. If unspecified, server will pick an appropriate default. See + * https://google.aip.dev/158 for more details. + * @param {string} [request.pageToken] + * Optional. A page token, received from a previous + * `ListInterceptEndpointGroups` call. Provide this to retrieve the subsequent + * page. When paginating, all other parameters provided to + * `ListInterceptEndpointGroups` must match the call that provided the page + * token. See https://google.aip.dev/158 for more details. + * @param {string} [request.filter] + * Optional. Filter expression. + * See https://google.aip.dev/160#filtering for more details. + * @param {string} [request.orderBy] + * Optional. Sort expression. + * See https://google.aip.dev/132#ordering for more details. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of {@link protos.google.cloud.networksecurity.v1.InterceptEndpointGroupAssociation|InterceptEndpointGroupAssociation}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listInterceptEndpointGroupAssociationsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listInterceptEndpointGroupAssociations( + request?: protos.google.cloud.networksecurity.v1.IListInterceptEndpointGroupAssociationsRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.networksecurity.v1.IInterceptEndpointGroupAssociation[], + protos.google.cloud.networksecurity.v1.IListInterceptEndpointGroupAssociationsRequest|null, + protos.google.cloud.networksecurity.v1.IListInterceptEndpointGroupAssociationsResponse + ]>; + listInterceptEndpointGroupAssociations( + request: protos.google.cloud.networksecurity.v1.IListInterceptEndpointGroupAssociationsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.networksecurity.v1.IListInterceptEndpointGroupAssociationsRequest, + protos.google.cloud.networksecurity.v1.IListInterceptEndpointGroupAssociationsResponse|null|undefined, + protos.google.cloud.networksecurity.v1.IInterceptEndpointGroupAssociation>): void; + listInterceptEndpointGroupAssociations( + request: protos.google.cloud.networksecurity.v1.IListInterceptEndpointGroupAssociationsRequest, + callback: PaginationCallback< + protos.google.cloud.networksecurity.v1.IListInterceptEndpointGroupAssociationsRequest, + protos.google.cloud.networksecurity.v1.IListInterceptEndpointGroupAssociationsResponse|null|undefined, + protos.google.cloud.networksecurity.v1.IInterceptEndpointGroupAssociation>): void; + listInterceptEndpointGroupAssociations( + request?: protos.google.cloud.networksecurity.v1.IListInterceptEndpointGroupAssociationsRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.cloud.networksecurity.v1.IListInterceptEndpointGroupAssociationsRequest, + protos.google.cloud.networksecurity.v1.IListInterceptEndpointGroupAssociationsResponse|null|undefined, + protos.google.cloud.networksecurity.v1.IInterceptEndpointGroupAssociation>, + callback?: PaginationCallback< + protos.google.cloud.networksecurity.v1.IListInterceptEndpointGroupAssociationsRequest, + protos.google.cloud.networksecurity.v1.IListInterceptEndpointGroupAssociationsResponse|null|undefined, + protos.google.cloud.networksecurity.v1.IInterceptEndpointGroupAssociation>): + Promise<[ + protos.google.cloud.networksecurity.v1.IInterceptEndpointGroupAssociation[], + protos.google.cloud.networksecurity.v1.IListInterceptEndpointGroupAssociationsRequest|null, + protos.google.cloud.networksecurity.v1.IListInterceptEndpointGroupAssociationsResponse + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize().catch(err => {throw err}); + const wrappedCallback: PaginationCallback< + protos.google.cloud.networksecurity.v1.IListInterceptEndpointGroupAssociationsRequest, + protos.google.cloud.networksecurity.v1.IListInterceptEndpointGroupAssociationsResponse|null|undefined, + protos.google.cloud.networksecurity.v1.IInterceptEndpointGroupAssociation>|undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listInterceptEndpointGroupAssociations values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listInterceptEndpointGroupAssociations request %j', request); + return this.innerApiCalls + .listInterceptEndpointGroupAssociations(request, options, wrappedCallback) + ?.then(([response, input, output]: [ + protos.google.cloud.networksecurity.v1.IInterceptEndpointGroupAssociation[], + protos.google.cloud.networksecurity.v1.IListInterceptEndpointGroupAssociationsRequest|null, + protos.google.cloud.networksecurity.v1.IListInterceptEndpointGroupAssociationsResponse + ]) => { + this._log.info('listInterceptEndpointGroupAssociations values %j', response); + return [response, input, output]; + }); + } + +/** + * Equivalent to `listInterceptEndpointGroupAssociations`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent, which owns this collection of associations. + * Example: `projects/123456789/locations/global`. + * See https://google.aip.dev/132 for more details. + * @param {number} [request.pageSize] + * Optional. Requested page size. Server may return fewer items than + * requested. If unspecified, server will pick an appropriate default. See + * https://google.aip.dev/158 for more details. + * @param {string} [request.pageToken] + * Optional. A page token, received from a previous + * `ListInterceptEndpointGroups` call. Provide this to retrieve the subsequent + * page. When paginating, all other parameters provided to + * `ListInterceptEndpointGroups` must match the call that provided the page + * token. See https://google.aip.dev/158 for more details. + * @param {string} [request.filter] + * Optional. Filter expression. + * See https://google.aip.dev/160#filtering for more details. + * @param {string} [request.orderBy] + * Optional. Sort expression. + * See https://google.aip.dev/132#ordering for more details. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing {@link protos.google.cloud.networksecurity.v1.InterceptEndpointGroupAssociation|InterceptEndpointGroupAssociation} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `listInterceptEndpointGroupAssociationsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listInterceptEndpointGroupAssociationsStream( + request?: protos.google.cloud.networksecurity.v1.IListInterceptEndpointGroupAssociationsRequest, + options?: CallOptions): + Transform{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listInterceptEndpointGroupAssociations']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listInterceptEndpointGroupAssociations stream %j', request); + return this.descriptors.page.listInterceptEndpointGroupAssociations.createStream( + this.innerApiCalls.listInterceptEndpointGroupAssociations as GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listInterceptEndpointGroupAssociations`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent, which owns this collection of associations. + * Example: `projects/123456789/locations/global`. + * See https://google.aip.dev/132 for more details. + * @param {number} [request.pageSize] + * Optional. Requested page size. Server may return fewer items than + * requested. If unspecified, server will pick an appropriate default. See + * https://google.aip.dev/158 for more details. + * @param {string} [request.pageToken] + * Optional. A page token, received from a previous + * `ListInterceptEndpointGroups` call. Provide this to retrieve the subsequent + * page. When paginating, all other parameters provided to + * `ListInterceptEndpointGroups` must match the call that provided the page + * token. See https://google.aip.dev/158 for more details. + * @param {string} [request.filter] + * Optional. Filter expression. + * See https://google.aip.dev/160#filtering for more details. + * @param {string} [request.orderBy] + * Optional. Sort expression. + * See https://google.aip.dev/132#ordering for more details. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link protos.google.cloud.networksecurity.v1.InterceptEndpointGroupAssociation|InterceptEndpointGroupAssociation}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example include:samples/generated/v1/intercept.list_intercept_endpoint_group_associations.js + * region_tag:networksecurity_v1_generated_Intercept_ListInterceptEndpointGroupAssociations_async + */ + listInterceptEndpointGroupAssociationsAsync( + request?: protos.google.cloud.networksecurity.v1.IListInterceptEndpointGroupAssociationsRequest, + options?: CallOptions): + AsyncIterable{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listInterceptEndpointGroupAssociations']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listInterceptEndpointGroupAssociations iterate %j', request); + return this.descriptors.page.listInterceptEndpointGroupAssociations.asyncIterate( + this.innerApiCalls['listInterceptEndpointGroupAssociations'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Lists deployment groups in a given project and location. + * See https://google.aip.dev/132. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent, which owns this collection of deployment groups. + * Example: `projects/123456789/locations/global`. + * See https://google.aip.dev/132 for more details. + * @param {number} [request.pageSize] + * Optional. Requested page size. Server may return fewer items than + * requested. If unspecified, server will pick an appropriate default. See + * https://google.aip.dev/158 for more details. + * @param {string} [request.pageToken] + * Optional. A page token, received from a previous + * `ListInterceptDeploymentGroups` call. Provide this to retrieve the + * subsequent page. When paginating, all other parameters provided to + * `ListInterceptDeploymentGroups` must match the call that provided the page + * token. See https://google.aip.dev/158 for more details. + * @param {string} [request.filter] + * Optional. Filter expression. + * See https://google.aip.dev/160#filtering for more details. + * @param {string} [request.orderBy] + * Optional. Sort expression. + * See https://google.aip.dev/132#ordering for more details. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of {@link protos.google.cloud.networksecurity.v1.InterceptDeploymentGroup|InterceptDeploymentGroup}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listInterceptDeploymentGroupsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listInterceptDeploymentGroups( + request?: protos.google.cloud.networksecurity.v1.IListInterceptDeploymentGroupsRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.networksecurity.v1.IInterceptDeploymentGroup[], + protos.google.cloud.networksecurity.v1.IListInterceptDeploymentGroupsRequest|null, + protos.google.cloud.networksecurity.v1.IListInterceptDeploymentGroupsResponse + ]>; + listInterceptDeploymentGroups( + request: protos.google.cloud.networksecurity.v1.IListInterceptDeploymentGroupsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.networksecurity.v1.IListInterceptDeploymentGroupsRequest, + protos.google.cloud.networksecurity.v1.IListInterceptDeploymentGroupsResponse|null|undefined, + protos.google.cloud.networksecurity.v1.IInterceptDeploymentGroup>): void; + listInterceptDeploymentGroups( + request: protos.google.cloud.networksecurity.v1.IListInterceptDeploymentGroupsRequest, + callback: PaginationCallback< + protos.google.cloud.networksecurity.v1.IListInterceptDeploymentGroupsRequest, + protos.google.cloud.networksecurity.v1.IListInterceptDeploymentGroupsResponse|null|undefined, + protos.google.cloud.networksecurity.v1.IInterceptDeploymentGroup>): void; + listInterceptDeploymentGroups( + request?: protos.google.cloud.networksecurity.v1.IListInterceptDeploymentGroupsRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.cloud.networksecurity.v1.IListInterceptDeploymentGroupsRequest, + protos.google.cloud.networksecurity.v1.IListInterceptDeploymentGroupsResponse|null|undefined, + protos.google.cloud.networksecurity.v1.IInterceptDeploymentGroup>, + callback?: PaginationCallback< + protos.google.cloud.networksecurity.v1.IListInterceptDeploymentGroupsRequest, + protos.google.cloud.networksecurity.v1.IListInterceptDeploymentGroupsResponse|null|undefined, + protos.google.cloud.networksecurity.v1.IInterceptDeploymentGroup>): + Promise<[ + protos.google.cloud.networksecurity.v1.IInterceptDeploymentGroup[], + protos.google.cloud.networksecurity.v1.IListInterceptDeploymentGroupsRequest|null, + protos.google.cloud.networksecurity.v1.IListInterceptDeploymentGroupsResponse + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize().catch(err => {throw err}); + const wrappedCallback: PaginationCallback< + protos.google.cloud.networksecurity.v1.IListInterceptDeploymentGroupsRequest, + protos.google.cloud.networksecurity.v1.IListInterceptDeploymentGroupsResponse|null|undefined, + protos.google.cloud.networksecurity.v1.IInterceptDeploymentGroup>|undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listInterceptDeploymentGroups values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listInterceptDeploymentGroups request %j', request); + return this.innerApiCalls + .listInterceptDeploymentGroups(request, options, wrappedCallback) + ?.then(([response, input, output]: [ + protos.google.cloud.networksecurity.v1.IInterceptDeploymentGroup[], + protos.google.cloud.networksecurity.v1.IListInterceptDeploymentGroupsRequest|null, + protos.google.cloud.networksecurity.v1.IListInterceptDeploymentGroupsResponse + ]) => { + this._log.info('listInterceptDeploymentGroups values %j', response); + return [response, input, output]; + }); + } + +/** + * Equivalent to `listInterceptDeploymentGroups`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent, which owns this collection of deployment groups. + * Example: `projects/123456789/locations/global`. + * See https://google.aip.dev/132 for more details. + * @param {number} [request.pageSize] + * Optional. Requested page size. Server may return fewer items than + * requested. If unspecified, server will pick an appropriate default. See + * https://google.aip.dev/158 for more details. + * @param {string} [request.pageToken] + * Optional. A page token, received from a previous + * `ListInterceptDeploymentGroups` call. Provide this to retrieve the + * subsequent page. When paginating, all other parameters provided to + * `ListInterceptDeploymentGroups` must match the call that provided the page + * token. See https://google.aip.dev/158 for more details. + * @param {string} [request.filter] + * Optional. Filter expression. + * See https://google.aip.dev/160#filtering for more details. + * @param {string} [request.orderBy] + * Optional. Sort expression. + * See https://google.aip.dev/132#ordering for more details. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing {@link protos.google.cloud.networksecurity.v1.InterceptDeploymentGroup|InterceptDeploymentGroup} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `listInterceptDeploymentGroupsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listInterceptDeploymentGroupsStream( + request?: protos.google.cloud.networksecurity.v1.IListInterceptDeploymentGroupsRequest, + options?: CallOptions): + Transform{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listInterceptDeploymentGroups']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listInterceptDeploymentGroups stream %j', request); + return this.descriptors.page.listInterceptDeploymentGroups.createStream( + this.innerApiCalls.listInterceptDeploymentGroups as GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listInterceptDeploymentGroups`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent, which owns this collection of deployment groups. + * Example: `projects/123456789/locations/global`. + * See https://google.aip.dev/132 for more details. + * @param {number} [request.pageSize] + * Optional. Requested page size. Server may return fewer items than + * requested. If unspecified, server will pick an appropriate default. See + * https://google.aip.dev/158 for more details. + * @param {string} [request.pageToken] + * Optional. A page token, received from a previous + * `ListInterceptDeploymentGroups` call. Provide this to retrieve the + * subsequent page. When paginating, all other parameters provided to + * `ListInterceptDeploymentGroups` must match the call that provided the page + * token. See https://google.aip.dev/158 for more details. + * @param {string} [request.filter] + * Optional. Filter expression. + * See https://google.aip.dev/160#filtering for more details. + * @param {string} [request.orderBy] + * Optional. Sort expression. + * See https://google.aip.dev/132#ordering for more details. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link protos.google.cloud.networksecurity.v1.InterceptDeploymentGroup|InterceptDeploymentGroup}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example include:samples/generated/v1/intercept.list_intercept_deployment_groups.js + * region_tag:networksecurity_v1_generated_Intercept_ListInterceptDeploymentGroups_async + */ + listInterceptDeploymentGroupsAsync( + request?: protos.google.cloud.networksecurity.v1.IListInterceptDeploymentGroupsRequest, + options?: CallOptions): + AsyncIterable{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listInterceptDeploymentGroups']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listInterceptDeploymentGroups iterate %j', request); + return this.descriptors.page.listInterceptDeploymentGroups.asyncIterate( + this.innerApiCalls['listInterceptDeploymentGroups'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Lists deployments in a given project and location. + * See https://google.aip.dev/132. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent, which owns this collection of deployments. + * Example: `projects/123456789/locations/us-central1-a`. + * See https://google.aip.dev/132 for more details. + * @param {number} [request.pageSize] + * Optional. Requested page size. Server may return fewer items than + * requested. If unspecified, server will pick an appropriate default. See + * https://google.aip.dev/158 for more details. + * @param {string} [request.pageToken] + * Optional. A page token, received from a previous `ListInterceptDeployments` + * call. Provide this to retrieve the subsequent page. When paginating, all + * other parameters provided to `ListInterceptDeployments` must match the call + * that provided the page token. See https://google.aip.dev/158 for more + * details. + * @param {string} [request.filter] + * Optional. Filter expression. + * See https://google.aip.dev/160#filtering for more details. + * @param {string} [request.orderBy] + * Optional. Sort expression. + * See https://google.aip.dev/132#ordering for more details. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of {@link protos.google.cloud.networksecurity.v1.InterceptDeployment|InterceptDeployment}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listInterceptDeploymentsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listInterceptDeployments( + request?: protos.google.cloud.networksecurity.v1.IListInterceptDeploymentsRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.networksecurity.v1.IInterceptDeployment[], + protos.google.cloud.networksecurity.v1.IListInterceptDeploymentsRequest|null, + protos.google.cloud.networksecurity.v1.IListInterceptDeploymentsResponse + ]>; + listInterceptDeployments( + request: protos.google.cloud.networksecurity.v1.IListInterceptDeploymentsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.networksecurity.v1.IListInterceptDeploymentsRequest, + protos.google.cloud.networksecurity.v1.IListInterceptDeploymentsResponse|null|undefined, + protos.google.cloud.networksecurity.v1.IInterceptDeployment>): void; + listInterceptDeployments( + request: protos.google.cloud.networksecurity.v1.IListInterceptDeploymentsRequest, + callback: PaginationCallback< + protos.google.cloud.networksecurity.v1.IListInterceptDeploymentsRequest, + protos.google.cloud.networksecurity.v1.IListInterceptDeploymentsResponse|null|undefined, + protos.google.cloud.networksecurity.v1.IInterceptDeployment>): void; + listInterceptDeployments( + request?: protos.google.cloud.networksecurity.v1.IListInterceptDeploymentsRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.cloud.networksecurity.v1.IListInterceptDeploymentsRequest, + protos.google.cloud.networksecurity.v1.IListInterceptDeploymentsResponse|null|undefined, + protos.google.cloud.networksecurity.v1.IInterceptDeployment>, + callback?: PaginationCallback< + protos.google.cloud.networksecurity.v1.IListInterceptDeploymentsRequest, + protos.google.cloud.networksecurity.v1.IListInterceptDeploymentsResponse|null|undefined, + protos.google.cloud.networksecurity.v1.IInterceptDeployment>): + Promise<[ + protos.google.cloud.networksecurity.v1.IInterceptDeployment[], + protos.google.cloud.networksecurity.v1.IListInterceptDeploymentsRequest|null, + protos.google.cloud.networksecurity.v1.IListInterceptDeploymentsResponse + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize().catch(err => {throw err}); + const wrappedCallback: PaginationCallback< + protos.google.cloud.networksecurity.v1.IListInterceptDeploymentsRequest, + protos.google.cloud.networksecurity.v1.IListInterceptDeploymentsResponse|null|undefined, + protos.google.cloud.networksecurity.v1.IInterceptDeployment>|undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listInterceptDeployments values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listInterceptDeployments request %j', request); + return this.innerApiCalls + .listInterceptDeployments(request, options, wrappedCallback) + ?.then(([response, input, output]: [ + protos.google.cloud.networksecurity.v1.IInterceptDeployment[], + protos.google.cloud.networksecurity.v1.IListInterceptDeploymentsRequest|null, + protos.google.cloud.networksecurity.v1.IListInterceptDeploymentsResponse + ]) => { + this._log.info('listInterceptDeployments values %j', response); + return [response, input, output]; + }); + } + +/** + * Equivalent to `listInterceptDeployments`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent, which owns this collection of deployments. + * Example: `projects/123456789/locations/us-central1-a`. + * See https://google.aip.dev/132 for more details. + * @param {number} [request.pageSize] + * Optional. Requested page size. Server may return fewer items than + * requested. If unspecified, server will pick an appropriate default. See + * https://google.aip.dev/158 for more details. + * @param {string} [request.pageToken] + * Optional. A page token, received from a previous `ListInterceptDeployments` + * call. Provide this to retrieve the subsequent page. When paginating, all + * other parameters provided to `ListInterceptDeployments` must match the call + * that provided the page token. See https://google.aip.dev/158 for more + * details. + * @param {string} [request.filter] + * Optional. Filter expression. + * See https://google.aip.dev/160#filtering for more details. + * @param {string} [request.orderBy] + * Optional. Sort expression. + * See https://google.aip.dev/132#ordering for more details. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing {@link protos.google.cloud.networksecurity.v1.InterceptDeployment|InterceptDeployment} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `listInterceptDeploymentsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listInterceptDeploymentsStream( + request?: protos.google.cloud.networksecurity.v1.IListInterceptDeploymentsRequest, + options?: CallOptions): + Transform{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listInterceptDeployments']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listInterceptDeployments stream %j', request); + return this.descriptors.page.listInterceptDeployments.createStream( + this.innerApiCalls.listInterceptDeployments as GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listInterceptDeployments`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent, which owns this collection of deployments. + * Example: `projects/123456789/locations/us-central1-a`. + * See https://google.aip.dev/132 for more details. + * @param {number} [request.pageSize] + * Optional. Requested page size. Server may return fewer items than + * requested. If unspecified, server will pick an appropriate default. See + * https://google.aip.dev/158 for more details. + * @param {string} [request.pageToken] + * Optional. A page token, received from a previous `ListInterceptDeployments` + * call. Provide this to retrieve the subsequent page. When paginating, all + * other parameters provided to `ListInterceptDeployments` must match the call + * that provided the page token. See https://google.aip.dev/158 for more + * details. + * @param {string} [request.filter] + * Optional. Filter expression. + * See https://google.aip.dev/160#filtering for more details. + * @param {string} [request.orderBy] + * Optional. Sort expression. + * See https://google.aip.dev/132#ordering for more details. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link protos.google.cloud.networksecurity.v1.InterceptDeployment|InterceptDeployment}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example include:samples/generated/v1/intercept.list_intercept_deployments.js + * region_tag:networksecurity_v1_generated_Intercept_ListInterceptDeployments_async + */ + listInterceptDeploymentsAsync( + request?: protos.google.cloud.networksecurity.v1.IListInterceptDeploymentsRequest, + options?: CallOptions): + AsyncIterable{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listInterceptDeployments']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listInterceptDeployments iterate %j', request); + return this.descriptors.page.listInterceptDeployments.asyncIterate( + this.innerApiCalls['listInterceptDeployments'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } +/** + * Gets the access control policy for a resource. Returns an empty policy + * if the resource exists and does not have a policy set. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.resource + * REQUIRED: The resource for which the policy is being requested. + * See the operation documentation for the appropriate value for this field. + * @param {Object} [request.options] + * OPTIONAL: A `GetPolicyOptions` object for specifying options to + * `GetIamPolicy`. This field is only used by Cloud IAM. + * + * This object should have the same structure as {@link google.iam.v1.GetPolicyOptions | GetPolicyOptions}. + * @param {Object} [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.CallOptions} for the details. + * @param {function(?Error, ?Object)} [callback] + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing {@link google.iam.v1.Policy | Policy}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.iam.v1.Policy | Policy}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + getIamPolicy( + request: IamProtos.google.iam.v1.GetIamPolicyRequest, + options?: + | gax.CallOptions + | Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.GetIamPolicyRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.GetIamPolicyRequest | null | undefined, + {} | null | undefined + > + ):Promise<[IamProtos.google.iam.v1.Policy]> { + return this.iamClient.getIamPolicy(request, options, callback); + } + +/** + * Returns permissions that a caller has on the specified resource. If the + * resource does not exist, this will return an empty set of + * permissions, not a NOT_FOUND error. + * + * Note: This operation is designed to be used for building + * permission-aware UIs and command-line tools, not for authorization + * checking. This operation may "fail open" without warning. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.resource + * REQUIRED: The resource for which the policy detail is being requested. + * See the operation documentation for the appropriate value for this field. + * @param {string[]} request.permissions + * The set of permissions to check for the `resource`. Permissions with + * wildcards (such as '*' or 'storage.*') are not allowed. For more + * information see {@link https://cloud.google.com/iam/docs/overview#permissions | IAM Overview }. + * @param {Object} [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.CallOptions} for the details. + * @param {function(?Error, ?Object)} [callback] + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + setIamPolicy( + request: IamProtos.google.iam.v1.SetIamPolicyRequest, + options?: + | gax.CallOptions + | Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.SetIamPolicyRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.SetIamPolicyRequest | null | undefined, + {} | null | undefined + > + ):Promise<[IamProtos.google.iam.v1.Policy]> { + return this.iamClient.setIamPolicy(request, options, callback); + } + +/** + * Returns permissions that a caller has on the specified resource. If the + * resource does not exist, this will return an empty set of + * permissions, not a NOT_FOUND error. + * + * Note: This operation is designed to be used for building + * permission-aware UIs and command-line tools, not for authorization + * checking. This operation may "fail open" without warning. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.resource + * REQUIRED: The resource for which the policy detail is being requested. + * See the operation documentation for the appropriate value for this field. + * @param {string[]} request.permissions + * The set of permissions to check for the `resource`. Permissions with + * wildcards (such as '*' or 'storage.*') are not allowed. For more + * information see {@link https://cloud.google.com/iam/docs/overview#permissions | IAM Overview }. + * @param {Object} [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.CallOptions} for the details. + * @param {function(?Error, ?Object)} [callback] + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. + * The promise has a method named "cancel" which cancels the ongoing API call. + * + */ + testIamPermissions( + request: IamProtos.google.iam.v1.TestIamPermissionsRequest, + options?: + | gax.CallOptions + | Callback< + IamProtos.google.iam.v1.TestIamPermissionsResponse, + IamProtos.google.iam.v1.TestIamPermissionsRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + IamProtos.google.iam.v1.TestIamPermissionsResponse, + IamProtos.google.iam.v1.TestIamPermissionsRequest | null | undefined, + {} | null | undefined + > + ):Promise<[IamProtos.google.iam.v1.TestIamPermissionsResponse]> { + return this.iamClient.testIamPermissions(request, options, callback); + } + +/** + * Gets information about a location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Resource name for the location. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html | CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.cloud.location.Location | Location}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example + * ``` + * const [response] = await client.getLocation(request); + * ``` + */ + getLocation( + request: LocationProtos.google.cloud.location.IGetLocationRequest, + options?: + | gax.CallOptions + | Callback< + LocationProtos.google.cloud.location.ILocation, + | LocationProtos.google.cloud.location.IGetLocationRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + LocationProtos.google.cloud.location.ILocation, + | LocationProtos.google.cloud.location.IGetLocationRequest + | null + | undefined, + {} | null | undefined + > + ): Promise { + return this.locationsClient.getLocation(request, options, callback); + } + +/** + * Lists information about the supported locations for this service. Returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * The resource that owns the locations collection, if applicable. + * @param {string} request.filter + * The standard list filter. + * @param {number} request.pageSize + * The standard list page size. + * @param {string} request.pageToken + * The standard list page token. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link google.cloud.location.Location | Location}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example + * ``` + * const iterable = client.listLocationsAsync(request); + * for await (const response of iterable) { + * // process response + * } + * ``` + */ + listLocationsAsync( + request: LocationProtos.google.cloud.location.IListLocationsRequest, + options?: CallOptions + ): AsyncIterable { + return this.locationsClient.listLocationsAsync(request, options); + } + +/** + * Gets the latest state of a long-running operation. Clients can use this + * method to poll the operation result at intervals as recommended by the API + * service. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation resource. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions} + * for the details. + * @param {function(?Error, ?Object)=} callback + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing + * {@link google.longrunning.Operation | google.longrunning.Operation}. + * @return {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * {@link google.longrunning.Operation | google.longrunning.Operation}. + * The promise has a method named "cancel" which cancels the ongoing API call. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * const name = ''; + * const [response] = await client.getOperation({name}); + * // doThingsWith(response) + * ``` + */ + getOperation( + request: protos.google.longrunning.GetOperationRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protos.google.longrunning.Operation, + protos.google.longrunning.GetOperationRequest, + {} | null | undefined + >, + callback?: Callback< + protos.google.longrunning.Operation, + protos.google.longrunning.GetOperationRequest, + {} | null | undefined + > + ): Promise<[protos.google.longrunning.Operation]> { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + return this.operationsClient.getOperation(request, options, callback); + } + /** + * Lists operations that match the specified filter in the request. If the + * server doesn't support this method, it returns `UNIMPLEMENTED`. Returns an iterable object. + * + * For-await-of syntax is used with the iterable to recursively get response element on-demand. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation collection. + * @param {string} request.filter - The standard list filter. + * @param {number=} request.pageSize - + * The maximum number of resources contained in the underlying API + * response. If page streaming is performed per-resource, this + * parameter does not affect the return value. If page streaming is + * performed per-page, this determines the maximum number of + * resources in a page. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions} for the + * details. + * @returns {Object} + * An iterable Object that conforms to {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | iteration protocols}. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * for await (const response of client.listOperationsAsync(request)); + * // doThingsWith(response) + * ``` + */ + listOperationsAsync( + request: protos.google.longrunning.ListOperationsRequest, + options?: gax.CallOptions + ): AsyncIterable { + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + return this.operationsClient.listOperationsAsync(request, options); + } + /** + * Starts asynchronous cancellation on a long-running operation. The server + * makes a best effort to cancel the operation, but success is not + * guaranteed. If the server doesn't support this method, it returns + * `google.rpc.Code.UNIMPLEMENTED`. Clients can use + * {@link Operations.GetOperation} or + * other methods to check whether the cancellation succeeded or whether the + * operation completed despite cancellation. On successful cancellation, + * the operation is not deleted; instead, it becomes an operation with + * an {@link Operation.error} value with a {@link google.rpc.Status.code} of + * 1, corresponding to `Code.CANCELLED`. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation resource to be cancelled. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions} for the + * details. + * @param {function(?Error)=} callback + * The function which will be called with the result of the API call. + * @return {Promise} - The promise which resolves when API call finishes. + * The promise has a method named "cancel" which cancels the ongoing API + * call. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * await client.cancelOperation({name: ''}); + * ``` + */ + cancelOperation( + request: protos.google.longrunning.CancelOperationRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protos.google.longrunning.CancelOperationRequest, + protos.google.protobuf.Empty, + {} | undefined | null + >, + callback?: Callback< + protos.google.longrunning.CancelOperationRequest, + protos.google.protobuf.Empty, + {} | undefined | null + > + ): Promise { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + return this.operationsClient.cancelOperation(request, options, callback); + } + + /** + * Deletes a long-running operation. This method indicates that the client is + * no longer interested in the operation result. It does not cancel the + * operation. If the server doesn't support this method, it returns + * `google.rpc.Code.UNIMPLEMENTED`. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation resource to be deleted. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions} + * for the details. + * @param {function(?Error)=} callback + * The function which will be called with the result of the API call. + * @return {Promise} - The promise which resolves when API call finishes. + * The promise has a method named "cancel" which cancels the ongoing API + * call. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * await client.deleteOperation({name: ''}); + * ``` + */ + deleteOperation( + request: protos.google.longrunning.DeleteOperationRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protos.google.protobuf.Empty, + protos.google.longrunning.DeleteOperationRequest, + {} | null | undefined + >, + callback?: Callback< + protos.google.protobuf.Empty, + protos.google.longrunning.DeleteOperationRequest, + {} | null | undefined + > + ): Promise { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + return this.operationsClient.deleteOperation(request, options, callback); + } + + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified authorizationPolicy resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} authorization_policy + * @returns {string} Resource name string. + */ + authorizationPolicyPath(project:string,location:string,authorizationPolicy:string) { + return this.pathTemplates.authorizationPolicyPathTemplate.render({ + project: project, + location: location, + authorization_policy: authorizationPolicy, + }); + } + + /** + * Parse the project from AuthorizationPolicy resource. + * + * @param {string} authorizationPolicyName + * A fully-qualified path representing AuthorizationPolicy resource. + * @returns {string} A string representing the project. + */ + matchProjectFromAuthorizationPolicyName(authorizationPolicyName: string) { + return this.pathTemplates.authorizationPolicyPathTemplate.match(authorizationPolicyName).project; + } + + /** + * Parse the location from AuthorizationPolicy resource. + * + * @param {string} authorizationPolicyName + * A fully-qualified path representing AuthorizationPolicy resource. + * @returns {string} A string representing the location. + */ + matchLocationFromAuthorizationPolicyName(authorizationPolicyName: string) { + return this.pathTemplates.authorizationPolicyPathTemplate.match(authorizationPolicyName).location; + } + + /** + * Parse the authorization_policy from AuthorizationPolicy resource. + * + * @param {string} authorizationPolicyName + * A fully-qualified path representing AuthorizationPolicy resource. + * @returns {string} A string representing the authorization_policy. + */ + matchAuthorizationPolicyFromAuthorizationPolicyName(authorizationPolicyName: string) { + return this.pathTemplates.authorizationPolicyPathTemplate.match(authorizationPolicyName).authorization_policy; + } + + /** + * Return a fully-qualified authzPolicy resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} authz_policy + * @returns {string} Resource name string. + */ + authzPolicyPath(project:string,location:string,authzPolicy:string) { + return this.pathTemplates.authzPolicyPathTemplate.render({ + project: project, + location: location, + authz_policy: authzPolicy, + }); + } + + /** + * Parse the project from AuthzPolicy resource. + * + * @param {string} authzPolicyName + * A fully-qualified path representing AuthzPolicy resource. + * @returns {string} A string representing the project. + */ + matchProjectFromAuthzPolicyName(authzPolicyName: string) { + return this.pathTemplates.authzPolicyPathTemplate.match(authzPolicyName).project; + } + + /** + * Parse the location from AuthzPolicy resource. + * + * @param {string} authzPolicyName + * A fully-qualified path representing AuthzPolicy resource. + * @returns {string} A string representing the location. + */ + matchLocationFromAuthzPolicyName(authzPolicyName: string) { + return this.pathTemplates.authzPolicyPathTemplate.match(authzPolicyName).location; + } + + /** + * Parse the authz_policy from AuthzPolicy resource. + * + * @param {string} authzPolicyName + * A fully-qualified path representing AuthzPolicy resource. + * @returns {string} A string representing the authz_policy. + */ + matchAuthzPolicyFromAuthzPolicyName(authzPolicyName: string) { + return this.pathTemplates.authzPolicyPathTemplate.match(authzPolicyName).authz_policy; + } + + /** + * Return a fully-qualified backendAuthenticationConfig resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} backend_authentication_config + * @returns {string} Resource name string. + */ + backendAuthenticationConfigPath(project:string,location:string,backendAuthenticationConfig:string) { + return this.pathTemplates.backendAuthenticationConfigPathTemplate.render({ + project: project, + location: location, + backend_authentication_config: backendAuthenticationConfig, + }); + } + + /** + * Parse the project from BackendAuthenticationConfig resource. + * + * @param {string} backendAuthenticationConfigName + * A fully-qualified path representing BackendAuthenticationConfig resource. + * @returns {string} A string representing the project. + */ + matchProjectFromBackendAuthenticationConfigName(backendAuthenticationConfigName: string) { + return this.pathTemplates.backendAuthenticationConfigPathTemplate.match(backendAuthenticationConfigName).project; + } + + /** + * Parse the location from BackendAuthenticationConfig resource. + * + * @param {string} backendAuthenticationConfigName + * A fully-qualified path representing BackendAuthenticationConfig resource. + * @returns {string} A string representing the location. + */ + matchLocationFromBackendAuthenticationConfigName(backendAuthenticationConfigName: string) { + return this.pathTemplates.backendAuthenticationConfigPathTemplate.match(backendAuthenticationConfigName).location; + } + + /** + * Parse the backend_authentication_config from BackendAuthenticationConfig resource. + * + * @param {string} backendAuthenticationConfigName + * A fully-qualified path representing BackendAuthenticationConfig resource. + * @returns {string} A string representing the backend_authentication_config. + */ + matchBackendAuthenticationConfigFromBackendAuthenticationConfigName(backendAuthenticationConfigName: string) { + return this.pathTemplates.backendAuthenticationConfigPathTemplate.match(backendAuthenticationConfigName).backend_authentication_config; + } + + /** + * Return a fully-qualified clientTlsPolicy resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} client_tls_policy + * @returns {string} Resource name string. + */ + clientTlsPolicyPath(project:string,location:string,clientTlsPolicy:string) { + return this.pathTemplates.clientTlsPolicyPathTemplate.render({ + project: project, + location: location, + client_tls_policy: clientTlsPolicy, + }); + } + + /** + * Parse the project from ClientTlsPolicy resource. + * + * @param {string} clientTlsPolicyName + * A fully-qualified path representing ClientTlsPolicy resource. + * @returns {string} A string representing the project. + */ + matchProjectFromClientTlsPolicyName(clientTlsPolicyName: string) { + return this.pathTemplates.clientTlsPolicyPathTemplate.match(clientTlsPolicyName).project; + } + + /** + * Parse the location from ClientTlsPolicy resource. + * + * @param {string} clientTlsPolicyName + * A fully-qualified path representing ClientTlsPolicy resource. + * @returns {string} A string representing the location. + */ + matchLocationFromClientTlsPolicyName(clientTlsPolicyName: string) { + return this.pathTemplates.clientTlsPolicyPathTemplate.match(clientTlsPolicyName).location; + } + + /** + * Parse the client_tls_policy from ClientTlsPolicy resource. + * + * @param {string} clientTlsPolicyName + * A fully-qualified path representing ClientTlsPolicy resource. + * @returns {string} A string representing the client_tls_policy. + */ + matchClientTlsPolicyFromClientTlsPolicyName(clientTlsPolicyName: string) { + return this.pathTemplates.clientTlsPolicyPathTemplate.match(clientTlsPolicyName).client_tls_policy; + } + + /** + * Return a fully-qualified dnsThreatDetector resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} dns_threat_detector + * @returns {string} Resource name string. + */ + dnsThreatDetectorPath(project:string,location:string,dnsThreatDetector:string) { + return this.pathTemplates.dnsThreatDetectorPathTemplate.render({ + project: project, + location: location, + dns_threat_detector: dnsThreatDetector, + }); + } + + /** + * Parse the project from DnsThreatDetector resource. + * + * @param {string} dnsThreatDetectorName + * A fully-qualified path representing DnsThreatDetector resource. + * @returns {string} A string representing the project. + */ + matchProjectFromDnsThreatDetectorName(dnsThreatDetectorName: string) { + return this.pathTemplates.dnsThreatDetectorPathTemplate.match(dnsThreatDetectorName).project; + } + + /** + * Parse the location from DnsThreatDetector resource. + * + * @param {string} dnsThreatDetectorName + * A fully-qualified path representing DnsThreatDetector resource. + * @returns {string} A string representing the location. + */ + matchLocationFromDnsThreatDetectorName(dnsThreatDetectorName: string) { + return this.pathTemplates.dnsThreatDetectorPathTemplate.match(dnsThreatDetectorName).location; + } + + /** + * Parse the dns_threat_detector from DnsThreatDetector resource. + * + * @param {string} dnsThreatDetectorName + * A fully-qualified path representing DnsThreatDetector resource. + * @returns {string} A string representing the dns_threat_detector. + */ + matchDnsThreatDetectorFromDnsThreatDetectorName(dnsThreatDetectorName: string) { + return this.pathTemplates.dnsThreatDetectorPathTemplate.match(dnsThreatDetectorName).dns_threat_detector; + } + + /** + * Return a fully-qualified firewallEndpointAssociation resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} firewall_endpoint_association + * @returns {string} Resource name string. + */ + firewallEndpointAssociationPath(project:string,location:string,firewallEndpointAssociation:string) { + return this.pathTemplates.firewallEndpointAssociationPathTemplate.render({ + project: project, + location: location, + firewall_endpoint_association: firewallEndpointAssociation, + }); + } + + /** + * Parse the project from FirewallEndpointAssociation resource. + * + * @param {string} firewallEndpointAssociationName + * A fully-qualified path representing FirewallEndpointAssociation resource. + * @returns {string} A string representing the project. + */ + matchProjectFromFirewallEndpointAssociationName(firewallEndpointAssociationName: string) { + return this.pathTemplates.firewallEndpointAssociationPathTemplate.match(firewallEndpointAssociationName).project; + } + + /** + * Parse the location from FirewallEndpointAssociation resource. + * + * @param {string} firewallEndpointAssociationName + * A fully-qualified path representing FirewallEndpointAssociation resource. + * @returns {string} A string representing the location. + */ + matchLocationFromFirewallEndpointAssociationName(firewallEndpointAssociationName: string) { + return this.pathTemplates.firewallEndpointAssociationPathTemplate.match(firewallEndpointAssociationName).location; + } + + /** + * Parse the firewall_endpoint_association from FirewallEndpointAssociation resource. + * + * @param {string} firewallEndpointAssociationName + * A fully-qualified path representing FirewallEndpointAssociation resource. + * @returns {string} A string representing the firewall_endpoint_association. + */ + matchFirewallEndpointAssociationFromFirewallEndpointAssociationName(firewallEndpointAssociationName: string) { + return this.pathTemplates.firewallEndpointAssociationPathTemplate.match(firewallEndpointAssociationName).firewall_endpoint_association; + } + + /** + * Return a fully-qualified forwardingRule resource name string. + * + * @param {string} project + * @param {string} forwarding_rule + * @returns {string} Resource name string. + */ + forwardingRulePath(project:string,forwardingRule:string) { + return this.pathTemplates.forwardingRulePathTemplate.render({ + project: project, + forwarding_rule: forwardingRule, + }); + } + + /** + * Parse the project from ForwardingRule resource. + * + * @param {string} forwardingRuleName + * A fully-qualified path representing ForwardingRule resource. + * @returns {string} A string representing the project. + */ + matchProjectFromForwardingRuleName(forwardingRuleName: string) { + return this.pathTemplates.forwardingRulePathTemplate.match(forwardingRuleName).project; + } + + /** + * Parse the forwarding_rule from ForwardingRule resource. + * + * @param {string} forwardingRuleName + * A fully-qualified path representing ForwardingRule resource. + * @returns {string} A string representing the forwarding_rule. + */ + matchForwardingRuleFromForwardingRuleName(forwardingRuleName: string) { + return this.pathTemplates.forwardingRulePathTemplate.match(forwardingRuleName).forwarding_rule; + } + + /** + * Return a fully-qualified gatewaySecurityPolicy resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} gateway_security_policy + * @returns {string} Resource name string. + */ + gatewaySecurityPolicyPath(project:string,location:string,gatewaySecurityPolicy:string) { + return this.pathTemplates.gatewaySecurityPolicyPathTemplate.render({ + project: project, + location: location, + gateway_security_policy: gatewaySecurityPolicy, + }); + } + + /** + * Parse the project from GatewaySecurityPolicy resource. + * + * @param {string} gatewaySecurityPolicyName + * A fully-qualified path representing GatewaySecurityPolicy resource. + * @returns {string} A string representing the project. + */ + matchProjectFromGatewaySecurityPolicyName(gatewaySecurityPolicyName: string) { + return this.pathTemplates.gatewaySecurityPolicyPathTemplate.match(gatewaySecurityPolicyName).project; + } + + /** + * Parse the location from GatewaySecurityPolicy resource. + * + * @param {string} gatewaySecurityPolicyName + * A fully-qualified path representing GatewaySecurityPolicy resource. + * @returns {string} A string representing the location. + */ + matchLocationFromGatewaySecurityPolicyName(gatewaySecurityPolicyName: string) { + return this.pathTemplates.gatewaySecurityPolicyPathTemplate.match(gatewaySecurityPolicyName).location; + } + + /** + * Parse the gateway_security_policy from GatewaySecurityPolicy resource. + * + * @param {string} gatewaySecurityPolicyName + * A fully-qualified path representing GatewaySecurityPolicy resource. + * @returns {string} A string representing the gateway_security_policy. + */ + matchGatewaySecurityPolicyFromGatewaySecurityPolicyName(gatewaySecurityPolicyName: string) { + return this.pathTemplates.gatewaySecurityPolicyPathTemplate.match(gatewaySecurityPolicyName).gateway_security_policy; + } + + /** + * Return a fully-qualified gatewaySecurityPolicyRule resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} gateway_security_policy + * @param {string} rule + * @returns {string} Resource name string. + */ + gatewaySecurityPolicyRulePath(project:string,location:string,gatewaySecurityPolicy:string,rule:string) { + return this.pathTemplates.gatewaySecurityPolicyRulePathTemplate.render({ + project: project, + location: location, + gateway_security_policy: gatewaySecurityPolicy, + rule: rule, + }); + } + + /** + * Parse the project from GatewaySecurityPolicyRule resource. + * + * @param {string} gatewaySecurityPolicyRuleName + * A fully-qualified path representing GatewaySecurityPolicyRule resource. + * @returns {string} A string representing the project. + */ + matchProjectFromGatewaySecurityPolicyRuleName(gatewaySecurityPolicyRuleName: string) { + return this.pathTemplates.gatewaySecurityPolicyRulePathTemplate.match(gatewaySecurityPolicyRuleName).project; + } + + /** + * Parse the location from GatewaySecurityPolicyRule resource. + * + * @param {string} gatewaySecurityPolicyRuleName + * A fully-qualified path representing GatewaySecurityPolicyRule resource. + * @returns {string} A string representing the location. + */ + matchLocationFromGatewaySecurityPolicyRuleName(gatewaySecurityPolicyRuleName: string) { + return this.pathTemplates.gatewaySecurityPolicyRulePathTemplate.match(gatewaySecurityPolicyRuleName).location; + } + + /** + * Parse the gateway_security_policy from GatewaySecurityPolicyRule resource. + * + * @param {string} gatewaySecurityPolicyRuleName + * A fully-qualified path representing GatewaySecurityPolicyRule resource. + * @returns {string} A string representing the gateway_security_policy. + */ + matchGatewaySecurityPolicyFromGatewaySecurityPolicyRuleName(gatewaySecurityPolicyRuleName: string) { + return this.pathTemplates.gatewaySecurityPolicyRulePathTemplate.match(gatewaySecurityPolicyRuleName).gateway_security_policy; + } + + /** + * Parse the rule from GatewaySecurityPolicyRule resource. + * + * @param {string} gatewaySecurityPolicyRuleName + * A fully-qualified path representing GatewaySecurityPolicyRule resource. + * @returns {string} A string representing the rule. + */ + matchRuleFromGatewaySecurityPolicyRuleName(gatewaySecurityPolicyRuleName: string) { + return this.pathTemplates.gatewaySecurityPolicyRulePathTemplate.match(gatewaySecurityPolicyRuleName).rule; + } + + /** + * Return a fully-qualified interceptDeployment resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} intercept_deployment + * @returns {string} Resource name string. + */ + interceptDeploymentPath(project:string,location:string,interceptDeployment:string) { + return this.pathTemplates.interceptDeploymentPathTemplate.render({ + project: project, + location: location, + intercept_deployment: interceptDeployment, + }); + } + + /** + * Parse the project from InterceptDeployment resource. + * + * @param {string} interceptDeploymentName + * A fully-qualified path representing InterceptDeployment resource. + * @returns {string} A string representing the project. + */ + matchProjectFromInterceptDeploymentName(interceptDeploymentName: string) { + return this.pathTemplates.interceptDeploymentPathTemplate.match(interceptDeploymentName).project; + } + + /** + * Parse the location from InterceptDeployment resource. + * + * @param {string} interceptDeploymentName + * A fully-qualified path representing InterceptDeployment resource. + * @returns {string} A string representing the location. + */ + matchLocationFromInterceptDeploymentName(interceptDeploymentName: string) { + return this.pathTemplates.interceptDeploymentPathTemplate.match(interceptDeploymentName).location; + } + + /** + * Parse the intercept_deployment from InterceptDeployment resource. + * + * @param {string} interceptDeploymentName + * A fully-qualified path representing InterceptDeployment resource. + * @returns {string} A string representing the intercept_deployment. + */ + matchInterceptDeploymentFromInterceptDeploymentName(interceptDeploymentName: string) { + return this.pathTemplates.interceptDeploymentPathTemplate.match(interceptDeploymentName).intercept_deployment; + } + + /** + * Return a fully-qualified interceptDeploymentGroup resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} intercept_deployment_group + * @returns {string} Resource name string. + */ + interceptDeploymentGroupPath(project:string,location:string,interceptDeploymentGroup:string) { + return this.pathTemplates.interceptDeploymentGroupPathTemplate.render({ + project: project, + location: location, + intercept_deployment_group: interceptDeploymentGroup, + }); + } + + /** + * Parse the project from InterceptDeploymentGroup resource. + * + * @param {string} interceptDeploymentGroupName + * A fully-qualified path representing InterceptDeploymentGroup resource. + * @returns {string} A string representing the project. + */ + matchProjectFromInterceptDeploymentGroupName(interceptDeploymentGroupName: string) { + return this.pathTemplates.interceptDeploymentGroupPathTemplate.match(interceptDeploymentGroupName).project; + } + + /** + * Parse the location from InterceptDeploymentGroup resource. + * + * @param {string} interceptDeploymentGroupName + * A fully-qualified path representing InterceptDeploymentGroup resource. + * @returns {string} A string representing the location. + */ + matchLocationFromInterceptDeploymentGroupName(interceptDeploymentGroupName: string) { + return this.pathTemplates.interceptDeploymentGroupPathTemplate.match(interceptDeploymentGroupName).location; + } + + /** + * Parse the intercept_deployment_group from InterceptDeploymentGroup resource. + * + * @param {string} interceptDeploymentGroupName + * A fully-qualified path representing InterceptDeploymentGroup resource. + * @returns {string} A string representing the intercept_deployment_group. + */ + matchInterceptDeploymentGroupFromInterceptDeploymentGroupName(interceptDeploymentGroupName: string) { + return this.pathTemplates.interceptDeploymentGroupPathTemplate.match(interceptDeploymentGroupName).intercept_deployment_group; + } + + /** + * Return a fully-qualified interceptEndpointGroup resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} intercept_endpoint_group + * @returns {string} Resource name string. + */ + interceptEndpointGroupPath(project:string,location:string,interceptEndpointGroup:string) { + return this.pathTemplates.interceptEndpointGroupPathTemplate.render({ + project: project, + location: location, + intercept_endpoint_group: interceptEndpointGroup, + }); + } + + /** + * Parse the project from InterceptEndpointGroup resource. + * + * @param {string} interceptEndpointGroupName + * A fully-qualified path representing InterceptEndpointGroup resource. + * @returns {string} A string representing the project. + */ + matchProjectFromInterceptEndpointGroupName(interceptEndpointGroupName: string) { + return this.pathTemplates.interceptEndpointGroupPathTemplate.match(interceptEndpointGroupName).project; + } + + /** + * Parse the location from InterceptEndpointGroup resource. + * + * @param {string} interceptEndpointGroupName + * A fully-qualified path representing InterceptEndpointGroup resource. + * @returns {string} A string representing the location. + */ + matchLocationFromInterceptEndpointGroupName(interceptEndpointGroupName: string) { + return this.pathTemplates.interceptEndpointGroupPathTemplate.match(interceptEndpointGroupName).location; + } + + /** + * Parse the intercept_endpoint_group from InterceptEndpointGroup resource. + * + * @param {string} interceptEndpointGroupName + * A fully-qualified path representing InterceptEndpointGroup resource. + * @returns {string} A string representing the intercept_endpoint_group. + */ + matchInterceptEndpointGroupFromInterceptEndpointGroupName(interceptEndpointGroupName: string) { + return this.pathTemplates.interceptEndpointGroupPathTemplate.match(interceptEndpointGroupName).intercept_endpoint_group; + } + + /** + * Return a fully-qualified interceptEndpointGroupAssociation resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} intercept_endpoint_group_association + * @returns {string} Resource name string. + */ + interceptEndpointGroupAssociationPath(project:string,location:string,interceptEndpointGroupAssociation:string) { + return this.pathTemplates.interceptEndpointGroupAssociationPathTemplate.render({ + project: project, + location: location, + intercept_endpoint_group_association: interceptEndpointGroupAssociation, + }); + } + + /** + * Parse the project from InterceptEndpointGroupAssociation resource. + * + * @param {string} interceptEndpointGroupAssociationName + * A fully-qualified path representing InterceptEndpointGroupAssociation resource. + * @returns {string} A string representing the project. + */ + matchProjectFromInterceptEndpointGroupAssociationName(interceptEndpointGroupAssociationName: string) { + return this.pathTemplates.interceptEndpointGroupAssociationPathTemplate.match(interceptEndpointGroupAssociationName).project; + } + + /** + * Parse the location from InterceptEndpointGroupAssociation resource. + * + * @param {string} interceptEndpointGroupAssociationName + * A fully-qualified path representing InterceptEndpointGroupAssociation resource. + * @returns {string} A string representing the location. + */ + matchLocationFromInterceptEndpointGroupAssociationName(interceptEndpointGroupAssociationName: string) { + return this.pathTemplates.interceptEndpointGroupAssociationPathTemplate.match(interceptEndpointGroupAssociationName).location; + } + + /** + * Parse the intercept_endpoint_group_association from InterceptEndpointGroupAssociation resource. + * + * @param {string} interceptEndpointGroupAssociationName + * A fully-qualified path representing InterceptEndpointGroupAssociation resource. + * @returns {string} A string representing the intercept_endpoint_group_association. + */ + matchInterceptEndpointGroupAssociationFromInterceptEndpointGroupAssociationName(interceptEndpointGroupAssociationName: string) { + return this.pathTemplates.interceptEndpointGroupAssociationPathTemplate.match(interceptEndpointGroupAssociationName).intercept_endpoint_group_association; + } + + /** + * Return a fully-qualified location resource name string. + * + * @param {string} project + * @param {string} location + * @returns {string} Resource name string. + */ + locationPath(project:string,location:string) { + return this.pathTemplates.locationPathTemplate.render({ + project: project, + location: location, + }); + } + + /** + * Parse the project from Location resource. + * + * @param {string} locationName + * A fully-qualified path representing Location resource. + * @returns {string} A string representing the project. + */ + matchProjectFromLocationName(locationName: string) { + return this.pathTemplates.locationPathTemplate.match(locationName).project; + } + + /** + * Parse the location from Location resource. + * + * @param {string} locationName + * A fully-qualified path representing Location resource. + * @returns {string} A string representing the location. + */ + matchLocationFromLocationName(locationName: string) { + return this.pathTemplates.locationPathTemplate.match(locationName).location; + } + + /** + * Return a fully-qualified mirroringDeployment resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} mirroring_deployment + * @returns {string} Resource name string. + */ + mirroringDeploymentPath(project:string,location:string,mirroringDeployment:string) { + return this.pathTemplates.mirroringDeploymentPathTemplate.render({ + project: project, + location: location, + mirroring_deployment: mirroringDeployment, + }); + } + + /** + * Parse the project from MirroringDeployment resource. + * + * @param {string} mirroringDeploymentName + * A fully-qualified path representing MirroringDeployment resource. + * @returns {string} A string representing the project. + */ + matchProjectFromMirroringDeploymentName(mirroringDeploymentName: string) { + return this.pathTemplates.mirroringDeploymentPathTemplate.match(mirroringDeploymentName).project; + } + + /** + * Parse the location from MirroringDeployment resource. + * + * @param {string} mirroringDeploymentName + * A fully-qualified path representing MirroringDeployment resource. + * @returns {string} A string representing the location. + */ + matchLocationFromMirroringDeploymentName(mirroringDeploymentName: string) { + return this.pathTemplates.mirroringDeploymentPathTemplate.match(mirroringDeploymentName).location; + } + + /** + * Parse the mirroring_deployment from MirroringDeployment resource. + * + * @param {string} mirroringDeploymentName + * A fully-qualified path representing MirroringDeployment resource. + * @returns {string} A string representing the mirroring_deployment. + */ + matchMirroringDeploymentFromMirroringDeploymentName(mirroringDeploymentName: string) { + return this.pathTemplates.mirroringDeploymentPathTemplate.match(mirroringDeploymentName).mirroring_deployment; + } + + /** + * Return a fully-qualified mirroringDeploymentGroup resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} mirroring_deployment_group + * @returns {string} Resource name string. + */ + mirroringDeploymentGroupPath(project:string,location:string,mirroringDeploymentGroup:string) { + return this.pathTemplates.mirroringDeploymentGroupPathTemplate.render({ + project: project, + location: location, + mirroring_deployment_group: mirroringDeploymentGroup, + }); + } + + /** + * Parse the project from MirroringDeploymentGroup resource. + * + * @param {string} mirroringDeploymentGroupName + * A fully-qualified path representing MirroringDeploymentGroup resource. + * @returns {string} A string representing the project. + */ + matchProjectFromMirroringDeploymentGroupName(mirroringDeploymentGroupName: string) { + return this.pathTemplates.mirroringDeploymentGroupPathTemplate.match(mirroringDeploymentGroupName).project; + } + + /** + * Parse the location from MirroringDeploymentGroup resource. + * + * @param {string} mirroringDeploymentGroupName + * A fully-qualified path representing MirroringDeploymentGroup resource. + * @returns {string} A string representing the location. + */ + matchLocationFromMirroringDeploymentGroupName(mirroringDeploymentGroupName: string) { + return this.pathTemplates.mirroringDeploymentGroupPathTemplate.match(mirroringDeploymentGroupName).location; + } + + /** + * Parse the mirroring_deployment_group from MirroringDeploymentGroup resource. + * + * @param {string} mirroringDeploymentGroupName + * A fully-qualified path representing MirroringDeploymentGroup resource. + * @returns {string} A string representing the mirroring_deployment_group. + */ + matchMirroringDeploymentGroupFromMirroringDeploymentGroupName(mirroringDeploymentGroupName: string) { + return this.pathTemplates.mirroringDeploymentGroupPathTemplate.match(mirroringDeploymentGroupName).mirroring_deployment_group; + } + + /** + * Return a fully-qualified mirroringEndpointGroup resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} mirroring_endpoint_group + * @returns {string} Resource name string. + */ + mirroringEndpointGroupPath(project:string,location:string,mirroringEndpointGroup:string) { + return this.pathTemplates.mirroringEndpointGroupPathTemplate.render({ + project: project, + location: location, + mirroring_endpoint_group: mirroringEndpointGroup, + }); + } + + /** + * Parse the project from MirroringEndpointGroup resource. + * + * @param {string} mirroringEndpointGroupName + * A fully-qualified path representing MirroringEndpointGroup resource. + * @returns {string} A string representing the project. + */ + matchProjectFromMirroringEndpointGroupName(mirroringEndpointGroupName: string) { + return this.pathTemplates.mirroringEndpointGroupPathTemplate.match(mirroringEndpointGroupName).project; + } + + /** + * Parse the location from MirroringEndpointGroup resource. + * + * @param {string} mirroringEndpointGroupName + * A fully-qualified path representing MirroringEndpointGroup resource. + * @returns {string} A string representing the location. + */ + matchLocationFromMirroringEndpointGroupName(mirroringEndpointGroupName: string) { + return this.pathTemplates.mirroringEndpointGroupPathTemplate.match(mirroringEndpointGroupName).location; + } + + /** + * Parse the mirroring_endpoint_group from MirroringEndpointGroup resource. + * + * @param {string} mirroringEndpointGroupName + * A fully-qualified path representing MirroringEndpointGroup resource. + * @returns {string} A string representing the mirroring_endpoint_group. + */ + matchMirroringEndpointGroupFromMirroringEndpointGroupName(mirroringEndpointGroupName: string) { + return this.pathTemplates.mirroringEndpointGroupPathTemplate.match(mirroringEndpointGroupName).mirroring_endpoint_group; + } + + /** + * Return a fully-qualified mirroringEndpointGroupAssociation resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} mirroring_endpoint_group_association + * @returns {string} Resource name string. + */ + mirroringEndpointGroupAssociationPath(project:string,location:string,mirroringEndpointGroupAssociation:string) { + return this.pathTemplates.mirroringEndpointGroupAssociationPathTemplate.render({ + project: project, + location: location, + mirroring_endpoint_group_association: mirroringEndpointGroupAssociation, + }); + } + + /** + * Parse the project from MirroringEndpointGroupAssociation resource. + * + * @param {string} mirroringEndpointGroupAssociationName + * A fully-qualified path representing MirroringEndpointGroupAssociation resource. + * @returns {string} A string representing the project. + */ + matchProjectFromMirroringEndpointGroupAssociationName(mirroringEndpointGroupAssociationName: string) { + return this.pathTemplates.mirroringEndpointGroupAssociationPathTemplate.match(mirroringEndpointGroupAssociationName).project; + } + + /** + * Parse the location from MirroringEndpointGroupAssociation resource. + * + * @param {string} mirroringEndpointGroupAssociationName + * A fully-qualified path representing MirroringEndpointGroupAssociation resource. + * @returns {string} A string representing the location. + */ + matchLocationFromMirroringEndpointGroupAssociationName(mirroringEndpointGroupAssociationName: string) { + return this.pathTemplates.mirroringEndpointGroupAssociationPathTemplate.match(mirroringEndpointGroupAssociationName).location; + } + + /** + * Parse the mirroring_endpoint_group_association from MirroringEndpointGroupAssociation resource. + * + * @param {string} mirroringEndpointGroupAssociationName + * A fully-qualified path representing MirroringEndpointGroupAssociation resource. + * @returns {string} A string representing the mirroring_endpoint_group_association. + */ + matchMirroringEndpointGroupAssociationFromMirroringEndpointGroupAssociationName(mirroringEndpointGroupAssociationName: string) { + return this.pathTemplates.mirroringEndpointGroupAssociationPathTemplate.match(mirroringEndpointGroupAssociationName).mirroring_endpoint_group_association; + } + + /** + * Return a fully-qualified network resource name string. + * + * @param {string} project + * @param {string} network + * @returns {string} Resource name string. + */ + networkPath(project:string,network:string) { + return this.pathTemplates.networkPathTemplate.render({ + project: project, + network: network, + }); + } + + /** + * Parse the project from Network resource. + * + * @param {string} networkName + * A fully-qualified path representing Network resource. + * @returns {string} A string representing the project. + */ + matchProjectFromNetworkName(networkName: string) { + return this.pathTemplates.networkPathTemplate.match(networkName).project; + } + + /** + * Parse the network from Network resource. + * + * @param {string} networkName + * A fully-qualified path representing Network resource. + * @returns {string} A string representing the network. + */ + matchNetworkFromNetworkName(networkName: string) { + return this.pathTemplates.networkPathTemplate.match(networkName).network; + } + + /** + * Return a fully-qualified organizationLocationAddressGroup resource name string. + * + * @param {string} organization + * @param {string} location + * @param {string} address_group + * @returns {string} Resource name string. + */ + organizationLocationAddressGroupPath(organization:string,location:string,addressGroup:string) { + return this.pathTemplates.organizationLocationAddressGroupPathTemplate.render({ + organization: organization, + location: location, + address_group: addressGroup, + }); + } + + /** + * Parse the organization from OrganizationLocationAddressGroup resource. + * + * @param {string} organizationLocationAddressGroupName + * A fully-qualified path representing organization_location_address_group resource. + * @returns {string} A string representing the organization. + */ + matchOrganizationFromOrganizationLocationAddressGroupName(organizationLocationAddressGroupName: string) { + return this.pathTemplates.organizationLocationAddressGroupPathTemplate.match(organizationLocationAddressGroupName).organization; + } + + /** + * Parse the location from OrganizationLocationAddressGroup resource. + * + * @param {string} organizationLocationAddressGroupName + * A fully-qualified path representing organization_location_address_group resource. + * @returns {string} A string representing the location. + */ + matchLocationFromOrganizationLocationAddressGroupName(organizationLocationAddressGroupName: string) { + return this.pathTemplates.organizationLocationAddressGroupPathTemplate.match(organizationLocationAddressGroupName).location; + } + + /** + * Parse the address_group from OrganizationLocationAddressGroup resource. + * + * @param {string} organizationLocationAddressGroupName + * A fully-qualified path representing organization_location_address_group resource. + * @returns {string} A string representing the address_group. + */ + matchAddressGroupFromOrganizationLocationAddressGroupName(organizationLocationAddressGroupName: string) { + return this.pathTemplates.organizationLocationAddressGroupPathTemplate.match(organizationLocationAddressGroupName).address_group; + } + + /** + * Return a fully-qualified organizationLocationFirewallEndpoints resource name string. + * + * @param {string} organization + * @param {string} location + * @param {string} firewall_endpoint + * @returns {string} Resource name string. + */ + organizationLocationFirewallEndpointsPath(organization:string,location:string,firewallEndpoint:string) { + return this.pathTemplates.organizationLocationFirewallEndpointsPathTemplate.render({ + organization: organization, + location: location, + firewall_endpoint: firewallEndpoint, + }); + } + + /** + * Parse the organization from OrganizationLocationFirewallEndpoints resource. + * + * @param {string} organizationLocationFirewallEndpointsName + * A fully-qualified path representing organization_location_firewallEndpoints resource. + * @returns {string} A string representing the organization. + */ + matchOrganizationFromOrganizationLocationFirewallEndpointsName(organizationLocationFirewallEndpointsName: string) { + return this.pathTemplates.organizationLocationFirewallEndpointsPathTemplate.match(organizationLocationFirewallEndpointsName).organization; + } + + /** + * Parse the location from OrganizationLocationFirewallEndpoints resource. + * + * @param {string} organizationLocationFirewallEndpointsName + * A fully-qualified path representing organization_location_firewallEndpoints resource. + * @returns {string} A string representing the location. + */ + matchLocationFromOrganizationLocationFirewallEndpointsName(organizationLocationFirewallEndpointsName: string) { + return this.pathTemplates.organizationLocationFirewallEndpointsPathTemplate.match(organizationLocationFirewallEndpointsName).location; + } + + /** + * Parse the firewall_endpoint from OrganizationLocationFirewallEndpoints resource. + * + * @param {string} organizationLocationFirewallEndpointsName + * A fully-qualified path representing organization_location_firewallEndpoints resource. + * @returns {string} A string representing the firewall_endpoint. + */ + matchFirewallEndpointFromOrganizationLocationFirewallEndpointsName(organizationLocationFirewallEndpointsName: string) { + return this.pathTemplates.organizationLocationFirewallEndpointsPathTemplate.match(organizationLocationFirewallEndpointsName).firewall_endpoint; + } + + /** + * Return a fully-qualified organizationLocationSecurityProfile resource name string. + * + * @param {string} organization + * @param {string} location + * @param {string} security_profile + * @returns {string} Resource name string. + */ + organizationLocationSecurityProfilePath(organization:string,location:string,securityProfile:string) { + return this.pathTemplates.organizationLocationSecurityProfilePathTemplate.render({ + organization: organization, + location: location, + security_profile: securityProfile, + }); + } + + /** + * Parse the organization from OrganizationLocationSecurityProfile resource. + * + * @param {string} organizationLocationSecurityProfileName + * A fully-qualified path representing organization_location_security_profile resource. + * @returns {string} A string representing the organization. + */ + matchOrganizationFromOrganizationLocationSecurityProfileName(organizationLocationSecurityProfileName: string) { + return this.pathTemplates.organizationLocationSecurityProfilePathTemplate.match(organizationLocationSecurityProfileName).organization; + } + + /** + * Parse the location from OrganizationLocationSecurityProfile resource. + * + * @param {string} organizationLocationSecurityProfileName + * A fully-qualified path representing organization_location_security_profile resource. + * @returns {string} A string representing the location. + */ + matchLocationFromOrganizationLocationSecurityProfileName(organizationLocationSecurityProfileName: string) { + return this.pathTemplates.organizationLocationSecurityProfilePathTemplate.match(organizationLocationSecurityProfileName).location; + } + + /** + * Parse the security_profile from OrganizationLocationSecurityProfile resource. + * + * @param {string} organizationLocationSecurityProfileName + * A fully-qualified path representing organization_location_security_profile resource. + * @returns {string} A string representing the security_profile. + */ + matchSecurityProfileFromOrganizationLocationSecurityProfileName(organizationLocationSecurityProfileName: string) { + return this.pathTemplates.organizationLocationSecurityProfilePathTemplate.match(organizationLocationSecurityProfileName).security_profile; + } + + /** + * Return a fully-qualified organizationLocationSecurityProfileGroup resource name string. + * + * @param {string} organization + * @param {string} location + * @param {string} security_profile_group + * @returns {string} Resource name string. + */ + organizationLocationSecurityProfileGroupPath(organization:string,location:string,securityProfileGroup:string) { + return this.pathTemplates.organizationLocationSecurityProfileGroupPathTemplate.render({ + organization: organization, + location: location, + security_profile_group: securityProfileGroup, + }); + } + + /** + * Parse the organization from OrganizationLocationSecurityProfileGroup resource. + * + * @param {string} organizationLocationSecurityProfileGroupName + * A fully-qualified path representing organization_location_security_profile_group resource. + * @returns {string} A string representing the organization. + */ + matchOrganizationFromOrganizationLocationSecurityProfileGroupName(organizationLocationSecurityProfileGroupName: string) { + return this.pathTemplates.organizationLocationSecurityProfileGroupPathTemplate.match(organizationLocationSecurityProfileGroupName).organization; + } + + /** + * Parse the location from OrganizationLocationSecurityProfileGroup resource. + * + * @param {string} organizationLocationSecurityProfileGroupName + * A fully-qualified path representing organization_location_security_profile_group resource. + * @returns {string} A string representing the location. + */ + matchLocationFromOrganizationLocationSecurityProfileGroupName(organizationLocationSecurityProfileGroupName: string) { + return this.pathTemplates.organizationLocationSecurityProfileGroupPathTemplate.match(organizationLocationSecurityProfileGroupName).location; + } + + /** + * Parse the security_profile_group from OrganizationLocationSecurityProfileGroup resource. + * + * @param {string} organizationLocationSecurityProfileGroupName + * A fully-qualified path representing organization_location_security_profile_group resource. + * @returns {string} A string representing the security_profile_group. + */ + matchSecurityProfileGroupFromOrganizationLocationSecurityProfileGroupName(organizationLocationSecurityProfileGroupName: string) { + return this.pathTemplates.organizationLocationSecurityProfileGroupPathTemplate.match(organizationLocationSecurityProfileGroupName).security_profile_group; + } + + /** + * Return a fully-qualified project resource name string. + * + * @param {string} project + * @returns {string} Resource name string. + */ + projectPath(project:string) { + return this.pathTemplates.projectPathTemplate.render({ + project: project, + }); + } + + /** + * Parse the project from Project resource. + * + * @param {string} projectName + * A fully-qualified path representing Project resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectName(projectName: string) { + return this.pathTemplates.projectPathTemplate.match(projectName).project; + } + + /** + * Return a fully-qualified projectLocationAddressGroup resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} address_group + * @returns {string} Resource name string. + */ + projectLocationAddressGroupPath(project:string,location:string,addressGroup:string) { + return this.pathTemplates.projectLocationAddressGroupPathTemplate.render({ + project: project, + location: location, + address_group: addressGroup, + }); + } + + /** + * Parse the project from ProjectLocationAddressGroup resource. + * + * @param {string} projectLocationAddressGroupName + * A fully-qualified path representing project_location_address_group resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationAddressGroupName(projectLocationAddressGroupName: string) { + return this.pathTemplates.projectLocationAddressGroupPathTemplate.match(projectLocationAddressGroupName).project; + } + + /** + * Parse the location from ProjectLocationAddressGroup resource. + * + * @param {string} projectLocationAddressGroupName + * A fully-qualified path representing project_location_address_group resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationAddressGroupName(projectLocationAddressGroupName: string) { + return this.pathTemplates.projectLocationAddressGroupPathTemplate.match(projectLocationAddressGroupName).location; + } + + /** + * Parse the address_group from ProjectLocationAddressGroup resource. + * + * @param {string} projectLocationAddressGroupName + * A fully-qualified path representing project_location_address_group resource. + * @returns {string} A string representing the address_group. + */ + matchAddressGroupFromProjectLocationAddressGroupName(projectLocationAddressGroupName: string) { + return this.pathTemplates.projectLocationAddressGroupPathTemplate.match(projectLocationAddressGroupName).address_group; + } + + /** + * Return a fully-qualified projectLocationFirewallEndpoints resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} firewall_endpoint + * @returns {string} Resource name string. + */ + projectLocationFirewallEndpointsPath(project:string,location:string,firewallEndpoint:string) { + return this.pathTemplates.projectLocationFirewallEndpointsPathTemplate.render({ + project: project, + location: location, + firewall_endpoint: firewallEndpoint, + }); + } + + /** + * Parse the project from ProjectLocationFirewallEndpoints resource. + * + * @param {string} projectLocationFirewallEndpointsName + * A fully-qualified path representing project_location_firewallEndpoints resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationFirewallEndpointsName(projectLocationFirewallEndpointsName: string) { + return this.pathTemplates.projectLocationFirewallEndpointsPathTemplate.match(projectLocationFirewallEndpointsName).project; + } + + /** + * Parse the location from ProjectLocationFirewallEndpoints resource. + * + * @param {string} projectLocationFirewallEndpointsName + * A fully-qualified path representing project_location_firewallEndpoints resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationFirewallEndpointsName(projectLocationFirewallEndpointsName: string) { + return this.pathTemplates.projectLocationFirewallEndpointsPathTemplate.match(projectLocationFirewallEndpointsName).location; + } + + /** + * Parse the firewall_endpoint from ProjectLocationFirewallEndpoints resource. + * + * @param {string} projectLocationFirewallEndpointsName + * A fully-qualified path representing project_location_firewallEndpoints resource. + * @returns {string} A string representing the firewall_endpoint. + */ + matchFirewallEndpointFromProjectLocationFirewallEndpointsName(projectLocationFirewallEndpointsName: string) { + return this.pathTemplates.projectLocationFirewallEndpointsPathTemplate.match(projectLocationFirewallEndpointsName).firewall_endpoint; + } + + /** + * Return a fully-qualified projectLocationSecurityProfile resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} security_profile + * @returns {string} Resource name string. + */ + projectLocationSecurityProfilePath(project:string,location:string,securityProfile:string) { + return this.pathTemplates.projectLocationSecurityProfilePathTemplate.render({ + project: project, + location: location, + security_profile: securityProfile, + }); + } + + /** + * Parse the project from ProjectLocationSecurityProfile resource. + * + * @param {string} projectLocationSecurityProfileName + * A fully-qualified path representing project_location_security_profile resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationSecurityProfileName(projectLocationSecurityProfileName: string) { + return this.pathTemplates.projectLocationSecurityProfilePathTemplate.match(projectLocationSecurityProfileName).project; + } + + /** + * Parse the location from ProjectLocationSecurityProfile resource. + * + * @param {string} projectLocationSecurityProfileName + * A fully-qualified path representing project_location_security_profile resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationSecurityProfileName(projectLocationSecurityProfileName: string) { + return this.pathTemplates.projectLocationSecurityProfilePathTemplate.match(projectLocationSecurityProfileName).location; + } + + /** + * Parse the security_profile from ProjectLocationSecurityProfile resource. + * + * @param {string} projectLocationSecurityProfileName + * A fully-qualified path representing project_location_security_profile resource. + * @returns {string} A string representing the security_profile. + */ + matchSecurityProfileFromProjectLocationSecurityProfileName(projectLocationSecurityProfileName: string) { + return this.pathTemplates.projectLocationSecurityProfilePathTemplate.match(projectLocationSecurityProfileName).security_profile; + } + + /** + * Return a fully-qualified projectLocationSecurityProfileGroup resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} security_profile_group + * @returns {string} Resource name string. + */ + projectLocationSecurityProfileGroupPath(project:string,location:string,securityProfileGroup:string) { + return this.pathTemplates.projectLocationSecurityProfileGroupPathTemplate.render({ + project: project, + location: location, + security_profile_group: securityProfileGroup, + }); + } + + /** + * Parse the project from ProjectLocationSecurityProfileGroup resource. + * + * @param {string} projectLocationSecurityProfileGroupName + * A fully-qualified path representing project_location_security_profile_group resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationSecurityProfileGroupName(projectLocationSecurityProfileGroupName: string) { + return this.pathTemplates.projectLocationSecurityProfileGroupPathTemplate.match(projectLocationSecurityProfileGroupName).project; + } + + /** + * Parse the location from ProjectLocationSecurityProfileGroup resource. + * + * @param {string} projectLocationSecurityProfileGroupName + * A fully-qualified path representing project_location_security_profile_group resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationSecurityProfileGroupName(projectLocationSecurityProfileGroupName: string) { + return this.pathTemplates.projectLocationSecurityProfileGroupPathTemplate.match(projectLocationSecurityProfileGroupName).location; + } + + /** + * Parse the security_profile_group from ProjectLocationSecurityProfileGroup resource. + * + * @param {string} projectLocationSecurityProfileGroupName + * A fully-qualified path representing project_location_security_profile_group resource. + * @returns {string} A string representing the security_profile_group. + */ + matchSecurityProfileGroupFromProjectLocationSecurityProfileGroupName(projectLocationSecurityProfileGroupName: string) { + return this.pathTemplates.projectLocationSecurityProfileGroupPathTemplate.match(projectLocationSecurityProfileGroupName).security_profile_group; + } + + /** + * Return a fully-qualified serverTlsPolicy resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} server_tls_policy + * @returns {string} Resource name string. + */ + serverTlsPolicyPath(project:string,location:string,serverTlsPolicy:string) { + return this.pathTemplates.serverTlsPolicyPathTemplate.render({ + project: project, + location: location, + server_tls_policy: serverTlsPolicy, + }); + } + + /** + * Parse the project from ServerTlsPolicy resource. + * + * @param {string} serverTlsPolicyName + * A fully-qualified path representing ServerTlsPolicy resource. + * @returns {string} A string representing the project. + */ + matchProjectFromServerTlsPolicyName(serverTlsPolicyName: string) { + return this.pathTemplates.serverTlsPolicyPathTemplate.match(serverTlsPolicyName).project; + } + + /** + * Parse the location from ServerTlsPolicy resource. + * + * @param {string} serverTlsPolicyName + * A fully-qualified path representing ServerTlsPolicy resource. + * @returns {string} A string representing the location. + */ + matchLocationFromServerTlsPolicyName(serverTlsPolicyName: string) { + return this.pathTemplates.serverTlsPolicyPathTemplate.match(serverTlsPolicyName).location; + } + + /** + * Parse the server_tls_policy from ServerTlsPolicy resource. + * + * @param {string} serverTlsPolicyName + * A fully-qualified path representing ServerTlsPolicy resource. + * @returns {string} A string representing the server_tls_policy. + */ + matchServerTlsPolicyFromServerTlsPolicyName(serverTlsPolicyName: string) { + return this.pathTemplates.serverTlsPolicyPathTemplate.match(serverTlsPolicyName).server_tls_policy; + } + + /** + * Return a fully-qualified tlsInspectionPolicy resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} tls_inspection_policy + * @returns {string} Resource name string. + */ + tlsInspectionPolicyPath(project:string,location:string,tlsInspectionPolicy:string) { + return this.pathTemplates.tlsInspectionPolicyPathTemplate.render({ + project: project, + location: location, + tls_inspection_policy: tlsInspectionPolicy, + }); + } + + /** + * Parse the project from TlsInspectionPolicy resource. + * + * @param {string} tlsInspectionPolicyName + * A fully-qualified path representing TlsInspectionPolicy resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTlsInspectionPolicyName(tlsInspectionPolicyName: string) { + return this.pathTemplates.tlsInspectionPolicyPathTemplate.match(tlsInspectionPolicyName).project; + } + + /** + * Parse the location from TlsInspectionPolicy resource. + * + * @param {string} tlsInspectionPolicyName + * A fully-qualified path representing TlsInspectionPolicy resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTlsInspectionPolicyName(tlsInspectionPolicyName: string) { + return this.pathTemplates.tlsInspectionPolicyPathTemplate.match(tlsInspectionPolicyName).location; + } + + /** + * Parse the tls_inspection_policy from TlsInspectionPolicy resource. + * + * @param {string} tlsInspectionPolicyName + * A fully-qualified path representing TlsInspectionPolicy resource. + * @returns {string} A string representing the tls_inspection_policy. + */ + matchTlsInspectionPolicyFromTlsInspectionPolicyName(tlsInspectionPolicyName: string) { + return this.pathTemplates.tlsInspectionPolicyPathTemplate.match(tlsInspectionPolicyName).tls_inspection_policy; + } + + /** + * Return a fully-qualified urlList resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} url_list + * @returns {string} Resource name string. + */ + urlListPath(project:string,location:string,urlList:string) { + return this.pathTemplates.urlListPathTemplate.render({ + project: project, + location: location, + url_list: urlList, + }); + } + + /** + * Parse the project from UrlList resource. + * + * @param {string} urlListName + * A fully-qualified path representing UrlList resource. + * @returns {string} A string representing the project. + */ + matchProjectFromUrlListName(urlListName: string) { + return this.pathTemplates.urlListPathTemplate.match(urlListName).project; + } + + /** + * Parse the location from UrlList resource. + * + * @param {string} urlListName + * A fully-qualified path representing UrlList resource. + * @returns {string} A string representing the location. + */ + matchLocationFromUrlListName(urlListName: string) { + return this.pathTemplates.urlListPathTemplate.match(urlListName).location; + } + + /** + * Parse the url_list from UrlList resource. + * + * @param {string} urlListName + * A fully-qualified path representing UrlList resource. + * @returns {string} A string representing the url_list. + */ + matchUrlListFromUrlListName(urlListName: string) { + return this.pathTemplates.urlListPathTemplate.match(urlListName).url_list; + } + + /** + * Terminate the gRPC channel and close the client. + * + * The client will no longer be usable and all future behavior is undefined. + * @returns {Promise} A promise that resolves when the client is closed. + */ + close(): Promise { + if (this.interceptStub && !this._terminated) { + return this.interceptStub.then(stub => { + this._log.info('ending gRPC channel'); + this._terminated = true; + stub.close(); + this.iamClient.close().catch(err => {throw err}); + this.locationsClient.close().catch(err => {throw err}); + void this.operationsClient.close(); + }); + } + return Promise.resolve(); + } +} \ No newline at end of file diff --git a/packages/google-cloud-networksecurity/src/v1/intercept_client_config.json b/packages/google-cloud-networksecurity/src/v1/intercept_client_config.json new file mode 100644 index 00000000000..0c47d4cca2e --- /dev/null +++ b/packages/google-cloud-networksecurity/src/v1/intercept_client_config.json @@ -0,0 +1,106 @@ +{ + "interfaces": { + "google.cloud.networksecurity.v1.Intercept": { + "retry_codes": { + "non_idempotent": [], + "idempotent": [ + "DEADLINE_EXCEEDED", + "UNAVAILABLE" + ] + }, + "retry_params": { + "default": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + } + }, + "methods": { + "ListInterceptEndpointGroups": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetInterceptEndpointGroup": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "CreateInterceptEndpointGroup": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UpdateInterceptEndpointGroup": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteInterceptEndpointGroup": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListInterceptEndpointGroupAssociations": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetInterceptEndpointGroupAssociation": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "CreateInterceptEndpointGroupAssociation": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UpdateInterceptEndpointGroupAssociation": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteInterceptEndpointGroupAssociation": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListInterceptDeploymentGroups": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetInterceptDeploymentGroup": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "CreateInterceptDeploymentGroup": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UpdateInterceptDeploymentGroup": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteInterceptDeploymentGroup": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListInterceptDeployments": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetInterceptDeployment": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "CreateInterceptDeployment": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UpdateInterceptDeployment": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteInterceptDeployment": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/packages/google-cloud-networksecurity/src/v1/intercept_proto_list.json b/packages/google-cloud-networksecurity/src/v1/intercept_proto_list.json new file mode 100644 index 00000000000..1451adf6674 --- /dev/null +++ b/packages/google-cloud-networksecurity/src/v1/intercept_proto_list.json @@ -0,0 +1,25 @@ +[ + "../../protos/google/cloud/networksecurity/v1/address_group.proto", + "../../protos/google/cloud/networksecurity/v1/authorization_policy.proto", + "../../protos/google/cloud/networksecurity/v1/authz_policy.proto", + "../../protos/google/cloud/networksecurity/v1/backend_authentication_config.proto", + "../../protos/google/cloud/networksecurity/v1/client_tls_policy.proto", + "../../protos/google/cloud/networksecurity/v1/common.proto", + "../../protos/google/cloud/networksecurity/v1/dns_threat_detector.proto", + "../../protos/google/cloud/networksecurity/v1/firewall_activation.proto", + "../../protos/google/cloud/networksecurity/v1/gateway_security_policy.proto", + "../../protos/google/cloud/networksecurity/v1/gateway_security_policy_rule.proto", + "../../protos/google/cloud/networksecurity/v1/intercept.proto", + "../../protos/google/cloud/networksecurity/v1/mirroring.proto", + "../../protos/google/cloud/networksecurity/v1/network_security.proto", + "../../protos/google/cloud/networksecurity/v1/security_profile_group.proto", + "../../protos/google/cloud/networksecurity/v1/security_profile_group_intercept.proto", + "../../protos/google/cloud/networksecurity/v1/security_profile_group_mirroring.proto", + "../../protos/google/cloud/networksecurity/v1/security_profile_group_service.proto", + "../../protos/google/cloud/networksecurity/v1/security_profile_group_threatprevention.proto", + "../../protos/google/cloud/networksecurity/v1/security_profile_group_urlfiltering.proto", + "../../protos/google/cloud/networksecurity/v1/server_tls_policy.proto", + "../../protos/google/cloud/networksecurity/v1/tls.proto", + "../../protos/google/cloud/networksecurity/v1/tls_inspection_policy.proto", + "../../protos/google/cloud/networksecurity/v1/url_list.proto" +] diff --git a/packages/google-cloud-networksecurity/src/v1/mirroring_client.ts b/packages/google-cloud-networksecurity/src/v1/mirroring_client.ts new file mode 100644 index 00000000000..a53271050cd --- /dev/null +++ b/packages/google-cloud-networksecurity/src/v1/mirroring_client.ts @@ -0,0 +1,5217 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +/* global window */ +import type * as gax from 'google-gax'; +import type {Callback, CallOptions, Descriptors, ClientOptions, GrpcClientOptions, LROperation, PaginationCallback, GaxCall, IamClient, IamProtos, LocationsClient, LocationProtos} from 'google-gax'; +import {Transform} from 'stream'; +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +import {loggingUtils as logging, decodeAnyProtosInArray} from 'google-gax'; + +/** + * Client JSON configuration object, loaded from + * `src/v1/mirroring_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './mirroring_client_config.json'; +const version = require('../../../package.json').version; + +/** + * PM2 is the "out-of-band" flavor of the Network Security Integrations product. + * @class + * @memberof v1 + */ +export class MirroringClient { + private _terminated = false; + private _opts: ClientOptions; + private _providedCustomServicePath: boolean; + private _gaxModule: typeof gax | typeof gax.fallback; + private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; + private _protos: {}; + private _defaults: {[method: string]: gax.CallSettings}; + private _universeDomain: string; + private _servicePath: string; + private _log = logging.log('network-security'); + + auth: gax.GoogleAuth; + descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; + warn: (code: string, message: string, warnType?: string) => void; + innerApiCalls: {[name: string]: Function}; + iamClient: IamClient; + locationsClient: LocationsClient; + pathTemplates: {[name: string]: gax.PathTemplate}; + operationsClient: gax.OperationsClient; + mirroringStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of MirroringClient. + * + * @param {object} [options] - The configuration object. + * The options accepted by the constructor are described in detail + * in [this document](https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#creating-the-client-instance). + * The common options are: + * @param {object} [options.credentials] - Credentials object. + * @param {string} [options.credentials.client_email] + * @param {string} [options.credentials.private_key] + * @param {string} [options.email] - Account email address. Required when + * using a .pem or .p12 keyFilename. + * @param {string} [options.keyFilename] - Full path to the a .json, .pem, or + * .p12 key downloaded from the Google Developers Console. If you provide + * a path to a JSON file, the projectId option below is not necessary. + * NOTE: .pem and .p12 require you to specify options.email as well. + * @param {number} [options.port] - The port on which to connect to + * the remote host. + * @param {string} [options.projectId] - The project ID from the Google + * Developer's Console, e.g. 'grape-spaceship-123'. We will also check + * the environment variable GCLOUD_PROJECT for your project ID. If your + * app is running in an environment which supports + * {@link https://cloud.google.com/docs/authentication/application-default-credentials Application Default Credentials}, + * your project ID will be detected automatically. + * @param {string} [options.apiEndpoint] - The domain name of the + * API remote host. + * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. + * Follows the structure of {@link gapicConfig}. + * @param {boolean} [options.fallback] - Use HTTP/1.1 REST mode. + * For more information, please check the + * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. + * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you + * need to avoid loading the default gRPC version and want to use the fallback + * HTTP implementation. Load only fallback version and pass it to the constructor: + * ``` + * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC + * const client = new MirroringClient({fallback: true}, gax); + * ``` + */ + constructor(opts?: ClientOptions, gaxInstance?: typeof gax | typeof gax.fallback) { + // Ensure that options include all the required fields. + const staticMembers = this.constructor as typeof MirroringClient; + if (opts?.universe_domain && opts?.universeDomain && opts?.universe_domain !== opts?.universeDomain) { + throw new Error('Please set either universe_domain or universeDomain, but not both.'); + } + const universeDomainEnvVar = (typeof process === 'object' && typeof process.env === 'object') ? process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] : undefined; + this._universeDomain = opts?.universeDomain ?? opts?.universe_domain ?? universeDomainEnvVar ?? 'googleapis.com'; + this._servicePath = 'networksecurity.' + this._universeDomain; + const servicePath = opts?.servicePath || opts?.apiEndpoint || this._servicePath; + this._providedCustomServicePath = !!(opts?.servicePath || opts?.apiEndpoint); + const port = opts?.port || staticMembers.port; + const clientConfig = opts?.clientConfig ?? {}; + const fallback = opts?.fallback ?? (typeof window !== 'undefined' && typeof window?.fetch === 'function'); + opts = Object.assign({servicePath, port, clientConfig, fallback}, opts); + + // Request numeric enum values if REST transport is used. + opts.numericEnums = true; + + // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. + if (servicePath !== this._servicePath && !('scopes' in opts)) { + opts['scopes'] = staticMembers.scopes; + } + + // Load google-gax module synchronously if needed + if (!gaxInstance) { + gaxInstance = require('google-gax') as typeof gax; + } + + // Choose either gRPC or proto-over-HTTP implementation of google-gax. + this._gaxModule = opts.fallback ? gaxInstance.fallback : gaxInstance; + + // Create a `gaxGrpc` object, with any grpc-specific options sent to the client. + this._gaxGrpc = new this._gaxModule.GrpcClient(opts); + + // Save options to use in initialize() method. + this._opts = opts; + + // Save the auth object to the client, for use by other methods. + this.auth = (this._gaxGrpc.auth as gax.GoogleAuth); + + // Set useJWTAccessWithScope on the auth object. + this.auth.useJWTAccessWithScope = true; + + // Set defaultServicePath on the auth object. + this.auth.defaultServicePath = this._servicePath; + + // Set the default scopes in auth client if needed. + if (servicePath === this._servicePath) { + this.auth.defaultScopes = staticMembers.scopes; + } + this.iamClient = new this._gaxModule.IamClient(this._gaxGrpc, opts); + + this.locationsClient = new this._gaxModule.LocationsClient( + this._gaxGrpc, + opts + ); + + + // Determine the client header string. + const clientHeader = [ + `gax/${this._gaxModule.version}`, + `gapic/${version}`, + ]; + if (typeof process === 'object' && 'versions' in process) { + clientHeader.push(`gl-node/${process.versions.node}`); + } else { + clientHeader.push(`gl-web/${this._gaxModule.version}`); + } + if (!opts.fallback) { + clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); + } else { + clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); + } + if (opts.libName && opts.libVersion) { + clientHeader.push(`${opts.libName}/${opts.libVersion}`); + } + // Load the applicable protos. + this._protos = this._gaxGrpc.loadProtoJSON(jsonProtos); + + // This API contains "path templates"; forward-slash-separated + // identifiers to uniquely identify resources within the API. + // Create useful helper objects for these. + this.pathTemplates = { + authorizationPolicyPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/authorizationPolicies/{authorization_policy}' + ), + authzPolicyPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/authzPolicies/{authz_policy}' + ), + backendAuthenticationConfigPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/backendAuthenticationConfigs/{backend_authentication_config}' + ), + clientTlsPolicyPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/clientTlsPolicies/{client_tls_policy}' + ), + dnsThreatDetectorPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/dnsThreatDetectors/{dns_threat_detector}' + ), + firewallEndpointAssociationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/firewallEndpointAssociations/{firewall_endpoint_association}' + ), + forwardingRulePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/global/forwardingRules/{forwarding_rule}' + ), + gatewaySecurityPolicyPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/gatewaySecurityPolicies/{gateway_security_policy}' + ), + gatewaySecurityPolicyRulePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/gatewaySecurityPolicies/{gateway_security_policy}/rules/{rule}' + ), + interceptDeploymentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/interceptDeployments/{intercept_deployment}' + ), + interceptDeploymentGroupPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/interceptDeploymentGroups/{intercept_deployment_group}' + ), + interceptEndpointGroupPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/interceptEndpointGroups/{intercept_endpoint_group}' + ), + interceptEndpointGroupAssociationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/interceptEndpointGroupAssociations/{intercept_endpoint_group_association}' + ), + locationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}' + ), + mirroringDeploymentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/mirroringDeployments/{mirroring_deployment}' + ), + mirroringDeploymentGroupPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/mirroringDeploymentGroups/{mirroring_deployment_group}' + ), + mirroringEndpointGroupPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/mirroringEndpointGroups/{mirroring_endpoint_group}' + ), + mirroringEndpointGroupAssociationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/mirroringEndpointGroupAssociations/{mirroring_endpoint_group_association}' + ), + networkPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/global/networks/{network}' + ), + organizationLocationAddressGroupPathTemplate: new this._gaxModule.PathTemplate( + 'organizations/{organization}/locations/{location}/addressGroups/{address_group}' + ), + organizationLocationFirewallEndpointsPathTemplate: new this._gaxModule.PathTemplate( + 'organizations/{organization}/locations/{location}/firewallEndpoints/{firewall_endpoint}' + ), + organizationLocationSecurityProfilePathTemplate: new this._gaxModule.PathTemplate( + 'organizations/{organization}/locations/{location}/securityProfiles/{security_profile}' + ), + organizationLocationSecurityProfileGroupPathTemplate: new this._gaxModule.PathTemplate( + 'organizations/{organization}/locations/{location}/securityProfileGroups/{security_profile_group}' + ), + projectPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}' + ), + projectLocationAddressGroupPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/addressGroups/{address_group}' + ), + projectLocationFirewallEndpointsPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/firewallEndpoints/{firewall_endpoint}' + ), + projectLocationSecurityProfilePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/securityProfiles/{security_profile}' + ), + projectLocationSecurityProfileGroupPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/securityProfileGroups/{security_profile_group}' + ), + serverTlsPolicyPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/serverTlsPolicies/{server_tls_policy}' + ), + tlsInspectionPolicyPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/tlsInspectionPolicies/{tls_inspection_policy}' + ), + urlListPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/urlLists/{url_list}' + ), + }; + + // Some of the methods on this service return "paged" results, + // (e.g. 50 results at a time, with tokens to get subsequent + // pages). Denote the keys used for pagination and results. + this.descriptors.page = { + listMirroringEndpointGroups: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'mirroringEndpointGroups'), + listMirroringEndpointGroupAssociations: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'mirroringEndpointGroupAssociations'), + listMirroringDeploymentGroups: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'mirroringDeploymentGroups'), + listMirroringDeployments: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'mirroringDeployments') + }; + + const protoFilesRoot = this._gaxModule.protobufFromJSON(jsonProtos); + // This API contains "long-running operations", which return a + // an Operation object that allows for tracking of the operation, + // rather than holding a request open. + const lroOptions: GrpcClientOptions = { + auth: this.auth, + grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined + }; + if (opts.fallback) { + lroOptions.protoJson = protoFilesRoot; + lroOptions.httpRules = [{selector: 'google.cloud.location.Locations.GetLocation',get: '/v1/{name=projects/*/locations/*}',additional_bindings: [{get: '/v1/{name=organizations/*/locations/*}',}], + },{selector: 'google.cloud.location.Locations.ListLocations',get: '/v1/{name=projects/*}/locations',additional_bindings: [{get: '/v1/{name=organizations/*/locations/*}',}], + },{selector: 'google.iam.v1.IAMPolicy.GetIamPolicy',get: '/v1/{resource=projects/*/locations/*/addressGroups/*}:getIamPolicy',additional_bindings: [{get: '/v1/{resource=projects/*/locations/*/authorizationPolicies/*}:getIamPolicy',},{get: '/v1/{resource=organizations/*/locations/*/addressGroups/*}:getIamPolicy',},{get: '/v1/{resource=projects/*/locations/*/serverTlsPolicies/*}:getIamPolicy',},{get: '/v1/{resource=projects/*/locations/*/clientTlsPolicies/*}:getIamPolicy',},{get: '/v1/{resource=projects/*/locations/*/authzPolicies/*}:getIamPolicy',}], + },{selector: 'google.iam.v1.IAMPolicy.SetIamPolicy',post: '/v1/{resource=projects/*/locations/*/addressGroups/*}:setIamPolicy',body: '*',additional_bindings: [{post: '/v1/{resource=projects/*/locations/*/authorizationPolicies/*}:setIamPolicy',body: '*',},{post: '/v1/{resource=organizations/*/locations/*/addressGroups/*}:setIamPolicy',body: '*',},{post: '/v1/{resource=projects/*/locations/*/serverTlsPolicies/*}:setIamPolicy',body: '*',},{post: '/v1/{resource=projects/*/locations/*/clientTlsPolicies/*}:setIamPolicy',body: '*',},{post: '/v1/{resource=projects/*/locations/*/authzPolicies/*}:setIamPolicy',body: '*',}], + },{selector: 'google.iam.v1.IAMPolicy.TestIamPermissions',post: '/v1/{resource=projects/*/locations/*/addressGroups/*}:testIamPermissions',body: '*',additional_bindings: [{post: '/v1/{resource=projects/*/locations/*/authorizationPolicies/*}:testIamPermissions',body: '*',},{post: '/v1/{resource=organizations/*/locations/*/addressGroups/*}:testIamPermissions',body: '*',},{post: '/v1/{resource=projects/*/locations/*/serverTlsPolicies/*}:testIamPermissions',body: '*',},{post: '/v1/{resource=projects/*/locations/*/clientTlsPolicies/*}:testIamPermissions',body: '*',},{post: '/v1/{resource=projects/*/locations/*/authzPolicies/*}:testIamPermissions',body: '*',}], + },{selector: 'google.longrunning.Operations.CancelOperation',post: '/v1/{name=projects/*/locations/*/operations/*}:cancel',body: '*',additional_bindings: [{post: '/v1/{name=organizations/*/locations/*/operations/*}:cancel',body: '*',}], + },{selector: 'google.longrunning.Operations.DeleteOperation',delete: '/v1/{name=projects/*/locations/*/operations/*}',additional_bindings: [{delete: '/v1/{name=organizations/*/locations/*/operations/*}',}], + },{selector: 'google.longrunning.Operations.GetOperation',get: '/v1/{name=projects/*/locations/*/operations/*}',additional_bindings: [{get: '/v1/{name=organizations/*/locations/*/operations/*}',}], + },{selector: 'google.longrunning.Operations.ListOperations',get: '/v1/{name=projects/*/locations/*}/operations',additional_bindings: [{get: '/v1/{name=organizations/*/locations/*}/operations',}], + }]; + } + this.operationsClient = this._gaxModule.lro(lroOptions).operationsClient(opts); + const createMirroringEndpointGroupResponse = protoFilesRoot.lookup( + '.google.cloud.networksecurity.v1.MirroringEndpointGroup') as gax.protobuf.Type; + const createMirroringEndpointGroupMetadata = protoFilesRoot.lookup( + '.google.cloud.networksecurity.v1.OperationMetadata') as gax.protobuf.Type; + const updateMirroringEndpointGroupResponse = protoFilesRoot.lookup( + '.google.cloud.networksecurity.v1.MirroringEndpointGroup') as gax.protobuf.Type; + const updateMirroringEndpointGroupMetadata = protoFilesRoot.lookup( + '.google.cloud.networksecurity.v1.OperationMetadata') as gax.protobuf.Type; + const deleteMirroringEndpointGroupResponse = protoFilesRoot.lookup( + '.google.protobuf.Empty') as gax.protobuf.Type; + const deleteMirroringEndpointGroupMetadata = protoFilesRoot.lookup( + '.google.cloud.networksecurity.v1.OperationMetadata') as gax.protobuf.Type; + const createMirroringEndpointGroupAssociationResponse = protoFilesRoot.lookup( + '.google.cloud.networksecurity.v1.MirroringEndpointGroupAssociation') as gax.protobuf.Type; + const createMirroringEndpointGroupAssociationMetadata = protoFilesRoot.lookup( + '.google.cloud.networksecurity.v1.OperationMetadata') as gax.protobuf.Type; + const updateMirroringEndpointGroupAssociationResponse = protoFilesRoot.lookup( + '.google.cloud.networksecurity.v1.MirroringEndpointGroupAssociation') as gax.protobuf.Type; + const updateMirroringEndpointGroupAssociationMetadata = protoFilesRoot.lookup( + '.google.cloud.networksecurity.v1.OperationMetadata') as gax.protobuf.Type; + const deleteMirroringEndpointGroupAssociationResponse = protoFilesRoot.lookup( + '.google.protobuf.Empty') as gax.protobuf.Type; + const deleteMirroringEndpointGroupAssociationMetadata = protoFilesRoot.lookup( + '.google.cloud.networksecurity.v1.OperationMetadata') as gax.protobuf.Type; + const createMirroringDeploymentGroupResponse = protoFilesRoot.lookup( + '.google.cloud.networksecurity.v1.MirroringDeploymentGroup') as gax.protobuf.Type; + const createMirroringDeploymentGroupMetadata = protoFilesRoot.lookup( + '.google.cloud.networksecurity.v1.OperationMetadata') as gax.protobuf.Type; + const updateMirroringDeploymentGroupResponse = protoFilesRoot.lookup( + '.google.cloud.networksecurity.v1.MirroringDeploymentGroup') as gax.protobuf.Type; + const updateMirroringDeploymentGroupMetadata = protoFilesRoot.lookup( + '.google.cloud.networksecurity.v1.OperationMetadata') as gax.protobuf.Type; + const deleteMirroringDeploymentGroupResponse = protoFilesRoot.lookup( + '.google.protobuf.Empty') as gax.protobuf.Type; + const deleteMirroringDeploymentGroupMetadata = protoFilesRoot.lookup( + '.google.cloud.networksecurity.v1.OperationMetadata') as gax.protobuf.Type; + const createMirroringDeploymentResponse = protoFilesRoot.lookup( + '.google.cloud.networksecurity.v1.MirroringDeployment') as gax.protobuf.Type; + const createMirroringDeploymentMetadata = protoFilesRoot.lookup( + '.google.cloud.networksecurity.v1.OperationMetadata') as gax.protobuf.Type; + const updateMirroringDeploymentResponse = protoFilesRoot.lookup( + '.google.cloud.networksecurity.v1.MirroringDeployment') as gax.protobuf.Type; + const updateMirroringDeploymentMetadata = protoFilesRoot.lookup( + '.google.cloud.networksecurity.v1.OperationMetadata') as gax.protobuf.Type; + const deleteMirroringDeploymentResponse = protoFilesRoot.lookup( + '.google.protobuf.Empty') as gax.protobuf.Type; + const deleteMirroringDeploymentMetadata = protoFilesRoot.lookup( + '.google.cloud.networksecurity.v1.OperationMetadata') as gax.protobuf.Type; + + this.descriptors.longrunning = { + createMirroringEndpointGroup: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + createMirroringEndpointGroupResponse.decode.bind(createMirroringEndpointGroupResponse), + createMirroringEndpointGroupMetadata.decode.bind(createMirroringEndpointGroupMetadata)), + updateMirroringEndpointGroup: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + updateMirroringEndpointGroupResponse.decode.bind(updateMirroringEndpointGroupResponse), + updateMirroringEndpointGroupMetadata.decode.bind(updateMirroringEndpointGroupMetadata)), + deleteMirroringEndpointGroup: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + deleteMirroringEndpointGroupResponse.decode.bind(deleteMirroringEndpointGroupResponse), + deleteMirroringEndpointGroupMetadata.decode.bind(deleteMirroringEndpointGroupMetadata)), + createMirroringEndpointGroupAssociation: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + createMirroringEndpointGroupAssociationResponse.decode.bind(createMirroringEndpointGroupAssociationResponse), + createMirroringEndpointGroupAssociationMetadata.decode.bind(createMirroringEndpointGroupAssociationMetadata)), + updateMirroringEndpointGroupAssociation: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + updateMirroringEndpointGroupAssociationResponse.decode.bind(updateMirroringEndpointGroupAssociationResponse), + updateMirroringEndpointGroupAssociationMetadata.decode.bind(updateMirroringEndpointGroupAssociationMetadata)), + deleteMirroringEndpointGroupAssociation: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + deleteMirroringEndpointGroupAssociationResponse.decode.bind(deleteMirroringEndpointGroupAssociationResponse), + deleteMirroringEndpointGroupAssociationMetadata.decode.bind(deleteMirroringEndpointGroupAssociationMetadata)), + createMirroringDeploymentGroup: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + createMirroringDeploymentGroupResponse.decode.bind(createMirroringDeploymentGroupResponse), + createMirroringDeploymentGroupMetadata.decode.bind(createMirroringDeploymentGroupMetadata)), + updateMirroringDeploymentGroup: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + updateMirroringDeploymentGroupResponse.decode.bind(updateMirroringDeploymentGroupResponse), + updateMirroringDeploymentGroupMetadata.decode.bind(updateMirroringDeploymentGroupMetadata)), + deleteMirroringDeploymentGroup: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + deleteMirroringDeploymentGroupResponse.decode.bind(deleteMirroringDeploymentGroupResponse), + deleteMirroringDeploymentGroupMetadata.decode.bind(deleteMirroringDeploymentGroupMetadata)), + createMirroringDeployment: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + createMirroringDeploymentResponse.decode.bind(createMirroringDeploymentResponse), + createMirroringDeploymentMetadata.decode.bind(createMirroringDeploymentMetadata)), + updateMirroringDeployment: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + updateMirroringDeploymentResponse.decode.bind(updateMirroringDeploymentResponse), + updateMirroringDeploymentMetadata.decode.bind(updateMirroringDeploymentMetadata)), + deleteMirroringDeployment: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + deleteMirroringDeploymentResponse.decode.bind(deleteMirroringDeploymentResponse), + deleteMirroringDeploymentMetadata.decode.bind(deleteMirroringDeploymentMetadata)) + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.networksecurity.v1.Mirroring', gapicConfig as gax.ClientConfig, + opts.clientConfig || {}, {'x-goog-api-client': clientHeader.join(' ')}); + + // Set up a dictionary of "inner API calls"; the core implementation + // of calling the API is handled in `google-gax`, with this code + // merely providing the destination and request information. + this.innerApiCalls = {}; + + // Add a warn function to the client constructor so it can be easily tested. + this.warn = this._gaxModule.warn; + } + + /** + * Initialize the client. + * Performs asynchronous operations (such as authentication) and prepares the client. + * This function will be called automatically when any class method is called for the + * first time, but if you need to initialize it before calling an actual method, + * feel free to call initialize() directly. + * + * You can await on this method if you want to make sure the client is initialized. + * + * @returns {Promise} A promise that resolves to an authenticated service stub. + */ + initialize() { + // If the client stub promise is already initialized, return immediately. + if (this.mirroringStub) { + return this.mirroringStub; + } + + // Put together the "service stub" for + // google.cloud.networksecurity.v1.Mirroring. + this.mirroringStub = this._gaxGrpc.createStub( + this._opts.fallback ? + (this._protos as protobuf.Root).lookupService('google.cloud.networksecurity.v1.Mirroring') : + // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.networksecurity.v1.Mirroring, + this._opts, this._providedCustomServicePath) as Promise<{[method: string]: Function}>; + + // Iterate over each of the methods that the service provides + // and create an API call method for each. + const mirroringStubMethods = + ['listMirroringEndpointGroups', 'getMirroringEndpointGroup', 'createMirroringEndpointGroup', 'updateMirroringEndpointGroup', 'deleteMirroringEndpointGroup', 'listMirroringEndpointGroupAssociations', 'getMirroringEndpointGroupAssociation', 'createMirroringEndpointGroupAssociation', 'updateMirroringEndpointGroupAssociation', 'deleteMirroringEndpointGroupAssociation', 'listMirroringDeploymentGroups', 'getMirroringDeploymentGroup', 'createMirroringDeploymentGroup', 'updateMirroringDeploymentGroup', 'deleteMirroringDeploymentGroup', 'listMirroringDeployments', 'getMirroringDeployment', 'createMirroringDeployment', 'updateMirroringDeployment', 'deleteMirroringDeployment']; + for (const methodName of mirroringStubMethods) { + const callPromise = this.mirroringStub.then( + stub => (...args: Array<{}>) => { + if (this._terminated) { + return Promise.reject('The client has already been closed.'); + } + const func = stub[methodName]; + return func.apply(stub, args); + }, + (err: Error|null|undefined) => () => { + throw err; + }); + + const descriptor = + this.descriptors.page[methodName] || + this.descriptors.longrunning[methodName] || + undefined; + const apiCall = this._gaxModule.createApiCall( + callPromise, + this._defaults[methodName], + descriptor, + this._opts.fallback + ); + + this.innerApiCalls[methodName] = apiCall; + } + + return this.mirroringStub; + } + + /** + * The DNS address for this API service. + * @deprecated Use the apiEndpoint method of the client instance. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + if (typeof process === 'object' && typeof process.emitWarning === 'function') { + process.emitWarning('Static servicePath is deprecated, please use the instance method instead.', 'DeprecationWarning'); + } + return 'networksecurity.googleapis.com'; + } + + /** + * The DNS address for this API service - same as servicePath. + * @deprecated Use the apiEndpoint method of the client instance. + * @returns {string} The DNS address for this service. + */ + static get apiEndpoint() { + if (typeof process === 'object' && typeof process.emitWarning === 'function') { + process.emitWarning('Static apiEndpoint is deprecated, please use the instance method instead.', 'DeprecationWarning'); + } + return 'networksecurity.googleapis.com'; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + get apiEndpoint() { + return this._servicePath; + } + + get universeDomain() { + return this._universeDomain; + } + + /** + * The port for this API service. + * @returns {number} The default port for this service. + */ + static get port() { + return 443; + } + + /** + * The scopes needed to make gRPC calls for every method defined + * in this service. + * @returns {string[]} List of default scopes. + */ + static get scopes() { + return [ + 'https://www.googleapis.com/auth/cloud-platform' + ]; + } + + getProjectId(): Promise; + getProjectId(callback: Callback): void; + /** + * Return the project ID used by this class. + * @returns {Promise} A promise that resolves to string containing the project ID. + */ + getProjectId(callback?: Callback): + Promise|void { + if (callback) { + this.auth.getProjectId(callback); + return; + } + return this.auth.getProjectId(); + } + + // ------------------- + // -- Service calls -- + // ------------------- +/** + * Gets a specific endpoint group. + * See https://google.aip.dev/131. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the endpoint group to retrieve. + * Format: + * projects/{project}/locations/{location}/mirroringEndpointGroups/{mirroring_endpoint_group} + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.cloud.networksecurity.v1.MirroringEndpointGroup|MirroringEndpointGroup}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1/mirroring.get_mirroring_endpoint_group.js + * region_tag:networksecurity_v1_generated_Mirroring_GetMirroringEndpointGroup_async + */ + getMirroringEndpointGroup( + request?: protos.google.cloud.networksecurity.v1.IGetMirroringEndpointGroupRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.networksecurity.v1.IMirroringEndpointGroup, + protos.google.cloud.networksecurity.v1.IGetMirroringEndpointGroupRequest|undefined, {}|undefined + ]>; + getMirroringEndpointGroup( + request: protos.google.cloud.networksecurity.v1.IGetMirroringEndpointGroupRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.networksecurity.v1.IMirroringEndpointGroup, + protos.google.cloud.networksecurity.v1.IGetMirroringEndpointGroupRequest|null|undefined, + {}|null|undefined>): void; + getMirroringEndpointGroup( + request: protos.google.cloud.networksecurity.v1.IGetMirroringEndpointGroupRequest, + callback: Callback< + protos.google.cloud.networksecurity.v1.IMirroringEndpointGroup, + protos.google.cloud.networksecurity.v1.IGetMirroringEndpointGroupRequest|null|undefined, + {}|null|undefined>): void; + getMirroringEndpointGroup( + request?: protos.google.cloud.networksecurity.v1.IGetMirroringEndpointGroupRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.networksecurity.v1.IMirroringEndpointGroup, + protos.google.cloud.networksecurity.v1.IGetMirroringEndpointGroupRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.networksecurity.v1.IMirroringEndpointGroup, + protos.google.cloud.networksecurity.v1.IGetMirroringEndpointGroupRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.networksecurity.v1.IMirroringEndpointGroup, + protos.google.cloud.networksecurity.v1.IGetMirroringEndpointGroupRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('getMirroringEndpointGroup request %j', request); + const wrappedCallback: Callback< + protos.google.cloud.networksecurity.v1.IMirroringEndpointGroup, + protos.google.cloud.networksecurity.v1.IGetMirroringEndpointGroupRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getMirroringEndpointGroup response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.getMirroringEndpointGroup(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.cloud.networksecurity.v1.IMirroringEndpointGroup, + protos.google.cloud.networksecurity.v1.IGetMirroringEndpointGroupRequest|undefined, + {}|undefined + ]) => { + this._log.info('getMirroringEndpointGroup response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * Gets a specific association. + * See https://google.aip.dev/131. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the association to retrieve. + * Format: + * projects/{project}/locations/{location}/mirroringEndpointGroupAssociations/{mirroring_endpoint_group_association} + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.cloud.networksecurity.v1.MirroringEndpointGroupAssociation|MirroringEndpointGroupAssociation}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1/mirroring.get_mirroring_endpoint_group_association.js + * region_tag:networksecurity_v1_generated_Mirroring_GetMirroringEndpointGroupAssociation_async + */ + getMirroringEndpointGroupAssociation( + request?: protos.google.cloud.networksecurity.v1.IGetMirroringEndpointGroupAssociationRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.networksecurity.v1.IMirroringEndpointGroupAssociation, + protos.google.cloud.networksecurity.v1.IGetMirroringEndpointGroupAssociationRequest|undefined, {}|undefined + ]>; + getMirroringEndpointGroupAssociation( + request: protos.google.cloud.networksecurity.v1.IGetMirroringEndpointGroupAssociationRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.networksecurity.v1.IMirroringEndpointGroupAssociation, + protos.google.cloud.networksecurity.v1.IGetMirroringEndpointGroupAssociationRequest|null|undefined, + {}|null|undefined>): void; + getMirroringEndpointGroupAssociation( + request: protos.google.cloud.networksecurity.v1.IGetMirroringEndpointGroupAssociationRequest, + callback: Callback< + protos.google.cloud.networksecurity.v1.IMirroringEndpointGroupAssociation, + protos.google.cloud.networksecurity.v1.IGetMirroringEndpointGroupAssociationRequest|null|undefined, + {}|null|undefined>): void; + getMirroringEndpointGroupAssociation( + request?: protos.google.cloud.networksecurity.v1.IGetMirroringEndpointGroupAssociationRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.networksecurity.v1.IMirroringEndpointGroupAssociation, + protos.google.cloud.networksecurity.v1.IGetMirroringEndpointGroupAssociationRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.networksecurity.v1.IMirroringEndpointGroupAssociation, + protos.google.cloud.networksecurity.v1.IGetMirroringEndpointGroupAssociationRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.networksecurity.v1.IMirroringEndpointGroupAssociation, + protos.google.cloud.networksecurity.v1.IGetMirroringEndpointGroupAssociationRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('getMirroringEndpointGroupAssociation request %j', request); + const wrappedCallback: Callback< + protos.google.cloud.networksecurity.v1.IMirroringEndpointGroupAssociation, + protos.google.cloud.networksecurity.v1.IGetMirroringEndpointGroupAssociationRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getMirroringEndpointGroupAssociation response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.getMirroringEndpointGroupAssociation(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.cloud.networksecurity.v1.IMirroringEndpointGroupAssociation, + protos.google.cloud.networksecurity.v1.IGetMirroringEndpointGroupAssociationRequest|undefined, + {}|undefined + ]) => { + this._log.info('getMirroringEndpointGroupAssociation response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * Gets a specific deployment group. + * See https://google.aip.dev/131. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the deployment group to retrieve. + * Format: + * projects/{project}/locations/{location}/mirroringDeploymentGroups/{mirroring_deployment_group} + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.cloud.networksecurity.v1.MirroringDeploymentGroup|MirroringDeploymentGroup}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1/mirroring.get_mirroring_deployment_group.js + * region_tag:networksecurity_v1_generated_Mirroring_GetMirroringDeploymentGroup_async + */ + getMirroringDeploymentGroup( + request?: protos.google.cloud.networksecurity.v1.IGetMirroringDeploymentGroupRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.networksecurity.v1.IMirroringDeploymentGroup, + protos.google.cloud.networksecurity.v1.IGetMirroringDeploymentGroupRequest|undefined, {}|undefined + ]>; + getMirroringDeploymentGroup( + request: protos.google.cloud.networksecurity.v1.IGetMirroringDeploymentGroupRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.networksecurity.v1.IMirroringDeploymentGroup, + protos.google.cloud.networksecurity.v1.IGetMirroringDeploymentGroupRequest|null|undefined, + {}|null|undefined>): void; + getMirroringDeploymentGroup( + request: protos.google.cloud.networksecurity.v1.IGetMirroringDeploymentGroupRequest, + callback: Callback< + protos.google.cloud.networksecurity.v1.IMirroringDeploymentGroup, + protos.google.cloud.networksecurity.v1.IGetMirroringDeploymentGroupRequest|null|undefined, + {}|null|undefined>): void; + getMirroringDeploymentGroup( + request?: protos.google.cloud.networksecurity.v1.IGetMirroringDeploymentGroupRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.networksecurity.v1.IMirroringDeploymentGroup, + protos.google.cloud.networksecurity.v1.IGetMirroringDeploymentGroupRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.networksecurity.v1.IMirroringDeploymentGroup, + protos.google.cloud.networksecurity.v1.IGetMirroringDeploymentGroupRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.networksecurity.v1.IMirroringDeploymentGroup, + protos.google.cloud.networksecurity.v1.IGetMirroringDeploymentGroupRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('getMirroringDeploymentGroup request %j', request); + const wrappedCallback: Callback< + protos.google.cloud.networksecurity.v1.IMirroringDeploymentGroup, + protos.google.cloud.networksecurity.v1.IGetMirroringDeploymentGroupRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getMirroringDeploymentGroup response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.getMirroringDeploymentGroup(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.cloud.networksecurity.v1.IMirroringDeploymentGroup, + protos.google.cloud.networksecurity.v1.IGetMirroringDeploymentGroupRequest|undefined, + {}|undefined + ]) => { + this._log.info('getMirroringDeploymentGroup response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * Gets a specific deployment. + * See https://google.aip.dev/131. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the deployment to retrieve. + * Format: + * projects/{project}/locations/{location}/mirroringDeployments/{mirroring_deployment} + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.cloud.networksecurity.v1.MirroringDeployment|MirroringDeployment}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1/mirroring.get_mirroring_deployment.js + * region_tag:networksecurity_v1_generated_Mirroring_GetMirroringDeployment_async + */ + getMirroringDeployment( + request?: protos.google.cloud.networksecurity.v1.IGetMirroringDeploymentRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.networksecurity.v1.IMirroringDeployment, + protos.google.cloud.networksecurity.v1.IGetMirroringDeploymentRequest|undefined, {}|undefined + ]>; + getMirroringDeployment( + request: protos.google.cloud.networksecurity.v1.IGetMirroringDeploymentRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.networksecurity.v1.IMirroringDeployment, + protos.google.cloud.networksecurity.v1.IGetMirroringDeploymentRequest|null|undefined, + {}|null|undefined>): void; + getMirroringDeployment( + request: protos.google.cloud.networksecurity.v1.IGetMirroringDeploymentRequest, + callback: Callback< + protos.google.cloud.networksecurity.v1.IMirroringDeployment, + protos.google.cloud.networksecurity.v1.IGetMirroringDeploymentRequest|null|undefined, + {}|null|undefined>): void; + getMirroringDeployment( + request?: protos.google.cloud.networksecurity.v1.IGetMirroringDeploymentRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.networksecurity.v1.IMirroringDeployment, + protos.google.cloud.networksecurity.v1.IGetMirroringDeploymentRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.networksecurity.v1.IMirroringDeployment, + protos.google.cloud.networksecurity.v1.IGetMirroringDeploymentRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.networksecurity.v1.IMirroringDeployment, + protos.google.cloud.networksecurity.v1.IGetMirroringDeploymentRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('getMirroringDeployment request %j', request); + const wrappedCallback: Callback< + protos.google.cloud.networksecurity.v1.IMirroringDeployment, + protos.google.cloud.networksecurity.v1.IGetMirroringDeploymentRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getMirroringDeployment response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.getMirroringDeployment(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.cloud.networksecurity.v1.IMirroringDeployment, + protos.google.cloud.networksecurity.v1.IGetMirroringDeploymentRequest|undefined, + {}|undefined + ]) => { + this._log.info('getMirroringDeployment response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } + +/** + * Creates an endpoint group in a given project and location. + * See https://google.aip.dev/133. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent resource where this endpoint group will be created. + * Format: projects/{project}/locations/{location} + * @param {string} request.mirroringEndpointGroupId + * Required. The ID to use for the endpoint group, which will become the final + * component of the endpoint group's resource name. + * @param {google.cloud.networksecurity.v1.MirroringEndpointGroup} request.mirroringEndpointGroup + * Required. The endpoint group to create. + * @param {string} [request.requestId] + * Optional. A unique identifier for this request. Must be a UUID4. + * This request is only idempotent if a `request_id` is provided. + * See https://google.aip.dev/155 for more details. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/mirroring.create_mirroring_endpoint_group.js + * region_tag:networksecurity_v1_generated_Mirroring_CreateMirroringEndpointGroup_async + */ + createMirroringEndpointGroup( + request?: protos.google.cloud.networksecurity.v1.ICreateMirroringEndpointGroupRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + createMirroringEndpointGroup( + request: protos.google.cloud.networksecurity.v1.ICreateMirroringEndpointGroupRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + createMirroringEndpointGroup( + request: protos.google.cloud.networksecurity.v1.ICreateMirroringEndpointGroupRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + createMirroringEndpointGroup( + request?: protos.google.cloud.networksecurity.v1.ICreateMirroringEndpointGroupRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize().catch(err => {throw err}); + const wrappedCallback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('createMirroringEndpointGroup response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('createMirroringEndpointGroup request %j', request); + return this.innerApiCalls.createMirroringEndpointGroup(request, options, wrappedCallback) + ?.then(([response, rawResponse, _]: [ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]) => { + this._log.info('createMirroringEndpointGroup response %j', rawResponse); + return [response, rawResponse, _]; + }); + } +/** + * Check the status of the long running operation returned by `createMirroringEndpointGroup()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/mirroring.create_mirroring_endpoint_group.js + * region_tag:networksecurity_v1_generated_Mirroring_CreateMirroringEndpointGroup_async + */ + async checkCreateMirroringEndpointGroupProgress(name: string): Promise>{ + this._log.info('createMirroringEndpointGroup long-running'); + const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.createMirroringEndpointGroup, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Updates an endpoint group. + * See https://google.aip.dev/134. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.protobuf.FieldMask} [request.updateMask] + * Optional. The list of fields to update. + * Fields are specified relative to the endpoint group + * (e.g. `description`; *not* `mirroring_endpoint_group.description`). + * See https://google.aip.dev/161 for more details. + * @param {google.cloud.networksecurity.v1.MirroringEndpointGroup} request.mirroringEndpointGroup + * Required. The endpoint group to update. + * @param {string} [request.requestId] + * Optional. A unique identifier for this request. Must be a UUID4. + * This request is only idempotent if a `request_id` is provided. + * See https://google.aip.dev/155 for more details. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/mirroring.update_mirroring_endpoint_group.js + * region_tag:networksecurity_v1_generated_Mirroring_UpdateMirroringEndpointGroup_async + */ + updateMirroringEndpointGroup( + request?: protos.google.cloud.networksecurity.v1.IUpdateMirroringEndpointGroupRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + updateMirroringEndpointGroup( + request: protos.google.cloud.networksecurity.v1.IUpdateMirroringEndpointGroupRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + updateMirroringEndpointGroup( + request: protos.google.cloud.networksecurity.v1.IUpdateMirroringEndpointGroupRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + updateMirroringEndpointGroup( + request?: protos.google.cloud.networksecurity.v1.IUpdateMirroringEndpointGroupRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'mirroring_endpoint_group.name': request.mirroringEndpointGroup!.name ?? '', + }); + this.initialize().catch(err => {throw err}); + const wrappedCallback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('updateMirroringEndpointGroup response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('updateMirroringEndpointGroup request %j', request); + return this.innerApiCalls.updateMirroringEndpointGroup(request, options, wrappedCallback) + ?.then(([response, rawResponse, _]: [ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]) => { + this._log.info('updateMirroringEndpointGroup response %j', rawResponse); + return [response, rawResponse, _]; + }); + } +/** + * Check the status of the long running operation returned by `updateMirroringEndpointGroup()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/mirroring.update_mirroring_endpoint_group.js + * region_tag:networksecurity_v1_generated_Mirroring_UpdateMirroringEndpointGroup_async + */ + async checkUpdateMirroringEndpointGroupProgress(name: string): Promise>{ + this._log.info('updateMirroringEndpointGroup long-running'); + const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.updateMirroringEndpointGroup, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Deletes an endpoint group. + * See https://google.aip.dev/135. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The endpoint group to delete. + * @param {string} [request.requestId] + * Optional. A unique identifier for this request. Must be a UUID4. + * This request is only idempotent if a `request_id` is provided. + * See https://google.aip.dev/155 for more details. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/mirroring.delete_mirroring_endpoint_group.js + * region_tag:networksecurity_v1_generated_Mirroring_DeleteMirroringEndpointGroup_async + */ + deleteMirroringEndpointGroup( + request?: protos.google.cloud.networksecurity.v1.IDeleteMirroringEndpointGroupRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + deleteMirroringEndpointGroup( + request: protos.google.cloud.networksecurity.v1.IDeleteMirroringEndpointGroupRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + deleteMirroringEndpointGroup( + request: protos.google.cloud.networksecurity.v1.IDeleteMirroringEndpointGroupRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + deleteMirroringEndpointGroup( + request?: protos.google.cloud.networksecurity.v1.IDeleteMirroringEndpointGroupRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize().catch(err => {throw err}); + const wrappedCallback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('deleteMirroringEndpointGroup response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('deleteMirroringEndpointGroup request %j', request); + return this.innerApiCalls.deleteMirroringEndpointGroup(request, options, wrappedCallback) + ?.then(([response, rawResponse, _]: [ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]) => { + this._log.info('deleteMirroringEndpointGroup response %j', rawResponse); + return [response, rawResponse, _]; + }); + } +/** + * Check the status of the long running operation returned by `deleteMirroringEndpointGroup()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/mirroring.delete_mirroring_endpoint_group.js + * region_tag:networksecurity_v1_generated_Mirroring_DeleteMirroringEndpointGroup_async + */ + async checkDeleteMirroringEndpointGroupProgress(name: string): Promise>{ + this._log.info('deleteMirroringEndpointGroup long-running'); + const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.deleteMirroringEndpointGroup, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Creates an association in a given project and location. + * See https://google.aip.dev/133. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent resource where this association will be created. + * Format: projects/{project}/locations/{location} + * @param {string} [request.mirroringEndpointGroupAssociationId] + * Optional. The ID to use for the new association, which will become the + * final component of the endpoint group's resource name. If not provided, the + * server will generate a unique ID. + * @param {google.cloud.networksecurity.v1.MirroringEndpointGroupAssociation} request.mirroringEndpointGroupAssociation + * Required. The association to create. + * @param {string} [request.requestId] + * Optional. A unique identifier for this request. Must be a UUID4. + * This request is only idempotent if a `request_id` is provided. + * See https://google.aip.dev/155 for more details. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/mirroring.create_mirroring_endpoint_group_association.js + * region_tag:networksecurity_v1_generated_Mirroring_CreateMirroringEndpointGroupAssociation_async + */ + createMirroringEndpointGroupAssociation( + request?: protos.google.cloud.networksecurity.v1.ICreateMirroringEndpointGroupAssociationRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + createMirroringEndpointGroupAssociation( + request: protos.google.cloud.networksecurity.v1.ICreateMirroringEndpointGroupAssociationRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + createMirroringEndpointGroupAssociation( + request: protos.google.cloud.networksecurity.v1.ICreateMirroringEndpointGroupAssociationRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + createMirroringEndpointGroupAssociation( + request?: protos.google.cloud.networksecurity.v1.ICreateMirroringEndpointGroupAssociationRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize().catch(err => {throw err}); + const wrappedCallback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('createMirroringEndpointGroupAssociation response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('createMirroringEndpointGroupAssociation request %j', request); + return this.innerApiCalls.createMirroringEndpointGroupAssociation(request, options, wrappedCallback) + ?.then(([response, rawResponse, _]: [ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]) => { + this._log.info('createMirroringEndpointGroupAssociation response %j', rawResponse); + return [response, rawResponse, _]; + }); + } +/** + * Check the status of the long running operation returned by `createMirroringEndpointGroupAssociation()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/mirroring.create_mirroring_endpoint_group_association.js + * region_tag:networksecurity_v1_generated_Mirroring_CreateMirroringEndpointGroupAssociation_async + */ + async checkCreateMirroringEndpointGroupAssociationProgress(name: string): Promise>{ + this._log.info('createMirroringEndpointGroupAssociation long-running'); + const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.createMirroringEndpointGroupAssociation, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Updates an association. + * See https://google.aip.dev/134. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.protobuf.FieldMask} [request.updateMask] + * Optional. The list of fields to update. + * Fields are specified relative to the association + * (e.g. `description`; *not* + * `mirroring_endpoint_group_association.description`). See + * https://google.aip.dev/161 for more details. + * @param {google.cloud.networksecurity.v1.MirroringEndpointGroupAssociation} request.mirroringEndpointGroupAssociation + * Required. The association to update. + * @param {string} [request.requestId] + * Optional. A unique identifier for this request. Must be a UUID4. + * This request is only idempotent if a `request_id` is provided. + * See https://google.aip.dev/155 for more details. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/mirroring.update_mirroring_endpoint_group_association.js + * region_tag:networksecurity_v1_generated_Mirroring_UpdateMirroringEndpointGroupAssociation_async + */ + updateMirroringEndpointGroupAssociation( + request?: protos.google.cloud.networksecurity.v1.IUpdateMirroringEndpointGroupAssociationRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + updateMirroringEndpointGroupAssociation( + request: protos.google.cloud.networksecurity.v1.IUpdateMirroringEndpointGroupAssociationRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + updateMirroringEndpointGroupAssociation( + request: protos.google.cloud.networksecurity.v1.IUpdateMirroringEndpointGroupAssociationRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + updateMirroringEndpointGroupAssociation( + request?: protos.google.cloud.networksecurity.v1.IUpdateMirroringEndpointGroupAssociationRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'mirroring_endpoint_group_association.name': request.mirroringEndpointGroupAssociation!.name ?? '', + }); + this.initialize().catch(err => {throw err}); + const wrappedCallback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('updateMirroringEndpointGroupAssociation response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('updateMirroringEndpointGroupAssociation request %j', request); + return this.innerApiCalls.updateMirroringEndpointGroupAssociation(request, options, wrappedCallback) + ?.then(([response, rawResponse, _]: [ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]) => { + this._log.info('updateMirroringEndpointGroupAssociation response %j', rawResponse); + return [response, rawResponse, _]; + }); + } +/** + * Check the status of the long running operation returned by `updateMirroringEndpointGroupAssociation()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/mirroring.update_mirroring_endpoint_group_association.js + * region_tag:networksecurity_v1_generated_Mirroring_UpdateMirroringEndpointGroupAssociation_async + */ + async checkUpdateMirroringEndpointGroupAssociationProgress(name: string): Promise>{ + this._log.info('updateMirroringEndpointGroupAssociation long-running'); + const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.updateMirroringEndpointGroupAssociation, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Deletes an association. + * See https://google.aip.dev/135. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The association to delete. + * @param {string} [request.requestId] + * Optional. A unique identifier for this request. Must be a UUID4. + * This request is only idempotent if a `request_id` is provided. + * See https://google.aip.dev/155 for more details. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/mirroring.delete_mirroring_endpoint_group_association.js + * region_tag:networksecurity_v1_generated_Mirroring_DeleteMirroringEndpointGroupAssociation_async + */ + deleteMirroringEndpointGroupAssociation( + request?: protos.google.cloud.networksecurity.v1.IDeleteMirroringEndpointGroupAssociationRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + deleteMirroringEndpointGroupAssociation( + request: protos.google.cloud.networksecurity.v1.IDeleteMirroringEndpointGroupAssociationRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + deleteMirroringEndpointGroupAssociation( + request: protos.google.cloud.networksecurity.v1.IDeleteMirroringEndpointGroupAssociationRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + deleteMirroringEndpointGroupAssociation( + request?: protos.google.cloud.networksecurity.v1.IDeleteMirroringEndpointGroupAssociationRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize().catch(err => {throw err}); + const wrappedCallback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('deleteMirroringEndpointGroupAssociation response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('deleteMirroringEndpointGroupAssociation request %j', request); + return this.innerApiCalls.deleteMirroringEndpointGroupAssociation(request, options, wrappedCallback) + ?.then(([response, rawResponse, _]: [ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]) => { + this._log.info('deleteMirroringEndpointGroupAssociation response %j', rawResponse); + return [response, rawResponse, _]; + }); + } +/** + * Check the status of the long running operation returned by `deleteMirroringEndpointGroupAssociation()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/mirroring.delete_mirroring_endpoint_group_association.js + * region_tag:networksecurity_v1_generated_Mirroring_DeleteMirroringEndpointGroupAssociation_async + */ + async checkDeleteMirroringEndpointGroupAssociationProgress(name: string): Promise>{ + this._log.info('deleteMirroringEndpointGroupAssociation long-running'); + const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.deleteMirroringEndpointGroupAssociation, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Creates a deployment group in a given project and location. + * See https://google.aip.dev/133. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent resource where this deployment group will be created. + * Format: projects/{project}/locations/{location} + * @param {string} request.mirroringDeploymentGroupId + * Required. The ID to use for the new deployment group, which will become the + * final component of the deployment group's resource name. + * @param {google.cloud.networksecurity.v1.MirroringDeploymentGroup} request.mirroringDeploymentGroup + * Required. The deployment group to create. + * @param {string} [request.requestId] + * Optional. A unique identifier for this request. Must be a UUID4. + * This request is only idempotent if a `request_id` is provided. + * See https://google.aip.dev/155 for more details. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/mirroring.create_mirroring_deployment_group.js + * region_tag:networksecurity_v1_generated_Mirroring_CreateMirroringDeploymentGroup_async + */ + createMirroringDeploymentGroup( + request?: protos.google.cloud.networksecurity.v1.ICreateMirroringDeploymentGroupRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + createMirroringDeploymentGroup( + request: protos.google.cloud.networksecurity.v1.ICreateMirroringDeploymentGroupRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + createMirroringDeploymentGroup( + request: protos.google.cloud.networksecurity.v1.ICreateMirroringDeploymentGroupRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + createMirroringDeploymentGroup( + request?: protos.google.cloud.networksecurity.v1.ICreateMirroringDeploymentGroupRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize().catch(err => {throw err}); + const wrappedCallback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('createMirroringDeploymentGroup response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('createMirroringDeploymentGroup request %j', request); + return this.innerApiCalls.createMirroringDeploymentGroup(request, options, wrappedCallback) + ?.then(([response, rawResponse, _]: [ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]) => { + this._log.info('createMirroringDeploymentGroup response %j', rawResponse); + return [response, rawResponse, _]; + }); + } +/** + * Check the status of the long running operation returned by `createMirroringDeploymentGroup()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/mirroring.create_mirroring_deployment_group.js + * region_tag:networksecurity_v1_generated_Mirroring_CreateMirroringDeploymentGroup_async + */ + async checkCreateMirroringDeploymentGroupProgress(name: string): Promise>{ + this._log.info('createMirroringDeploymentGroup long-running'); + const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.createMirroringDeploymentGroup, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Updates a deployment group. + * See https://google.aip.dev/134. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.protobuf.FieldMask} [request.updateMask] + * Optional. The list of fields to update. + * Fields are specified relative to the deployment group + * (e.g. `description`; *not* + * `mirroring_deployment_group.description`). See + * https://google.aip.dev/161 for more details. + * @param {google.cloud.networksecurity.v1.MirroringDeploymentGroup} request.mirroringDeploymentGroup + * Required. The deployment group to update. + * @param {string} [request.requestId] + * Optional. A unique identifier for this request. Must be a UUID4. + * This request is only idempotent if a `request_id` is provided. + * See https://google.aip.dev/155 for more details. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/mirroring.update_mirroring_deployment_group.js + * region_tag:networksecurity_v1_generated_Mirroring_UpdateMirroringDeploymentGroup_async + */ + updateMirroringDeploymentGroup( + request?: protos.google.cloud.networksecurity.v1.IUpdateMirroringDeploymentGroupRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + updateMirroringDeploymentGroup( + request: protos.google.cloud.networksecurity.v1.IUpdateMirroringDeploymentGroupRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + updateMirroringDeploymentGroup( + request: protos.google.cloud.networksecurity.v1.IUpdateMirroringDeploymentGroupRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + updateMirroringDeploymentGroup( + request?: protos.google.cloud.networksecurity.v1.IUpdateMirroringDeploymentGroupRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'mirroring_deployment_group.name': request.mirroringDeploymentGroup!.name ?? '', + }); + this.initialize().catch(err => {throw err}); + const wrappedCallback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('updateMirroringDeploymentGroup response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('updateMirroringDeploymentGroup request %j', request); + return this.innerApiCalls.updateMirroringDeploymentGroup(request, options, wrappedCallback) + ?.then(([response, rawResponse, _]: [ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]) => { + this._log.info('updateMirroringDeploymentGroup response %j', rawResponse); + return [response, rawResponse, _]; + }); + } +/** + * Check the status of the long running operation returned by `updateMirroringDeploymentGroup()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/mirroring.update_mirroring_deployment_group.js + * region_tag:networksecurity_v1_generated_Mirroring_UpdateMirroringDeploymentGroup_async + */ + async checkUpdateMirroringDeploymentGroupProgress(name: string): Promise>{ + this._log.info('updateMirroringDeploymentGroup long-running'); + const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.updateMirroringDeploymentGroup, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Deletes a deployment group. + * See https://google.aip.dev/135. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The deployment group to delete. + * @param {string} [request.requestId] + * Optional. A unique identifier for this request. Must be a UUID4. + * This request is only idempotent if a `request_id` is provided. + * See https://google.aip.dev/155 for more details. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/mirroring.delete_mirroring_deployment_group.js + * region_tag:networksecurity_v1_generated_Mirroring_DeleteMirroringDeploymentGroup_async + */ + deleteMirroringDeploymentGroup( + request?: protos.google.cloud.networksecurity.v1.IDeleteMirroringDeploymentGroupRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + deleteMirroringDeploymentGroup( + request: protos.google.cloud.networksecurity.v1.IDeleteMirroringDeploymentGroupRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + deleteMirroringDeploymentGroup( + request: protos.google.cloud.networksecurity.v1.IDeleteMirroringDeploymentGroupRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + deleteMirroringDeploymentGroup( + request?: protos.google.cloud.networksecurity.v1.IDeleteMirroringDeploymentGroupRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize().catch(err => {throw err}); + const wrappedCallback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('deleteMirroringDeploymentGroup response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('deleteMirroringDeploymentGroup request %j', request); + return this.innerApiCalls.deleteMirroringDeploymentGroup(request, options, wrappedCallback) + ?.then(([response, rawResponse, _]: [ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]) => { + this._log.info('deleteMirroringDeploymentGroup response %j', rawResponse); + return [response, rawResponse, _]; + }); + } +/** + * Check the status of the long running operation returned by `deleteMirroringDeploymentGroup()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/mirroring.delete_mirroring_deployment_group.js + * region_tag:networksecurity_v1_generated_Mirroring_DeleteMirroringDeploymentGroup_async + */ + async checkDeleteMirroringDeploymentGroupProgress(name: string): Promise>{ + this._log.info('deleteMirroringDeploymentGroup long-running'); + const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.deleteMirroringDeploymentGroup, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Creates a deployment in a given project and location. + * See https://google.aip.dev/133. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent resource where this deployment will be created. + * Format: projects/{project}/locations/{location} + * @param {string} request.mirroringDeploymentId + * Required. The ID to use for the new deployment, which will become the final + * component of the deployment's resource name. + * @param {google.cloud.networksecurity.v1.MirroringDeployment} request.mirroringDeployment + * Required. The deployment to create. + * @param {string} [request.requestId] + * Optional. A unique identifier for this request. Must be a UUID4. + * This request is only idempotent if a `request_id` is provided. + * See https://google.aip.dev/155 for more details. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/mirroring.create_mirroring_deployment.js + * region_tag:networksecurity_v1_generated_Mirroring_CreateMirroringDeployment_async + */ + createMirroringDeployment( + request?: protos.google.cloud.networksecurity.v1.ICreateMirroringDeploymentRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + createMirroringDeployment( + request: protos.google.cloud.networksecurity.v1.ICreateMirroringDeploymentRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + createMirroringDeployment( + request: protos.google.cloud.networksecurity.v1.ICreateMirroringDeploymentRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + createMirroringDeployment( + request?: protos.google.cloud.networksecurity.v1.ICreateMirroringDeploymentRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize().catch(err => {throw err}); + const wrappedCallback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('createMirroringDeployment response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('createMirroringDeployment request %j', request); + return this.innerApiCalls.createMirroringDeployment(request, options, wrappedCallback) + ?.then(([response, rawResponse, _]: [ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]) => { + this._log.info('createMirroringDeployment response %j', rawResponse); + return [response, rawResponse, _]; + }); + } +/** + * Check the status of the long running operation returned by `createMirroringDeployment()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/mirroring.create_mirroring_deployment.js + * region_tag:networksecurity_v1_generated_Mirroring_CreateMirroringDeployment_async + */ + async checkCreateMirroringDeploymentProgress(name: string): Promise>{ + this._log.info('createMirroringDeployment long-running'); + const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.createMirroringDeployment, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Updates a deployment. + * See https://google.aip.dev/134. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.protobuf.FieldMask} [request.updateMask] + * Optional. The list of fields to update. + * Fields are specified relative to the deployment + * (e.g. `description`; *not* `mirroring_deployment.description`). + * See https://google.aip.dev/161 for more details. + * @param {google.cloud.networksecurity.v1.MirroringDeployment} request.mirroringDeployment + * Required. The deployment to update. + * @param {string} [request.requestId] + * Optional. A unique identifier for this request. Must be a UUID4. + * This request is only idempotent if a `request_id` is provided. + * See https://google.aip.dev/155 for more details. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/mirroring.update_mirroring_deployment.js + * region_tag:networksecurity_v1_generated_Mirroring_UpdateMirroringDeployment_async + */ + updateMirroringDeployment( + request?: protos.google.cloud.networksecurity.v1.IUpdateMirroringDeploymentRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + updateMirroringDeployment( + request: protos.google.cloud.networksecurity.v1.IUpdateMirroringDeploymentRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + updateMirroringDeployment( + request: protos.google.cloud.networksecurity.v1.IUpdateMirroringDeploymentRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + updateMirroringDeployment( + request?: protos.google.cloud.networksecurity.v1.IUpdateMirroringDeploymentRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'mirroring_deployment.name': request.mirroringDeployment!.name ?? '', + }); + this.initialize().catch(err => {throw err}); + const wrappedCallback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('updateMirroringDeployment response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('updateMirroringDeployment request %j', request); + return this.innerApiCalls.updateMirroringDeployment(request, options, wrappedCallback) + ?.then(([response, rawResponse, _]: [ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]) => { + this._log.info('updateMirroringDeployment response %j', rawResponse); + return [response, rawResponse, _]; + }); + } +/** + * Check the status of the long running operation returned by `updateMirroringDeployment()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/mirroring.update_mirroring_deployment.js + * region_tag:networksecurity_v1_generated_Mirroring_UpdateMirroringDeployment_async + */ + async checkUpdateMirroringDeploymentProgress(name: string): Promise>{ + this._log.info('updateMirroringDeployment long-running'); + const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.updateMirroringDeployment, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Deletes a deployment. + * See https://google.aip.dev/135. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Name of the resource + * @param {string} [request.requestId] + * Optional. A unique identifier for this request. Must be a UUID4. + * This request is only idempotent if a `request_id` is provided. + * See https://google.aip.dev/155 for more details. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/mirroring.delete_mirroring_deployment.js + * region_tag:networksecurity_v1_generated_Mirroring_DeleteMirroringDeployment_async + */ + deleteMirroringDeployment( + request?: protos.google.cloud.networksecurity.v1.IDeleteMirroringDeploymentRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + deleteMirroringDeployment( + request: protos.google.cloud.networksecurity.v1.IDeleteMirroringDeploymentRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + deleteMirroringDeployment( + request: protos.google.cloud.networksecurity.v1.IDeleteMirroringDeploymentRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + deleteMirroringDeployment( + request?: protos.google.cloud.networksecurity.v1.IDeleteMirroringDeploymentRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize().catch(err => {throw err}); + const wrappedCallback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('deleteMirroringDeployment response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('deleteMirroringDeployment request %j', request); + return this.innerApiCalls.deleteMirroringDeployment(request, options, wrappedCallback) + ?.then(([response, rawResponse, _]: [ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]) => { + this._log.info('deleteMirroringDeployment response %j', rawResponse); + return [response, rawResponse, _]; + }); + } +/** + * Check the status of the long running operation returned by `deleteMirroringDeployment()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/mirroring.delete_mirroring_deployment.js + * region_tag:networksecurity_v1_generated_Mirroring_DeleteMirroringDeployment_async + */ + async checkDeleteMirroringDeploymentProgress(name: string): Promise>{ + this._log.info('deleteMirroringDeployment long-running'); + const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.deleteMirroringDeployment, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } + /** + * Lists endpoint groups in a given project and location. + * See https://google.aip.dev/132. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent, which owns this collection of endpoint groups. + * Example: `projects/123456789/locations/global`. + * See https://google.aip.dev/132 for more details. + * @param {number} [request.pageSize] + * Optional. Requested page size. Server may return fewer items than + * requested. If unspecified, server will pick an appropriate default. See + * https://google.aip.dev/158 for more details. + * @param {string} [request.pageToken] + * Optional. A page token, received from a previous + * `ListMirroringEndpointGroups` call. Provide this to retrieve the subsequent + * page. When paginating, all other parameters provided to + * `ListMirroringEndpointGroups` must match the call that provided the page + * token. + * See https://google.aip.dev/158 for more details. + * @param {string} [request.filter] + * Optional. Filter expression. + * See https://google.aip.dev/160#filtering for more details. + * @param {string} [request.orderBy] + * Optional. Sort expression. + * See https://google.aip.dev/132#ordering for more details. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of {@link protos.google.cloud.networksecurity.v1.MirroringEndpointGroup|MirroringEndpointGroup}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listMirroringEndpointGroupsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listMirroringEndpointGroups( + request?: protos.google.cloud.networksecurity.v1.IListMirroringEndpointGroupsRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.networksecurity.v1.IMirroringEndpointGroup[], + protos.google.cloud.networksecurity.v1.IListMirroringEndpointGroupsRequest|null, + protos.google.cloud.networksecurity.v1.IListMirroringEndpointGroupsResponse + ]>; + listMirroringEndpointGroups( + request: protos.google.cloud.networksecurity.v1.IListMirroringEndpointGroupsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.networksecurity.v1.IListMirroringEndpointGroupsRequest, + protos.google.cloud.networksecurity.v1.IListMirroringEndpointGroupsResponse|null|undefined, + protos.google.cloud.networksecurity.v1.IMirroringEndpointGroup>): void; + listMirroringEndpointGroups( + request: protos.google.cloud.networksecurity.v1.IListMirroringEndpointGroupsRequest, + callback: PaginationCallback< + protos.google.cloud.networksecurity.v1.IListMirroringEndpointGroupsRequest, + protos.google.cloud.networksecurity.v1.IListMirroringEndpointGroupsResponse|null|undefined, + protos.google.cloud.networksecurity.v1.IMirroringEndpointGroup>): void; + listMirroringEndpointGroups( + request?: protos.google.cloud.networksecurity.v1.IListMirroringEndpointGroupsRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.cloud.networksecurity.v1.IListMirroringEndpointGroupsRequest, + protos.google.cloud.networksecurity.v1.IListMirroringEndpointGroupsResponse|null|undefined, + protos.google.cloud.networksecurity.v1.IMirroringEndpointGroup>, + callback?: PaginationCallback< + protos.google.cloud.networksecurity.v1.IListMirroringEndpointGroupsRequest, + protos.google.cloud.networksecurity.v1.IListMirroringEndpointGroupsResponse|null|undefined, + protos.google.cloud.networksecurity.v1.IMirroringEndpointGroup>): + Promise<[ + protos.google.cloud.networksecurity.v1.IMirroringEndpointGroup[], + protos.google.cloud.networksecurity.v1.IListMirroringEndpointGroupsRequest|null, + protos.google.cloud.networksecurity.v1.IListMirroringEndpointGroupsResponse + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize().catch(err => {throw err}); + const wrappedCallback: PaginationCallback< + protos.google.cloud.networksecurity.v1.IListMirroringEndpointGroupsRequest, + protos.google.cloud.networksecurity.v1.IListMirroringEndpointGroupsResponse|null|undefined, + protos.google.cloud.networksecurity.v1.IMirroringEndpointGroup>|undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listMirroringEndpointGroups values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listMirroringEndpointGroups request %j', request); + return this.innerApiCalls + .listMirroringEndpointGroups(request, options, wrappedCallback) + ?.then(([response, input, output]: [ + protos.google.cloud.networksecurity.v1.IMirroringEndpointGroup[], + protos.google.cloud.networksecurity.v1.IListMirroringEndpointGroupsRequest|null, + protos.google.cloud.networksecurity.v1.IListMirroringEndpointGroupsResponse + ]) => { + this._log.info('listMirroringEndpointGroups values %j', response); + return [response, input, output]; + }); + } + +/** + * Equivalent to `listMirroringEndpointGroups`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent, which owns this collection of endpoint groups. + * Example: `projects/123456789/locations/global`. + * See https://google.aip.dev/132 for more details. + * @param {number} [request.pageSize] + * Optional. Requested page size. Server may return fewer items than + * requested. If unspecified, server will pick an appropriate default. See + * https://google.aip.dev/158 for more details. + * @param {string} [request.pageToken] + * Optional. A page token, received from a previous + * `ListMirroringEndpointGroups` call. Provide this to retrieve the subsequent + * page. When paginating, all other parameters provided to + * `ListMirroringEndpointGroups` must match the call that provided the page + * token. + * See https://google.aip.dev/158 for more details. + * @param {string} [request.filter] + * Optional. Filter expression. + * See https://google.aip.dev/160#filtering for more details. + * @param {string} [request.orderBy] + * Optional. Sort expression. + * See https://google.aip.dev/132#ordering for more details. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing {@link protos.google.cloud.networksecurity.v1.MirroringEndpointGroup|MirroringEndpointGroup} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `listMirroringEndpointGroupsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listMirroringEndpointGroupsStream( + request?: protos.google.cloud.networksecurity.v1.IListMirroringEndpointGroupsRequest, + options?: CallOptions): + Transform{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listMirroringEndpointGroups']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listMirroringEndpointGroups stream %j', request); + return this.descriptors.page.listMirroringEndpointGroups.createStream( + this.innerApiCalls.listMirroringEndpointGroups as GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listMirroringEndpointGroups`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent, which owns this collection of endpoint groups. + * Example: `projects/123456789/locations/global`. + * See https://google.aip.dev/132 for more details. + * @param {number} [request.pageSize] + * Optional. Requested page size. Server may return fewer items than + * requested. If unspecified, server will pick an appropriate default. See + * https://google.aip.dev/158 for more details. + * @param {string} [request.pageToken] + * Optional. A page token, received from a previous + * `ListMirroringEndpointGroups` call. Provide this to retrieve the subsequent + * page. When paginating, all other parameters provided to + * `ListMirroringEndpointGroups` must match the call that provided the page + * token. + * See https://google.aip.dev/158 for more details. + * @param {string} [request.filter] + * Optional. Filter expression. + * See https://google.aip.dev/160#filtering for more details. + * @param {string} [request.orderBy] + * Optional. Sort expression. + * See https://google.aip.dev/132#ordering for more details. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link protos.google.cloud.networksecurity.v1.MirroringEndpointGroup|MirroringEndpointGroup}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example include:samples/generated/v1/mirroring.list_mirroring_endpoint_groups.js + * region_tag:networksecurity_v1_generated_Mirroring_ListMirroringEndpointGroups_async + */ + listMirroringEndpointGroupsAsync( + request?: protos.google.cloud.networksecurity.v1.IListMirroringEndpointGroupsRequest, + options?: CallOptions): + AsyncIterable{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listMirroringEndpointGroups']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listMirroringEndpointGroups iterate %j', request); + return this.descriptors.page.listMirroringEndpointGroups.asyncIterate( + this.innerApiCalls['listMirroringEndpointGroups'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Lists associations in a given project and location. + * See https://google.aip.dev/132. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent, which owns this collection of associations. + * Example: `projects/123456789/locations/global`. + * See https://google.aip.dev/132 for more details. + * @param {number} [request.pageSize] + * Optional. Requested page size. Server may return fewer items than + * requested. If unspecified, server will pick an appropriate default. See + * https://google.aip.dev/158 for more details. + * @param {string} [request.pageToken] + * Optional. A page token, received from a previous + * `ListMirroringEndpointGroups` call. Provide this to retrieve the subsequent + * page. When paginating, all other parameters provided to + * `ListMirroringEndpointGroups` must match the call that provided the page + * token. See https://google.aip.dev/158 for more details. + * @param {string} [request.filter] + * Optional. Filter expression. + * See https://google.aip.dev/160#filtering for more details. + * @param {string} [request.orderBy] + * Optional. Sort expression. + * See https://google.aip.dev/132#ordering for more details. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of {@link protos.google.cloud.networksecurity.v1.MirroringEndpointGroupAssociation|MirroringEndpointGroupAssociation}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listMirroringEndpointGroupAssociationsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listMirroringEndpointGroupAssociations( + request?: protos.google.cloud.networksecurity.v1.IListMirroringEndpointGroupAssociationsRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.networksecurity.v1.IMirroringEndpointGroupAssociation[], + protos.google.cloud.networksecurity.v1.IListMirroringEndpointGroupAssociationsRequest|null, + protos.google.cloud.networksecurity.v1.IListMirroringEndpointGroupAssociationsResponse + ]>; + listMirroringEndpointGroupAssociations( + request: protos.google.cloud.networksecurity.v1.IListMirroringEndpointGroupAssociationsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.networksecurity.v1.IListMirroringEndpointGroupAssociationsRequest, + protos.google.cloud.networksecurity.v1.IListMirroringEndpointGroupAssociationsResponse|null|undefined, + protos.google.cloud.networksecurity.v1.IMirroringEndpointGroupAssociation>): void; + listMirroringEndpointGroupAssociations( + request: protos.google.cloud.networksecurity.v1.IListMirroringEndpointGroupAssociationsRequest, + callback: PaginationCallback< + protos.google.cloud.networksecurity.v1.IListMirroringEndpointGroupAssociationsRequest, + protos.google.cloud.networksecurity.v1.IListMirroringEndpointGroupAssociationsResponse|null|undefined, + protos.google.cloud.networksecurity.v1.IMirroringEndpointGroupAssociation>): void; + listMirroringEndpointGroupAssociations( + request?: protos.google.cloud.networksecurity.v1.IListMirroringEndpointGroupAssociationsRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.cloud.networksecurity.v1.IListMirroringEndpointGroupAssociationsRequest, + protos.google.cloud.networksecurity.v1.IListMirroringEndpointGroupAssociationsResponse|null|undefined, + protos.google.cloud.networksecurity.v1.IMirroringEndpointGroupAssociation>, + callback?: PaginationCallback< + protos.google.cloud.networksecurity.v1.IListMirroringEndpointGroupAssociationsRequest, + protos.google.cloud.networksecurity.v1.IListMirroringEndpointGroupAssociationsResponse|null|undefined, + protos.google.cloud.networksecurity.v1.IMirroringEndpointGroupAssociation>): + Promise<[ + protos.google.cloud.networksecurity.v1.IMirroringEndpointGroupAssociation[], + protos.google.cloud.networksecurity.v1.IListMirroringEndpointGroupAssociationsRequest|null, + protos.google.cloud.networksecurity.v1.IListMirroringEndpointGroupAssociationsResponse + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize().catch(err => {throw err}); + const wrappedCallback: PaginationCallback< + protos.google.cloud.networksecurity.v1.IListMirroringEndpointGroupAssociationsRequest, + protos.google.cloud.networksecurity.v1.IListMirroringEndpointGroupAssociationsResponse|null|undefined, + protos.google.cloud.networksecurity.v1.IMirroringEndpointGroupAssociation>|undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listMirroringEndpointGroupAssociations values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listMirroringEndpointGroupAssociations request %j', request); + return this.innerApiCalls + .listMirroringEndpointGroupAssociations(request, options, wrappedCallback) + ?.then(([response, input, output]: [ + protos.google.cloud.networksecurity.v1.IMirroringEndpointGroupAssociation[], + protos.google.cloud.networksecurity.v1.IListMirroringEndpointGroupAssociationsRequest|null, + protos.google.cloud.networksecurity.v1.IListMirroringEndpointGroupAssociationsResponse + ]) => { + this._log.info('listMirroringEndpointGroupAssociations values %j', response); + return [response, input, output]; + }); + } + +/** + * Equivalent to `listMirroringEndpointGroupAssociations`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent, which owns this collection of associations. + * Example: `projects/123456789/locations/global`. + * See https://google.aip.dev/132 for more details. + * @param {number} [request.pageSize] + * Optional. Requested page size. Server may return fewer items than + * requested. If unspecified, server will pick an appropriate default. See + * https://google.aip.dev/158 for more details. + * @param {string} [request.pageToken] + * Optional. A page token, received from a previous + * `ListMirroringEndpointGroups` call. Provide this to retrieve the subsequent + * page. When paginating, all other parameters provided to + * `ListMirroringEndpointGroups` must match the call that provided the page + * token. See https://google.aip.dev/158 for more details. + * @param {string} [request.filter] + * Optional. Filter expression. + * See https://google.aip.dev/160#filtering for more details. + * @param {string} [request.orderBy] + * Optional. Sort expression. + * See https://google.aip.dev/132#ordering for more details. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing {@link protos.google.cloud.networksecurity.v1.MirroringEndpointGroupAssociation|MirroringEndpointGroupAssociation} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `listMirroringEndpointGroupAssociationsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listMirroringEndpointGroupAssociationsStream( + request?: protos.google.cloud.networksecurity.v1.IListMirroringEndpointGroupAssociationsRequest, + options?: CallOptions): + Transform{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listMirroringEndpointGroupAssociations']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listMirroringEndpointGroupAssociations stream %j', request); + return this.descriptors.page.listMirroringEndpointGroupAssociations.createStream( + this.innerApiCalls.listMirroringEndpointGroupAssociations as GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listMirroringEndpointGroupAssociations`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent, which owns this collection of associations. + * Example: `projects/123456789/locations/global`. + * See https://google.aip.dev/132 for more details. + * @param {number} [request.pageSize] + * Optional. Requested page size. Server may return fewer items than + * requested. If unspecified, server will pick an appropriate default. See + * https://google.aip.dev/158 for more details. + * @param {string} [request.pageToken] + * Optional. A page token, received from a previous + * `ListMirroringEndpointGroups` call. Provide this to retrieve the subsequent + * page. When paginating, all other parameters provided to + * `ListMirroringEndpointGroups` must match the call that provided the page + * token. See https://google.aip.dev/158 for more details. + * @param {string} [request.filter] + * Optional. Filter expression. + * See https://google.aip.dev/160#filtering for more details. + * @param {string} [request.orderBy] + * Optional. Sort expression. + * See https://google.aip.dev/132#ordering for more details. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link protos.google.cloud.networksecurity.v1.MirroringEndpointGroupAssociation|MirroringEndpointGroupAssociation}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example include:samples/generated/v1/mirroring.list_mirroring_endpoint_group_associations.js + * region_tag:networksecurity_v1_generated_Mirroring_ListMirroringEndpointGroupAssociations_async + */ + listMirroringEndpointGroupAssociationsAsync( + request?: protos.google.cloud.networksecurity.v1.IListMirroringEndpointGroupAssociationsRequest, + options?: CallOptions): + AsyncIterable{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listMirroringEndpointGroupAssociations']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listMirroringEndpointGroupAssociations iterate %j', request); + return this.descriptors.page.listMirroringEndpointGroupAssociations.asyncIterate( + this.innerApiCalls['listMirroringEndpointGroupAssociations'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Lists deployment groups in a given project and location. + * See https://google.aip.dev/132. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent, which owns this collection of deployment groups. + * Example: `projects/123456789/locations/global`. + * See https://google.aip.dev/132 for more details. + * @param {number} [request.pageSize] + * Optional. Requested page size. Server may return fewer items than + * requested. If unspecified, server will pick an appropriate default. See + * https://google.aip.dev/158 for more details. + * @param {string} [request.pageToken] + * Optional. A page token, received from a previous + * `ListMirroringDeploymentGroups` call. Provide this to retrieve the + * subsequent page. When paginating, all other parameters provided to + * `ListMirroringDeploymentGroups` must match the call that provided the page + * token. See https://google.aip.dev/158 for more details. + * @param {string} [request.filter] + * Optional. Filter expression. + * See https://google.aip.dev/160#filtering for more details. + * @param {string} [request.orderBy] + * Optional. Sort expression. + * See https://google.aip.dev/132#ordering for more details. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of {@link protos.google.cloud.networksecurity.v1.MirroringDeploymentGroup|MirroringDeploymentGroup}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listMirroringDeploymentGroupsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listMirroringDeploymentGroups( + request?: protos.google.cloud.networksecurity.v1.IListMirroringDeploymentGroupsRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.networksecurity.v1.IMirroringDeploymentGroup[], + protos.google.cloud.networksecurity.v1.IListMirroringDeploymentGroupsRequest|null, + protos.google.cloud.networksecurity.v1.IListMirroringDeploymentGroupsResponse + ]>; + listMirroringDeploymentGroups( + request: protos.google.cloud.networksecurity.v1.IListMirroringDeploymentGroupsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.networksecurity.v1.IListMirroringDeploymentGroupsRequest, + protos.google.cloud.networksecurity.v1.IListMirroringDeploymentGroupsResponse|null|undefined, + protos.google.cloud.networksecurity.v1.IMirroringDeploymentGroup>): void; + listMirroringDeploymentGroups( + request: protos.google.cloud.networksecurity.v1.IListMirroringDeploymentGroupsRequest, + callback: PaginationCallback< + protos.google.cloud.networksecurity.v1.IListMirroringDeploymentGroupsRequest, + protos.google.cloud.networksecurity.v1.IListMirroringDeploymentGroupsResponse|null|undefined, + protos.google.cloud.networksecurity.v1.IMirroringDeploymentGroup>): void; + listMirroringDeploymentGroups( + request?: protos.google.cloud.networksecurity.v1.IListMirroringDeploymentGroupsRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.cloud.networksecurity.v1.IListMirroringDeploymentGroupsRequest, + protos.google.cloud.networksecurity.v1.IListMirroringDeploymentGroupsResponse|null|undefined, + protos.google.cloud.networksecurity.v1.IMirroringDeploymentGroup>, + callback?: PaginationCallback< + protos.google.cloud.networksecurity.v1.IListMirroringDeploymentGroupsRequest, + protos.google.cloud.networksecurity.v1.IListMirroringDeploymentGroupsResponse|null|undefined, + protos.google.cloud.networksecurity.v1.IMirroringDeploymentGroup>): + Promise<[ + protos.google.cloud.networksecurity.v1.IMirroringDeploymentGroup[], + protos.google.cloud.networksecurity.v1.IListMirroringDeploymentGroupsRequest|null, + protos.google.cloud.networksecurity.v1.IListMirroringDeploymentGroupsResponse + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize().catch(err => {throw err}); + const wrappedCallback: PaginationCallback< + protos.google.cloud.networksecurity.v1.IListMirroringDeploymentGroupsRequest, + protos.google.cloud.networksecurity.v1.IListMirroringDeploymentGroupsResponse|null|undefined, + protos.google.cloud.networksecurity.v1.IMirroringDeploymentGroup>|undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listMirroringDeploymentGroups values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listMirroringDeploymentGroups request %j', request); + return this.innerApiCalls + .listMirroringDeploymentGroups(request, options, wrappedCallback) + ?.then(([response, input, output]: [ + protos.google.cloud.networksecurity.v1.IMirroringDeploymentGroup[], + protos.google.cloud.networksecurity.v1.IListMirroringDeploymentGroupsRequest|null, + protos.google.cloud.networksecurity.v1.IListMirroringDeploymentGroupsResponse + ]) => { + this._log.info('listMirroringDeploymentGroups values %j', response); + return [response, input, output]; + }); + } + +/** + * Equivalent to `listMirroringDeploymentGroups`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent, which owns this collection of deployment groups. + * Example: `projects/123456789/locations/global`. + * See https://google.aip.dev/132 for more details. + * @param {number} [request.pageSize] + * Optional. Requested page size. Server may return fewer items than + * requested. If unspecified, server will pick an appropriate default. See + * https://google.aip.dev/158 for more details. + * @param {string} [request.pageToken] + * Optional. A page token, received from a previous + * `ListMirroringDeploymentGroups` call. Provide this to retrieve the + * subsequent page. When paginating, all other parameters provided to + * `ListMirroringDeploymentGroups` must match the call that provided the page + * token. See https://google.aip.dev/158 for more details. + * @param {string} [request.filter] + * Optional. Filter expression. + * See https://google.aip.dev/160#filtering for more details. + * @param {string} [request.orderBy] + * Optional. Sort expression. + * See https://google.aip.dev/132#ordering for more details. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing {@link protos.google.cloud.networksecurity.v1.MirroringDeploymentGroup|MirroringDeploymentGroup} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `listMirroringDeploymentGroupsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listMirroringDeploymentGroupsStream( + request?: protos.google.cloud.networksecurity.v1.IListMirroringDeploymentGroupsRequest, + options?: CallOptions): + Transform{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listMirroringDeploymentGroups']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listMirroringDeploymentGroups stream %j', request); + return this.descriptors.page.listMirroringDeploymentGroups.createStream( + this.innerApiCalls.listMirroringDeploymentGroups as GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listMirroringDeploymentGroups`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent, which owns this collection of deployment groups. + * Example: `projects/123456789/locations/global`. + * See https://google.aip.dev/132 for more details. + * @param {number} [request.pageSize] + * Optional. Requested page size. Server may return fewer items than + * requested. If unspecified, server will pick an appropriate default. See + * https://google.aip.dev/158 for more details. + * @param {string} [request.pageToken] + * Optional. A page token, received from a previous + * `ListMirroringDeploymentGroups` call. Provide this to retrieve the + * subsequent page. When paginating, all other parameters provided to + * `ListMirroringDeploymentGroups` must match the call that provided the page + * token. See https://google.aip.dev/158 for more details. + * @param {string} [request.filter] + * Optional. Filter expression. + * See https://google.aip.dev/160#filtering for more details. + * @param {string} [request.orderBy] + * Optional. Sort expression. + * See https://google.aip.dev/132#ordering for more details. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link protos.google.cloud.networksecurity.v1.MirroringDeploymentGroup|MirroringDeploymentGroup}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example include:samples/generated/v1/mirroring.list_mirroring_deployment_groups.js + * region_tag:networksecurity_v1_generated_Mirroring_ListMirroringDeploymentGroups_async + */ + listMirroringDeploymentGroupsAsync( + request?: protos.google.cloud.networksecurity.v1.IListMirroringDeploymentGroupsRequest, + options?: CallOptions): + AsyncIterable{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listMirroringDeploymentGroups']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listMirroringDeploymentGroups iterate %j', request); + return this.descriptors.page.listMirroringDeploymentGroups.asyncIterate( + this.innerApiCalls['listMirroringDeploymentGroups'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Lists deployments in a given project and location. + * See https://google.aip.dev/132. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent, which owns this collection of deployments. + * Example: `projects/123456789/locations/us-central1-a`. + * See https://google.aip.dev/132 for more details. + * @param {number} [request.pageSize] + * Optional. Requested page size. Server may return fewer items than + * requested. If unspecified, server will pick an appropriate default. See + * https://google.aip.dev/158 for more details. + * @param {string} [request.pageToken] + * Optional. A page token, received from a previous `ListMirroringDeployments` + * call. Provide this to retrieve the subsequent page. When paginating, all + * other parameters provided to `ListMirroringDeployments` must match the call + * that provided the page token. See https://google.aip.dev/158 for more + * details. + * @param {string} [request.filter] + * Optional. Filter expression. + * See https://google.aip.dev/160#filtering for more details. + * @param {string} [request.orderBy] + * Optional. Sort expression. + * See https://google.aip.dev/132#ordering for more details. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of {@link protos.google.cloud.networksecurity.v1.MirroringDeployment|MirroringDeployment}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listMirroringDeploymentsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listMirroringDeployments( + request?: protos.google.cloud.networksecurity.v1.IListMirroringDeploymentsRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.networksecurity.v1.IMirroringDeployment[], + protos.google.cloud.networksecurity.v1.IListMirroringDeploymentsRequest|null, + protos.google.cloud.networksecurity.v1.IListMirroringDeploymentsResponse + ]>; + listMirroringDeployments( + request: protos.google.cloud.networksecurity.v1.IListMirroringDeploymentsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.networksecurity.v1.IListMirroringDeploymentsRequest, + protos.google.cloud.networksecurity.v1.IListMirroringDeploymentsResponse|null|undefined, + protos.google.cloud.networksecurity.v1.IMirroringDeployment>): void; + listMirroringDeployments( + request: protos.google.cloud.networksecurity.v1.IListMirroringDeploymentsRequest, + callback: PaginationCallback< + protos.google.cloud.networksecurity.v1.IListMirroringDeploymentsRequest, + protos.google.cloud.networksecurity.v1.IListMirroringDeploymentsResponse|null|undefined, + protos.google.cloud.networksecurity.v1.IMirroringDeployment>): void; + listMirroringDeployments( + request?: protos.google.cloud.networksecurity.v1.IListMirroringDeploymentsRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.cloud.networksecurity.v1.IListMirroringDeploymentsRequest, + protos.google.cloud.networksecurity.v1.IListMirroringDeploymentsResponse|null|undefined, + protos.google.cloud.networksecurity.v1.IMirroringDeployment>, + callback?: PaginationCallback< + protos.google.cloud.networksecurity.v1.IListMirroringDeploymentsRequest, + protos.google.cloud.networksecurity.v1.IListMirroringDeploymentsResponse|null|undefined, + protos.google.cloud.networksecurity.v1.IMirroringDeployment>): + Promise<[ + protos.google.cloud.networksecurity.v1.IMirroringDeployment[], + protos.google.cloud.networksecurity.v1.IListMirroringDeploymentsRequest|null, + protos.google.cloud.networksecurity.v1.IListMirroringDeploymentsResponse + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize().catch(err => {throw err}); + const wrappedCallback: PaginationCallback< + protos.google.cloud.networksecurity.v1.IListMirroringDeploymentsRequest, + protos.google.cloud.networksecurity.v1.IListMirroringDeploymentsResponse|null|undefined, + protos.google.cloud.networksecurity.v1.IMirroringDeployment>|undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listMirroringDeployments values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listMirroringDeployments request %j', request); + return this.innerApiCalls + .listMirroringDeployments(request, options, wrappedCallback) + ?.then(([response, input, output]: [ + protos.google.cloud.networksecurity.v1.IMirroringDeployment[], + protos.google.cloud.networksecurity.v1.IListMirroringDeploymentsRequest|null, + protos.google.cloud.networksecurity.v1.IListMirroringDeploymentsResponse + ]) => { + this._log.info('listMirroringDeployments values %j', response); + return [response, input, output]; + }); + } + +/** + * Equivalent to `listMirroringDeployments`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent, which owns this collection of deployments. + * Example: `projects/123456789/locations/us-central1-a`. + * See https://google.aip.dev/132 for more details. + * @param {number} [request.pageSize] + * Optional. Requested page size. Server may return fewer items than + * requested. If unspecified, server will pick an appropriate default. See + * https://google.aip.dev/158 for more details. + * @param {string} [request.pageToken] + * Optional. A page token, received from a previous `ListMirroringDeployments` + * call. Provide this to retrieve the subsequent page. When paginating, all + * other parameters provided to `ListMirroringDeployments` must match the call + * that provided the page token. See https://google.aip.dev/158 for more + * details. + * @param {string} [request.filter] + * Optional. Filter expression. + * See https://google.aip.dev/160#filtering for more details. + * @param {string} [request.orderBy] + * Optional. Sort expression. + * See https://google.aip.dev/132#ordering for more details. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing {@link protos.google.cloud.networksecurity.v1.MirroringDeployment|MirroringDeployment} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `listMirroringDeploymentsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listMirroringDeploymentsStream( + request?: protos.google.cloud.networksecurity.v1.IListMirroringDeploymentsRequest, + options?: CallOptions): + Transform{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listMirroringDeployments']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listMirroringDeployments stream %j', request); + return this.descriptors.page.listMirroringDeployments.createStream( + this.innerApiCalls.listMirroringDeployments as GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listMirroringDeployments`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent, which owns this collection of deployments. + * Example: `projects/123456789/locations/us-central1-a`. + * See https://google.aip.dev/132 for more details. + * @param {number} [request.pageSize] + * Optional. Requested page size. Server may return fewer items than + * requested. If unspecified, server will pick an appropriate default. See + * https://google.aip.dev/158 for more details. + * @param {string} [request.pageToken] + * Optional. A page token, received from a previous `ListMirroringDeployments` + * call. Provide this to retrieve the subsequent page. When paginating, all + * other parameters provided to `ListMirroringDeployments` must match the call + * that provided the page token. See https://google.aip.dev/158 for more + * details. + * @param {string} [request.filter] + * Optional. Filter expression. + * See https://google.aip.dev/160#filtering for more details. + * @param {string} [request.orderBy] + * Optional. Sort expression. + * See https://google.aip.dev/132#ordering for more details. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link protos.google.cloud.networksecurity.v1.MirroringDeployment|MirroringDeployment}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example include:samples/generated/v1/mirroring.list_mirroring_deployments.js + * region_tag:networksecurity_v1_generated_Mirroring_ListMirroringDeployments_async + */ + listMirroringDeploymentsAsync( + request?: protos.google.cloud.networksecurity.v1.IListMirroringDeploymentsRequest, + options?: CallOptions): + AsyncIterable{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listMirroringDeployments']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listMirroringDeployments iterate %j', request); + return this.descriptors.page.listMirroringDeployments.asyncIterate( + this.innerApiCalls['listMirroringDeployments'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } +/** + * Gets the access control policy for a resource. Returns an empty policy + * if the resource exists and does not have a policy set. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.resource + * REQUIRED: The resource for which the policy is being requested. + * See the operation documentation for the appropriate value for this field. + * @param {Object} [request.options] + * OPTIONAL: A `GetPolicyOptions` object for specifying options to + * `GetIamPolicy`. This field is only used by Cloud IAM. + * + * This object should have the same structure as {@link google.iam.v1.GetPolicyOptions | GetPolicyOptions}. + * @param {Object} [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.CallOptions} for the details. + * @param {function(?Error, ?Object)} [callback] + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing {@link google.iam.v1.Policy | Policy}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.iam.v1.Policy | Policy}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + getIamPolicy( + request: IamProtos.google.iam.v1.GetIamPolicyRequest, + options?: + | gax.CallOptions + | Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.GetIamPolicyRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.GetIamPolicyRequest | null | undefined, + {} | null | undefined + > + ):Promise<[IamProtos.google.iam.v1.Policy]> { + return this.iamClient.getIamPolicy(request, options, callback); + } + +/** + * Returns permissions that a caller has on the specified resource. If the + * resource does not exist, this will return an empty set of + * permissions, not a NOT_FOUND error. + * + * Note: This operation is designed to be used for building + * permission-aware UIs and command-line tools, not for authorization + * checking. This operation may "fail open" without warning. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.resource + * REQUIRED: The resource for which the policy detail is being requested. + * See the operation documentation for the appropriate value for this field. + * @param {string[]} request.permissions + * The set of permissions to check for the `resource`. Permissions with + * wildcards (such as '*' or 'storage.*') are not allowed. For more + * information see {@link https://cloud.google.com/iam/docs/overview#permissions | IAM Overview }. + * @param {Object} [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.CallOptions} for the details. + * @param {function(?Error, ?Object)} [callback] + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + setIamPolicy( + request: IamProtos.google.iam.v1.SetIamPolicyRequest, + options?: + | gax.CallOptions + | Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.SetIamPolicyRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.SetIamPolicyRequest | null | undefined, + {} | null | undefined + > + ):Promise<[IamProtos.google.iam.v1.Policy]> { + return this.iamClient.setIamPolicy(request, options, callback); + } + +/** + * Returns permissions that a caller has on the specified resource. If the + * resource does not exist, this will return an empty set of + * permissions, not a NOT_FOUND error. + * + * Note: This operation is designed to be used for building + * permission-aware UIs and command-line tools, not for authorization + * checking. This operation may "fail open" without warning. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.resource + * REQUIRED: The resource for which the policy detail is being requested. + * See the operation documentation for the appropriate value for this field. + * @param {string[]} request.permissions + * The set of permissions to check for the `resource`. Permissions with + * wildcards (such as '*' or 'storage.*') are not allowed. For more + * information see {@link https://cloud.google.com/iam/docs/overview#permissions | IAM Overview }. + * @param {Object} [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.CallOptions} for the details. + * @param {function(?Error, ?Object)} [callback] + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. + * The promise has a method named "cancel" which cancels the ongoing API call. + * + */ + testIamPermissions( + request: IamProtos.google.iam.v1.TestIamPermissionsRequest, + options?: + | gax.CallOptions + | Callback< + IamProtos.google.iam.v1.TestIamPermissionsResponse, + IamProtos.google.iam.v1.TestIamPermissionsRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + IamProtos.google.iam.v1.TestIamPermissionsResponse, + IamProtos.google.iam.v1.TestIamPermissionsRequest | null | undefined, + {} | null | undefined + > + ):Promise<[IamProtos.google.iam.v1.TestIamPermissionsResponse]> { + return this.iamClient.testIamPermissions(request, options, callback); + } + +/** + * Gets information about a location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Resource name for the location. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html | CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.cloud.location.Location | Location}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example + * ``` + * const [response] = await client.getLocation(request); + * ``` + */ + getLocation( + request: LocationProtos.google.cloud.location.IGetLocationRequest, + options?: + | gax.CallOptions + | Callback< + LocationProtos.google.cloud.location.ILocation, + | LocationProtos.google.cloud.location.IGetLocationRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + LocationProtos.google.cloud.location.ILocation, + | LocationProtos.google.cloud.location.IGetLocationRequest + | null + | undefined, + {} | null | undefined + > + ): Promise { + return this.locationsClient.getLocation(request, options, callback); + } + +/** + * Lists information about the supported locations for this service. Returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * The resource that owns the locations collection, if applicable. + * @param {string} request.filter + * The standard list filter. + * @param {number} request.pageSize + * The standard list page size. + * @param {string} request.pageToken + * The standard list page token. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link google.cloud.location.Location | Location}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example + * ``` + * const iterable = client.listLocationsAsync(request); + * for await (const response of iterable) { + * // process response + * } + * ``` + */ + listLocationsAsync( + request: LocationProtos.google.cloud.location.IListLocationsRequest, + options?: CallOptions + ): AsyncIterable { + return this.locationsClient.listLocationsAsync(request, options); + } + +/** + * Gets the latest state of a long-running operation. Clients can use this + * method to poll the operation result at intervals as recommended by the API + * service. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation resource. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions} + * for the details. + * @param {function(?Error, ?Object)=} callback + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing + * {@link google.longrunning.Operation | google.longrunning.Operation}. + * @return {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * {@link google.longrunning.Operation | google.longrunning.Operation}. + * The promise has a method named "cancel" which cancels the ongoing API call. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * const name = ''; + * const [response] = await client.getOperation({name}); + * // doThingsWith(response) + * ``` + */ + getOperation( + request: protos.google.longrunning.GetOperationRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protos.google.longrunning.Operation, + protos.google.longrunning.GetOperationRequest, + {} | null | undefined + >, + callback?: Callback< + protos.google.longrunning.Operation, + protos.google.longrunning.GetOperationRequest, + {} | null | undefined + > + ): Promise<[protos.google.longrunning.Operation]> { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + return this.operationsClient.getOperation(request, options, callback); + } + /** + * Lists operations that match the specified filter in the request. If the + * server doesn't support this method, it returns `UNIMPLEMENTED`. Returns an iterable object. + * + * For-await-of syntax is used with the iterable to recursively get response element on-demand. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation collection. + * @param {string} request.filter - The standard list filter. + * @param {number=} request.pageSize - + * The maximum number of resources contained in the underlying API + * response. If page streaming is performed per-resource, this + * parameter does not affect the return value. If page streaming is + * performed per-page, this determines the maximum number of + * resources in a page. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions} for the + * details. + * @returns {Object} + * An iterable Object that conforms to {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | iteration protocols}. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * for await (const response of client.listOperationsAsync(request)); + * // doThingsWith(response) + * ``` + */ + listOperationsAsync( + request: protos.google.longrunning.ListOperationsRequest, + options?: gax.CallOptions + ): AsyncIterable { + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + return this.operationsClient.listOperationsAsync(request, options); + } + /** + * Starts asynchronous cancellation on a long-running operation. The server + * makes a best effort to cancel the operation, but success is not + * guaranteed. If the server doesn't support this method, it returns + * `google.rpc.Code.UNIMPLEMENTED`. Clients can use + * {@link Operations.GetOperation} or + * other methods to check whether the cancellation succeeded or whether the + * operation completed despite cancellation. On successful cancellation, + * the operation is not deleted; instead, it becomes an operation with + * an {@link Operation.error} value with a {@link google.rpc.Status.code} of + * 1, corresponding to `Code.CANCELLED`. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation resource to be cancelled. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions} for the + * details. + * @param {function(?Error)=} callback + * The function which will be called with the result of the API call. + * @return {Promise} - The promise which resolves when API call finishes. + * The promise has a method named "cancel" which cancels the ongoing API + * call. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * await client.cancelOperation({name: ''}); + * ``` + */ + cancelOperation( + request: protos.google.longrunning.CancelOperationRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protos.google.longrunning.CancelOperationRequest, + protos.google.protobuf.Empty, + {} | undefined | null + >, + callback?: Callback< + protos.google.longrunning.CancelOperationRequest, + protos.google.protobuf.Empty, + {} | undefined | null + > + ): Promise { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + return this.operationsClient.cancelOperation(request, options, callback); + } + + /** + * Deletes a long-running operation. This method indicates that the client is + * no longer interested in the operation result. It does not cancel the + * operation. If the server doesn't support this method, it returns + * `google.rpc.Code.UNIMPLEMENTED`. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation resource to be deleted. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions} + * for the details. + * @param {function(?Error)=} callback + * The function which will be called with the result of the API call. + * @return {Promise} - The promise which resolves when API call finishes. + * The promise has a method named "cancel" which cancels the ongoing API + * call. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * await client.deleteOperation({name: ''}); + * ``` + */ + deleteOperation( + request: protos.google.longrunning.DeleteOperationRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protos.google.protobuf.Empty, + protos.google.longrunning.DeleteOperationRequest, + {} | null | undefined + >, + callback?: Callback< + protos.google.protobuf.Empty, + protos.google.longrunning.DeleteOperationRequest, + {} | null | undefined + > + ): Promise { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + return this.operationsClient.deleteOperation(request, options, callback); + } + + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified authorizationPolicy resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} authorization_policy + * @returns {string} Resource name string. + */ + authorizationPolicyPath(project:string,location:string,authorizationPolicy:string) { + return this.pathTemplates.authorizationPolicyPathTemplate.render({ + project: project, + location: location, + authorization_policy: authorizationPolicy, + }); + } + + /** + * Parse the project from AuthorizationPolicy resource. + * + * @param {string} authorizationPolicyName + * A fully-qualified path representing AuthorizationPolicy resource. + * @returns {string} A string representing the project. + */ + matchProjectFromAuthorizationPolicyName(authorizationPolicyName: string) { + return this.pathTemplates.authorizationPolicyPathTemplate.match(authorizationPolicyName).project; + } + + /** + * Parse the location from AuthorizationPolicy resource. + * + * @param {string} authorizationPolicyName + * A fully-qualified path representing AuthorizationPolicy resource. + * @returns {string} A string representing the location. + */ + matchLocationFromAuthorizationPolicyName(authorizationPolicyName: string) { + return this.pathTemplates.authorizationPolicyPathTemplate.match(authorizationPolicyName).location; + } + + /** + * Parse the authorization_policy from AuthorizationPolicy resource. + * + * @param {string} authorizationPolicyName + * A fully-qualified path representing AuthorizationPolicy resource. + * @returns {string} A string representing the authorization_policy. + */ + matchAuthorizationPolicyFromAuthorizationPolicyName(authorizationPolicyName: string) { + return this.pathTemplates.authorizationPolicyPathTemplate.match(authorizationPolicyName).authorization_policy; + } + + /** + * Return a fully-qualified authzPolicy resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} authz_policy + * @returns {string} Resource name string. + */ + authzPolicyPath(project:string,location:string,authzPolicy:string) { + return this.pathTemplates.authzPolicyPathTemplate.render({ + project: project, + location: location, + authz_policy: authzPolicy, + }); + } + + /** + * Parse the project from AuthzPolicy resource. + * + * @param {string} authzPolicyName + * A fully-qualified path representing AuthzPolicy resource. + * @returns {string} A string representing the project. + */ + matchProjectFromAuthzPolicyName(authzPolicyName: string) { + return this.pathTemplates.authzPolicyPathTemplate.match(authzPolicyName).project; + } + + /** + * Parse the location from AuthzPolicy resource. + * + * @param {string} authzPolicyName + * A fully-qualified path representing AuthzPolicy resource. + * @returns {string} A string representing the location. + */ + matchLocationFromAuthzPolicyName(authzPolicyName: string) { + return this.pathTemplates.authzPolicyPathTemplate.match(authzPolicyName).location; + } + + /** + * Parse the authz_policy from AuthzPolicy resource. + * + * @param {string} authzPolicyName + * A fully-qualified path representing AuthzPolicy resource. + * @returns {string} A string representing the authz_policy. + */ + matchAuthzPolicyFromAuthzPolicyName(authzPolicyName: string) { + return this.pathTemplates.authzPolicyPathTemplate.match(authzPolicyName).authz_policy; + } + + /** + * Return a fully-qualified backendAuthenticationConfig resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} backend_authentication_config + * @returns {string} Resource name string. + */ + backendAuthenticationConfigPath(project:string,location:string,backendAuthenticationConfig:string) { + return this.pathTemplates.backendAuthenticationConfigPathTemplate.render({ + project: project, + location: location, + backend_authentication_config: backendAuthenticationConfig, + }); + } + + /** + * Parse the project from BackendAuthenticationConfig resource. + * + * @param {string} backendAuthenticationConfigName + * A fully-qualified path representing BackendAuthenticationConfig resource. + * @returns {string} A string representing the project. + */ + matchProjectFromBackendAuthenticationConfigName(backendAuthenticationConfigName: string) { + return this.pathTemplates.backendAuthenticationConfigPathTemplate.match(backendAuthenticationConfigName).project; + } + + /** + * Parse the location from BackendAuthenticationConfig resource. + * + * @param {string} backendAuthenticationConfigName + * A fully-qualified path representing BackendAuthenticationConfig resource. + * @returns {string} A string representing the location. + */ + matchLocationFromBackendAuthenticationConfigName(backendAuthenticationConfigName: string) { + return this.pathTemplates.backendAuthenticationConfigPathTemplate.match(backendAuthenticationConfigName).location; + } + + /** + * Parse the backend_authentication_config from BackendAuthenticationConfig resource. + * + * @param {string} backendAuthenticationConfigName + * A fully-qualified path representing BackendAuthenticationConfig resource. + * @returns {string} A string representing the backend_authentication_config. + */ + matchBackendAuthenticationConfigFromBackendAuthenticationConfigName(backendAuthenticationConfigName: string) { + return this.pathTemplates.backendAuthenticationConfigPathTemplate.match(backendAuthenticationConfigName).backend_authentication_config; + } + + /** + * Return a fully-qualified clientTlsPolicy resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} client_tls_policy + * @returns {string} Resource name string. + */ + clientTlsPolicyPath(project:string,location:string,clientTlsPolicy:string) { + return this.pathTemplates.clientTlsPolicyPathTemplate.render({ + project: project, + location: location, + client_tls_policy: clientTlsPolicy, + }); + } + + /** + * Parse the project from ClientTlsPolicy resource. + * + * @param {string} clientTlsPolicyName + * A fully-qualified path representing ClientTlsPolicy resource. + * @returns {string} A string representing the project. + */ + matchProjectFromClientTlsPolicyName(clientTlsPolicyName: string) { + return this.pathTemplates.clientTlsPolicyPathTemplate.match(clientTlsPolicyName).project; + } + + /** + * Parse the location from ClientTlsPolicy resource. + * + * @param {string} clientTlsPolicyName + * A fully-qualified path representing ClientTlsPolicy resource. + * @returns {string} A string representing the location. + */ + matchLocationFromClientTlsPolicyName(clientTlsPolicyName: string) { + return this.pathTemplates.clientTlsPolicyPathTemplate.match(clientTlsPolicyName).location; + } + + /** + * Parse the client_tls_policy from ClientTlsPolicy resource. + * + * @param {string} clientTlsPolicyName + * A fully-qualified path representing ClientTlsPolicy resource. + * @returns {string} A string representing the client_tls_policy. + */ + matchClientTlsPolicyFromClientTlsPolicyName(clientTlsPolicyName: string) { + return this.pathTemplates.clientTlsPolicyPathTemplate.match(clientTlsPolicyName).client_tls_policy; + } + + /** + * Return a fully-qualified dnsThreatDetector resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} dns_threat_detector + * @returns {string} Resource name string. + */ + dnsThreatDetectorPath(project:string,location:string,dnsThreatDetector:string) { + return this.pathTemplates.dnsThreatDetectorPathTemplate.render({ + project: project, + location: location, + dns_threat_detector: dnsThreatDetector, + }); + } + + /** + * Parse the project from DnsThreatDetector resource. + * + * @param {string} dnsThreatDetectorName + * A fully-qualified path representing DnsThreatDetector resource. + * @returns {string} A string representing the project. + */ + matchProjectFromDnsThreatDetectorName(dnsThreatDetectorName: string) { + return this.pathTemplates.dnsThreatDetectorPathTemplate.match(dnsThreatDetectorName).project; + } + + /** + * Parse the location from DnsThreatDetector resource. + * + * @param {string} dnsThreatDetectorName + * A fully-qualified path representing DnsThreatDetector resource. + * @returns {string} A string representing the location. + */ + matchLocationFromDnsThreatDetectorName(dnsThreatDetectorName: string) { + return this.pathTemplates.dnsThreatDetectorPathTemplate.match(dnsThreatDetectorName).location; + } + + /** + * Parse the dns_threat_detector from DnsThreatDetector resource. + * + * @param {string} dnsThreatDetectorName + * A fully-qualified path representing DnsThreatDetector resource. + * @returns {string} A string representing the dns_threat_detector. + */ + matchDnsThreatDetectorFromDnsThreatDetectorName(dnsThreatDetectorName: string) { + return this.pathTemplates.dnsThreatDetectorPathTemplate.match(dnsThreatDetectorName).dns_threat_detector; + } + + /** + * Return a fully-qualified firewallEndpointAssociation resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} firewall_endpoint_association + * @returns {string} Resource name string. + */ + firewallEndpointAssociationPath(project:string,location:string,firewallEndpointAssociation:string) { + return this.pathTemplates.firewallEndpointAssociationPathTemplate.render({ + project: project, + location: location, + firewall_endpoint_association: firewallEndpointAssociation, + }); + } + + /** + * Parse the project from FirewallEndpointAssociation resource. + * + * @param {string} firewallEndpointAssociationName + * A fully-qualified path representing FirewallEndpointAssociation resource. + * @returns {string} A string representing the project. + */ + matchProjectFromFirewallEndpointAssociationName(firewallEndpointAssociationName: string) { + return this.pathTemplates.firewallEndpointAssociationPathTemplate.match(firewallEndpointAssociationName).project; + } + + /** + * Parse the location from FirewallEndpointAssociation resource. + * + * @param {string} firewallEndpointAssociationName + * A fully-qualified path representing FirewallEndpointAssociation resource. + * @returns {string} A string representing the location. + */ + matchLocationFromFirewallEndpointAssociationName(firewallEndpointAssociationName: string) { + return this.pathTemplates.firewallEndpointAssociationPathTemplate.match(firewallEndpointAssociationName).location; + } + + /** + * Parse the firewall_endpoint_association from FirewallEndpointAssociation resource. + * + * @param {string} firewallEndpointAssociationName + * A fully-qualified path representing FirewallEndpointAssociation resource. + * @returns {string} A string representing the firewall_endpoint_association. + */ + matchFirewallEndpointAssociationFromFirewallEndpointAssociationName(firewallEndpointAssociationName: string) { + return this.pathTemplates.firewallEndpointAssociationPathTemplate.match(firewallEndpointAssociationName).firewall_endpoint_association; + } + + /** + * Return a fully-qualified forwardingRule resource name string. + * + * @param {string} project + * @param {string} forwarding_rule + * @returns {string} Resource name string. + */ + forwardingRulePath(project:string,forwardingRule:string) { + return this.pathTemplates.forwardingRulePathTemplate.render({ + project: project, + forwarding_rule: forwardingRule, + }); + } + + /** + * Parse the project from ForwardingRule resource. + * + * @param {string} forwardingRuleName + * A fully-qualified path representing ForwardingRule resource. + * @returns {string} A string representing the project. + */ + matchProjectFromForwardingRuleName(forwardingRuleName: string) { + return this.pathTemplates.forwardingRulePathTemplate.match(forwardingRuleName).project; + } + + /** + * Parse the forwarding_rule from ForwardingRule resource. + * + * @param {string} forwardingRuleName + * A fully-qualified path representing ForwardingRule resource. + * @returns {string} A string representing the forwarding_rule. + */ + matchForwardingRuleFromForwardingRuleName(forwardingRuleName: string) { + return this.pathTemplates.forwardingRulePathTemplate.match(forwardingRuleName).forwarding_rule; + } + + /** + * Return a fully-qualified gatewaySecurityPolicy resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} gateway_security_policy + * @returns {string} Resource name string. + */ + gatewaySecurityPolicyPath(project:string,location:string,gatewaySecurityPolicy:string) { + return this.pathTemplates.gatewaySecurityPolicyPathTemplate.render({ + project: project, + location: location, + gateway_security_policy: gatewaySecurityPolicy, + }); + } + + /** + * Parse the project from GatewaySecurityPolicy resource. + * + * @param {string} gatewaySecurityPolicyName + * A fully-qualified path representing GatewaySecurityPolicy resource. + * @returns {string} A string representing the project. + */ + matchProjectFromGatewaySecurityPolicyName(gatewaySecurityPolicyName: string) { + return this.pathTemplates.gatewaySecurityPolicyPathTemplate.match(gatewaySecurityPolicyName).project; + } + + /** + * Parse the location from GatewaySecurityPolicy resource. + * + * @param {string} gatewaySecurityPolicyName + * A fully-qualified path representing GatewaySecurityPolicy resource. + * @returns {string} A string representing the location. + */ + matchLocationFromGatewaySecurityPolicyName(gatewaySecurityPolicyName: string) { + return this.pathTemplates.gatewaySecurityPolicyPathTemplate.match(gatewaySecurityPolicyName).location; + } + + /** + * Parse the gateway_security_policy from GatewaySecurityPolicy resource. + * + * @param {string} gatewaySecurityPolicyName + * A fully-qualified path representing GatewaySecurityPolicy resource. + * @returns {string} A string representing the gateway_security_policy. + */ + matchGatewaySecurityPolicyFromGatewaySecurityPolicyName(gatewaySecurityPolicyName: string) { + return this.pathTemplates.gatewaySecurityPolicyPathTemplate.match(gatewaySecurityPolicyName).gateway_security_policy; + } + + /** + * Return a fully-qualified gatewaySecurityPolicyRule resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} gateway_security_policy + * @param {string} rule + * @returns {string} Resource name string. + */ + gatewaySecurityPolicyRulePath(project:string,location:string,gatewaySecurityPolicy:string,rule:string) { + return this.pathTemplates.gatewaySecurityPolicyRulePathTemplate.render({ + project: project, + location: location, + gateway_security_policy: gatewaySecurityPolicy, + rule: rule, + }); + } + + /** + * Parse the project from GatewaySecurityPolicyRule resource. + * + * @param {string} gatewaySecurityPolicyRuleName + * A fully-qualified path representing GatewaySecurityPolicyRule resource. + * @returns {string} A string representing the project. + */ + matchProjectFromGatewaySecurityPolicyRuleName(gatewaySecurityPolicyRuleName: string) { + return this.pathTemplates.gatewaySecurityPolicyRulePathTemplate.match(gatewaySecurityPolicyRuleName).project; + } + + /** + * Parse the location from GatewaySecurityPolicyRule resource. + * + * @param {string} gatewaySecurityPolicyRuleName + * A fully-qualified path representing GatewaySecurityPolicyRule resource. + * @returns {string} A string representing the location. + */ + matchLocationFromGatewaySecurityPolicyRuleName(gatewaySecurityPolicyRuleName: string) { + return this.pathTemplates.gatewaySecurityPolicyRulePathTemplate.match(gatewaySecurityPolicyRuleName).location; + } + + /** + * Parse the gateway_security_policy from GatewaySecurityPolicyRule resource. + * + * @param {string} gatewaySecurityPolicyRuleName + * A fully-qualified path representing GatewaySecurityPolicyRule resource. + * @returns {string} A string representing the gateway_security_policy. + */ + matchGatewaySecurityPolicyFromGatewaySecurityPolicyRuleName(gatewaySecurityPolicyRuleName: string) { + return this.pathTemplates.gatewaySecurityPolicyRulePathTemplate.match(gatewaySecurityPolicyRuleName).gateway_security_policy; + } + + /** + * Parse the rule from GatewaySecurityPolicyRule resource. + * + * @param {string} gatewaySecurityPolicyRuleName + * A fully-qualified path representing GatewaySecurityPolicyRule resource. + * @returns {string} A string representing the rule. + */ + matchRuleFromGatewaySecurityPolicyRuleName(gatewaySecurityPolicyRuleName: string) { + return this.pathTemplates.gatewaySecurityPolicyRulePathTemplate.match(gatewaySecurityPolicyRuleName).rule; + } + + /** + * Return a fully-qualified interceptDeployment resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} intercept_deployment + * @returns {string} Resource name string. + */ + interceptDeploymentPath(project:string,location:string,interceptDeployment:string) { + return this.pathTemplates.interceptDeploymentPathTemplate.render({ + project: project, + location: location, + intercept_deployment: interceptDeployment, + }); + } + + /** + * Parse the project from InterceptDeployment resource. + * + * @param {string} interceptDeploymentName + * A fully-qualified path representing InterceptDeployment resource. + * @returns {string} A string representing the project. + */ + matchProjectFromInterceptDeploymentName(interceptDeploymentName: string) { + return this.pathTemplates.interceptDeploymentPathTemplate.match(interceptDeploymentName).project; + } + + /** + * Parse the location from InterceptDeployment resource. + * + * @param {string} interceptDeploymentName + * A fully-qualified path representing InterceptDeployment resource. + * @returns {string} A string representing the location. + */ + matchLocationFromInterceptDeploymentName(interceptDeploymentName: string) { + return this.pathTemplates.interceptDeploymentPathTemplate.match(interceptDeploymentName).location; + } + + /** + * Parse the intercept_deployment from InterceptDeployment resource. + * + * @param {string} interceptDeploymentName + * A fully-qualified path representing InterceptDeployment resource. + * @returns {string} A string representing the intercept_deployment. + */ + matchInterceptDeploymentFromInterceptDeploymentName(interceptDeploymentName: string) { + return this.pathTemplates.interceptDeploymentPathTemplate.match(interceptDeploymentName).intercept_deployment; + } + + /** + * Return a fully-qualified interceptDeploymentGroup resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} intercept_deployment_group + * @returns {string} Resource name string. + */ + interceptDeploymentGroupPath(project:string,location:string,interceptDeploymentGroup:string) { + return this.pathTemplates.interceptDeploymentGroupPathTemplate.render({ + project: project, + location: location, + intercept_deployment_group: interceptDeploymentGroup, + }); + } + + /** + * Parse the project from InterceptDeploymentGroup resource. + * + * @param {string} interceptDeploymentGroupName + * A fully-qualified path representing InterceptDeploymentGroup resource. + * @returns {string} A string representing the project. + */ + matchProjectFromInterceptDeploymentGroupName(interceptDeploymentGroupName: string) { + return this.pathTemplates.interceptDeploymentGroupPathTemplate.match(interceptDeploymentGroupName).project; + } + + /** + * Parse the location from InterceptDeploymentGroup resource. + * + * @param {string} interceptDeploymentGroupName + * A fully-qualified path representing InterceptDeploymentGroup resource. + * @returns {string} A string representing the location. + */ + matchLocationFromInterceptDeploymentGroupName(interceptDeploymentGroupName: string) { + return this.pathTemplates.interceptDeploymentGroupPathTemplate.match(interceptDeploymentGroupName).location; + } + + /** + * Parse the intercept_deployment_group from InterceptDeploymentGroup resource. + * + * @param {string} interceptDeploymentGroupName + * A fully-qualified path representing InterceptDeploymentGroup resource. + * @returns {string} A string representing the intercept_deployment_group. + */ + matchInterceptDeploymentGroupFromInterceptDeploymentGroupName(interceptDeploymentGroupName: string) { + return this.pathTemplates.interceptDeploymentGroupPathTemplate.match(interceptDeploymentGroupName).intercept_deployment_group; + } + + /** + * Return a fully-qualified interceptEndpointGroup resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} intercept_endpoint_group + * @returns {string} Resource name string. + */ + interceptEndpointGroupPath(project:string,location:string,interceptEndpointGroup:string) { + return this.pathTemplates.interceptEndpointGroupPathTemplate.render({ + project: project, + location: location, + intercept_endpoint_group: interceptEndpointGroup, + }); + } + + /** + * Parse the project from InterceptEndpointGroup resource. + * + * @param {string} interceptEndpointGroupName + * A fully-qualified path representing InterceptEndpointGroup resource. + * @returns {string} A string representing the project. + */ + matchProjectFromInterceptEndpointGroupName(interceptEndpointGroupName: string) { + return this.pathTemplates.interceptEndpointGroupPathTemplate.match(interceptEndpointGroupName).project; + } + + /** + * Parse the location from InterceptEndpointGroup resource. + * + * @param {string} interceptEndpointGroupName + * A fully-qualified path representing InterceptEndpointGroup resource. + * @returns {string} A string representing the location. + */ + matchLocationFromInterceptEndpointGroupName(interceptEndpointGroupName: string) { + return this.pathTemplates.interceptEndpointGroupPathTemplate.match(interceptEndpointGroupName).location; + } + + /** + * Parse the intercept_endpoint_group from InterceptEndpointGroup resource. + * + * @param {string} interceptEndpointGroupName + * A fully-qualified path representing InterceptEndpointGroup resource. + * @returns {string} A string representing the intercept_endpoint_group. + */ + matchInterceptEndpointGroupFromInterceptEndpointGroupName(interceptEndpointGroupName: string) { + return this.pathTemplates.interceptEndpointGroupPathTemplate.match(interceptEndpointGroupName).intercept_endpoint_group; + } + + /** + * Return a fully-qualified interceptEndpointGroupAssociation resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} intercept_endpoint_group_association + * @returns {string} Resource name string. + */ + interceptEndpointGroupAssociationPath(project:string,location:string,interceptEndpointGroupAssociation:string) { + return this.pathTemplates.interceptEndpointGroupAssociationPathTemplate.render({ + project: project, + location: location, + intercept_endpoint_group_association: interceptEndpointGroupAssociation, + }); + } + + /** + * Parse the project from InterceptEndpointGroupAssociation resource. + * + * @param {string} interceptEndpointGroupAssociationName + * A fully-qualified path representing InterceptEndpointGroupAssociation resource. + * @returns {string} A string representing the project. + */ + matchProjectFromInterceptEndpointGroupAssociationName(interceptEndpointGroupAssociationName: string) { + return this.pathTemplates.interceptEndpointGroupAssociationPathTemplate.match(interceptEndpointGroupAssociationName).project; + } + + /** + * Parse the location from InterceptEndpointGroupAssociation resource. + * + * @param {string} interceptEndpointGroupAssociationName + * A fully-qualified path representing InterceptEndpointGroupAssociation resource. + * @returns {string} A string representing the location. + */ + matchLocationFromInterceptEndpointGroupAssociationName(interceptEndpointGroupAssociationName: string) { + return this.pathTemplates.interceptEndpointGroupAssociationPathTemplate.match(interceptEndpointGroupAssociationName).location; + } + + /** + * Parse the intercept_endpoint_group_association from InterceptEndpointGroupAssociation resource. + * + * @param {string} interceptEndpointGroupAssociationName + * A fully-qualified path representing InterceptEndpointGroupAssociation resource. + * @returns {string} A string representing the intercept_endpoint_group_association. + */ + matchInterceptEndpointGroupAssociationFromInterceptEndpointGroupAssociationName(interceptEndpointGroupAssociationName: string) { + return this.pathTemplates.interceptEndpointGroupAssociationPathTemplate.match(interceptEndpointGroupAssociationName).intercept_endpoint_group_association; + } + + /** + * Return a fully-qualified location resource name string. + * + * @param {string} project + * @param {string} location + * @returns {string} Resource name string. + */ + locationPath(project:string,location:string) { + return this.pathTemplates.locationPathTemplate.render({ + project: project, + location: location, + }); + } + + /** + * Parse the project from Location resource. + * + * @param {string} locationName + * A fully-qualified path representing Location resource. + * @returns {string} A string representing the project. + */ + matchProjectFromLocationName(locationName: string) { + return this.pathTemplates.locationPathTemplate.match(locationName).project; + } + + /** + * Parse the location from Location resource. + * + * @param {string} locationName + * A fully-qualified path representing Location resource. + * @returns {string} A string representing the location. + */ + matchLocationFromLocationName(locationName: string) { + return this.pathTemplates.locationPathTemplate.match(locationName).location; + } + + /** + * Return a fully-qualified mirroringDeployment resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} mirroring_deployment + * @returns {string} Resource name string. + */ + mirroringDeploymentPath(project:string,location:string,mirroringDeployment:string) { + return this.pathTemplates.mirroringDeploymentPathTemplate.render({ + project: project, + location: location, + mirroring_deployment: mirroringDeployment, + }); + } + + /** + * Parse the project from MirroringDeployment resource. + * + * @param {string} mirroringDeploymentName + * A fully-qualified path representing MirroringDeployment resource. + * @returns {string} A string representing the project. + */ + matchProjectFromMirroringDeploymentName(mirroringDeploymentName: string) { + return this.pathTemplates.mirroringDeploymentPathTemplate.match(mirroringDeploymentName).project; + } + + /** + * Parse the location from MirroringDeployment resource. + * + * @param {string} mirroringDeploymentName + * A fully-qualified path representing MirroringDeployment resource. + * @returns {string} A string representing the location. + */ + matchLocationFromMirroringDeploymentName(mirroringDeploymentName: string) { + return this.pathTemplates.mirroringDeploymentPathTemplate.match(mirroringDeploymentName).location; + } + + /** + * Parse the mirroring_deployment from MirroringDeployment resource. + * + * @param {string} mirroringDeploymentName + * A fully-qualified path representing MirroringDeployment resource. + * @returns {string} A string representing the mirroring_deployment. + */ + matchMirroringDeploymentFromMirroringDeploymentName(mirroringDeploymentName: string) { + return this.pathTemplates.mirroringDeploymentPathTemplate.match(mirroringDeploymentName).mirroring_deployment; + } + + /** + * Return a fully-qualified mirroringDeploymentGroup resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} mirroring_deployment_group + * @returns {string} Resource name string. + */ + mirroringDeploymentGroupPath(project:string,location:string,mirroringDeploymentGroup:string) { + return this.pathTemplates.mirroringDeploymentGroupPathTemplate.render({ + project: project, + location: location, + mirroring_deployment_group: mirroringDeploymentGroup, + }); + } + + /** + * Parse the project from MirroringDeploymentGroup resource. + * + * @param {string} mirroringDeploymentGroupName + * A fully-qualified path representing MirroringDeploymentGroup resource. + * @returns {string} A string representing the project. + */ + matchProjectFromMirroringDeploymentGroupName(mirroringDeploymentGroupName: string) { + return this.pathTemplates.mirroringDeploymentGroupPathTemplate.match(mirroringDeploymentGroupName).project; + } + + /** + * Parse the location from MirroringDeploymentGroup resource. + * + * @param {string} mirroringDeploymentGroupName + * A fully-qualified path representing MirroringDeploymentGroup resource. + * @returns {string} A string representing the location. + */ + matchLocationFromMirroringDeploymentGroupName(mirroringDeploymentGroupName: string) { + return this.pathTemplates.mirroringDeploymentGroupPathTemplate.match(mirroringDeploymentGroupName).location; + } + + /** + * Parse the mirroring_deployment_group from MirroringDeploymentGroup resource. + * + * @param {string} mirroringDeploymentGroupName + * A fully-qualified path representing MirroringDeploymentGroup resource. + * @returns {string} A string representing the mirroring_deployment_group. + */ + matchMirroringDeploymentGroupFromMirroringDeploymentGroupName(mirroringDeploymentGroupName: string) { + return this.pathTemplates.mirroringDeploymentGroupPathTemplate.match(mirroringDeploymentGroupName).mirroring_deployment_group; + } + + /** + * Return a fully-qualified mirroringEndpointGroup resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} mirroring_endpoint_group + * @returns {string} Resource name string. + */ + mirroringEndpointGroupPath(project:string,location:string,mirroringEndpointGroup:string) { + return this.pathTemplates.mirroringEndpointGroupPathTemplate.render({ + project: project, + location: location, + mirroring_endpoint_group: mirroringEndpointGroup, + }); + } + + /** + * Parse the project from MirroringEndpointGroup resource. + * + * @param {string} mirroringEndpointGroupName + * A fully-qualified path representing MirroringEndpointGroup resource. + * @returns {string} A string representing the project. + */ + matchProjectFromMirroringEndpointGroupName(mirroringEndpointGroupName: string) { + return this.pathTemplates.mirroringEndpointGroupPathTemplate.match(mirroringEndpointGroupName).project; + } + + /** + * Parse the location from MirroringEndpointGroup resource. + * + * @param {string} mirroringEndpointGroupName + * A fully-qualified path representing MirroringEndpointGroup resource. + * @returns {string} A string representing the location. + */ + matchLocationFromMirroringEndpointGroupName(mirroringEndpointGroupName: string) { + return this.pathTemplates.mirroringEndpointGroupPathTemplate.match(mirroringEndpointGroupName).location; + } + + /** + * Parse the mirroring_endpoint_group from MirroringEndpointGroup resource. + * + * @param {string} mirroringEndpointGroupName + * A fully-qualified path representing MirroringEndpointGroup resource. + * @returns {string} A string representing the mirroring_endpoint_group. + */ + matchMirroringEndpointGroupFromMirroringEndpointGroupName(mirroringEndpointGroupName: string) { + return this.pathTemplates.mirroringEndpointGroupPathTemplate.match(mirroringEndpointGroupName).mirroring_endpoint_group; + } + + /** + * Return a fully-qualified mirroringEndpointGroupAssociation resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} mirroring_endpoint_group_association + * @returns {string} Resource name string. + */ + mirroringEndpointGroupAssociationPath(project:string,location:string,mirroringEndpointGroupAssociation:string) { + return this.pathTemplates.mirroringEndpointGroupAssociationPathTemplate.render({ + project: project, + location: location, + mirroring_endpoint_group_association: mirroringEndpointGroupAssociation, + }); + } + + /** + * Parse the project from MirroringEndpointGroupAssociation resource. + * + * @param {string} mirroringEndpointGroupAssociationName + * A fully-qualified path representing MirroringEndpointGroupAssociation resource. + * @returns {string} A string representing the project. + */ + matchProjectFromMirroringEndpointGroupAssociationName(mirroringEndpointGroupAssociationName: string) { + return this.pathTemplates.mirroringEndpointGroupAssociationPathTemplate.match(mirroringEndpointGroupAssociationName).project; + } + + /** + * Parse the location from MirroringEndpointGroupAssociation resource. + * + * @param {string} mirroringEndpointGroupAssociationName + * A fully-qualified path representing MirroringEndpointGroupAssociation resource. + * @returns {string} A string representing the location. + */ + matchLocationFromMirroringEndpointGroupAssociationName(mirroringEndpointGroupAssociationName: string) { + return this.pathTemplates.mirroringEndpointGroupAssociationPathTemplate.match(mirroringEndpointGroupAssociationName).location; + } + + /** + * Parse the mirroring_endpoint_group_association from MirroringEndpointGroupAssociation resource. + * + * @param {string} mirroringEndpointGroupAssociationName + * A fully-qualified path representing MirroringEndpointGroupAssociation resource. + * @returns {string} A string representing the mirroring_endpoint_group_association. + */ + matchMirroringEndpointGroupAssociationFromMirroringEndpointGroupAssociationName(mirroringEndpointGroupAssociationName: string) { + return this.pathTemplates.mirroringEndpointGroupAssociationPathTemplate.match(mirroringEndpointGroupAssociationName).mirroring_endpoint_group_association; + } + + /** + * Return a fully-qualified network resource name string. + * + * @param {string} project + * @param {string} network + * @returns {string} Resource name string. + */ + networkPath(project:string,network:string) { + return this.pathTemplates.networkPathTemplate.render({ + project: project, + network: network, + }); + } + + /** + * Parse the project from Network resource. + * + * @param {string} networkName + * A fully-qualified path representing Network resource. + * @returns {string} A string representing the project. + */ + matchProjectFromNetworkName(networkName: string) { + return this.pathTemplates.networkPathTemplate.match(networkName).project; + } + + /** + * Parse the network from Network resource. + * + * @param {string} networkName + * A fully-qualified path representing Network resource. + * @returns {string} A string representing the network. + */ + matchNetworkFromNetworkName(networkName: string) { + return this.pathTemplates.networkPathTemplate.match(networkName).network; + } + + /** + * Return a fully-qualified organizationLocationAddressGroup resource name string. + * + * @param {string} organization + * @param {string} location + * @param {string} address_group + * @returns {string} Resource name string. + */ + organizationLocationAddressGroupPath(organization:string,location:string,addressGroup:string) { + return this.pathTemplates.organizationLocationAddressGroupPathTemplate.render({ + organization: organization, + location: location, + address_group: addressGroup, + }); + } + + /** + * Parse the organization from OrganizationLocationAddressGroup resource. + * + * @param {string} organizationLocationAddressGroupName + * A fully-qualified path representing organization_location_address_group resource. + * @returns {string} A string representing the organization. + */ + matchOrganizationFromOrganizationLocationAddressGroupName(organizationLocationAddressGroupName: string) { + return this.pathTemplates.organizationLocationAddressGroupPathTemplate.match(organizationLocationAddressGroupName).organization; + } + + /** + * Parse the location from OrganizationLocationAddressGroup resource. + * + * @param {string} organizationLocationAddressGroupName + * A fully-qualified path representing organization_location_address_group resource. + * @returns {string} A string representing the location. + */ + matchLocationFromOrganizationLocationAddressGroupName(organizationLocationAddressGroupName: string) { + return this.pathTemplates.organizationLocationAddressGroupPathTemplate.match(organizationLocationAddressGroupName).location; + } + + /** + * Parse the address_group from OrganizationLocationAddressGroup resource. + * + * @param {string} organizationLocationAddressGroupName + * A fully-qualified path representing organization_location_address_group resource. + * @returns {string} A string representing the address_group. + */ + matchAddressGroupFromOrganizationLocationAddressGroupName(organizationLocationAddressGroupName: string) { + return this.pathTemplates.organizationLocationAddressGroupPathTemplate.match(organizationLocationAddressGroupName).address_group; + } + + /** + * Return a fully-qualified organizationLocationFirewallEndpoints resource name string. + * + * @param {string} organization + * @param {string} location + * @param {string} firewall_endpoint + * @returns {string} Resource name string. + */ + organizationLocationFirewallEndpointsPath(organization:string,location:string,firewallEndpoint:string) { + return this.pathTemplates.organizationLocationFirewallEndpointsPathTemplate.render({ + organization: organization, + location: location, + firewall_endpoint: firewallEndpoint, + }); + } + + /** + * Parse the organization from OrganizationLocationFirewallEndpoints resource. + * + * @param {string} organizationLocationFirewallEndpointsName + * A fully-qualified path representing organization_location_firewallEndpoints resource. + * @returns {string} A string representing the organization. + */ + matchOrganizationFromOrganizationLocationFirewallEndpointsName(organizationLocationFirewallEndpointsName: string) { + return this.pathTemplates.organizationLocationFirewallEndpointsPathTemplate.match(organizationLocationFirewallEndpointsName).organization; + } + + /** + * Parse the location from OrganizationLocationFirewallEndpoints resource. + * + * @param {string} organizationLocationFirewallEndpointsName + * A fully-qualified path representing organization_location_firewallEndpoints resource. + * @returns {string} A string representing the location. + */ + matchLocationFromOrganizationLocationFirewallEndpointsName(organizationLocationFirewallEndpointsName: string) { + return this.pathTemplates.organizationLocationFirewallEndpointsPathTemplate.match(organizationLocationFirewallEndpointsName).location; + } + + /** + * Parse the firewall_endpoint from OrganizationLocationFirewallEndpoints resource. + * + * @param {string} organizationLocationFirewallEndpointsName + * A fully-qualified path representing organization_location_firewallEndpoints resource. + * @returns {string} A string representing the firewall_endpoint. + */ + matchFirewallEndpointFromOrganizationLocationFirewallEndpointsName(organizationLocationFirewallEndpointsName: string) { + return this.pathTemplates.organizationLocationFirewallEndpointsPathTemplate.match(organizationLocationFirewallEndpointsName).firewall_endpoint; + } + + /** + * Return a fully-qualified organizationLocationSecurityProfile resource name string. + * + * @param {string} organization + * @param {string} location + * @param {string} security_profile + * @returns {string} Resource name string. + */ + organizationLocationSecurityProfilePath(organization:string,location:string,securityProfile:string) { + return this.pathTemplates.organizationLocationSecurityProfilePathTemplate.render({ + organization: organization, + location: location, + security_profile: securityProfile, + }); + } + + /** + * Parse the organization from OrganizationLocationSecurityProfile resource. + * + * @param {string} organizationLocationSecurityProfileName + * A fully-qualified path representing organization_location_security_profile resource. + * @returns {string} A string representing the organization. + */ + matchOrganizationFromOrganizationLocationSecurityProfileName(organizationLocationSecurityProfileName: string) { + return this.pathTemplates.organizationLocationSecurityProfilePathTemplate.match(organizationLocationSecurityProfileName).organization; + } + + /** + * Parse the location from OrganizationLocationSecurityProfile resource. + * + * @param {string} organizationLocationSecurityProfileName + * A fully-qualified path representing organization_location_security_profile resource. + * @returns {string} A string representing the location. + */ + matchLocationFromOrganizationLocationSecurityProfileName(organizationLocationSecurityProfileName: string) { + return this.pathTemplates.organizationLocationSecurityProfilePathTemplate.match(organizationLocationSecurityProfileName).location; + } + + /** + * Parse the security_profile from OrganizationLocationSecurityProfile resource. + * + * @param {string} organizationLocationSecurityProfileName + * A fully-qualified path representing organization_location_security_profile resource. + * @returns {string} A string representing the security_profile. + */ + matchSecurityProfileFromOrganizationLocationSecurityProfileName(organizationLocationSecurityProfileName: string) { + return this.pathTemplates.organizationLocationSecurityProfilePathTemplate.match(organizationLocationSecurityProfileName).security_profile; + } + + /** + * Return a fully-qualified organizationLocationSecurityProfileGroup resource name string. + * + * @param {string} organization + * @param {string} location + * @param {string} security_profile_group + * @returns {string} Resource name string. + */ + organizationLocationSecurityProfileGroupPath(organization:string,location:string,securityProfileGroup:string) { + return this.pathTemplates.organizationLocationSecurityProfileGroupPathTemplate.render({ + organization: organization, + location: location, + security_profile_group: securityProfileGroup, + }); + } + + /** + * Parse the organization from OrganizationLocationSecurityProfileGroup resource. + * + * @param {string} organizationLocationSecurityProfileGroupName + * A fully-qualified path representing organization_location_security_profile_group resource. + * @returns {string} A string representing the organization. + */ + matchOrganizationFromOrganizationLocationSecurityProfileGroupName(organizationLocationSecurityProfileGroupName: string) { + return this.pathTemplates.organizationLocationSecurityProfileGroupPathTemplate.match(organizationLocationSecurityProfileGroupName).organization; + } + + /** + * Parse the location from OrganizationLocationSecurityProfileGroup resource. + * + * @param {string} organizationLocationSecurityProfileGroupName + * A fully-qualified path representing organization_location_security_profile_group resource. + * @returns {string} A string representing the location. + */ + matchLocationFromOrganizationLocationSecurityProfileGroupName(organizationLocationSecurityProfileGroupName: string) { + return this.pathTemplates.organizationLocationSecurityProfileGroupPathTemplate.match(organizationLocationSecurityProfileGroupName).location; + } + + /** + * Parse the security_profile_group from OrganizationLocationSecurityProfileGroup resource. + * + * @param {string} organizationLocationSecurityProfileGroupName + * A fully-qualified path representing organization_location_security_profile_group resource. + * @returns {string} A string representing the security_profile_group. + */ + matchSecurityProfileGroupFromOrganizationLocationSecurityProfileGroupName(organizationLocationSecurityProfileGroupName: string) { + return this.pathTemplates.organizationLocationSecurityProfileGroupPathTemplate.match(organizationLocationSecurityProfileGroupName).security_profile_group; + } + + /** + * Return a fully-qualified project resource name string. + * + * @param {string} project + * @returns {string} Resource name string. + */ + projectPath(project:string) { + return this.pathTemplates.projectPathTemplate.render({ + project: project, + }); + } + + /** + * Parse the project from Project resource. + * + * @param {string} projectName + * A fully-qualified path representing Project resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectName(projectName: string) { + return this.pathTemplates.projectPathTemplate.match(projectName).project; + } + + /** + * Return a fully-qualified projectLocationAddressGroup resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} address_group + * @returns {string} Resource name string. + */ + projectLocationAddressGroupPath(project:string,location:string,addressGroup:string) { + return this.pathTemplates.projectLocationAddressGroupPathTemplate.render({ + project: project, + location: location, + address_group: addressGroup, + }); + } + + /** + * Parse the project from ProjectLocationAddressGroup resource. + * + * @param {string} projectLocationAddressGroupName + * A fully-qualified path representing project_location_address_group resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationAddressGroupName(projectLocationAddressGroupName: string) { + return this.pathTemplates.projectLocationAddressGroupPathTemplate.match(projectLocationAddressGroupName).project; + } + + /** + * Parse the location from ProjectLocationAddressGroup resource. + * + * @param {string} projectLocationAddressGroupName + * A fully-qualified path representing project_location_address_group resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationAddressGroupName(projectLocationAddressGroupName: string) { + return this.pathTemplates.projectLocationAddressGroupPathTemplate.match(projectLocationAddressGroupName).location; + } + + /** + * Parse the address_group from ProjectLocationAddressGroup resource. + * + * @param {string} projectLocationAddressGroupName + * A fully-qualified path representing project_location_address_group resource. + * @returns {string} A string representing the address_group. + */ + matchAddressGroupFromProjectLocationAddressGroupName(projectLocationAddressGroupName: string) { + return this.pathTemplates.projectLocationAddressGroupPathTemplate.match(projectLocationAddressGroupName).address_group; + } + + /** + * Return a fully-qualified projectLocationFirewallEndpoints resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} firewall_endpoint + * @returns {string} Resource name string. + */ + projectLocationFirewallEndpointsPath(project:string,location:string,firewallEndpoint:string) { + return this.pathTemplates.projectLocationFirewallEndpointsPathTemplate.render({ + project: project, + location: location, + firewall_endpoint: firewallEndpoint, + }); + } + + /** + * Parse the project from ProjectLocationFirewallEndpoints resource. + * + * @param {string} projectLocationFirewallEndpointsName + * A fully-qualified path representing project_location_firewallEndpoints resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationFirewallEndpointsName(projectLocationFirewallEndpointsName: string) { + return this.pathTemplates.projectLocationFirewallEndpointsPathTemplate.match(projectLocationFirewallEndpointsName).project; + } + + /** + * Parse the location from ProjectLocationFirewallEndpoints resource. + * + * @param {string} projectLocationFirewallEndpointsName + * A fully-qualified path representing project_location_firewallEndpoints resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationFirewallEndpointsName(projectLocationFirewallEndpointsName: string) { + return this.pathTemplates.projectLocationFirewallEndpointsPathTemplate.match(projectLocationFirewallEndpointsName).location; + } + + /** + * Parse the firewall_endpoint from ProjectLocationFirewallEndpoints resource. + * + * @param {string} projectLocationFirewallEndpointsName + * A fully-qualified path representing project_location_firewallEndpoints resource. + * @returns {string} A string representing the firewall_endpoint. + */ + matchFirewallEndpointFromProjectLocationFirewallEndpointsName(projectLocationFirewallEndpointsName: string) { + return this.pathTemplates.projectLocationFirewallEndpointsPathTemplate.match(projectLocationFirewallEndpointsName).firewall_endpoint; + } + + /** + * Return a fully-qualified projectLocationSecurityProfile resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} security_profile + * @returns {string} Resource name string. + */ + projectLocationSecurityProfilePath(project:string,location:string,securityProfile:string) { + return this.pathTemplates.projectLocationSecurityProfilePathTemplate.render({ + project: project, + location: location, + security_profile: securityProfile, + }); + } + + /** + * Parse the project from ProjectLocationSecurityProfile resource. + * + * @param {string} projectLocationSecurityProfileName + * A fully-qualified path representing project_location_security_profile resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationSecurityProfileName(projectLocationSecurityProfileName: string) { + return this.pathTemplates.projectLocationSecurityProfilePathTemplate.match(projectLocationSecurityProfileName).project; + } + + /** + * Parse the location from ProjectLocationSecurityProfile resource. + * + * @param {string} projectLocationSecurityProfileName + * A fully-qualified path representing project_location_security_profile resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationSecurityProfileName(projectLocationSecurityProfileName: string) { + return this.pathTemplates.projectLocationSecurityProfilePathTemplate.match(projectLocationSecurityProfileName).location; + } + + /** + * Parse the security_profile from ProjectLocationSecurityProfile resource. + * + * @param {string} projectLocationSecurityProfileName + * A fully-qualified path representing project_location_security_profile resource. + * @returns {string} A string representing the security_profile. + */ + matchSecurityProfileFromProjectLocationSecurityProfileName(projectLocationSecurityProfileName: string) { + return this.pathTemplates.projectLocationSecurityProfilePathTemplate.match(projectLocationSecurityProfileName).security_profile; + } + + /** + * Return a fully-qualified projectLocationSecurityProfileGroup resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} security_profile_group + * @returns {string} Resource name string. + */ + projectLocationSecurityProfileGroupPath(project:string,location:string,securityProfileGroup:string) { + return this.pathTemplates.projectLocationSecurityProfileGroupPathTemplate.render({ + project: project, + location: location, + security_profile_group: securityProfileGroup, + }); + } + + /** + * Parse the project from ProjectLocationSecurityProfileGroup resource. + * + * @param {string} projectLocationSecurityProfileGroupName + * A fully-qualified path representing project_location_security_profile_group resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationSecurityProfileGroupName(projectLocationSecurityProfileGroupName: string) { + return this.pathTemplates.projectLocationSecurityProfileGroupPathTemplate.match(projectLocationSecurityProfileGroupName).project; + } + + /** + * Parse the location from ProjectLocationSecurityProfileGroup resource. + * + * @param {string} projectLocationSecurityProfileGroupName + * A fully-qualified path representing project_location_security_profile_group resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationSecurityProfileGroupName(projectLocationSecurityProfileGroupName: string) { + return this.pathTemplates.projectLocationSecurityProfileGroupPathTemplate.match(projectLocationSecurityProfileGroupName).location; + } + + /** + * Parse the security_profile_group from ProjectLocationSecurityProfileGroup resource. + * + * @param {string} projectLocationSecurityProfileGroupName + * A fully-qualified path representing project_location_security_profile_group resource. + * @returns {string} A string representing the security_profile_group. + */ + matchSecurityProfileGroupFromProjectLocationSecurityProfileGroupName(projectLocationSecurityProfileGroupName: string) { + return this.pathTemplates.projectLocationSecurityProfileGroupPathTemplate.match(projectLocationSecurityProfileGroupName).security_profile_group; + } + + /** + * Return a fully-qualified serverTlsPolicy resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} server_tls_policy + * @returns {string} Resource name string. + */ + serverTlsPolicyPath(project:string,location:string,serverTlsPolicy:string) { + return this.pathTemplates.serverTlsPolicyPathTemplate.render({ + project: project, + location: location, + server_tls_policy: serverTlsPolicy, + }); + } + + /** + * Parse the project from ServerTlsPolicy resource. + * + * @param {string} serverTlsPolicyName + * A fully-qualified path representing ServerTlsPolicy resource. + * @returns {string} A string representing the project. + */ + matchProjectFromServerTlsPolicyName(serverTlsPolicyName: string) { + return this.pathTemplates.serverTlsPolicyPathTemplate.match(serverTlsPolicyName).project; + } + + /** + * Parse the location from ServerTlsPolicy resource. + * + * @param {string} serverTlsPolicyName + * A fully-qualified path representing ServerTlsPolicy resource. + * @returns {string} A string representing the location. + */ + matchLocationFromServerTlsPolicyName(serverTlsPolicyName: string) { + return this.pathTemplates.serverTlsPolicyPathTemplate.match(serverTlsPolicyName).location; + } + + /** + * Parse the server_tls_policy from ServerTlsPolicy resource. + * + * @param {string} serverTlsPolicyName + * A fully-qualified path representing ServerTlsPolicy resource. + * @returns {string} A string representing the server_tls_policy. + */ + matchServerTlsPolicyFromServerTlsPolicyName(serverTlsPolicyName: string) { + return this.pathTemplates.serverTlsPolicyPathTemplate.match(serverTlsPolicyName).server_tls_policy; + } + + /** + * Return a fully-qualified tlsInspectionPolicy resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} tls_inspection_policy + * @returns {string} Resource name string. + */ + tlsInspectionPolicyPath(project:string,location:string,tlsInspectionPolicy:string) { + return this.pathTemplates.tlsInspectionPolicyPathTemplate.render({ + project: project, + location: location, + tls_inspection_policy: tlsInspectionPolicy, + }); + } + + /** + * Parse the project from TlsInspectionPolicy resource. + * + * @param {string} tlsInspectionPolicyName + * A fully-qualified path representing TlsInspectionPolicy resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTlsInspectionPolicyName(tlsInspectionPolicyName: string) { + return this.pathTemplates.tlsInspectionPolicyPathTemplate.match(tlsInspectionPolicyName).project; + } + + /** + * Parse the location from TlsInspectionPolicy resource. + * + * @param {string} tlsInspectionPolicyName + * A fully-qualified path representing TlsInspectionPolicy resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTlsInspectionPolicyName(tlsInspectionPolicyName: string) { + return this.pathTemplates.tlsInspectionPolicyPathTemplate.match(tlsInspectionPolicyName).location; + } + + /** + * Parse the tls_inspection_policy from TlsInspectionPolicy resource. + * + * @param {string} tlsInspectionPolicyName + * A fully-qualified path representing TlsInspectionPolicy resource. + * @returns {string} A string representing the tls_inspection_policy. + */ + matchTlsInspectionPolicyFromTlsInspectionPolicyName(tlsInspectionPolicyName: string) { + return this.pathTemplates.tlsInspectionPolicyPathTemplate.match(tlsInspectionPolicyName).tls_inspection_policy; + } + + /** + * Return a fully-qualified urlList resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} url_list + * @returns {string} Resource name string. + */ + urlListPath(project:string,location:string,urlList:string) { + return this.pathTemplates.urlListPathTemplate.render({ + project: project, + location: location, + url_list: urlList, + }); + } + + /** + * Parse the project from UrlList resource. + * + * @param {string} urlListName + * A fully-qualified path representing UrlList resource. + * @returns {string} A string representing the project. + */ + matchProjectFromUrlListName(urlListName: string) { + return this.pathTemplates.urlListPathTemplate.match(urlListName).project; + } + + /** + * Parse the location from UrlList resource. + * + * @param {string} urlListName + * A fully-qualified path representing UrlList resource. + * @returns {string} A string representing the location. + */ + matchLocationFromUrlListName(urlListName: string) { + return this.pathTemplates.urlListPathTemplate.match(urlListName).location; + } + + /** + * Parse the url_list from UrlList resource. + * + * @param {string} urlListName + * A fully-qualified path representing UrlList resource. + * @returns {string} A string representing the url_list. + */ + matchUrlListFromUrlListName(urlListName: string) { + return this.pathTemplates.urlListPathTemplate.match(urlListName).url_list; + } + + /** + * Terminate the gRPC channel and close the client. + * + * The client will no longer be usable and all future behavior is undefined. + * @returns {Promise} A promise that resolves when the client is closed. + */ + close(): Promise { + if (this.mirroringStub && !this._terminated) { + return this.mirroringStub.then(stub => { + this._log.info('ending gRPC channel'); + this._terminated = true; + stub.close(); + this.iamClient.close().catch(err => {throw err}); + this.locationsClient.close().catch(err => {throw err}); + void this.operationsClient.close(); + }); + } + return Promise.resolve(); + } +} \ No newline at end of file diff --git a/packages/google-cloud-networksecurity/src/v1/mirroring_client_config.json b/packages/google-cloud-networksecurity/src/v1/mirroring_client_config.json new file mode 100644 index 00000000000..ed430cbf297 --- /dev/null +++ b/packages/google-cloud-networksecurity/src/v1/mirroring_client_config.json @@ -0,0 +1,106 @@ +{ + "interfaces": { + "google.cloud.networksecurity.v1.Mirroring": { + "retry_codes": { + "non_idempotent": [], + "idempotent": [ + "DEADLINE_EXCEEDED", + "UNAVAILABLE" + ] + }, + "retry_params": { + "default": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + } + }, + "methods": { + "ListMirroringEndpointGroups": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetMirroringEndpointGroup": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "CreateMirroringEndpointGroup": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UpdateMirroringEndpointGroup": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteMirroringEndpointGroup": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListMirroringEndpointGroupAssociations": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetMirroringEndpointGroupAssociation": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "CreateMirroringEndpointGroupAssociation": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UpdateMirroringEndpointGroupAssociation": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteMirroringEndpointGroupAssociation": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListMirroringDeploymentGroups": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetMirroringDeploymentGroup": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "CreateMirroringDeploymentGroup": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UpdateMirroringDeploymentGroup": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteMirroringDeploymentGroup": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListMirroringDeployments": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetMirroringDeployment": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "CreateMirroringDeployment": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UpdateMirroringDeployment": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteMirroringDeployment": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/packages/google-cloud-networksecurity/src/v1/mirroring_proto_list.json b/packages/google-cloud-networksecurity/src/v1/mirroring_proto_list.json new file mode 100644 index 00000000000..1451adf6674 --- /dev/null +++ b/packages/google-cloud-networksecurity/src/v1/mirroring_proto_list.json @@ -0,0 +1,25 @@ +[ + "../../protos/google/cloud/networksecurity/v1/address_group.proto", + "../../protos/google/cloud/networksecurity/v1/authorization_policy.proto", + "../../protos/google/cloud/networksecurity/v1/authz_policy.proto", + "../../protos/google/cloud/networksecurity/v1/backend_authentication_config.proto", + "../../protos/google/cloud/networksecurity/v1/client_tls_policy.proto", + "../../protos/google/cloud/networksecurity/v1/common.proto", + "../../protos/google/cloud/networksecurity/v1/dns_threat_detector.proto", + "../../protos/google/cloud/networksecurity/v1/firewall_activation.proto", + "../../protos/google/cloud/networksecurity/v1/gateway_security_policy.proto", + "../../protos/google/cloud/networksecurity/v1/gateway_security_policy_rule.proto", + "../../protos/google/cloud/networksecurity/v1/intercept.proto", + "../../protos/google/cloud/networksecurity/v1/mirroring.proto", + "../../protos/google/cloud/networksecurity/v1/network_security.proto", + "../../protos/google/cloud/networksecurity/v1/security_profile_group.proto", + "../../protos/google/cloud/networksecurity/v1/security_profile_group_intercept.proto", + "../../protos/google/cloud/networksecurity/v1/security_profile_group_mirroring.proto", + "../../protos/google/cloud/networksecurity/v1/security_profile_group_service.proto", + "../../protos/google/cloud/networksecurity/v1/security_profile_group_threatprevention.proto", + "../../protos/google/cloud/networksecurity/v1/security_profile_group_urlfiltering.proto", + "../../protos/google/cloud/networksecurity/v1/server_tls_policy.proto", + "../../protos/google/cloud/networksecurity/v1/tls.proto", + "../../protos/google/cloud/networksecurity/v1/tls_inspection_policy.proto", + "../../protos/google/cloud/networksecurity/v1/url_list.proto" +] diff --git a/packages/google-cloud-networksecurity/src/v1/network_security_client.ts b/packages/google-cloud-networksecurity/src/v1/network_security_client.ts index 950e97be57c..b24c763e361 100644 --- a/packages/google-cloud-networksecurity/src/v1/network_security_client.ts +++ b/packages/google-cloud-networksecurity/src/v1/network_security_client.ts @@ -192,18 +192,84 @@ export class NetworkSecurityClient { authorizationPolicyPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/authorizationPolicies/{authorization_policy}' ), + authzPolicyPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/authzPolicies/{authz_policy}' + ), + backendAuthenticationConfigPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/backendAuthenticationConfigs/{backend_authentication_config}' + ), clientTlsPolicyPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/clientTlsPolicies/{client_tls_policy}' ), + dnsThreatDetectorPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/dnsThreatDetectors/{dns_threat_detector}' + ), + firewallEndpointAssociationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/firewallEndpointAssociations/{firewall_endpoint_association}' + ), + gatewaySecurityPolicyPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/gatewaySecurityPolicies/{gateway_security_policy}' + ), + gatewaySecurityPolicyRulePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/gatewaySecurityPolicies/{gateway_security_policy}/rules/{rule}' + ), + interceptDeploymentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/interceptDeployments/{intercept_deployment}' + ), + interceptDeploymentGroupPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/interceptDeploymentGroups/{intercept_deployment_group}' + ), + interceptEndpointGroupPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/interceptEndpointGroups/{intercept_endpoint_group}' + ), + interceptEndpointGroupAssociationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/interceptEndpointGroupAssociations/{intercept_endpoint_group_association}' + ), + mirroringDeploymentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/mirroringDeployments/{mirroring_deployment}' + ), + mirroringDeploymentGroupPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/mirroringDeploymentGroups/{mirroring_deployment_group}' + ), + mirroringEndpointGroupPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/mirroringEndpointGroups/{mirroring_endpoint_group}' + ), + mirroringEndpointGroupAssociationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/mirroringEndpointGroupAssociations/{mirroring_endpoint_group_association}' + ), organizationLocationAddressGroupPathTemplate: new this._gaxModule.PathTemplate( 'organizations/{organization}/locations/{location}/addressGroups/{address_group}' ), + organizationLocationFirewallEndpointsPathTemplate: new this._gaxModule.PathTemplate( + 'organizations/{organization}/locations/{location}/firewallEndpoints/{firewall_endpoint}' + ), + organizationLocationSecurityProfilePathTemplate: new this._gaxModule.PathTemplate( + 'organizations/{organization}/locations/{location}/securityProfiles/{security_profile}' + ), + organizationLocationSecurityProfileGroupPathTemplate: new this._gaxModule.PathTemplate( + 'organizations/{organization}/locations/{location}/securityProfileGroups/{security_profile_group}' + ), projectLocationAddressGroupPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/addressGroups/{address_group}' ), + projectLocationFirewallEndpointsPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/firewallEndpoints/{firewall_endpoint}' + ), + projectLocationSecurityProfilePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/securityProfiles/{security_profile}' + ), + projectLocationSecurityProfileGroupPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/securityProfileGroups/{security_profile_group}' + ), serverTlsPolicyPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/serverTlsPolicies/{server_tls_policy}' ), + tlsInspectionPolicyPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/tlsInspectionPolicies/{tls_inspection_policy}' + ), + urlListPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/urlLists/{url_list}' + ), }; // Some of the methods on this service return "paged" results, @@ -212,10 +278,22 @@ export class NetworkSecurityClient { this.descriptors.page = { listAuthorizationPolicies: new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'authorizationPolicies'), + listBackendAuthenticationConfigs: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'backendAuthenticationConfigs'), listServerTlsPolicies: new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'serverTlsPolicies'), listClientTlsPolicies: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'clientTlsPolicies') + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'clientTlsPolicies'), + listGatewaySecurityPolicies: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'gatewaySecurityPolicies'), + listGatewaySecurityPolicyRules: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'gatewaySecurityPolicyRules'), + listUrlLists: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'urlLists'), + listTlsInspectionPolicies: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'tlsInspectionPolicies'), + listAuthzPolicies: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'authzPolicies') }; const protoFilesRoot = this._gaxModule.protobufFromJSON(jsonProtos); @@ -230,9 +308,9 @@ export class NetworkSecurityClient { lroOptions.protoJson = protoFilesRoot; lroOptions.httpRules = [{selector: 'google.cloud.location.Locations.GetLocation',get: '/v1/{name=projects/*/locations/*}',additional_bindings: [{get: '/v1/{name=organizations/*/locations/*}',}], },{selector: 'google.cloud.location.Locations.ListLocations',get: '/v1/{name=projects/*}/locations',additional_bindings: [{get: '/v1/{name=organizations/*/locations/*}',}], - },{selector: 'google.iam.v1.IAMPolicy.GetIamPolicy',get: '/v1/{resource=projects/*/locations/*/authorizationPolicies/*}:getIamPolicy',additional_bindings: [{get: '/v1/{resource=projects/*/locations/*/addressGroups/*}:getIamPolicy',},{get: '/v1/{resource=organizations/*/locations/*/addressGroups/*}:getIamPolicy',},{get: '/v1/{resource=projects/*/locations/*/serverTlsPolicies/*}:getIamPolicy',},{get: '/v1/{resource=projects/*/locations/*/clientTlsPolicies/*}:getIamPolicy',}], - },{selector: 'google.iam.v1.IAMPolicy.SetIamPolicy',post: '/v1/{resource=projects/*/locations/*/authorizationPolicies/*}:setIamPolicy',body: '*',additional_bindings: [{post: '/v1/{resource=projects/*/locations/*/addressGroups/*}:setIamPolicy',body: '*',},{post: '/v1/{resource=organizations/*/locations/*/addressGroups/*}:setIamPolicy',body: '*',},{post: '/v1/{resource=projects/*/locations/*/serverTlsPolicies/*}:setIamPolicy',body: '*',},{post: '/v1/{resource=projects/*/locations/*/clientTlsPolicies/*}:setIamPolicy',body: '*',}], - },{selector: 'google.iam.v1.IAMPolicy.TestIamPermissions',post: '/v1/{resource=projects/*/locations/*/authorizationPolicies/*}:testIamPermissions',body: '*',additional_bindings: [{post: '/v1/{resource=projects/*/locations/*/addressGroups/*}:testIamPermissions',body: '*',},{post: '/v1/{resource=organizations/*/locations/*/addressGroups/*}:testIamPermissions',body: '*',},{post: '/v1/{resource=projects/*/locations/*/serverTlsPolicies/*}:testIamPermissions',body: '*',},{post: '/v1/{resource=projects/*/locations/*/clientTlsPolicies/*}:testIamPermissions',body: '*',}], + },{selector: 'google.iam.v1.IAMPolicy.GetIamPolicy',get: '/v1/{resource=projects/*/locations/*/addressGroups/*}:getIamPolicy',additional_bindings: [{get: '/v1/{resource=projects/*/locations/*/authorizationPolicies/*}:getIamPolicy',},{get: '/v1/{resource=organizations/*/locations/*/addressGroups/*}:getIamPolicy',},{get: '/v1/{resource=projects/*/locations/*/serverTlsPolicies/*}:getIamPolicy',},{get: '/v1/{resource=projects/*/locations/*/clientTlsPolicies/*}:getIamPolicy',},{get: '/v1/{resource=projects/*/locations/*/authzPolicies/*}:getIamPolicy',}], + },{selector: 'google.iam.v1.IAMPolicy.SetIamPolicy',post: '/v1/{resource=projects/*/locations/*/addressGroups/*}:setIamPolicy',body: '*',additional_bindings: [{post: '/v1/{resource=projects/*/locations/*/authorizationPolicies/*}:setIamPolicy',body: '*',},{post: '/v1/{resource=organizations/*/locations/*/addressGroups/*}:setIamPolicy',body: '*',},{post: '/v1/{resource=projects/*/locations/*/serverTlsPolicies/*}:setIamPolicy',body: '*',},{post: '/v1/{resource=projects/*/locations/*/clientTlsPolicies/*}:setIamPolicy',body: '*',},{post: '/v1/{resource=projects/*/locations/*/authzPolicies/*}:setIamPolicy',body: '*',}], + },{selector: 'google.iam.v1.IAMPolicy.TestIamPermissions',post: '/v1/{resource=projects/*/locations/*/addressGroups/*}:testIamPermissions',body: '*',additional_bindings: [{post: '/v1/{resource=projects/*/locations/*/authorizationPolicies/*}:testIamPermissions',body: '*',},{post: '/v1/{resource=organizations/*/locations/*/addressGroups/*}:testIamPermissions',body: '*',},{post: '/v1/{resource=projects/*/locations/*/serverTlsPolicies/*}:testIamPermissions',body: '*',},{post: '/v1/{resource=projects/*/locations/*/clientTlsPolicies/*}:testIamPermissions',body: '*',},{post: '/v1/{resource=projects/*/locations/*/authzPolicies/*}:testIamPermissions',body: '*',}], },{selector: 'google.longrunning.Operations.CancelOperation',post: '/v1/{name=projects/*/locations/*/operations/*}:cancel',body: '*',additional_bindings: [{post: '/v1/{name=organizations/*/locations/*/operations/*}:cancel',body: '*',}], },{selector: 'google.longrunning.Operations.DeleteOperation',delete: '/v1/{name=projects/*/locations/*/operations/*}',additional_bindings: [{delete: '/v1/{name=organizations/*/locations/*/operations/*}',}], },{selector: 'google.longrunning.Operations.GetOperation',get: '/v1/{name=projects/*/locations/*/operations/*}',additional_bindings: [{get: '/v1/{name=organizations/*/locations/*/operations/*}',}], @@ -252,6 +330,18 @@ export class NetworkSecurityClient { '.google.protobuf.Empty') as gax.protobuf.Type; const deleteAuthorizationPolicyMetadata = protoFilesRoot.lookup( '.google.cloud.networksecurity.v1.OperationMetadata') as gax.protobuf.Type; + const createBackendAuthenticationConfigResponse = protoFilesRoot.lookup( + '.google.cloud.networksecurity.v1.BackendAuthenticationConfig') as gax.protobuf.Type; + const createBackendAuthenticationConfigMetadata = protoFilesRoot.lookup( + '.google.cloud.networksecurity.v1.OperationMetadata') as gax.protobuf.Type; + const updateBackendAuthenticationConfigResponse = protoFilesRoot.lookup( + '.google.cloud.networksecurity.v1.BackendAuthenticationConfig') as gax.protobuf.Type; + const updateBackendAuthenticationConfigMetadata = protoFilesRoot.lookup( + '.google.cloud.networksecurity.v1.OperationMetadata') as gax.protobuf.Type; + const deleteBackendAuthenticationConfigResponse = protoFilesRoot.lookup( + '.google.protobuf.Empty') as gax.protobuf.Type; + const deleteBackendAuthenticationConfigMetadata = protoFilesRoot.lookup( + '.google.cloud.networksecurity.v1.OperationMetadata') as gax.protobuf.Type; const createServerTlsPolicyResponse = protoFilesRoot.lookup( '.google.cloud.networksecurity.v1.ServerTlsPolicy') as gax.protobuf.Type; const createServerTlsPolicyMetadata = protoFilesRoot.lookup( @@ -276,6 +366,66 @@ export class NetworkSecurityClient { '.google.protobuf.Empty') as gax.protobuf.Type; const deleteClientTlsPolicyMetadata = protoFilesRoot.lookup( '.google.cloud.networksecurity.v1.OperationMetadata') as gax.protobuf.Type; + const createGatewaySecurityPolicyResponse = protoFilesRoot.lookup( + '.google.cloud.networksecurity.v1.GatewaySecurityPolicy') as gax.protobuf.Type; + const createGatewaySecurityPolicyMetadata = protoFilesRoot.lookup( + '.google.cloud.networksecurity.v1.OperationMetadata') as gax.protobuf.Type; + const updateGatewaySecurityPolicyResponse = protoFilesRoot.lookup( + '.google.cloud.networksecurity.v1.GatewaySecurityPolicy') as gax.protobuf.Type; + const updateGatewaySecurityPolicyMetadata = protoFilesRoot.lookup( + '.google.cloud.networksecurity.v1.OperationMetadata') as gax.protobuf.Type; + const deleteGatewaySecurityPolicyResponse = protoFilesRoot.lookup( + '.google.protobuf.Empty') as gax.protobuf.Type; + const deleteGatewaySecurityPolicyMetadata = protoFilesRoot.lookup( + '.google.cloud.networksecurity.v1.OperationMetadata') as gax.protobuf.Type; + const createGatewaySecurityPolicyRuleResponse = protoFilesRoot.lookup( + '.google.cloud.networksecurity.v1.GatewaySecurityPolicyRule') as gax.protobuf.Type; + const createGatewaySecurityPolicyRuleMetadata = protoFilesRoot.lookup( + '.google.cloud.networksecurity.v1.OperationMetadata') as gax.protobuf.Type; + const updateGatewaySecurityPolicyRuleResponse = protoFilesRoot.lookup( + '.google.cloud.networksecurity.v1.GatewaySecurityPolicyRule') as gax.protobuf.Type; + const updateGatewaySecurityPolicyRuleMetadata = protoFilesRoot.lookup( + '.google.cloud.networksecurity.v1.OperationMetadata') as gax.protobuf.Type; + const deleteGatewaySecurityPolicyRuleResponse = protoFilesRoot.lookup( + '.google.protobuf.Empty') as gax.protobuf.Type; + const deleteGatewaySecurityPolicyRuleMetadata = protoFilesRoot.lookup( + '.google.cloud.networksecurity.v1.OperationMetadata') as gax.protobuf.Type; + const createUrlListResponse = protoFilesRoot.lookup( + '.google.cloud.networksecurity.v1.UrlList') as gax.protobuf.Type; + const createUrlListMetadata = protoFilesRoot.lookup( + '.google.cloud.networksecurity.v1.OperationMetadata') as gax.protobuf.Type; + const updateUrlListResponse = protoFilesRoot.lookup( + '.google.cloud.networksecurity.v1.UrlList') as gax.protobuf.Type; + const updateUrlListMetadata = protoFilesRoot.lookup( + '.google.cloud.networksecurity.v1.OperationMetadata') as gax.protobuf.Type; + const deleteUrlListResponse = protoFilesRoot.lookup( + '.google.protobuf.Empty') as gax.protobuf.Type; + const deleteUrlListMetadata = protoFilesRoot.lookup( + '.google.cloud.networksecurity.v1.OperationMetadata') as gax.protobuf.Type; + const createTlsInspectionPolicyResponse = protoFilesRoot.lookup( + '.google.cloud.networksecurity.v1.TlsInspectionPolicy') as gax.protobuf.Type; + const createTlsInspectionPolicyMetadata = protoFilesRoot.lookup( + '.google.cloud.networksecurity.v1.OperationMetadata') as gax.protobuf.Type; + const updateTlsInspectionPolicyResponse = protoFilesRoot.lookup( + '.google.cloud.networksecurity.v1.TlsInspectionPolicy') as gax.protobuf.Type; + const updateTlsInspectionPolicyMetadata = protoFilesRoot.lookup( + '.google.cloud.networksecurity.v1.OperationMetadata') as gax.protobuf.Type; + const deleteTlsInspectionPolicyResponse = protoFilesRoot.lookup( + '.google.protobuf.Empty') as gax.protobuf.Type; + const deleteTlsInspectionPolicyMetadata = protoFilesRoot.lookup( + '.google.cloud.networksecurity.v1.OperationMetadata') as gax.protobuf.Type; + const createAuthzPolicyResponse = protoFilesRoot.lookup( + '.google.cloud.networksecurity.v1.AuthzPolicy') as gax.protobuf.Type; + const createAuthzPolicyMetadata = protoFilesRoot.lookup( + '.google.cloud.networksecurity.v1.OperationMetadata') as gax.protobuf.Type; + const updateAuthzPolicyResponse = protoFilesRoot.lookup( + '.google.cloud.networksecurity.v1.AuthzPolicy') as gax.protobuf.Type; + const updateAuthzPolicyMetadata = protoFilesRoot.lookup( + '.google.cloud.networksecurity.v1.OperationMetadata') as gax.protobuf.Type; + const deleteAuthzPolicyResponse = protoFilesRoot.lookup( + '.google.protobuf.Empty') as gax.protobuf.Type; + const deleteAuthzPolicyMetadata = protoFilesRoot.lookup( + '.google.cloud.networksecurity.v1.OperationMetadata') as gax.protobuf.Type; this.descriptors.longrunning = { createAuthorizationPolicy: new this._gaxModule.LongrunningDescriptor( @@ -290,6 +440,18 @@ export class NetworkSecurityClient { this.operationsClient, deleteAuthorizationPolicyResponse.decode.bind(deleteAuthorizationPolicyResponse), deleteAuthorizationPolicyMetadata.decode.bind(deleteAuthorizationPolicyMetadata)), + createBackendAuthenticationConfig: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + createBackendAuthenticationConfigResponse.decode.bind(createBackendAuthenticationConfigResponse), + createBackendAuthenticationConfigMetadata.decode.bind(createBackendAuthenticationConfigMetadata)), + updateBackendAuthenticationConfig: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + updateBackendAuthenticationConfigResponse.decode.bind(updateBackendAuthenticationConfigResponse), + updateBackendAuthenticationConfigMetadata.decode.bind(updateBackendAuthenticationConfigMetadata)), + deleteBackendAuthenticationConfig: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + deleteBackendAuthenticationConfigResponse.decode.bind(deleteBackendAuthenticationConfigResponse), + deleteBackendAuthenticationConfigMetadata.decode.bind(deleteBackendAuthenticationConfigMetadata)), createServerTlsPolicy: new this._gaxModule.LongrunningDescriptor( this.operationsClient, createServerTlsPolicyResponse.decode.bind(createServerTlsPolicyResponse), @@ -313,7 +475,67 @@ export class NetworkSecurityClient { deleteClientTlsPolicy: new this._gaxModule.LongrunningDescriptor( this.operationsClient, deleteClientTlsPolicyResponse.decode.bind(deleteClientTlsPolicyResponse), - deleteClientTlsPolicyMetadata.decode.bind(deleteClientTlsPolicyMetadata)) + deleteClientTlsPolicyMetadata.decode.bind(deleteClientTlsPolicyMetadata)), + createGatewaySecurityPolicy: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + createGatewaySecurityPolicyResponse.decode.bind(createGatewaySecurityPolicyResponse), + createGatewaySecurityPolicyMetadata.decode.bind(createGatewaySecurityPolicyMetadata)), + updateGatewaySecurityPolicy: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + updateGatewaySecurityPolicyResponse.decode.bind(updateGatewaySecurityPolicyResponse), + updateGatewaySecurityPolicyMetadata.decode.bind(updateGatewaySecurityPolicyMetadata)), + deleteGatewaySecurityPolicy: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + deleteGatewaySecurityPolicyResponse.decode.bind(deleteGatewaySecurityPolicyResponse), + deleteGatewaySecurityPolicyMetadata.decode.bind(deleteGatewaySecurityPolicyMetadata)), + createGatewaySecurityPolicyRule: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + createGatewaySecurityPolicyRuleResponse.decode.bind(createGatewaySecurityPolicyRuleResponse), + createGatewaySecurityPolicyRuleMetadata.decode.bind(createGatewaySecurityPolicyRuleMetadata)), + updateGatewaySecurityPolicyRule: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + updateGatewaySecurityPolicyRuleResponse.decode.bind(updateGatewaySecurityPolicyRuleResponse), + updateGatewaySecurityPolicyRuleMetadata.decode.bind(updateGatewaySecurityPolicyRuleMetadata)), + deleteGatewaySecurityPolicyRule: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + deleteGatewaySecurityPolicyRuleResponse.decode.bind(deleteGatewaySecurityPolicyRuleResponse), + deleteGatewaySecurityPolicyRuleMetadata.decode.bind(deleteGatewaySecurityPolicyRuleMetadata)), + createUrlList: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + createUrlListResponse.decode.bind(createUrlListResponse), + createUrlListMetadata.decode.bind(createUrlListMetadata)), + updateUrlList: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + updateUrlListResponse.decode.bind(updateUrlListResponse), + updateUrlListMetadata.decode.bind(updateUrlListMetadata)), + deleteUrlList: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + deleteUrlListResponse.decode.bind(deleteUrlListResponse), + deleteUrlListMetadata.decode.bind(deleteUrlListMetadata)), + createTlsInspectionPolicy: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + createTlsInspectionPolicyResponse.decode.bind(createTlsInspectionPolicyResponse), + createTlsInspectionPolicyMetadata.decode.bind(createTlsInspectionPolicyMetadata)), + updateTlsInspectionPolicy: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + updateTlsInspectionPolicyResponse.decode.bind(updateTlsInspectionPolicyResponse), + updateTlsInspectionPolicyMetadata.decode.bind(updateTlsInspectionPolicyMetadata)), + deleteTlsInspectionPolicy: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + deleteTlsInspectionPolicyResponse.decode.bind(deleteTlsInspectionPolicyResponse), + deleteTlsInspectionPolicyMetadata.decode.bind(deleteTlsInspectionPolicyMetadata)), + createAuthzPolicy: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + createAuthzPolicyResponse.decode.bind(createAuthzPolicyResponse), + createAuthzPolicyMetadata.decode.bind(createAuthzPolicyMetadata)), + updateAuthzPolicy: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + updateAuthzPolicyResponse.decode.bind(updateAuthzPolicyResponse), + updateAuthzPolicyMetadata.decode.bind(updateAuthzPolicyMetadata)), + deleteAuthzPolicy: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + deleteAuthzPolicyResponse.decode.bind(deleteAuthzPolicyResponse), + deleteAuthzPolicyMetadata.decode.bind(deleteAuthzPolicyMetadata)) }; // Put together the default options sent with requests. @@ -359,7 +581,7 @@ export class NetworkSecurityClient { // Iterate over each of the methods that the service provides // and create an API call method for each. const networkSecurityStubMethods = - ['listAuthorizationPolicies', 'getAuthorizationPolicy', 'createAuthorizationPolicy', 'updateAuthorizationPolicy', 'deleteAuthorizationPolicy', 'listServerTlsPolicies', 'getServerTlsPolicy', 'createServerTlsPolicy', 'updateServerTlsPolicy', 'deleteServerTlsPolicy', 'listClientTlsPolicies', 'getClientTlsPolicy', 'createClientTlsPolicy', 'updateClientTlsPolicy', 'deleteClientTlsPolicy']; + ['listAuthorizationPolicies', 'getAuthorizationPolicy', 'createAuthorizationPolicy', 'updateAuthorizationPolicy', 'deleteAuthorizationPolicy', 'listBackendAuthenticationConfigs', 'getBackendAuthenticationConfig', 'createBackendAuthenticationConfig', 'updateBackendAuthenticationConfig', 'deleteBackendAuthenticationConfig', 'listServerTlsPolicies', 'getServerTlsPolicy', 'createServerTlsPolicy', 'updateServerTlsPolicy', 'deleteServerTlsPolicy', 'listClientTlsPolicies', 'getClientTlsPolicy', 'createClientTlsPolicy', 'updateClientTlsPolicy', 'deleteClientTlsPolicy', 'listGatewaySecurityPolicies', 'getGatewaySecurityPolicy', 'createGatewaySecurityPolicy', 'updateGatewaySecurityPolicy', 'deleteGatewaySecurityPolicy', 'listGatewaySecurityPolicyRules', 'getGatewaySecurityPolicyRule', 'createGatewaySecurityPolicyRule', 'updateGatewaySecurityPolicyRule', 'deleteGatewaySecurityPolicyRule', 'listUrlLists', 'getUrlList', 'createUrlList', 'updateUrlList', 'deleteUrlList', 'listTlsInspectionPolicies', 'getTlsInspectionPolicy', 'createTlsInspectionPolicy', 'updateTlsInspectionPolicy', 'deleteTlsInspectionPolicy', 'listAuthzPolicies', 'getAuthzPolicy', 'createAuthzPolicy', 'updateAuthzPolicy', 'deleteAuthzPolicy']; for (const methodName of networkSecurityStubMethods) { const callPromise = this.networkSecurityStub.then( stub => (...args: Array<{}>) => { @@ -558,6 +780,102 @@ export class NetworkSecurityClient { throw error; }); } +/** + * Gets details of a single BackendAuthenticationConfig to + * BackendAuthenticationConfig. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. A name of the BackendAuthenticationConfig to get. Must be in the + * format `projects/* /locations/{location}/backendAuthenticationConfigs/*`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.cloud.networksecurity.v1.BackendAuthenticationConfig|BackendAuthenticationConfig}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1/network_security.get_backend_authentication_config.js + * region_tag:networksecurity_v1_generated_NetworkSecurity_GetBackendAuthenticationConfig_async + */ + getBackendAuthenticationConfig( + request?: protos.google.cloud.networksecurity.v1.IGetBackendAuthenticationConfigRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.networksecurity.v1.IBackendAuthenticationConfig, + protos.google.cloud.networksecurity.v1.IGetBackendAuthenticationConfigRequest|undefined, {}|undefined + ]>; + getBackendAuthenticationConfig( + request: protos.google.cloud.networksecurity.v1.IGetBackendAuthenticationConfigRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.networksecurity.v1.IBackendAuthenticationConfig, + protos.google.cloud.networksecurity.v1.IGetBackendAuthenticationConfigRequest|null|undefined, + {}|null|undefined>): void; + getBackendAuthenticationConfig( + request: protos.google.cloud.networksecurity.v1.IGetBackendAuthenticationConfigRequest, + callback: Callback< + protos.google.cloud.networksecurity.v1.IBackendAuthenticationConfig, + protos.google.cloud.networksecurity.v1.IGetBackendAuthenticationConfigRequest|null|undefined, + {}|null|undefined>): void; + getBackendAuthenticationConfig( + request?: protos.google.cloud.networksecurity.v1.IGetBackendAuthenticationConfigRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.networksecurity.v1.IBackendAuthenticationConfig, + protos.google.cloud.networksecurity.v1.IGetBackendAuthenticationConfigRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.networksecurity.v1.IBackendAuthenticationConfig, + protos.google.cloud.networksecurity.v1.IGetBackendAuthenticationConfigRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.networksecurity.v1.IBackendAuthenticationConfig, + protos.google.cloud.networksecurity.v1.IGetBackendAuthenticationConfigRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('getBackendAuthenticationConfig request %j', request); + const wrappedCallback: Callback< + protos.google.cloud.networksecurity.v1.IBackendAuthenticationConfig, + protos.google.cloud.networksecurity.v1.IGetBackendAuthenticationConfigRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getBackendAuthenticationConfig response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.getBackendAuthenticationConfig(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.cloud.networksecurity.v1.IBackendAuthenticationConfig, + protos.google.cloud.networksecurity.v1.IGetBackendAuthenticationConfigRequest|undefined, + {}|undefined + ]) => { + this._log.info('getBackendAuthenticationConfig response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } /** * Gets details of a single ServerTlsPolicy. * @@ -748,66 +1066,56 @@ export class NetworkSecurityClient { throw error; }); } - /** - * Creates a new AuthorizationPolicy in a given project and location. + * Gets details of a single GatewaySecurityPolicy. * * @param {Object} request * The request object that will be sent. - * @param {string} request.parent - * Required. The parent resource of the AuthorizationPolicy. Must be in the - * format `projects/{project}/locations/{location}`. - * @param {string} request.authorizationPolicyId - * Required. Short name of the AuthorizationPolicy resource to be created. - * This value should be 1-63 characters long, containing only - * letters, numbers, hyphens, and underscores, and should not start - * with a number. E.g. "authz_policy". - * @param {google.cloud.networksecurity.v1.AuthorizationPolicy} request.authorizationPolicy - * Required. AuthorizationPolicy resource to be created. + * @param {string} request.name + * Required. A name of the GatewaySecurityPolicy to get. Must be in the format + * `projects/{project}/locations/{location}/gatewaySecurityPolicies/*`. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * The first element of the array is an object representing {@link protos.google.cloud.networksecurity.v1.GatewaySecurityPolicy|GatewaySecurityPolicy}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } * for more details and examples. - * @example include:samples/generated/v1/network_security.create_authorization_policy.js - * region_tag:networksecurity_v1_generated_NetworkSecurity_CreateAuthorizationPolicy_async + * @example include:samples/generated/v1/network_security.get_gateway_security_policy.js + * region_tag:networksecurity_v1_generated_NetworkSecurity_GetGatewaySecurityPolicy_async */ - createAuthorizationPolicy( - request?: protos.google.cloud.networksecurity.v1.ICreateAuthorizationPolicyRequest, + getGatewaySecurityPolicy( + request?: protos.google.cloud.networksecurity.v1.IGetGatewaySecurityPolicyRequest, options?: CallOptions): Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined + protos.google.cloud.networksecurity.v1.IGatewaySecurityPolicy, + protos.google.cloud.networksecurity.v1.IGetGatewaySecurityPolicyRequest|undefined, {}|undefined ]>; - createAuthorizationPolicy( - request: protos.google.cloud.networksecurity.v1.ICreateAuthorizationPolicyRequest, + getGatewaySecurityPolicy( + request: protos.google.cloud.networksecurity.v1.IGetGatewaySecurityPolicyRequest, options: CallOptions, callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, + protos.google.cloud.networksecurity.v1.IGatewaySecurityPolicy, + protos.google.cloud.networksecurity.v1.IGetGatewaySecurityPolicyRequest|null|undefined, {}|null|undefined>): void; - createAuthorizationPolicy( - request: protos.google.cloud.networksecurity.v1.ICreateAuthorizationPolicyRequest, + getGatewaySecurityPolicy( + request: protos.google.cloud.networksecurity.v1.IGetGatewaySecurityPolicyRequest, callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, + protos.google.cloud.networksecurity.v1.IGatewaySecurityPolicy, + protos.google.cloud.networksecurity.v1.IGetGatewaySecurityPolicyRequest|null|undefined, {}|null|undefined>): void; - createAuthorizationPolicy( - request?: protos.google.cloud.networksecurity.v1.ICreateAuthorizationPolicyRequest, + getGatewaySecurityPolicy( + request?: protos.google.cloud.networksecurity.v1.IGetGatewaySecurityPolicyRequest, optionsOrCallback?: CallOptions|Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, + protos.google.cloud.networksecurity.v1.IGatewaySecurityPolicy, + protos.google.cloud.networksecurity.v1.IGetGatewaySecurityPolicyRequest|null|undefined, {}|null|undefined>, callback?: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, + protos.google.cloud.networksecurity.v1.IGatewaySecurityPolicy, + protos.google.cloud.networksecurity.v1.IGetGatewaySecurityPolicyRequest|null|undefined, {}|null|undefined>): Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined + protos.google.cloud.networksecurity.v1.IGatewaySecurityPolicy, + protos.google.cloud.networksecurity.v1.IGetGatewaySecurityPolicyRequest|undefined, {}|undefined ]>|void { request = request || {}; let options: CallOptions; @@ -824,103 +1132,86 @@ export class NetworkSecurityClient { options.otherArgs.headers[ 'x-goog-request-params' ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', + 'name': request.name ?? '', }); this.initialize().catch(err => {throw err}); + this._log.info('getGatewaySecurityPolicy request %j', request); const wrappedCallback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, rawResponse, _) => { - this._log.info('createAuthorizationPolicy response %j', rawResponse); - callback!(error, response, rawResponse, _); // We verified callback above. + protos.google.cloud.networksecurity.v1.IGatewaySecurityPolicy, + protos.google.cloud.networksecurity.v1.IGetGatewaySecurityPolicyRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getGatewaySecurityPolicy response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. } : undefined; - this._log.info('createAuthorizationPolicy request %j', request); - return this.innerApiCalls.createAuthorizationPolicy(request, options, wrappedCallback) - ?.then(([response, rawResponse, _]: [ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]) => { - this._log.info('createAuthorizationPolicy response %j', rawResponse); - return [response, rawResponse, _]; - }); - } -/** - * Check the status of the long running operation returned by `createAuthorizationPolicy()`. - * @param {String} name - * The operation name that will be passed. - * @returns {Promise} - The promise which resolves to an object. - * The decoded operation object has result and metadata field to get information from. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } - * for more details and examples. - * @example include:samples/generated/v1/network_security.create_authorization_policy.js - * region_tag:networksecurity_v1_generated_NetworkSecurity_CreateAuthorizationPolicy_async - */ - async checkCreateAuthorizationPolicyProgress(name: string): Promise>{ - this._log.info('createAuthorizationPolicy long-running'); - const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.createAuthorizationPolicy, this._gaxModule.createDefaultBackoffSettings()); - return decodeOperation as LROperation; + return this.innerApiCalls.getGatewaySecurityPolicy(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.cloud.networksecurity.v1.IGatewaySecurityPolicy, + protos.google.cloud.networksecurity.v1.IGetGatewaySecurityPolicyRequest|undefined, + {}|undefined + ]) => { + this._log.info('getGatewaySecurityPolicy response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); } /** - * Updates the parameters of a single AuthorizationPolicy. + * Gets details of a single GatewaySecurityPolicyRule. * * @param {Object} request * The request object that will be sent. - * @param {google.protobuf.FieldMask} [request.updateMask] - * Optional. Field mask is used to specify the fields to be overwritten in the - * AuthorizationPolicy resource by the update. - * The fields specified in the update_mask are relative to the resource, not - * the full request. A field will be overwritten if it is in the mask. If the - * user does not provide a mask then all fields will be overwritten. - * @param {google.cloud.networksecurity.v1.AuthorizationPolicy} request.authorizationPolicy - * Required. Updated AuthorizationPolicy resource. + * @param {string} request.name + * Required. The name of the GatewaySecurityPolicyRule to retrieve. + * Format: + * projects/{project}/location/{location}/gatewaySecurityPolicies/* /rules/* * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * The first element of the array is an object representing {@link protos.google.cloud.networksecurity.v1.GatewaySecurityPolicyRule|GatewaySecurityPolicyRule}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } * for more details and examples. - * @example include:samples/generated/v1/network_security.update_authorization_policy.js - * region_tag:networksecurity_v1_generated_NetworkSecurity_UpdateAuthorizationPolicy_async + * @example include:samples/generated/v1/network_security.get_gateway_security_policy_rule.js + * region_tag:networksecurity_v1_generated_NetworkSecurity_GetGatewaySecurityPolicyRule_async */ - updateAuthorizationPolicy( - request?: protos.google.cloud.networksecurity.v1.IUpdateAuthorizationPolicyRequest, + getGatewaySecurityPolicyRule( + request?: protos.google.cloud.networksecurity.v1.IGetGatewaySecurityPolicyRuleRequest, options?: CallOptions): Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined + protos.google.cloud.networksecurity.v1.IGatewaySecurityPolicyRule, + protos.google.cloud.networksecurity.v1.IGetGatewaySecurityPolicyRuleRequest|undefined, {}|undefined ]>; - updateAuthorizationPolicy( - request: protos.google.cloud.networksecurity.v1.IUpdateAuthorizationPolicyRequest, + getGatewaySecurityPolicyRule( + request: protos.google.cloud.networksecurity.v1.IGetGatewaySecurityPolicyRuleRequest, options: CallOptions, callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, + protos.google.cloud.networksecurity.v1.IGatewaySecurityPolicyRule, + protos.google.cloud.networksecurity.v1.IGetGatewaySecurityPolicyRuleRequest|null|undefined, {}|null|undefined>): void; - updateAuthorizationPolicy( - request: protos.google.cloud.networksecurity.v1.IUpdateAuthorizationPolicyRequest, + getGatewaySecurityPolicyRule( + request: protos.google.cloud.networksecurity.v1.IGetGatewaySecurityPolicyRuleRequest, callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, + protos.google.cloud.networksecurity.v1.IGatewaySecurityPolicyRule, + protos.google.cloud.networksecurity.v1.IGetGatewaySecurityPolicyRuleRequest|null|undefined, {}|null|undefined>): void; - updateAuthorizationPolicy( - request?: protos.google.cloud.networksecurity.v1.IUpdateAuthorizationPolicyRequest, + getGatewaySecurityPolicyRule( + request?: protos.google.cloud.networksecurity.v1.IGetGatewaySecurityPolicyRuleRequest, optionsOrCallback?: CallOptions|Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, + protos.google.cloud.networksecurity.v1.IGatewaySecurityPolicyRule, + protos.google.cloud.networksecurity.v1.IGetGatewaySecurityPolicyRuleRequest|null|undefined, {}|null|undefined>, callback?: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, + protos.google.cloud.networksecurity.v1.IGatewaySecurityPolicyRule, + protos.google.cloud.networksecurity.v1.IGetGatewaySecurityPolicyRuleRequest|null|undefined, {}|null|undefined>): Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined + protos.google.cloud.networksecurity.v1.IGatewaySecurityPolicyRule, + protos.google.cloud.networksecurity.v1.IGetGatewaySecurityPolicyRuleRequest|undefined, {}|undefined ]>|void { request = request || {}; let options: CallOptions; @@ -937,98 +1228,85 @@ export class NetworkSecurityClient { options.otherArgs.headers[ 'x-goog-request-params' ] = this._gaxModule.routingHeader.fromParams({ - 'authorization_policy.name': request.authorizationPolicy!.name ?? '', + 'name': request.name ?? '', }); this.initialize().catch(err => {throw err}); + this._log.info('getGatewaySecurityPolicyRule request %j', request); const wrappedCallback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, rawResponse, _) => { - this._log.info('updateAuthorizationPolicy response %j', rawResponse); - callback!(error, response, rawResponse, _); // We verified callback above. + protos.google.cloud.networksecurity.v1.IGatewaySecurityPolicyRule, + protos.google.cloud.networksecurity.v1.IGetGatewaySecurityPolicyRuleRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getGatewaySecurityPolicyRule response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. } : undefined; - this._log.info('updateAuthorizationPolicy request %j', request); - return this.innerApiCalls.updateAuthorizationPolicy(request, options, wrappedCallback) - ?.then(([response, rawResponse, _]: [ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]) => { - this._log.info('updateAuthorizationPolicy response %j', rawResponse); - return [response, rawResponse, _]; - }); - } -/** - * Check the status of the long running operation returned by `updateAuthorizationPolicy()`. - * @param {String} name - * The operation name that will be passed. - * @returns {Promise} - The promise which resolves to an object. - * The decoded operation object has result and metadata field to get information from. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } - * for more details and examples. - * @example include:samples/generated/v1/network_security.update_authorization_policy.js - * region_tag:networksecurity_v1_generated_NetworkSecurity_UpdateAuthorizationPolicy_async - */ - async checkUpdateAuthorizationPolicyProgress(name: string): Promise>{ - this._log.info('updateAuthorizationPolicy long-running'); - const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.updateAuthorizationPolicy, this._gaxModule.createDefaultBackoffSettings()); - return decodeOperation as LROperation; + return this.innerApiCalls.getGatewaySecurityPolicyRule(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.cloud.networksecurity.v1.IGatewaySecurityPolicyRule, + protos.google.cloud.networksecurity.v1.IGetGatewaySecurityPolicyRuleRequest|undefined, + {}|undefined + ]) => { + this._log.info('getGatewaySecurityPolicyRule response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); } /** - * Deletes a single AuthorizationPolicy. + * Gets details of a single UrlList. * * @param {Object} request * The request object that will be sent. * @param {string} request.name - * Required. A name of the AuthorizationPolicy to delete. Must be in the format - * `projects/{project}/locations/{location}/authorizationPolicies/*`. + * Required. A name of the UrlList to get. Must be in the format + * `projects/* /locations/{location}/urlLists/*`. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * The first element of the array is an object representing {@link protos.google.cloud.networksecurity.v1.UrlList|UrlList}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } * for more details and examples. - * @example include:samples/generated/v1/network_security.delete_authorization_policy.js - * region_tag:networksecurity_v1_generated_NetworkSecurity_DeleteAuthorizationPolicy_async + * @example include:samples/generated/v1/network_security.get_url_list.js + * region_tag:networksecurity_v1_generated_NetworkSecurity_GetUrlList_async */ - deleteAuthorizationPolicy( - request?: protos.google.cloud.networksecurity.v1.IDeleteAuthorizationPolicyRequest, + getUrlList( + request?: protos.google.cloud.networksecurity.v1.IGetUrlListRequest, options?: CallOptions): Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined + protos.google.cloud.networksecurity.v1.IUrlList, + protos.google.cloud.networksecurity.v1.IGetUrlListRequest|undefined, {}|undefined ]>; - deleteAuthorizationPolicy( - request: protos.google.cloud.networksecurity.v1.IDeleteAuthorizationPolicyRequest, + getUrlList( + request: protos.google.cloud.networksecurity.v1.IGetUrlListRequest, options: CallOptions, callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, + protos.google.cloud.networksecurity.v1.IUrlList, + protos.google.cloud.networksecurity.v1.IGetUrlListRequest|null|undefined, {}|null|undefined>): void; - deleteAuthorizationPolicy( - request: protos.google.cloud.networksecurity.v1.IDeleteAuthorizationPolicyRequest, + getUrlList( + request: protos.google.cloud.networksecurity.v1.IGetUrlListRequest, callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, + protos.google.cloud.networksecurity.v1.IUrlList, + protos.google.cloud.networksecurity.v1.IGetUrlListRequest|null|undefined, {}|null|undefined>): void; - deleteAuthorizationPolicy( - request?: protos.google.cloud.networksecurity.v1.IDeleteAuthorizationPolicyRequest, + getUrlList( + request?: protos.google.cloud.networksecurity.v1.IGetUrlListRequest, optionsOrCallback?: CallOptions|Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, + protos.google.cloud.networksecurity.v1.IUrlList, + protos.google.cloud.networksecurity.v1.IGetUrlListRequest|null|undefined, {}|null|undefined>, callback?: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, + protos.google.cloud.networksecurity.v1.IUrlList, + protos.google.cloud.networksecurity.v1.IGetUrlListRequest|null|undefined, {}|null|undefined>): Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined + protos.google.cloud.networksecurity.v1.IUrlList, + protos.google.cloud.networksecurity.v1.IGetUrlListRequest|undefined, {}|undefined ]>|void { request = request || {}; let options: CallOptions; @@ -1048,101 +1326,82 @@ export class NetworkSecurityClient { 'name': request.name ?? '', }); this.initialize().catch(err => {throw err}); + this._log.info('getUrlList request %j', request); const wrappedCallback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, rawResponse, _) => { - this._log.info('deleteAuthorizationPolicy response %j', rawResponse); - callback!(error, response, rawResponse, _); // We verified callback above. + protos.google.cloud.networksecurity.v1.IUrlList, + protos.google.cloud.networksecurity.v1.IGetUrlListRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getUrlList response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. } : undefined; - this._log.info('deleteAuthorizationPolicy request %j', request); - return this.innerApiCalls.deleteAuthorizationPolicy(request, options, wrappedCallback) - ?.then(([response, rawResponse, _]: [ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]) => { - this._log.info('deleteAuthorizationPolicy response %j', rawResponse); - return [response, rawResponse, _]; - }); - } -/** - * Check the status of the long running operation returned by `deleteAuthorizationPolicy()`. - * @param {String} name - * The operation name that will be passed. - * @returns {Promise} - The promise which resolves to an object. - * The decoded operation object has result and metadata field to get information from. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } - * for more details and examples. - * @example include:samples/generated/v1/network_security.delete_authorization_policy.js - * region_tag:networksecurity_v1_generated_NetworkSecurity_DeleteAuthorizationPolicy_async - */ - async checkDeleteAuthorizationPolicyProgress(name: string): Promise>{ - this._log.info('deleteAuthorizationPolicy long-running'); - const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.deleteAuthorizationPolicy, this._gaxModule.createDefaultBackoffSettings()); - return decodeOperation as LROperation; + return this.innerApiCalls.getUrlList(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.cloud.networksecurity.v1.IUrlList, + protos.google.cloud.networksecurity.v1.IGetUrlListRequest|undefined, + {}|undefined + ]) => { + this._log.info('getUrlList response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); } /** - * Creates a new ServerTlsPolicy in a given project and location. + * Gets details of a single TlsInspectionPolicy. * * @param {Object} request * The request object that will be sent. - * @param {string} request.parent - * Required. The parent resource of the ServerTlsPolicy. Must be in - * the format `projects/* /locations/{location}`. - * @param {string} request.serverTlsPolicyId - * Required. Short name of the ServerTlsPolicy resource to be created. This value should - * be 1-63 characters long, containing only letters, numbers, hyphens, and - * underscores, and should not start with a number. E.g. "server_mtls_policy". - * @param {google.cloud.networksecurity.v1.ServerTlsPolicy} request.serverTlsPolicy - * Required. ServerTlsPolicy resource to be created. + * @param {string} request.name + * Required. A name of the TlsInspectionPolicy to get. Must be in the format + * `projects/{project}/locations/{location}/tlsInspectionPolicies/{tls_inspection_policy}`. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * The first element of the array is an object representing {@link protos.google.cloud.networksecurity.v1.TlsInspectionPolicy|TlsInspectionPolicy}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } * for more details and examples. - * @example include:samples/generated/v1/network_security.create_server_tls_policy.js - * region_tag:networksecurity_v1_generated_NetworkSecurity_CreateServerTlsPolicy_async + * @example include:samples/generated/v1/network_security.get_tls_inspection_policy.js + * region_tag:networksecurity_v1_generated_NetworkSecurity_GetTlsInspectionPolicy_async */ - createServerTlsPolicy( - request?: protos.google.cloud.networksecurity.v1.ICreateServerTlsPolicyRequest, + getTlsInspectionPolicy( + request?: protos.google.cloud.networksecurity.v1.IGetTlsInspectionPolicyRequest, options?: CallOptions): Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined + protos.google.cloud.networksecurity.v1.ITlsInspectionPolicy, + protos.google.cloud.networksecurity.v1.IGetTlsInspectionPolicyRequest|undefined, {}|undefined ]>; - createServerTlsPolicy( - request: protos.google.cloud.networksecurity.v1.ICreateServerTlsPolicyRequest, + getTlsInspectionPolicy( + request: protos.google.cloud.networksecurity.v1.IGetTlsInspectionPolicyRequest, options: CallOptions, callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, + protos.google.cloud.networksecurity.v1.ITlsInspectionPolicy, + protos.google.cloud.networksecurity.v1.IGetTlsInspectionPolicyRequest|null|undefined, {}|null|undefined>): void; - createServerTlsPolicy( - request: protos.google.cloud.networksecurity.v1.ICreateServerTlsPolicyRequest, + getTlsInspectionPolicy( + request: protos.google.cloud.networksecurity.v1.IGetTlsInspectionPolicyRequest, callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, + protos.google.cloud.networksecurity.v1.ITlsInspectionPolicy, + protos.google.cloud.networksecurity.v1.IGetTlsInspectionPolicyRequest|null|undefined, {}|null|undefined>): void; - createServerTlsPolicy( - request?: protos.google.cloud.networksecurity.v1.ICreateServerTlsPolicyRequest, + getTlsInspectionPolicy( + request?: protos.google.cloud.networksecurity.v1.IGetTlsInspectionPolicyRequest, optionsOrCallback?: CallOptions|Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, + protos.google.cloud.networksecurity.v1.ITlsInspectionPolicy, + protos.google.cloud.networksecurity.v1.IGetTlsInspectionPolicyRequest|null|undefined, {}|null|undefined>, callback?: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, + protos.google.cloud.networksecurity.v1.ITlsInspectionPolicy, + protos.google.cloud.networksecurity.v1.IGetTlsInspectionPolicyRequest|null|undefined, {}|null|undefined>): Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined + protos.google.cloud.networksecurity.v1.ITlsInspectionPolicy, + protos.google.cloud.networksecurity.v1.IGetTlsInspectionPolicyRequest|undefined, {}|undefined ]>|void { request = request || {}; let options: CallOptions; @@ -1159,104 +1418,86 @@ export class NetworkSecurityClient { options.otherArgs.headers[ 'x-goog-request-params' ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', + 'name': request.name ?? '', }); this.initialize().catch(err => {throw err}); + this._log.info('getTlsInspectionPolicy request %j', request); const wrappedCallback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, rawResponse, _) => { - this._log.info('createServerTlsPolicy response %j', rawResponse); - callback!(error, response, rawResponse, _); // We verified callback above. + protos.google.cloud.networksecurity.v1.ITlsInspectionPolicy, + protos.google.cloud.networksecurity.v1.IGetTlsInspectionPolicyRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getTlsInspectionPolicy response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. } : undefined; - this._log.info('createServerTlsPolicy request %j', request); - return this.innerApiCalls.createServerTlsPolicy(request, options, wrappedCallback) - ?.then(([response, rawResponse, _]: [ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]) => { - this._log.info('createServerTlsPolicy response %j', rawResponse); - return [response, rawResponse, _]; - }); - } -/** - * Check the status of the long running operation returned by `createServerTlsPolicy()`. - * @param {String} name - * The operation name that will be passed. - * @returns {Promise} - The promise which resolves to an object. - * The decoded operation object has result and metadata field to get information from. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } - * for more details and examples. - * @example include:samples/generated/v1/network_security.create_server_tls_policy.js - * region_tag:networksecurity_v1_generated_NetworkSecurity_CreateServerTlsPolicy_async - */ - async checkCreateServerTlsPolicyProgress(name: string): Promise>{ - this._log.info('createServerTlsPolicy long-running'); - const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.createServerTlsPolicy, this._gaxModule.createDefaultBackoffSettings()); - return decodeOperation as LROperation; + return this.innerApiCalls.getTlsInspectionPolicy(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.cloud.networksecurity.v1.ITlsInspectionPolicy, + protos.google.cloud.networksecurity.v1.IGetTlsInspectionPolicyRequest|undefined, + {}|undefined + ]) => { + this._log.info('getTlsInspectionPolicy response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); } /** - * Updates the parameters of a single ServerTlsPolicy. + * Gets details of a single AuthzPolicy. * * @param {Object} request * The request object that will be sent. - * @param {google.protobuf.FieldMask} [request.updateMask] - * Optional. Field mask is used to specify the fields to be overwritten in the - * ServerTlsPolicy resource by the update. The fields - * specified in the update_mask are relative to the resource, not - * the full request. A field will be overwritten if it is in the - * mask. If the user does not provide a mask then all fields will be - * overwritten. - * @param {google.cloud.networksecurity.v1.ServerTlsPolicy} request.serverTlsPolicy - * Required. Updated ServerTlsPolicy resource. + * @param {string} request.name + * Required. A name of the `AuthzPolicy` resource to get. Must be in the + * format + * `projects/{project}/locations/{location}/authzPolicies/{authz_policy}`. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * The first element of the array is an object representing {@link protos.google.cloud.networksecurity.v1.AuthzPolicy|AuthzPolicy}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } * for more details and examples. - * @example include:samples/generated/v1/network_security.update_server_tls_policy.js - * region_tag:networksecurity_v1_generated_NetworkSecurity_UpdateServerTlsPolicy_async + * @example include:samples/generated/v1/network_security.get_authz_policy.js + * region_tag:networksecurity_v1_generated_NetworkSecurity_GetAuthzPolicy_async */ - updateServerTlsPolicy( - request?: protos.google.cloud.networksecurity.v1.IUpdateServerTlsPolicyRequest, + getAuthzPolicy( + request?: protos.google.cloud.networksecurity.v1.IGetAuthzPolicyRequest, options?: CallOptions): Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined + protos.google.cloud.networksecurity.v1.IAuthzPolicy, + protos.google.cloud.networksecurity.v1.IGetAuthzPolicyRequest|undefined, {}|undefined ]>; - updateServerTlsPolicy( - request: protos.google.cloud.networksecurity.v1.IUpdateServerTlsPolicyRequest, + getAuthzPolicy( + request: protos.google.cloud.networksecurity.v1.IGetAuthzPolicyRequest, options: CallOptions, callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, + protos.google.cloud.networksecurity.v1.IAuthzPolicy, + protos.google.cloud.networksecurity.v1.IGetAuthzPolicyRequest|null|undefined, {}|null|undefined>): void; - updateServerTlsPolicy( - request: protos.google.cloud.networksecurity.v1.IUpdateServerTlsPolicyRequest, + getAuthzPolicy( + request: protos.google.cloud.networksecurity.v1.IGetAuthzPolicyRequest, callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, + protos.google.cloud.networksecurity.v1.IAuthzPolicy, + protos.google.cloud.networksecurity.v1.IGetAuthzPolicyRequest|null|undefined, {}|null|undefined>): void; - updateServerTlsPolicy( - request?: protos.google.cloud.networksecurity.v1.IUpdateServerTlsPolicyRequest, + getAuthzPolicy( + request?: protos.google.cloud.networksecurity.v1.IGetAuthzPolicyRequest, optionsOrCallback?: CallOptions|Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, + protos.google.cloud.networksecurity.v1.IAuthzPolicy, + protos.google.cloud.networksecurity.v1.IGetAuthzPolicyRequest|null|undefined, {}|null|undefined>, callback?: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, + protos.google.cloud.networksecurity.v1.IAuthzPolicy, + protos.google.cloud.networksecurity.v1.IGetAuthzPolicyRequest|null|undefined, {}|null|undefined>): Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined + protos.google.cloud.networksecurity.v1.IAuthzPolicy, + protos.google.cloud.networksecurity.v1.IGetAuthzPolicyRequest|undefined, {}|undefined ]>|void { request = request || {}; let options: CallOptions; @@ -1273,54 +1514,51 @@ export class NetworkSecurityClient { options.otherArgs.headers[ 'x-goog-request-params' ] = this._gaxModule.routingHeader.fromParams({ - 'server_tls_policy.name': request.serverTlsPolicy!.name ?? '', + 'name': request.name ?? '', }); this.initialize().catch(err => {throw err}); + this._log.info('getAuthzPolicy request %j', request); const wrappedCallback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, rawResponse, _) => { - this._log.info('updateServerTlsPolicy response %j', rawResponse); - callback!(error, response, rawResponse, _); // We verified callback above. + protos.google.cloud.networksecurity.v1.IAuthzPolicy, + protos.google.cloud.networksecurity.v1.IGetAuthzPolicyRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getAuthzPolicy response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. } : undefined; - this._log.info('updateServerTlsPolicy request %j', request); - return this.innerApiCalls.updateServerTlsPolicy(request, options, wrappedCallback) - ?.then(([response, rawResponse, _]: [ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]) => { - this._log.info('updateServerTlsPolicy response %j', rawResponse); - return [response, rawResponse, _]; - }); - } -/** - * Check the status of the long running operation returned by `updateServerTlsPolicy()`. - * @param {String} name - * The operation name that will be passed. - * @returns {Promise} - The promise which resolves to an object. - * The decoded operation object has result and metadata field to get information from. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } - * for more details and examples. - * @example include:samples/generated/v1/network_security.update_server_tls_policy.js - * region_tag:networksecurity_v1_generated_NetworkSecurity_UpdateServerTlsPolicy_async - */ - async checkUpdateServerTlsPolicyProgress(name: string): Promise>{ - this._log.info('updateServerTlsPolicy long-running'); - const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.updateServerTlsPolicy, this._gaxModule.createDefaultBackoffSettings()); - return decodeOperation as LROperation; + return this.innerApiCalls.getAuthzPolicy(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.cloud.networksecurity.v1.IAuthzPolicy, + protos.google.cloud.networksecurity.v1.IGetAuthzPolicyRequest|undefined, + {}|undefined + ]) => { + this._log.info('getAuthzPolicy response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); } + /** - * Deletes a single ServerTlsPolicy. + * Creates a new AuthorizationPolicy in a given project and location. * * @param {Object} request * The request object that will be sent. - * @param {string} request.name - * Required. A name of the ServerTlsPolicy to delete. Must be in - * the format `projects/* /locations/{location}/serverTlsPolicies/*`. + * @param {string} request.parent + * Required. The parent resource of the AuthorizationPolicy. Must be in the + * format `projects/{project}/locations/{location}`. + * @param {string} request.authorizationPolicyId + * Required. Short name of the AuthorizationPolicy resource to be created. + * This value should be 1-63 characters long, containing only + * letters, numbers, hyphens, and underscores, and should not start + * with a number. E.g. "authz_policy". + * @param {google.cloud.networksecurity.v1.AuthorizationPolicy} request.authorizationPolicy + * Required. AuthorizationPolicy resource to be created. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. @@ -1329,41 +1567,41 @@ export class NetworkSecurityClient { * you can `await` for. * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } * for more details and examples. - * @example include:samples/generated/v1/network_security.delete_server_tls_policy.js - * region_tag:networksecurity_v1_generated_NetworkSecurity_DeleteServerTlsPolicy_async + * @example include:samples/generated/v1/network_security.create_authorization_policy.js + * region_tag:networksecurity_v1_generated_NetworkSecurity_CreateAuthorizationPolicy_async */ - deleteServerTlsPolicy( - request?: protos.google.cloud.networksecurity.v1.IDeleteServerTlsPolicyRequest, + createAuthorizationPolicy( + request?: protos.google.cloud.networksecurity.v1.ICreateAuthorizationPolicyRequest, options?: CallOptions): Promise<[ - LROperation, + LROperation, protos.google.longrunning.IOperation|undefined, {}|undefined ]>; - deleteServerTlsPolicy( - request: protos.google.cloud.networksecurity.v1.IDeleteServerTlsPolicyRequest, + createAuthorizationPolicy( + request: protos.google.cloud.networksecurity.v1.ICreateAuthorizationPolicyRequest, options: CallOptions, callback: Callback< - LROperation, + LROperation, protos.google.longrunning.IOperation|null|undefined, {}|null|undefined>): void; - deleteServerTlsPolicy( - request: protos.google.cloud.networksecurity.v1.IDeleteServerTlsPolicyRequest, + createAuthorizationPolicy( + request: protos.google.cloud.networksecurity.v1.ICreateAuthorizationPolicyRequest, callback: Callback< - LROperation, + LROperation, protos.google.longrunning.IOperation|null|undefined, {}|null|undefined>): void; - deleteServerTlsPolicy( - request?: protos.google.cloud.networksecurity.v1.IDeleteServerTlsPolicyRequest, + createAuthorizationPolicy( + request?: protos.google.cloud.networksecurity.v1.ICreateAuthorizationPolicyRequest, optionsOrCallback?: CallOptions|Callback< - LROperation, + LROperation, protos.google.longrunning.IOperation|null|undefined, {}|null|undefined>, callback?: Callback< - LROperation, + LROperation, protos.google.longrunning.IOperation|null|undefined, {}|null|undefined>): Promise<[ - LROperation, + LROperation, protos.google.longrunning.IOperation|undefined, {}|undefined ]>|void { request = request || {}; @@ -1381,60 +1619,59 @@ export class NetworkSecurityClient { options.otherArgs.headers[ 'x-goog-request-params' ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', + 'parent': request.parent ?? '', }); this.initialize().catch(err => {throw err}); const wrappedCallback: Callback< - LROperation, + LROperation, protos.google.longrunning.IOperation|null|undefined, {}|null|undefined>|undefined = callback ? (error, response, rawResponse, _) => { - this._log.info('deleteServerTlsPolicy response %j', rawResponse); + this._log.info('createAuthorizationPolicy response %j', rawResponse); callback!(error, response, rawResponse, _); // We verified callback above. } : undefined; - this._log.info('deleteServerTlsPolicy request %j', request); - return this.innerApiCalls.deleteServerTlsPolicy(request, options, wrappedCallback) + this._log.info('createAuthorizationPolicy request %j', request); + return this.innerApiCalls.createAuthorizationPolicy(request, options, wrappedCallback) ?.then(([response, rawResponse, _]: [ - LROperation, + LROperation, protos.google.longrunning.IOperation|undefined, {}|undefined ]) => { - this._log.info('deleteServerTlsPolicy response %j', rawResponse); + this._log.info('createAuthorizationPolicy response %j', rawResponse); return [response, rawResponse, _]; }); } /** - * Check the status of the long running operation returned by `deleteServerTlsPolicy()`. + * Check the status of the long running operation returned by `createAuthorizationPolicy()`. * @param {String} name * The operation name that will be passed. * @returns {Promise} - The promise which resolves to an object. * The decoded operation object has result and metadata field to get information from. * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } * for more details and examples. - * @example include:samples/generated/v1/network_security.delete_server_tls_policy.js - * region_tag:networksecurity_v1_generated_NetworkSecurity_DeleteServerTlsPolicy_async + * @example include:samples/generated/v1/network_security.create_authorization_policy.js + * region_tag:networksecurity_v1_generated_NetworkSecurity_CreateAuthorizationPolicy_async */ - async checkDeleteServerTlsPolicyProgress(name: string): Promise>{ - this._log.info('deleteServerTlsPolicy long-running'); + async checkCreateAuthorizationPolicyProgress(name: string): Promise>{ + this._log.info('createAuthorizationPolicy long-running'); const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.deleteServerTlsPolicy, this._gaxModule.createDefaultBackoffSettings()); - return decodeOperation as LROperation; + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.createAuthorizationPolicy, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; } /** - * Creates a new ClientTlsPolicy in a given project and location. + * Updates the parameters of a single AuthorizationPolicy. * * @param {Object} request * The request object that will be sent. - * @param {string} request.parent - * Required. The parent resource of the ClientTlsPolicy. Must be in - * the format `projects/* /locations/{location}`. - * @param {string} request.clientTlsPolicyId - * Required. Short name of the ClientTlsPolicy resource to be created. This value should - * be 1-63 characters long, containing only letters, numbers, hyphens, and - * underscores, and should not start with a number. E.g. "client_mtls_policy". - * @param {google.cloud.networksecurity.v1.ClientTlsPolicy} request.clientTlsPolicy - * Required. ClientTlsPolicy resource to be created. + * @param {google.protobuf.FieldMask} [request.updateMask] + * Optional. Field mask is used to specify the fields to be overwritten in the + * AuthorizationPolicy resource by the update. + * The fields specified in the update_mask are relative to the resource, not + * the full request. A field will be overwritten if it is in the mask. If the + * user does not provide a mask then all fields will be overwritten. + * @param {google.cloud.networksecurity.v1.AuthorizationPolicy} request.authorizationPolicy + * Required. Updated AuthorizationPolicy resource. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. @@ -1443,41 +1680,41 @@ export class NetworkSecurityClient { * you can `await` for. * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } * for more details and examples. - * @example include:samples/generated/v1/network_security.create_client_tls_policy.js - * region_tag:networksecurity_v1_generated_NetworkSecurity_CreateClientTlsPolicy_async + * @example include:samples/generated/v1/network_security.update_authorization_policy.js + * region_tag:networksecurity_v1_generated_NetworkSecurity_UpdateAuthorizationPolicy_async */ - createClientTlsPolicy( - request?: protos.google.cloud.networksecurity.v1.ICreateClientTlsPolicyRequest, + updateAuthorizationPolicy( + request?: protos.google.cloud.networksecurity.v1.IUpdateAuthorizationPolicyRequest, options?: CallOptions): Promise<[ - LROperation, + LROperation, protos.google.longrunning.IOperation|undefined, {}|undefined ]>; - createClientTlsPolicy( - request: protos.google.cloud.networksecurity.v1.ICreateClientTlsPolicyRequest, + updateAuthorizationPolicy( + request: protos.google.cloud.networksecurity.v1.IUpdateAuthorizationPolicyRequest, options: CallOptions, callback: Callback< - LROperation, + LROperation, protos.google.longrunning.IOperation|null|undefined, {}|null|undefined>): void; - createClientTlsPolicy( - request: protos.google.cloud.networksecurity.v1.ICreateClientTlsPolicyRequest, + updateAuthorizationPolicy( + request: protos.google.cloud.networksecurity.v1.IUpdateAuthorizationPolicyRequest, callback: Callback< - LROperation, + LROperation, protos.google.longrunning.IOperation|null|undefined, {}|null|undefined>): void; - createClientTlsPolicy( - request?: protos.google.cloud.networksecurity.v1.ICreateClientTlsPolicyRequest, + updateAuthorizationPolicy( + request?: protos.google.cloud.networksecurity.v1.IUpdateAuthorizationPolicyRequest, optionsOrCallback?: CallOptions|Callback< - LROperation, + LROperation, protos.google.longrunning.IOperation|null|undefined, {}|null|undefined>, callback?: Callback< - LROperation, + LROperation, protos.google.longrunning.IOperation|null|undefined, {}|null|undefined>): Promise<[ - LROperation, + LROperation, protos.google.longrunning.IOperation|undefined, {}|undefined ]>|void { request = request || {}; @@ -1495,60 +1732,54 @@ export class NetworkSecurityClient { options.otherArgs.headers[ 'x-goog-request-params' ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', + 'authorization_policy.name': request.authorizationPolicy!.name ?? '', }); this.initialize().catch(err => {throw err}); const wrappedCallback: Callback< - LROperation, + LROperation, protos.google.longrunning.IOperation|null|undefined, {}|null|undefined>|undefined = callback ? (error, response, rawResponse, _) => { - this._log.info('createClientTlsPolicy response %j', rawResponse); + this._log.info('updateAuthorizationPolicy response %j', rawResponse); callback!(error, response, rawResponse, _); // We verified callback above. } : undefined; - this._log.info('createClientTlsPolicy request %j', request); - return this.innerApiCalls.createClientTlsPolicy(request, options, wrappedCallback) + this._log.info('updateAuthorizationPolicy request %j', request); + return this.innerApiCalls.updateAuthorizationPolicy(request, options, wrappedCallback) ?.then(([response, rawResponse, _]: [ - LROperation, + LROperation, protos.google.longrunning.IOperation|undefined, {}|undefined ]) => { - this._log.info('createClientTlsPolicy response %j', rawResponse); + this._log.info('updateAuthorizationPolicy response %j', rawResponse); return [response, rawResponse, _]; }); } /** - * Check the status of the long running operation returned by `createClientTlsPolicy()`. + * Check the status of the long running operation returned by `updateAuthorizationPolicy()`. * @param {String} name * The operation name that will be passed. * @returns {Promise} - The promise which resolves to an object. * The decoded operation object has result and metadata field to get information from. * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } * for more details and examples. - * @example include:samples/generated/v1/network_security.create_client_tls_policy.js - * region_tag:networksecurity_v1_generated_NetworkSecurity_CreateClientTlsPolicy_async + * @example include:samples/generated/v1/network_security.update_authorization_policy.js + * region_tag:networksecurity_v1_generated_NetworkSecurity_UpdateAuthorizationPolicy_async */ - async checkCreateClientTlsPolicyProgress(name: string): Promise>{ - this._log.info('createClientTlsPolicy long-running'); + async checkUpdateAuthorizationPolicyProgress(name: string): Promise>{ + this._log.info('updateAuthorizationPolicy long-running'); const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.createClientTlsPolicy, this._gaxModule.createDefaultBackoffSettings()); - return decodeOperation as LROperation; + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.updateAuthorizationPolicy, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; } /** - * Updates the parameters of a single ClientTlsPolicy. + * Deletes a single AuthorizationPolicy. * * @param {Object} request * The request object that will be sent. - * @param {google.protobuf.FieldMask} [request.updateMask] - * Optional. Field mask is used to specify the fields to be overwritten in the - * ClientTlsPolicy resource by the update. The fields - * specified in the update_mask are relative to the resource, not - * the full request. A field will be overwritten if it is in the - * mask. If the user does not provide a mask then all fields will be - * overwritten. - * @param {google.cloud.networksecurity.v1.ClientTlsPolicy} request.clientTlsPolicy - * Required. Updated ClientTlsPolicy resource. + * @param {string} request.name + * Required. A name of the AuthorizationPolicy to delete. Must be in the + * format `projects/{project}/locations/{location}/authorizationPolicies/*`. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. @@ -1557,41 +1788,41 @@ export class NetworkSecurityClient { * you can `await` for. * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } * for more details and examples. - * @example include:samples/generated/v1/network_security.update_client_tls_policy.js - * region_tag:networksecurity_v1_generated_NetworkSecurity_UpdateClientTlsPolicy_async + * @example include:samples/generated/v1/network_security.delete_authorization_policy.js + * region_tag:networksecurity_v1_generated_NetworkSecurity_DeleteAuthorizationPolicy_async */ - updateClientTlsPolicy( - request?: protos.google.cloud.networksecurity.v1.IUpdateClientTlsPolicyRequest, + deleteAuthorizationPolicy( + request?: protos.google.cloud.networksecurity.v1.IDeleteAuthorizationPolicyRequest, options?: CallOptions): Promise<[ - LROperation, + LROperation, protos.google.longrunning.IOperation|undefined, {}|undefined ]>; - updateClientTlsPolicy( - request: protos.google.cloud.networksecurity.v1.IUpdateClientTlsPolicyRequest, + deleteAuthorizationPolicy( + request: protos.google.cloud.networksecurity.v1.IDeleteAuthorizationPolicyRequest, options: CallOptions, callback: Callback< - LROperation, + LROperation, protos.google.longrunning.IOperation|null|undefined, {}|null|undefined>): void; - updateClientTlsPolicy( - request: protos.google.cloud.networksecurity.v1.IUpdateClientTlsPolicyRequest, + deleteAuthorizationPolicy( + request: protos.google.cloud.networksecurity.v1.IDeleteAuthorizationPolicyRequest, callback: Callback< - LROperation, + LROperation, protos.google.longrunning.IOperation|null|undefined, {}|null|undefined>): void; - updateClientTlsPolicy( - request?: protos.google.cloud.networksecurity.v1.IUpdateClientTlsPolicyRequest, + deleteAuthorizationPolicy( + request?: protos.google.cloud.networksecurity.v1.IDeleteAuthorizationPolicyRequest, optionsOrCallback?: CallOptions|Callback< - LROperation, + LROperation, protos.google.longrunning.IOperation|null|undefined, {}|null|undefined>, callback?: Callback< - LROperation, + LROperation, protos.google.longrunning.IOperation|null|undefined, {}|null|undefined>): Promise<[ - LROperation, + LROperation, protos.google.longrunning.IOperation|undefined, {}|undefined ]>|void { request = request || {}; @@ -1609,54 +1840,61 @@ export class NetworkSecurityClient { options.otherArgs.headers[ 'x-goog-request-params' ] = this._gaxModule.routingHeader.fromParams({ - 'client_tls_policy.name': request.clientTlsPolicy!.name ?? '', + 'name': request.name ?? '', }); this.initialize().catch(err => {throw err}); const wrappedCallback: Callback< - LROperation, + LROperation, protos.google.longrunning.IOperation|null|undefined, {}|null|undefined>|undefined = callback ? (error, response, rawResponse, _) => { - this._log.info('updateClientTlsPolicy response %j', rawResponse); + this._log.info('deleteAuthorizationPolicy response %j', rawResponse); callback!(error, response, rawResponse, _); // We verified callback above. } : undefined; - this._log.info('updateClientTlsPolicy request %j', request); - return this.innerApiCalls.updateClientTlsPolicy(request, options, wrappedCallback) + this._log.info('deleteAuthorizationPolicy request %j', request); + return this.innerApiCalls.deleteAuthorizationPolicy(request, options, wrappedCallback) ?.then(([response, rawResponse, _]: [ - LROperation, + LROperation, protos.google.longrunning.IOperation|undefined, {}|undefined ]) => { - this._log.info('updateClientTlsPolicy response %j', rawResponse); + this._log.info('deleteAuthorizationPolicy response %j', rawResponse); return [response, rawResponse, _]; }); } /** - * Check the status of the long running operation returned by `updateClientTlsPolicy()`. + * Check the status of the long running operation returned by `deleteAuthorizationPolicy()`. * @param {String} name * The operation name that will be passed. * @returns {Promise} - The promise which resolves to an object. * The decoded operation object has result and metadata field to get information from. * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } * for more details and examples. - * @example include:samples/generated/v1/network_security.update_client_tls_policy.js - * region_tag:networksecurity_v1_generated_NetworkSecurity_UpdateClientTlsPolicy_async + * @example include:samples/generated/v1/network_security.delete_authorization_policy.js + * region_tag:networksecurity_v1_generated_NetworkSecurity_DeleteAuthorizationPolicy_async */ - async checkUpdateClientTlsPolicyProgress(name: string): Promise>{ - this._log.info('updateClientTlsPolicy long-running'); + async checkDeleteAuthorizationPolicyProgress(name: string): Promise>{ + this._log.info('deleteAuthorizationPolicy long-running'); const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.updateClientTlsPolicy, this._gaxModule.createDefaultBackoffSettings()); - return decodeOperation as LROperation; + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.deleteAuthorizationPolicy, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; } /** - * Deletes a single ClientTlsPolicy. + * Creates a new BackendAuthenticationConfig in a given project and location. * * @param {Object} request * The request object that will be sent. - * @param {string} request.name - * Required. A name of the ClientTlsPolicy to delete. Must be in - * the format `projects/* /locations/{location}/clientTlsPolicies/*`. + * @param {string} request.parent + * Required. The parent resource of the BackendAuthenticationConfig. Must be + * in the format `projects/* /locations/{location}`. + * @param {string} request.backendAuthenticationConfigId + * Required. Short name of the BackendAuthenticationConfig resource to be + * created. This value should be 1-63 characters long, containing only + * letters, numbers, hyphens, and underscores, and should not start with a + * number. E.g. "backend-auth-config". + * @param {google.cloud.networksecurity.v1.BackendAuthenticationConfig} request.backendAuthenticationConfig + * Required. BackendAuthenticationConfig resource to be created. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. @@ -1665,41 +1903,41 @@ export class NetworkSecurityClient { * you can `await` for. * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } * for more details and examples. - * @example include:samples/generated/v1/network_security.delete_client_tls_policy.js - * region_tag:networksecurity_v1_generated_NetworkSecurity_DeleteClientTlsPolicy_async + * @example include:samples/generated/v1/network_security.create_backend_authentication_config.js + * region_tag:networksecurity_v1_generated_NetworkSecurity_CreateBackendAuthenticationConfig_async */ - deleteClientTlsPolicy( - request?: protos.google.cloud.networksecurity.v1.IDeleteClientTlsPolicyRequest, + createBackendAuthenticationConfig( + request?: protos.google.cloud.networksecurity.v1.ICreateBackendAuthenticationConfigRequest, options?: CallOptions): Promise<[ - LROperation, + LROperation, protos.google.longrunning.IOperation|undefined, {}|undefined ]>; - deleteClientTlsPolicy( - request: protos.google.cloud.networksecurity.v1.IDeleteClientTlsPolicyRequest, + createBackendAuthenticationConfig( + request: protos.google.cloud.networksecurity.v1.ICreateBackendAuthenticationConfigRequest, options: CallOptions, callback: Callback< - LROperation, + LROperation, protos.google.longrunning.IOperation|null|undefined, {}|null|undefined>): void; - deleteClientTlsPolicy( - request: protos.google.cloud.networksecurity.v1.IDeleteClientTlsPolicyRequest, + createBackendAuthenticationConfig( + request: protos.google.cloud.networksecurity.v1.ICreateBackendAuthenticationConfigRequest, callback: Callback< - LROperation, + LROperation, protos.google.longrunning.IOperation|null|undefined, {}|null|undefined>): void; - deleteClientTlsPolicy( - request?: protos.google.cloud.networksecurity.v1.IDeleteClientTlsPolicyRequest, + createBackendAuthenticationConfig( + request?: protos.google.cloud.networksecurity.v1.ICreateBackendAuthenticationConfigRequest, optionsOrCallback?: CallOptions|Callback< - LROperation, + LROperation, protos.google.longrunning.IOperation|null|undefined, {}|null|undefined>, callback?: Callback< - LROperation, + LROperation, protos.google.longrunning.IOperation|null|undefined, {}|null|undefined>): Promise<[ - LROperation, + LROperation, protos.google.longrunning.IOperation|undefined, {}|undefined ]>|void { request = request || {}; @@ -1717,109 +1955,105 @@ export class NetworkSecurityClient { options.otherArgs.headers[ 'x-goog-request-params' ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', + 'parent': request.parent ?? '', }); this.initialize().catch(err => {throw err}); const wrappedCallback: Callback< - LROperation, + LROperation, protos.google.longrunning.IOperation|null|undefined, {}|null|undefined>|undefined = callback ? (error, response, rawResponse, _) => { - this._log.info('deleteClientTlsPolicy response %j', rawResponse); + this._log.info('createBackendAuthenticationConfig response %j', rawResponse); callback!(error, response, rawResponse, _); // We verified callback above. } : undefined; - this._log.info('deleteClientTlsPolicy request %j', request); - return this.innerApiCalls.deleteClientTlsPolicy(request, options, wrappedCallback) + this._log.info('createBackendAuthenticationConfig request %j', request); + return this.innerApiCalls.createBackendAuthenticationConfig(request, options, wrappedCallback) ?.then(([response, rawResponse, _]: [ - LROperation, + LROperation, protos.google.longrunning.IOperation|undefined, {}|undefined ]) => { - this._log.info('deleteClientTlsPolicy response %j', rawResponse); + this._log.info('createBackendAuthenticationConfig response %j', rawResponse); return [response, rawResponse, _]; }); } /** - * Check the status of the long running operation returned by `deleteClientTlsPolicy()`. + * Check the status of the long running operation returned by `createBackendAuthenticationConfig()`. * @param {String} name * The operation name that will be passed. * @returns {Promise} - The promise which resolves to an object. * The decoded operation object has result and metadata field to get information from. * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } * for more details and examples. - * @example include:samples/generated/v1/network_security.delete_client_tls_policy.js - * region_tag:networksecurity_v1_generated_NetworkSecurity_DeleteClientTlsPolicy_async + * @example include:samples/generated/v1/network_security.create_backend_authentication_config.js + * region_tag:networksecurity_v1_generated_NetworkSecurity_CreateBackendAuthenticationConfig_async */ - async checkDeleteClientTlsPolicyProgress(name: string): Promise>{ - this._log.info('deleteClientTlsPolicy long-running'); + async checkCreateBackendAuthenticationConfigProgress(name: string): Promise>{ + this._log.info('createBackendAuthenticationConfig long-running'); const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.deleteClientTlsPolicy, this._gaxModule.createDefaultBackoffSettings()); - return decodeOperation as LROperation; + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.createBackendAuthenticationConfig, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; } - /** - * Lists AuthorizationPolicies in a given project and location. +/** + * Updates the parameters of a single BackendAuthenticationConfig to + * BackendAuthenticationConfig. * * @param {Object} request * The request object that will be sent. - * @param {string} request.parent - * Required. The project and location from which the AuthorizationPolicies - * should be listed, specified in the format - * `projects/{project}/locations/{location}`. - * @param {number} request.pageSize - * Maximum number of AuthorizationPolicies to return per call. - * @param {string} request.pageToken - * The value returned by the last - * `ListAuthorizationPoliciesResponse` Indicates that this is a - * continuation of a prior `ListAuthorizationPolicies` call, and - * that the system should return the next page of data. + * @param {google.protobuf.FieldMask} [request.updateMask] + * Optional. Field mask is used to specify the fields to be overwritten in the + * BackendAuthenticationConfig resource by the update. The fields + * specified in the update_mask are relative to the resource, not + * the full request. A field will be overwritten if it is in the + * mask. If the user does not provide a mask then all fields will be + * overwritten. + * @param {google.cloud.networksecurity.v1.BackendAuthenticationConfig} request.backendAuthenticationConfig + * Required. Updated BackendAuthenticationConfig resource. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is Array of {@link protos.google.cloud.networksecurity.v1.AuthorizationPolicy|AuthorizationPolicy}. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed and will merge results from all the pages into this array. - * Note that it can affect your quota. - * We recommend using `listAuthorizationPoliciesAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } * for more details and examples. + * @example include:samples/generated/v1/network_security.update_backend_authentication_config.js + * region_tag:networksecurity_v1_generated_NetworkSecurity_UpdateBackendAuthenticationConfig_async */ - listAuthorizationPolicies( - request?: protos.google.cloud.networksecurity.v1.IListAuthorizationPoliciesRequest, + updateBackendAuthenticationConfig( + request?: protos.google.cloud.networksecurity.v1.IUpdateBackendAuthenticationConfigRequest, options?: CallOptions): Promise<[ - protos.google.cloud.networksecurity.v1.IAuthorizationPolicy[], - protos.google.cloud.networksecurity.v1.IListAuthorizationPoliciesRequest|null, - protos.google.cloud.networksecurity.v1.IListAuthorizationPoliciesResponse + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined ]>; - listAuthorizationPolicies( - request: protos.google.cloud.networksecurity.v1.IListAuthorizationPoliciesRequest, + updateBackendAuthenticationConfig( + request: protos.google.cloud.networksecurity.v1.IUpdateBackendAuthenticationConfigRequest, options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.networksecurity.v1.IListAuthorizationPoliciesRequest, - protos.google.cloud.networksecurity.v1.IListAuthorizationPoliciesResponse|null|undefined, - protos.google.cloud.networksecurity.v1.IAuthorizationPolicy>): void; - listAuthorizationPolicies( - request: protos.google.cloud.networksecurity.v1.IListAuthorizationPoliciesRequest, - callback: PaginationCallback< - protos.google.cloud.networksecurity.v1.IListAuthorizationPoliciesRequest, - protos.google.cloud.networksecurity.v1.IListAuthorizationPoliciesResponse|null|undefined, - protos.google.cloud.networksecurity.v1.IAuthorizationPolicy>): void; - listAuthorizationPolicies( - request?: protos.google.cloud.networksecurity.v1.IListAuthorizationPoliciesRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.cloud.networksecurity.v1.IListAuthorizationPoliciesRequest, - protos.google.cloud.networksecurity.v1.IListAuthorizationPoliciesResponse|null|undefined, - protos.google.cloud.networksecurity.v1.IAuthorizationPolicy>, - callback?: PaginationCallback< - protos.google.cloud.networksecurity.v1.IListAuthorizationPoliciesRequest, - protos.google.cloud.networksecurity.v1.IListAuthorizationPoliciesResponse|null|undefined, - protos.google.cloud.networksecurity.v1.IAuthorizationPolicy>): + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + updateBackendAuthenticationConfig( + request: protos.google.cloud.networksecurity.v1.IUpdateBackendAuthenticationConfigRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + updateBackendAuthenticationConfig( + request?: protos.google.cloud.networksecurity.v1.IUpdateBackendAuthenticationConfigRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): Promise<[ - protos.google.cloud.networksecurity.v1.IAuthorizationPolicy[], - protos.google.cloud.networksecurity.v1.IListAuthorizationPoliciesRequest|null, - protos.google.cloud.networksecurity.v1.IListAuthorizationPoliciesResponse + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined ]>|void { request = request || {}; let options: CallOptions; @@ -1836,115 +2070,228 @@ export class NetworkSecurityClient { options.otherArgs.headers[ 'x-goog-request-params' ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', + 'backend_authentication_config.name': request.backendAuthenticationConfig!.name ?? '', }); this.initialize().catch(err => {throw err}); - const wrappedCallback: PaginationCallback< - protos.google.cloud.networksecurity.v1.IListAuthorizationPoliciesRequest, - protos.google.cloud.networksecurity.v1.IListAuthorizationPoliciesResponse|null|undefined, - protos.google.cloud.networksecurity.v1.IAuthorizationPolicy>|undefined = callback - ? (error, values, nextPageRequest, rawResponse) => { - this._log.info('listAuthorizationPolicies values %j', values); - callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + const wrappedCallback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('updateBackendAuthenticationConfig response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. } : undefined; - this._log.info('listAuthorizationPolicies request %j', request); - return this.innerApiCalls - .listAuthorizationPolicies(request, options, wrappedCallback) - ?.then(([response, input, output]: [ - protos.google.cloud.networksecurity.v1.IAuthorizationPolicy[], - protos.google.cloud.networksecurity.v1.IListAuthorizationPoliciesRequest|null, - protos.google.cloud.networksecurity.v1.IListAuthorizationPoliciesResponse - ]) => { - this._log.info('listAuthorizationPolicies values %j', response); - return [response, input, output]; - }); + this._log.info('updateBackendAuthenticationConfig request %j', request); + return this.innerApiCalls.updateBackendAuthenticationConfig(request, options, wrappedCallback) + ?.then(([response, rawResponse, _]: [ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]) => { + this._log.info('updateBackendAuthenticationConfig response %j', rawResponse); + return [response, rawResponse, _]; + }); } - /** - * Equivalent to `listAuthorizationPolicies`, but returns a NodeJS Stream object. + * Check the status of the long running operation returned by `updateBackendAuthenticationConfig()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/network_security.update_backend_authentication_config.js + * region_tag:networksecurity_v1_generated_NetworkSecurity_UpdateBackendAuthenticationConfig_async + */ + async checkUpdateBackendAuthenticationConfigProgress(name: string): Promise>{ + this._log.info('updateBackendAuthenticationConfig long-running'); + const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.updateBackendAuthenticationConfig, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Deletes a single BackendAuthenticationConfig to + * BackendAuthenticationConfig. + * * @param {Object} request * The request object that will be sent. - * @param {string} request.parent - * Required. The project and location from which the AuthorizationPolicies - * should be listed, specified in the format - * `projects/{project}/locations/{location}`. - * @param {number} request.pageSize - * Maximum number of AuthorizationPolicies to return per call. - * @param {string} request.pageToken - * The value returned by the last - * `ListAuthorizationPoliciesResponse` Indicates that this is a - * continuation of a prior `ListAuthorizationPolicies` call, and - * that the system should return the next page of data. + * @param {string} request.name + * Required. A name of the BackendAuthenticationConfig to delete. Must be in + * the format + * `projects/* /locations/{location}/backendAuthenticationConfigs/*`. + * @param {string} [request.etag] + * Optional. Etag of the resource. + * If this is provided, it must match the server's etag. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Stream} - * An object stream which emits an object representing {@link protos.google.cloud.networksecurity.v1.AuthorizationPolicy|AuthorizationPolicy} on 'data' event. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed. Note that it can affect your quota. - * We recommend using `listAuthorizationPoliciesAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } * for more details and examples. + * @example include:samples/generated/v1/network_security.delete_backend_authentication_config.js + * region_tag:networksecurity_v1_generated_NetworkSecurity_DeleteBackendAuthenticationConfig_async */ - listAuthorizationPoliciesStream( - request?: protos.google.cloud.networksecurity.v1.IListAuthorizationPoliciesRequest, + deleteBackendAuthenticationConfig( + request?: protos.google.cloud.networksecurity.v1.IDeleteBackendAuthenticationConfigRequest, options?: CallOptions): - Transform{ + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + deleteBackendAuthenticationConfig( + request: protos.google.cloud.networksecurity.v1.IDeleteBackendAuthenticationConfigRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + deleteBackendAuthenticationConfig( + request: protos.google.cloud.networksecurity.v1.IDeleteBackendAuthenticationConfigRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + deleteBackendAuthenticationConfig( + request?: protos.google.cloud.networksecurity.v1.IDeleteBackendAuthenticationConfigRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers[ 'x-goog-request-params' ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', + 'name': request.name ?? '', }); - const defaultCallSettings = this._defaults['listAuthorizationPolicies']; - const callSettings = defaultCallSettings.merge(options); this.initialize().catch(err => {throw err}); - this._log.info('listAuthorizationPolicies stream %j', request); - return this.descriptors.page.listAuthorizationPolicies.createStream( - this.innerApiCalls.listAuthorizationPolicies as GaxCall, - request, - callSettings - ); + const wrappedCallback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('deleteBackendAuthenticationConfig response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('deleteBackendAuthenticationConfig request %j', request); + return this.innerApiCalls.deleteBackendAuthenticationConfig(request, options, wrappedCallback) + ?.then(([response, rawResponse, _]: [ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]) => { + this._log.info('deleteBackendAuthenticationConfig response %j', rawResponse); + return [response, rawResponse, _]; + }); } - /** - * Equivalent to `listAuthorizationPolicies`, but returns an iterable object. + * Check the status of the long running operation returned by `deleteBackendAuthenticationConfig()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/network_security.delete_backend_authentication_config.js + * region_tag:networksecurity_v1_generated_NetworkSecurity_DeleteBackendAuthenticationConfig_async + */ + async checkDeleteBackendAuthenticationConfigProgress(name: string): Promise>{ + this._log.info('deleteBackendAuthenticationConfig long-running'); + const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.deleteBackendAuthenticationConfig, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Creates a new ServerTlsPolicy in a given project and location. * - * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. * @param {Object} request * The request object that will be sent. * @param {string} request.parent - * Required. The project and location from which the AuthorizationPolicies - * should be listed, specified in the format - * `projects/{project}/locations/{location}`. - * @param {number} request.pageSize - * Maximum number of AuthorizationPolicies to return per call. - * @param {string} request.pageToken - * The value returned by the last - * `ListAuthorizationPoliciesResponse` Indicates that this is a - * continuation of a prior `ListAuthorizationPolicies` call, and - * that the system should return the next page of data. + * Required. The parent resource of the ServerTlsPolicy. Must be in + * the format `projects/* /locations/{location}`. + * @param {string} request.serverTlsPolicyId + * Required. Short name of the ServerTlsPolicy resource to be created. This + * value should be 1-63 characters long, containing only letters, numbers, + * hyphens, and underscores, and should not start with a number. E.g. + * "server_mtls_policy". + * @param {google.cloud.networksecurity.v1.ServerTlsPolicy} request.serverTlsPolicy + * Required. ServerTlsPolicy resource to be created. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Object} - * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. - * When you iterate the returned iterable, each element will be an object representing - * {@link protos.google.cloud.networksecurity.v1.AuthorizationPolicy|AuthorizationPolicy}. The API will be called under the hood as needed, once per the page, - * so you can stop the iteration when you don't need more results. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } * for more details and examples. - * @example include:samples/generated/v1/network_security.list_authorization_policies.js - * region_tag:networksecurity_v1_generated_NetworkSecurity_ListAuthorizationPolicies_async + * @example include:samples/generated/v1/network_security.create_server_tls_policy.js + * region_tag:networksecurity_v1_generated_NetworkSecurity_CreateServerTlsPolicy_async */ - listAuthorizationPoliciesAsync( - request?: protos.google.cloud.networksecurity.v1.IListAuthorizationPoliciesRequest, + createServerTlsPolicy( + request?: protos.google.cloud.networksecurity.v1.ICreateServerTlsPolicyRequest, options?: CallOptions): - AsyncIterable{ + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + createServerTlsPolicy( + request: protos.google.cloud.networksecurity.v1.ICreateServerTlsPolicyRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + createServerTlsPolicy( + request: protos.google.cloud.networksecurity.v1.ICreateServerTlsPolicyRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + createServerTlsPolicy( + request?: protos.google.cloud.networksecurity.v1.ICreateServerTlsPolicyRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; @@ -1953,78 +2300,102 @@ export class NetworkSecurityClient { ] = this._gaxModule.routingHeader.fromParams({ 'parent': request.parent ?? '', }); - const defaultCallSettings = this._defaults['listAuthorizationPolicies']; - const callSettings = defaultCallSettings.merge(options); this.initialize().catch(err => {throw err}); - this._log.info('listAuthorizationPolicies iterate %j', request); - return this.descriptors.page.listAuthorizationPolicies.asyncIterate( - this.innerApiCalls['listAuthorizationPolicies'] as GaxCall, - request as {}, - callSettings - ) as AsyncIterable; + const wrappedCallback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('createServerTlsPolicy response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('createServerTlsPolicy request %j', request); + return this.innerApiCalls.createServerTlsPolicy(request, options, wrappedCallback) + ?.then(([response, rawResponse, _]: [ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]) => { + this._log.info('createServerTlsPolicy response %j', rawResponse); + return [response, rawResponse, _]; + }); } - /** - * Lists ServerTlsPolicies in a given project and location. +/** + * Check the status of the long running operation returned by `createServerTlsPolicy()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/network_security.create_server_tls_policy.js + * region_tag:networksecurity_v1_generated_NetworkSecurity_CreateServerTlsPolicy_async + */ + async checkCreateServerTlsPolicyProgress(name: string): Promise>{ + this._log.info('createServerTlsPolicy long-running'); + const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.createServerTlsPolicy, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Updates the parameters of a single ServerTlsPolicy. * * @param {Object} request * The request object that will be sent. - * @param {string} request.parent - * Required. The project and location from which the ServerTlsPolicies should - * be listed, specified in the format `projects/* /locations/{location}`. - * @param {number} request.pageSize - * Maximum number of ServerTlsPolicies to return per call. - * @param {string} request.pageToken - * The value returned by the last `ListServerTlsPoliciesResponse` - * Indicates that this is a continuation of a prior - * `ListServerTlsPolicies` call, and that the system - * should return the next page of data. + * @param {google.protobuf.FieldMask} [request.updateMask] + * Optional. Field mask is used to specify the fields to be overwritten in the + * ServerTlsPolicy resource by the update. The fields + * specified in the update_mask are relative to the resource, not + * the full request. A field will be overwritten if it is in the + * mask. If the user does not provide a mask then all fields will be + * overwritten. + * @param {google.cloud.networksecurity.v1.ServerTlsPolicy} request.serverTlsPolicy + * Required. Updated ServerTlsPolicy resource. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is Array of {@link protos.google.cloud.networksecurity.v1.ServerTlsPolicy|ServerTlsPolicy}. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed and will merge results from all the pages into this array. - * Note that it can affect your quota. - * We recommend using `listServerTlsPoliciesAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } * for more details and examples. + * @example include:samples/generated/v1/network_security.update_server_tls_policy.js + * region_tag:networksecurity_v1_generated_NetworkSecurity_UpdateServerTlsPolicy_async */ - listServerTlsPolicies( - request?: protos.google.cloud.networksecurity.v1.IListServerTlsPoliciesRequest, + updateServerTlsPolicy( + request?: protos.google.cloud.networksecurity.v1.IUpdateServerTlsPolicyRequest, options?: CallOptions): Promise<[ - protos.google.cloud.networksecurity.v1.IServerTlsPolicy[], - protos.google.cloud.networksecurity.v1.IListServerTlsPoliciesRequest|null, - protos.google.cloud.networksecurity.v1.IListServerTlsPoliciesResponse + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined ]>; - listServerTlsPolicies( - request: protos.google.cloud.networksecurity.v1.IListServerTlsPoliciesRequest, + updateServerTlsPolicy( + request: protos.google.cloud.networksecurity.v1.IUpdateServerTlsPolicyRequest, options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.networksecurity.v1.IListServerTlsPoliciesRequest, - protos.google.cloud.networksecurity.v1.IListServerTlsPoliciesResponse|null|undefined, - protos.google.cloud.networksecurity.v1.IServerTlsPolicy>): void; - listServerTlsPolicies( - request: protos.google.cloud.networksecurity.v1.IListServerTlsPoliciesRequest, - callback: PaginationCallback< - protos.google.cloud.networksecurity.v1.IListServerTlsPoliciesRequest, - protos.google.cloud.networksecurity.v1.IListServerTlsPoliciesResponse|null|undefined, - protos.google.cloud.networksecurity.v1.IServerTlsPolicy>): void; - listServerTlsPolicies( - request?: protos.google.cloud.networksecurity.v1.IListServerTlsPoliciesRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.cloud.networksecurity.v1.IListServerTlsPoliciesRequest, - protos.google.cloud.networksecurity.v1.IListServerTlsPoliciesResponse|null|undefined, - protos.google.cloud.networksecurity.v1.IServerTlsPolicy>, - callback?: PaginationCallback< - protos.google.cloud.networksecurity.v1.IListServerTlsPoliciesRequest, - protos.google.cloud.networksecurity.v1.IListServerTlsPoliciesResponse|null|undefined, - protos.google.cloud.networksecurity.v1.IServerTlsPolicy>): + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + updateServerTlsPolicy( + request: protos.google.cloud.networksecurity.v1.IUpdateServerTlsPolicyRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + updateServerTlsPolicy( + request?: protos.google.cloud.networksecurity.v1.IUpdateServerTlsPolicyRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): Promise<[ - protos.google.cloud.networksecurity.v1.IServerTlsPolicy[], - protos.google.cloud.networksecurity.v1.IListServerTlsPoliciesRequest|null, - protos.google.cloud.networksecurity.v1.IListServerTlsPoliciesResponse + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined ]>|void { request = request || {}; let options: CallOptions; @@ -2041,193 +2412,98 @@ export class NetworkSecurityClient { options.otherArgs.headers[ 'x-goog-request-params' ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', + 'server_tls_policy.name': request.serverTlsPolicy!.name ?? '', }); this.initialize().catch(err => {throw err}); - const wrappedCallback: PaginationCallback< - protos.google.cloud.networksecurity.v1.IListServerTlsPoliciesRequest, - protos.google.cloud.networksecurity.v1.IListServerTlsPoliciesResponse|null|undefined, - protos.google.cloud.networksecurity.v1.IServerTlsPolicy>|undefined = callback - ? (error, values, nextPageRequest, rawResponse) => { - this._log.info('listServerTlsPolicies values %j', values); - callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + const wrappedCallback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('updateServerTlsPolicy response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. } : undefined; - this._log.info('listServerTlsPolicies request %j', request); - return this.innerApiCalls - .listServerTlsPolicies(request, options, wrappedCallback) - ?.then(([response, input, output]: [ - protos.google.cloud.networksecurity.v1.IServerTlsPolicy[], - protos.google.cloud.networksecurity.v1.IListServerTlsPoliciesRequest|null, - protos.google.cloud.networksecurity.v1.IListServerTlsPoliciesResponse - ]) => { - this._log.info('listServerTlsPolicies values %j', response); - return [response, input, output]; - }); + this._log.info('updateServerTlsPolicy request %j', request); + return this.innerApiCalls.updateServerTlsPolicy(request, options, wrappedCallback) + ?.then(([response, rawResponse, _]: [ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]) => { + this._log.info('updateServerTlsPolicy response %j', rawResponse); + return [response, rawResponse, _]; + }); } - /** - * Equivalent to `listServerTlsPolicies`, but returns a NodeJS Stream object. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The project and location from which the ServerTlsPolicies should - * be listed, specified in the format `projects/* /locations/{location}`. - * @param {number} request.pageSize - * Maximum number of ServerTlsPolicies to return per call. - * @param {string} request.pageToken - * The value returned by the last `ListServerTlsPoliciesResponse` - * Indicates that this is a continuation of a prior - * `ListServerTlsPolicies` call, and that the system - * should return the next page of data. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Stream} - * An object stream which emits an object representing {@link protos.google.cloud.networksecurity.v1.ServerTlsPolicy|ServerTlsPolicy} on 'data' event. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed. Note that it can affect your quota. - * We recommend using `listServerTlsPoliciesAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * Check the status of the long running operation returned by `updateServerTlsPolicy()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } * for more details and examples. + * @example include:samples/generated/v1/network_security.update_server_tls_policy.js + * region_tag:networksecurity_v1_generated_NetworkSecurity_UpdateServerTlsPolicy_async */ - listServerTlsPoliciesStream( - request?: protos.google.cloud.networksecurity.v1.IListServerTlsPoliciesRequest, - options?: CallOptions): - Transform{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - const defaultCallSettings = this._defaults['listServerTlsPolicies']; - const callSettings = defaultCallSettings.merge(options); - this.initialize().catch(err => {throw err}); - this._log.info('listServerTlsPolicies stream %j', request); - return this.descriptors.page.listServerTlsPolicies.createStream( - this.innerApiCalls.listServerTlsPolicies as GaxCall, - request, - callSettings - ); + async checkUpdateServerTlsPolicyProgress(name: string): Promise>{ + this._log.info('updateServerTlsPolicy long-running'); + const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.updateServerTlsPolicy, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; } - /** - * Equivalent to `listServerTlsPolicies`, but returns an iterable object. - * - * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The project and location from which the ServerTlsPolicies should - * be listed, specified in the format `projects/* /locations/{location}`. - * @param {number} request.pageSize - * Maximum number of ServerTlsPolicies to return per call. - * @param {string} request.pageToken - * The value returned by the last `ListServerTlsPoliciesResponse` - * Indicates that this is a continuation of a prior - * `ListServerTlsPolicies` call, and that the system - * should return the next page of data. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Object} - * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. - * When you iterate the returned iterable, each element will be an object representing - * {@link protos.google.cloud.networksecurity.v1.ServerTlsPolicy|ServerTlsPolicy}. The API will be called under the hood as needed, once per the page, - * so you can stop the iteration when you don't need more results. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } - * for more details and examples. - * @example include:samples/generated/v1/network_security.list_server_tls_policies.js - * region_tag:networksecurity_v1_generated_NetworkSecurity_ListServerTlsPolicies_async - */ - listServerTlsPoliciesAsync( - request?: protos.google.cloud.networksecurity.v1.IListServerTlsPoliciesRequest, - options?: CallOptions): - AsyncIterable{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - const defaultCallSettings = this._defaults['listServerTlsPolicies']; - const callSettings = defaultCallSettings.merge(options); - this.initialize().catch(err => {throw err}); - this._log.info('listServerTlsPolicies iterate %j', request); - return this.descriptors.page.listServerTlsPolicies.asyncIterate( - this.innerApiCalls['listServerTlsPolicies'] as GaxCall, - request as {}, - callSettings - ) as AsyncIterable; - } - /** - * Lists ClientTlsPolicies in a given project and location. + * Deletes a single ServerTlsPolicy. * * @param {Object} request * The request object that will be sent. - * @param {string} request.parent - * Required. The project and location from which the ClientTlsPolicies should - * be listed, specified in the format `projects/* /locations/{location}`. - * @param {number} request.pageSize - * Maximum number of ClientTlsPolicies to return per call. - * @param {string} request.pageToken - * The value returned by the last `ListClientTlsPoliciesResponse` - * Indicates that this is a continuation of a prior - * `ListClientTlsPolicies` call, and that the system - * should return the next page of data. + * @param {string} request.name + * Required. A name of the ServerTlsPolicy to delete. Must be in + * the format `projects/* /locations/{location}/serverTlsPolicies/*`. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is Array of {@link protos.google.cloud.networksecurity.v1.ClientTlsPolicy|ClientTlsPolicy}. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed and will merge results from all the pages into this array. - * Note that it can affect your quota. - * We recommend using `listClientTlsPoliciesAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } * for more details and examples. + * @example include:samples/generated/v1/network_security.delete_server_tls_policy.js + * region_tag:networksecurity_v1_generated_NetworkSecurity_DeleteServerTlsPolicy_async */ - listClientTlsPolicies( - request?: protos.google.cloud.networksecurity.v1.IListClientTlsPoliciesRequest, + deleteServerTlsPolicy( + request?: protos.google.cloud.networksecurity.v1.IDeleteServerTlsPolicyRequest, options?: CallOptions): Promise<[ - protos.google.cloud.networksecurity.v1.IClientTlsPolicy[], - protos.google.cloud.networksecurity.v1.IListClientTlsPoliciesRequest|null, - protos.google.cloud.networksecurity.v1.IListClientTlsPoliciesResponse + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined ]>; - listClientTlsPolicies( - request: protos.google.cloud.networksecurity.v1.IListClientTlsPoliciesRequest, + deleteServerTlsPolicy( + request: protos.google.cloud.networksecurity.v1.IDeleteServerTlsPolicyRequest, options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.networksecurity.v1.IListClientTlsPoliciesRequest, - protos.google.cloud.networksecurity.v1.IListClientTlsPoliciesResponse|null|undefined, - protos.google.cloud.networksecurity.v1.IClientTlsPolicy>): void; - listClientTlsPolicies( - request: protos.google.cloud.networksecurity.v1.IListClientTlsPoliciesRequest, - callback: PaginationCallback< - protos.google.cloud.networksecurity.v1.IListClientTlsPoliciesRequest, - protos.google.cloud.networksecurity.v1.IListClientTlsPoliciesResponse|null|undefined, - protos.google.cloud.networksecurity.v1.IClientTlsPolicy>): void; - listClientTlsPolicies( - request?: protos.google.cloud.networksecurity.v1.IListClientTlsPoliciesRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.cloud.networksecurity.v1.IListClientTlsPoliciesRequest, - protos.google.cloud.networksecurity.v1.IListClientTlsPoliciesResponse|null|undefined, - protos.google.cloud.networksecurity.v1.IClientTlsPolicy>, - callback?: PaginationCallback< - protos.google.cloud.networksecurity.v1.IListClientTlsPoliciesRequest, - protos.google.cloud.networksecurity.v1.IListClientTlsPoliciesResponse|null|undefined, - protos.google.cloud.networksecurity.v1.IClientTlsPolicy>): + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + deleteServerTlsPolicy( + request: protos.google.cloud.networksecurity.v1.IDeleteServerTlsPolicyRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + deleteServerTlsPolicy( + request?: protos.google.cloud.networksecurity.v1.IDeleteServerTlsPolicyRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): Promise<[ - protos.google.cloud.networksecurity.v1.IClientTlsPolicy[], - protos.google.cloud.networksecurity.v1.IListClientTlsPoliciesRequest|null, - protos.google.cloud.networksecurity.v1.IListClientTlsPoliciesResponse + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined ]>|void { request = request || {}; let options: CallOptions; @@ -2244,61 +2520,115 @@ export class NetworkSecurityClient { options.otherArgs.headers[ 'x-goog-request-params' ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', + 'name': request.name ?? '', }); this.initialize().catch(err => {throw err}); - const wrappedCallback: PaginationCallback< - protos.google.cloud.networksecurity.v1.IListClientTlsPoliciesRequest, - protos.google.cloud.networksecurity.v1.IListClientTlsPoliciesResponse|null|undefined, - protos.google.cloud.networksecurity.v1.IClientTlsPolicy>|undefined = callback - ? (error, values, nextPageRequest, rawResponse) => { - this._log.info('listClientTlsPolicies values %j', values); - callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + const wrappedCallback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('deleteServerTlsPolicy response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. } : undefined; - this._log.info('listClientTlsPolicies request %j', request); - return this.innerApiCalls - .listClientTlsPolicies(request, options, wrappedCallback) - ?.then(([response, input, output]: [ - protos.google.cloud.networksecurity.v1.IClientTlsPolicy[], - protos.google.cloud.networksecurity.v1.IListClientTlsPoliciesRequest|null, - protos.google.cloud.networksecurity.v1.IListClientTlsPoliciesResponse - ]) => { - this._log.info('listClientTlsPolicies values %j', response); - return [response, input, output]; - }); + this._log.info('deleteServerTlsPolicy request %j', request); + return this.innerApiCalls.deleteServerTlsPolicy(request, options, wrappedCallback) + ?.then(([response, rawResponse, _]: [ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]) => { + this._log.info('deleteServerTlsPolicy response %j', rawResponse); + return [response, rawResponse, _]; + }); } - /** - * Equivalent to `listClientTlsPolicies`, but returns a NodeJS Stream object. + * Check the status of the long running operation returned by `deleteServerTlsPolicy()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/network_security.delete_server_tls_policy.js + * region_tag:networksecurity_v1_generated_NetworkSecurity_DeleteServerTlsPolicy_async + */ + async checkDeleteServerTlsPolicyProgress(name: string): Promise>{ + this._log.info('deleteServerTlsPolicy long-running'); + const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.deleteServerTlsPolicy, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Creates a new ClientTlsPolicy in a given project and location. + * * @param {Object} request * The request object that will be sent. * @param {string} request.parent - * Required. The project and location from which the ClientTlsPolicies should - * be listed, specified in the format `projects/* /locations/{location}`. - * @param {number} request.pageSize - * Maximum number of ClientTlsPolicies to return per call. - * @param {string} request.pageToken - * The value returned by the last `ListClientTlsPoliciesResponse` - * Indicates that this is a continuation of a prior - * `ListClientTlsPolicies` call, and that the system - * should return the next page of data. + * Required. The parent resource of the ClientTlsPolicy. Must be in + * the format `projects/* /locations/{location}`. + * @param {string} request.clientTlsPolicyId + * Required. Short name of the ClientTlsPolicy resource to be created. This + * value should be 1-63 characters long, containing only letters, numbers, + * hyphens, and underscores, and should not start with a number. E.g. + * "client_mtls_policy". + * @param {google.cloud.networksecurity.v1.ClientTlsPolicy} request.clientTlsPolicy + * Required. ClientTlsPolicy resource to be created. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Stream} - * An object stream which emits an object representing {@link protos.google.cloud.networksecurity.v1.ClientTlsPolicy|ClientTlsPolicy} on 'data' event. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed. Note that it can affect your quota. - * We recommend using `listClientTlsPoliciesAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } * for more details and examples. + * @example include:samples/generated/v1/network_security.create_client_tls_policy.js + * region_tag:networksecurity_v1_generated_NetworkSecurity_CreateClientTlsPolicy_async */ - listClientTlsPoliciesStream( - request?: protos.google.cloud.networksecurity.v1.IListClientTlsPoliciesRequest, + createClientTlsPolicy( + request?: protos.google.cloud.networksecurity.v1.ICreateClientTlsPolicyRequest, options?: CallOptions): - Transform{ + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + createClientTlsPolicy( + request: protos.google.cloud.networksecurity.v1.ICreateClientTlsPolicyRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + createClientTlsPolicy( + request: protos.google.cloud.networksecurity.v1.ICreateClientTlsPolicyRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + createClientTlsPolicy( + request?: protos.google.cloud.networksecurity.v1.ICreateClientTlsPolicyRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; @@ -2307,608 +2637,5104 @@ export class NetworkSecurityClient { ] = this._gaxModule.routingHeader.fromParams({ 'parent': request.parent ?? '', }); - const defaultCallSettings = this._defaults['listClientTlsPolicies']; - const callSettings = defaultCallSettings.merge(options); this.initialize().catch(err => {throw err}); - this._log.info('listClientTlsPolicies stream %j', request); - return this.descriptors.page.listClientTlsPolicies.createStream( - this.innerApiCalls.listClientTlsPolicies as GaxCall, - request, - callSettings - ); + const wrappedCallback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('createClientTlsPolicy response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('createClientTlsPolicy request %j', request); + return this.innerApiCalls.createClientTlsPolicy(request, options, wrappedCallback) + ?.then(([response, rawResponse, _]: [ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]) => { + this._log.info('createClientTlsPolicy response %j', rawResponse); + return [response, rawResponse, _]; + }); } - /** - * Equivalent to `listClientTlsPolicies`, but returns an iterable object. + * Check the status of the long running operation returned by `createClientTlsPolicy()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/network_security.create_client_tls_policy.js + * region_tag:networksecurity_v1_generated_NetworkSecurity_CreateClientTlsPolicy_async + */ + async checkCreateClientTlsPolicyProgress(name: string): Promise>{ + this._log.info('createClientTlsPolicy long-running'); + const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.createClientTlsPolicy, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Updates the parameters of a single ClientTlsPolicy. * - * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. * @param {Object} request * The request object that will be sent. - * @param {string} request.parent - * Required. The project and location from which the ClientTlsPolicies should - * be listed, specified in the format `projects/* /locations/{location}`. - * @param {number} request.pageSize - * Maximum number of ClientTlsPolicies to return per call. - * @param {string} request.pageToken - * The value returned by the last `ListClientTlsPoliciesResponse` - * Indicates that this is a continuation of a prior - * `ListClientTlsPolicies` call, and that the system - * should return the next page of data. + * @param {google.protobuf.FieldMask} [request.updateMask] + * Optional. Field mask is used to specify the fields to be overwritten in the + * ClientTlsPolicy resource by the update. The fields + * specified in the update_mask are relative to the resource, not + * the full request. A field will be overwritten if it is in the + * mask. If the user does not provide a mask then all fields will be + * overwritten. + * @param {google.cloud.networksecurity.v1.ClientTlsPolicy} request.clientTlsPolicy + * Required. Updated ClientTlsPolicy resource. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Object} - * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. - * When you iterate the returned iterable, each element will be an object representing - * {@link protos.google.cloud.networksecurity.v1.ClientTlsPolicy|ClientTlsPolicy}. The API will be called under the hood as needed, once per the page, - * so you can stop the iteration when you don't need more results. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } * for more details and examples. - * @example include:samples/generated/v1/network_security.list_client_tls_policies.js - * region_tag:networksecurity_v1_generated_NetworkSecurity_ListClientTlsPolicies_async + * @example include:samples/generated/v1/network_security.update_client_tls_policy.js + * region_tag:networksecurity_v1_generated_NetworkSecurity_UpdateClientTlsPolicy_async */ - listClientTlsPoliciesAsync( - request?: protos.google.cloud.networksecurity.v1.IListClientTlsPoliciesRequest, + updateClientTlsPolicy( + request?: protos.google.cloud.networksecurity.v1.IUpdateClientTlsPolicyRequest, options?: CallOptions): - AsyncIterable{ + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + updateClientTlsPolicy( + request: protos.google.cloud.networksecurity.v1.IUpdateClientTlsPolicyRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + updateClientTlsPolicy( + request: protos.google.cloud.networksecurity.v1.IUpdateClientTlsPolicyRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + updateClientTlsPolicy( + request?: protos.google.cloud.networksecurity.v1.IUpdateClientTlsPolicyRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers[ 'x-goog-request-params' ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', + 'client_tls_policy.name': request.clientTlsPolicy!.name ?? '', }); - const defaultCallSettings = this._defaults['listClientTlsPolicies']; - const callSettings = defaultCallSettings.merge(options); this.initialize().catch(err => {throw err}); - this._log.info('listClientTlsPolicies iterate %j', request); - return this.descriptors.page.listClientTlsPolicies.asyncIterate( - this.innerApiCalls['listClientTlsPolicies'] as GaxCall, - request as {}, - callSettings - ) as AsyncIterable; + const wrappedCallback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('updateClientTlsPolicy response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('updateClientTlsPolicy request %j', request); + return this.innerApiCalls.updateClientTlsPolicy(request, options, wrappedCallback) + ?.then(([response, rawResponse, _]: [ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]) => { + this._log.info('updateClientTlsPolicy response %j', rawResponse); + return [response, rawResponse, _]; + }); } /** - * Gets the access control policy for a resource. Returns an empty policy - * if the resource exists and does not have a policy set. + * Check the status of the long running operation returned by `updateClientTlsPolicy()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/network_security.update_client_tls_policy.js + * region_tag:networksecurity_v1_generated_NetworkSecurity_UpdateClientTlsPolicy_async + */ + async checkUpdateClientTlsPolicyProgress(name: string): Promise>{ + this._log.info('updateClientTlsPolicy long-running'); + const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.updateClientTlsPolicy, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Deletes a single ClientTlsPolicy. * * @param {Object} request * The request object that will be sent. - * @param {string} request.resource - * REQUIRED: The resource for which the policy is being requested. - * See the operation documentation for the appropriate value for this field. - * @param {Object} [request.options] - * OPTIONAL: A `GetPolicyOptions` object for specifying options to - * `GetIamPolicy`. This field is only used by Cloud IAM. - * - * This object should have the same structure as {@link google.iam.v1.GetPolicyOptions | GetPolicyOptions}. - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.CallOptions} for the details. - * @param {function(?Error, ?Object)} [callback] - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is an object representing {@link google.iam.v1.Policy | Policy}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.iam.v1.Policy | Policy}. - * The promise has a method named "cancel" which cancels the ongoing API call. + * @param {string} request.name + * Required. A name of the ClientTlsPolicy to delete. Must be in + * the format `projects/* /locations/{location}/clientTlsPolicies/*`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/network_security.delete_client_tls_policy.js + * region_tag:networksecurity_v1_generated_NetworkSecurity_DeleteClientTlsPolicy_async */ - getIamPolicy( - request: IamProtos.google.iam.v1.GetIamPolicyRequest, - options?: - | gax.CallOptions - | Callback< - IamProtos.google.iam.v1.Policy, - IamProtos.google.iam.v1.GetIamPolicyRequest | null | undefined, - {} | null | undefined - >, - callback?: Callback< - IamProtos.google.iam.v1.Policy, - IamProtos.google.iam.v1.GetIamPolicyRequest | null | undefined, - {} | null | undefined - > - ):Promise<[IamProtos.google.iam.v1.Policy]> { - return this.iamClient.getIamPolicy(request, options, callback); + deleteClientTlsPolicy( + request?: protos.google.cloud.networksecurity.v1.IDeleteClientTlsPolicyRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + deleteClientTlsPolicy( + request: protos.google.cloud.networksecurity.v1.IDeleteClientTlsPolicyRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + deleteClientTlsPolicy( + request: protos.google.cloud.networksecurity.v1.IDeleteClientTlsPolicyRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + deleteClientTlsPolicy( + request?: protos.google.cloud.networksecurity.v1.IDeleteClientTlsPolicyRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize().catch(err => {throw err}); + const wrappedCallback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('deleteClientTlsPolicy response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('deleteClientTlsPolicy request %j', request); + return this.innerApiCalls.deleteClientTlsPolicy(request, options, wrappedCallback) + ?.then(([response, rawResponse, _]: [ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]) => { + this._log.info('deleteClientTlsPolicy response %j', rawResponse); + return [response, rawResponse, _]; + }); } - /** - * Returns permissions that a caller has on the specified resource. If the - * resource does not exist, this will return an empty set of - * permissions, not a NOT_FOUND error. - * - * Note: This operation is designed to be used for building - * permission-aware UIs and command-line tools, not for authorization - * checking. This operation may "fail open" without warning. + * Check the status of the long running operation returned by `deleteClientTlsPolicy()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/network_security.delete_client_tls_policy.js + * region_tag:networksecurity_v1_generated_NetworkSecurity_DeleteClientTlsPolicy_async + */ + async checkDeleteClientTlsPolicyProgress(name: string): Promise>{ + this._log.info('deleteClientTlsPolicy long-running'); + const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.deleteClientTlsPolicy, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Creates a new GatewaySecurityPolicy in a given project and location. * * @param {Object} request * The request object that will be sent. - * @param {string} request.resource - * REQUIRED: The resource for which the policy detail is being requested. - * See the operation documentation for the appropriate value for this field. - * @param {string[]} request.permissions - * The set of permissions to check for the `resource`. Permissions with - * wildcards (such as '*' or 'storage.*') are not allowed. For more - * information see {@link https://cloud.google.com/iam/docs/overview#permissions | IAM Overview }. - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.CallOptions} for the details. - * @param {function(?Error, ?Object)} [callback] - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is an object representing {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. + * @param {string} request.parent + * Required. The parent resource of the GatewaySecurityPolicy. Must be in the + * format `projects/{project}/locations/{location}`. + * @param {string} request.gatewaySecurityPolicyId + * Required. Short name of the GatewaySecurityPolicy resource to be created. + * This value should be 1-63 characters long, containing only + * letters, numbers, hyphens, and underscores, and should not start + * with a number. E.g. "gateway_security_policy1". + * @param {google.cloud.networksecurity.v1.GatewaySecurityPolicy} request.gatewaySecurityPolicy + * Required. GatewaySecurityPolicy resource to be created. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. - * The promise has a method named "cancel" which cancels the ongoing API call. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/network_security.create_gateway_security_policy.js + * region_tag:networksecurity_v1_generated_NetworkSecurity_CreateGatewaySecurityPolicy_async */ - setIamPolicy( - request: IamProtos.google.iam.v1.SetIamPolicyRequest, - options?: - | gax.CallOptions - | Callback< - IamProtos.google.iam.v1.Policy, - IamProtos.google.iam.v1.SetIamPolicyRequest | null | undefined, - {} | null | undefined - >, - callback?: Callback< - IamProtos.google.iam.v1.Policy, - IamProtos.google.iam.v1.SetIamPolicyRequest | null | undefined, - {} | null | undefined - > - ):Promise<[IamProtos.google.iam.v1.Policy]> { - return this.iamClient.setIamPolicy(request, options, callback); + createGatewaySecurityPolicy( + request?: protos.google.cloud.networksecurity.v1.ICreateGatewaySecurityPolicyRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + createGatewaySecurityPolicy( + request: protos.google.cloud.networksecurity.v1.ICreateGatewaySecurityPolicyRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + createGatewaySecurityPolicy( + request: protos.google.cloud.networksecurity.v1.ICreateGatewaySecurityPolicyRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + createGatewaySecurityPolicy( + request?: protos.google.cloud.networksecurity.v1.ICreateGatewaySecurityPolicyRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize().catch(err => {throw err}); + const wrappedCallback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('createGatewaySecurityPolicy response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('createGatewaySecurityPolicy request %j', request); + return this.innerApiCalls.createGatewaySecurityPolicy(request, options, wrappedCallback) + ?.then(([response, rawResponse, _]: [ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]) => { + this._log.info('createGatewaySecurityPolicy response %j', rawResponse); + return [response, rawResponse, _]; + }); } - /** - * Returns permissions that a caller has on the specified resource. If the - * resource does not exist, this will return an empty set of - * permissions, not a NOT_FOUND error. - * - * Note: This operation is designed to be used for building - * permission-aware UIs and command-line tools, not for authorization - * checking. This operation may "fail open" without warning. + * Check the status of the long running operation returned by `createGatewaySecurityPolicy()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/network_security.create_gateway_security_policy.js + * region_tag:networksecurity_v1_generated_NetworkSecurity_CreateGatewaySecurityPolicy_async + */ + async checkCreateGatewaySecurityPolicyProgress(name: string): Promise>{ + this._log.info('createGatewaySecurityPolicy long-running'); + const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.createGatewaySecurityPolicy, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Updates the parameters of a single GatewaySecurityPolicy. * * @param {Object} request * The request object that will be sent. - * @param {string} request.resource - * REQUIRED: The resource for which the policy detail is being requested. - * See the operation documentation for the appropriate value for this field. - * @param {string[]} request.permissions - * The set of permissions to check for the `resource`. Permissions with - * wildcards (such as '*' or 'storage.*') are not allowed. For more - * information see {@link https://cloud.google.com/iam/docs/overview#permissions | IAM Overview }. - * @param {Object} [options] - * Optional parameters. You can override the default settings for this call, e.g, timeout, - * retries, paginations, etc. See {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.CallOptions} for the details. - * @param {function(?Error, ?Object)} [callback] - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is an object representing {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. - * The promise has a method named "cancel" which cancels the ongoing API call. - * + * @param {google.protobuf.FieldMask} [request.updateMask] + * Optional. Field mask is used to specify the fields to be overwritten in the + * GatewaySecurityPolicy resource by the update. + * The fields specified in the update_mask are relative to the resource, not + * the full request. A field will be overwritten if it is in the mask. If the + * user does not provide a mask then all fields will be overwritten. + * @param {google.cloud.networksecurity.v1.GatewaySecurityPolicy} request.gatewaySecurityPolicy + * Required. Updated GatewaySecurityPolicy resource. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/network_security.update_gateway_security_policy.js + * region_tag:networksecurity_v1_generated_NetworkSecurity_UpdateGatewaySecurityPolicy_async + */ + updateGatewaySecurityPolicy( + request?: protos.google.cloud.networksecurity.v1.IUpdateGatewaySecurityPolicyRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + updateGatewaySecurityPolicy( + request: protos.google.cloud.networksecurity.v1.IUpdateGatewaySecurityPolicyRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + updateGatewaySecurityPolicy( + request: protos.google.cloud.networksecurity.v1.IUpdateGatewaySecurityPolicyRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + updateGatewaySecurityPolicy( + request?: protos.google.cloud.networksecurity.v1.IUpdateGatewaySecurityPolicyRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'gateway_security_policy.name': request.gatewaySecurityPolicy!.name ?? '', + }); + this.initialize().catch(err => {throw err}); + const wrappedCallback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('updateGatewaySecurityPolicy response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('updateGatewaySecurityPolicy request %j', request); + return this.innerApiCalls.updateGatewaySecurityPolicy(request, options, wrappedCallback) + ?.then(([response, rawResponse, _]: [ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]) => { + this._log.info('updateGatewaySecurityPolicy response %j', rawResponse); + return [response, rawResponse, _]; + }); + } +/** + * Check the status of the long running operation returned by `updateGatewaySecurityPolicy()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/network_security.update_gateway_security_policy.js + * region_tag:networksecurity_v1_generated_NetworkSecurity_UpdateGatewaySecurityPolicy_async + */ + async checkUpdateGatewaySecurityPolicyProgress(name: string): Promise>{ + this._log.info('updateGatewaySecurityPolicy long-running'); + const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.updateGatewaySecurityPolicy, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Deletes a single GatewaySecurityPolicy. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. A name of the GatewaySecurityPolicy to delete. Must be in the + * format `projects/{project}/locations/{location}/gatewaySecurityPolicies/*`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/network_security.delete_gateway_security_policy.js + * region_tag:networksecurity_v1_generated_NetworkSecurity_DeleteGatewaySecurityPolicy_async + */ + deleteGatewaySecurityPolicy( + request?: protos.google.cloud.networksecurity.v1.IDeleteGatewaySecurityPolicyRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + deleteGatewaySecurityPolicy( + request: protos.google.cloud.networksecurity.v1.IDeleteGatewaySecurityPolicyRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + deleteGatewaySecurityPolicy( + request: protos.google.cloud.networksecurity.v1.IDeleteGatewaySecurityPolicyRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + deleteGatewaySecurityPolicy( + request?: protos.google.cloud.networksecurity.v1.IDeleteGatewaySecurityPolicyRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize().catch(err => {throw err}); + const wrappedCallback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('deleteGatewaySecurityPolicy response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('deleteGatewaySecurityPolicy request %j', request); + return this.innerApiCalls.deleteGatewaySecurityPolicy(request, options, wrappedCallback) + ?.then(([response, rawResponse, _]: [ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]) => { + this._log.info('deleteGatewaySecurityPolicy response %j', rawResponse); + return [response, rawResponse, _]; + }); + } +/** + * Check the status of the long running operation returned by `deleteGatewaySecurityPolicy()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/network_security.delete_gateway_security_policy.js + * region_tag:networksecurity_v1_generated_NetworkSecurity_DeleteGatewaySecurityPolicy_async + */ + async checkDeleteGatewaySecurityPolicyProgress(name: string): Promise>{ + this._log.info('deleteGatewaySecurityPolicy long-running'); + const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.deleteGatewaySecurityPolicy, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Creates a new GatewaySecurityPolicy in a given project and location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent where this rule will be created. + * Format : + * projects/{project}/location/{location}/gatewaySecurityPolicies/* + * @param {google.cloud.networksecurity.v1.GatewaySecurityPolicyRule} request.gatewaySecurityPolicyRule + * Required. The rule to be created. + * @param {string} request.gatewaySecurityPolicyRuleId + * The ID to use for the rule, which will become the final component of + * the rule's resource name. + * This value should be 4-63 characters, and valid characters + * are /{@link protos.0-9|a-z}-/. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/network_security.create_gateway_security_policy_rule.js + * region_tag:networksecurity_v1_generated_NetworkSecurity_CreateGatewaySecurityPolicyRule_async + */ + createGatewaySecurityPolicyRule( + request?: protos.google.cloud.networksecurity.v1.ICreateGatewaySecurityPolicyRuleRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + createGatewaySecurityPolicyRule( + request: protos.google.cloud.networksecurity.v1.ICreateGatewaySecurityPolicyRuleRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + createGatewaySecurityPolicyRule( + request: protos.google.cloud.networksecurity.v1.ICreateGatewaySecurityPolicyRuleRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + createGatewaySecurityPolicyRule( + request?: protos.google.cloud.networksecurity.v1.ICreateGatewaySecurityPolicyRuleRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize().catch(err => {throw err}); + const wrappedCallback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('createGatewaySecurityPolicyRule response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('createGatewaySecurityPolicyRule request %j', request); + return this.innerApiCalls.createGatewaySecurityPolicyRule(request, options, wrappedCallback) + ?.then(([response, rawResponse, _]: [ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]) => { + this._log.info('createGatewaySecurityPolicyRule response %j', rawResponse); + return [response, rawResponse, _]; + }); + } +/** + * Check the status of the long running operation returned by `createGatewaySecurityPolicyRule()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/network_security.create_gateway_security_policy_rule.js + * region_tag:networksecurity_v1_generated_NetworkSecurity_CreateGatewaySecurityPolicyRule_async + */ + async checkCreateGatewaySecurityPolicyRuleProgress(name: string): Promise>{ + this._log.info('createGatewaySecurityPolicyRule long-running'); + const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.createGatewaySecurityPolicyRule, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Updates the parameters of a single GatewaySecurityPolicyRule. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.protobuf.FieldMask} [request.updateMask] + * Optional. Field mask is used to specify the fields to be overwritten in the + * GatewaySecurityPolicy resource by the update. + * The fields specified in the update_mask are relative to the resource, not + * the full request. A field will be overwritten if it is in the mask. If the + * user does not provide a mask then all fields will be overwritten. + * @param {google.cloud.networksecurity.v1.GatewaySecurityPolicyRule} request.gatewaySecurityPolicyRule + * Required. Updated GatewaySecurityPolicyRule resource. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/network_security.update_gateway_security_policy_rule.js + * region_tag:networksecurity_v1_generated_NetworkSecurity_UpdateGatewaySecurityPolicyRule_async + */ + updateGatewaySecurityPolicyRule( + request?: protos.google.cloud.networksecurity.v1.IUpdateGatewaySecurityPolicyRuleRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + updateGatewaySecurityPolicyRule( + request: protos.google.cloud.networksecurity.v1.IUpdateGatewaySecurityPolicyRuleRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + updateGatewaySecurityPolicyRule( + request: protos.google.cloud.networksecurity.v1.IUpdateGatewaySecurityPolicyRuleRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + updateGatewaySecurityPolicyRule( + request?: protos.google.cloud.networksecurity.v1.IUpdateGatewaySecurityPolicyRuleRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'gateway_security_policy_rule.name': request.gatewaySecurityPolicyRule!.name ?? '', + }); + this.initialize().catch(err => {throw err}); + const wrappedCallback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('updateGatewaySecurityPolicyRule response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('updateGatewaySecurityPolicyRule request %j', request); + return this.innerApiCalls.updateGatewaySecurityPolicyRule(request, options, wrappedCallback) + ?.then(([response, rawResponse, _]: [ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]) => { + this._log.info('updateGatewaySecurityPolicyRule response %j', rawResponse); + return [response, rawResponse, _]; + }); + } +/** + * Check the status of the long running operation returned by `updateGatewaySecurityPolicyRule()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/network_security.update_gateway_security_policy_rule.js + * region_tag:networksecurity_v1_generated_NetworkSecurity_UpdateGatewaySecurityPolicyRule_async + */ + async checkUpdateGatewaySecurityPolicyRuleProgress(name: string): Promise>{ + this._log.info('updateGatewaySecurityPolicyRule long-running'); + const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.updateGatewaySecurityPolicyRule, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Deletes a single GatewaySecurityPolicyRule. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. A name of the GatewaySecurityPolicyRule to delete. Must be in the + * format + * `projects/{project}/locations/{location}/gatewaySecurityPolicies/{gatewaySecurityPolicy}/rules/*`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/network_security.delete_gateway_security_policy_rule.js + * region_tag:networksecurity_v1_generated_NetworkSecurity_DeleteGatewaySecurityPolicyRule_async + */ + deleteGatewaySecurityPolicyRule( + request?: protos.google.cloud.networksecurity.v1.IDeleteGatewaySecurityPolicyRuleRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + deleteGatewaySecurityPolicyRule( + request: protos.google.cloud.networksecurity.v1.IDeleteGatewaySecurityPolicyRuleRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + deleteGatewaySecurityPolicyRule( + request: protos.google.cloud.networksecurity.v1.IDeleteGatewaySecurityPolicyRuleRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + deleteGatewaySecurityPolicyRule( + request?: protos.google.cloud.networksecurity.v1.IDeleteGatewaySecurityPolicyRuleRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize().catch(err => {throw err}); + const wrappedCallback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('deleteGatewaySecurityPolicyRule response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('deleteGatewaySecurityPolicyRule request %j', request); + return this.innerApiCalls.deleteGatewaySecurityPolicyRule(request, options, wrappedCallback) + ?.then(([response, rawResponse, _]: [ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]) => { + this._log.info('deleteGatewaySecurityPolicyRule response %j', rawResponse); + return [response, rawResponse, _]; + }); + } +/** + * Check the status of the long running operation returned by `deleteGatewaySecurityPolicyRule()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/network_security.delete_gateway_security_policy_rule.js + * region_tag:networksecurity_v1_generated_NetworkSecurity_DeleteGatewaySecurityPolicyRule_async + */ + async checkDeleteGatewaySecurityPolicyRuleProgress(name: string): Promise>{ + this._log.info('deleteGatewaySecurityPolicyRule long-running'); + const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.deleteGatewaySecurityPolicyRule, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Creates a new UrlList in a given project and location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent resource of the UrlList. Must be in + * the format `projects/* /locations/{location}`. + * @param {string} request.urlListId + * Required. Short name of the UrlList resource to be created. This value + * should be 1-63 characters long, containing only letters, numbers, hyphens, + * and underscores, and should not start with a number. E.g. "url_list". + * @param {google.cloud.networksecurity.v1.UrlList} request.urlList + * Required. UrlList resource to be created. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/network_security.create_url_list.js + * region_tag:networksecurity_v1_generated_NetworkSecurity_CreateUrlList_async + */ + createUrlList( + request?: protos.google.cloud.networksecurity.v1.ICreateUrlListRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + createUrlList( + request: protos.google.cloud.networksecurity.v1.ICreateUrlListRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + createUrlList( + request: protos.google.cloud.networksecurity.v1.ICreateUrlListRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + createUrlList( + request?: protos.google.cloud.networksecurity.v1.ICreateUrlListRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize().catch(err => {throw err}); + const wrappedCallback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('createUrlList response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('createUrlList request %j', request); + return this.innerApiCalls.createUrlList(request, options, wrappedCallback) + ?.then(([response, rawResponse, _]: [ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]) => { + this._log.info('createUrlList response %j', rawResponse); + return [response, rawResponse, _]; + }); + } +/** + * Check the status of the long running operation returned by `createUrlList()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/network_security.create_url_list.js + * region_tag:networksecurity_v1_generated_NetworkSecurity_CreateUrlList_async + */ + async checkCreateUrlListProgress(name: string): Promise>{ + this._log.info('createUrlList long-running'); + const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.createUrlList, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Updates the parameters of a single UrlList. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.protobuf.FieldMask} [request.updateMask] + * Optional. Field mask is used to specify the fields to be overwritten in the + * UrlList resource by the update. The fields + * specified in the update_mask are relative to the resource, not + * the full request. A field will be overwritten if it is in the + * mask. If the user does not provide a mask then all fields will be + * overwritten. + * @param {google.cloud.networksecurity.v1.UrlList} request.urlList + * Required. Updated UrlList resource. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/network_security.update_url_list.js + * region_tag:networksecurity_v1_generated_NetworkSecurity_UpdateUrlList_async + */ + updateUrlList( + request?: protos.google.cloud.networksecurity.v1.IUpdateUrlListRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + updateUrlList( + request: protos.google.cloud.networksecurity.v1.IUpdateUrlListRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + updateUrlList( + request: protos.google.cloud.networksecurity.v1.IUpdateUrlListRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + updateUrlList( + request?: protos.google.cloud.networksecurity.v1.IUpdateUrlListRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'url_list.name': request.urlList!.name ?? '', + }); + this.initialize().catch(err => {throw err}); + const wrappedCallback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('updateUrlList response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('updateUrlList request %j', request); + return this.innerApiCalls.updateUrlList(request, options, wrappedCallback) + ?.then(([response, rawResponse, _]: [ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]) => { + this._log.info('updateUrlList response %j', rawResponse); + return [response, rawResponse, _]; + }); + } +/** + * Check the status of the long running operation returned by `updateUrlList()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/network_security.update_url_list.js + * region_tag:networksecurity_v1_generated_NetworkSecurity_UpdateUrlList_async + */ + async checkUpdateUrlListProgress(name: string): Promise>{ + this._log.info('updateUrlList long-running'); + const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.updateUrlList, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Deletes a single UrlList. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. A name of the UrlList to delete. Must be in + * the format `projects/* /locations/{location}/urlLists/*`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/network_security.delete_url_list.js + * region_tag:networksecurity_v1_generated_NetworkSecurity_DeleteUrlList_async + */ + deleteUrlList( + request?: protos.google.cloud.networksecurity.v1.IDeleteUrlListRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + deleteUrlList( + request: protos.google.cloud.networksecurity.v1.IDeleteUrlListRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + deleteUrlList( + request: protos.google.cloud.networksecurity.v1.IDeleteUrlListRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + deleteUrlList( + request?: protos.google.cloud.networksecurity.v1.IDeleteUrlListRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize().catch(err => {throw err}); + const wrappedCallback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('deleteUrlList response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('deleteUrlList request %j', request); + return this.innerApiCalls.deleteUrlList(request, options, wrappedCallback) + ?.then(([response, rawResponse, _]: [ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]) => { + this._log.info('deleteUrlList response %j', rawResponse); + return [response, rawResponse, _]; + }); + } +/** + * Check the status of the long running operation returned by `deleteUrlList()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/network_security.delete_url_list.js + * region_tag:networksecurity_v1_generated_NetworkSecurity_DeleteUrlList_async + */ + async checkDeleteUrlListProgress(name: string): Promise>{ + this._log.info('deleteUrlList long-running'); + const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.deleteUrlList, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Creates a new TlsInspectionPolicy in a given project and location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent resource of the TlsInspectionPolicy. Must be in the + * format `projects/{project}/locations/{location}`. + * @param {string} request.tlsInspectionPolicyId + * Required. Short name of the TlsInspectionPolicy resource to be created. + * This value should be 1-63 characters long, containing only + * letters, numbers, hyphens, and underscores, and should not start + * with a number. E.g. "tls_inspection_policy1". + * @param {google.cloud.networksecurity.v1.TlsInspectionPolicy} request.tlsInspectionPolicy + * Required. TlsInspectionPolicy resource to be created. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/network_security.create_tls_inspection_policy.js + * region_tag:networksecurity_v1_generated_NetworkSecurity_CreateTlsInspectionPolicy_async + */ + createTlsInspectionPolicy( + request?: protos.google.cloud.networksecurity.v1.ICreateTlsInspectionPolicyRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + createTlsInspectionPolicy( + request: protos.google.cloud.networksecurity.v1.ICreateTlsInspectionPolicyRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + createTlsInspectionPolicy( + request: protos.google.cloud.networksecurity.v1.ICreateTlsInspectionPolicyRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + createTlsInspectionPolicy( + request?: protos.google.cloud.networksecurity.v1.ICreateTlsInspectionPolicyRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize().catch(err => {throw err}); + const wrappedCallback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('createTlsInspectionPolicy response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('createTlsInspectionPolicy request %j', request); + return this.innerApiCalls.createTlsInspectionPolicy(request, options, wrappedCallback) + ?.then(([response, rawResponse, _]: [ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]) => { + this._log.info('createTlsInspectionPolicy response %j', rawResponse); + return [response, rawResponse, _]; + }); + } +/** + * Check the status of the long running operation returned by `createTlsInspectionPolicy()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/network_security.create_tls_inspection_policy.js + * region_tag:networksecurity_v1_generated_NetworkSecurity_CreateTlsInspectionPolicy_async + */ + async checkCreateTlsInspectionPolicyProgress(name: string): Promise>{ + this._log.info('createTlsInspectionPolicy long-running'); + const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.createTlsInspectionPolicy, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Updates the parameters of a single TlsInspectionPolicy. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.protobuf.FieldMask} [request.updateMask] + * Optional. Field mask is used to specify the fields to be overwritten in the + * TlsInspectionPolicy resource by the update. + * The fields specified in the update_mask are relative to the resource, not + * the full request. A field will be overwritten if it is in the mask. If the + * user does not provide a mask then all fields will be overwritten. + * @param {google.cloud.networksecurity.v1.TlsInspectionPolicy} request.tlsInspectionPolicy + * Required. Updated TlsInspectionPolicy resource. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/network_security.update_tls_inspection_policy.js + * region_tag:networksecurity_v1_generated_NetworkSecurity_UpdateTlsInspectionPolicy_async + */ + updateTlsInspectionPolicy( + request?: protos.google.cloud.networksecurity.v1.IUpdateTlsInspectionPolicyRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + updateTlsInspectionPolicy( + request: protos.google.cloud.networksecurity.v1.IUpdateTlsInspectionPolicyRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + updateTlsInspectionPolicy( + request: protos.google.cloud.networksecurity.v1.IUpdateTlsInspectionPolicyRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + updateTlsInspectionPolicy( + request?: protos.google.cloud.networksecurity.v1.IUpdateTlsInspectionPolicyRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'tls_inspection_policy.name': request.tlsInspectionPolicy!.name ?? '', + }); + this.initialize().catch(err => {throw err}); + const wrappedCallback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('updateTlsInspectionPolicy response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('updateTlsInspectionPolicy request %j', request); + return this.innerApiCalls.updateTlsInspectionPolicy(request, options, wrappedCallback) + ?.then(([response, rawResponse, _]: [ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]) => { + this._log.info('updateTlsInspectionPolicy response %j', rawResponse); + return [response, rawResponse, _]; + }); + } +/** + * Check the status of the long running operation returned by `updateTlsInspectionPolicy()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/network_security.update_tls_inspection_policy.js + * region_tag:networksecurity_v1_generated_NetworkSecurity_UpdateTlsInspectionPolicy_async + */ + async checkUpdateTlsInspectionPolicyProgress(name: string): Promise>{ + this._log.info('updateTlsInspectionPolicy long-running'); + const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.updateTlsInspectionPolicy, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Deletes a single TlsInspectionPolicy. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. A name of the TlsInspectionPolicy to delete. Must be in the + * format + * `projects/{project}/locations/{location}/tlsInspectionPolicies/{tls_inspection_policy}`. + * @param {boolean} request.force + * If set to true, any rules for this TlsInspectionPolicy will also be + * deleted. (Otherwise, the request will only work if the TlsInspectionPolicy + * has no rules.) + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/network_security.delete_tls_inspection_policy.js + * region_tag:networksecurity_v1_generated_NetworkSecurity_DeleteTlsInspectionPolicy_async + */ + deleteTlsInspectionPolicy( + request?: protos.google.cloud.networksecurity.v1.IDeleteTlsInspectionPolicyRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + deleteTlsInspectionPolicy( + request: protos.google.cloud.networksecurity.v1.IDeleteTlsInspectionPolicyRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + deleteTlsInspectionPolicy( + request: protos.google.cloud.networksecurity.v1.IDeleteTlsInspectionPolicyRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + deleteTlsInspectionPolicy( + request?: protos.google.cloud.networksecurity.v1.IDeleteTlsInspectionPolicyRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize().catch(err => {throw err}); + const wrappedCallback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('deleteTlsInspectionPolicy response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('deleteTlsInspectionPolicy request %j', request); + return this.innerApiCalls.deleteTlsInspectionPolicy(request, options, wrappedCallback) + ?.then(([response, rawResponse, _]: [ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]) => { + this._log.info('deleteTlsInspectionPolicy response %j', rawResponse); + return [response, rawResponse, _]; + }); + } +/** + * Check the status of the long running operation returned by `deleteTlsInspectionPolicy()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/network_security.delete_tls_inspection_policy.js + * region_tag:networksecurity_v1_generated_NetworkSecurity_DeleteTlsInspectionPolicy_async + */ + async checkDeleteTlsInspectionPolicyProgress(name: string): Promise>{ + this._log.info('deleteTlsInspectionPolicy long-running'); + const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.deleteTlsInspectionPolicy, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Creates a new AuthzPolicy in a given project and location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent resource of the `AuthzPolicy` resource. Must be in + * the format `projects/{project}/locations/{location}`. + * @param {string} request.authzPolicyId + * Required. User-provided ID of the `AuthzPolicy` resource to be created. + * @param {google.cloud.networksecurity.v1.AuthzPolicy} request.authzPolicy + * Required. `AuthzPolicy` resource to be created. + * @param {string} [request.requestId] + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server can ignore + * the request if it has already been completed. The server guarantees + * that for at least 60 minutes since the first request. + * + * For example, consider a situation where you make an initial request and the + * request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, ignores the second request. This prevents + * clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/network_security.create_authz_policy.js + * region_tag:networksecurity_v1_generated_NetworkSecurity_CreateAuthzPolicy_async + */ + createAuthzPolicy( + request?: protos.google.cloud.networksecurity.v1.ICreateAuthzPolicyRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + createAuthzPolicy( + request: protos.google.cloud.networksecurity.v1.ICreateAuthzPolicyRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + createAuthzPolicy( + request: protos.google.cloud.networksecurity.v1.ICreateAuthzPolicyRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + createAuthzPolicy( + request?: protos.google.cloud.networksecurity.v1.ICreateAuthzPolicyRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize().catch(err => {throw err}); + const wrappedCallback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('createAuthzPolicy response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('createAuthzPolicy request %j', request); + return this.innerApiCalls.createAuthzPolicy(request, options, wrappedCallback) + ?.then(([response, rawResponse, _]: [ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]) => { + this._log.info('createAuthzPolicy response %j', rawResponse); + return [response, rawResponse, _]; + }); + } +/** + * Check the status of the long running operation returned by `createAuthzPolicy()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/network_security.create_authz_policy.js + * region_tag:networksecurity_v1_generated_NetworkSecurity_CreateAuthzPolicy_async + */ + async checkCreateAuthzPolicyProgress(name: string): Promise>{ + this._log.info('createAuthzPolicy long-running'); + const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.createAuthzPolicy, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Updates the parameters of a single AuthzPolicy. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.protobuf.FieldMask} request.updateMask + * Required. Used to specify the fields to be overwritten in the + * `AuthzPolicy` resource by the update. + * The fields specified in the `update_mask` are relative to the resource, not + * the full request. A field is overwritten if it is in the mask. If the + * user does not specify a mask, then all fields are overwritten. + * @param {google.cloud.networksecurity.v1.AuthzPolicy} request.authzPolicy + * Required. `AuthzPolicy` resource being updated. + * @param {string} [request.requestId] + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server can ignore + * the request if it has already been completed. The server guarantees + * that for at least 60 minutes since the first request. + * + * For example, consider a situation where you make an initial request and the + * request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, ignores the second request. This prevents + * clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/network_security.update_authz_policy.js + * region_tag:networksecurity_v1_generated_NetworkSecurity_UpdateAuthzPolicy_async + */ + updateAuthzPolicy( + request?: protos.google.cloud.networksecurity.v1.IUpdateAuthzPolicyRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + updateAuthzPolicy( + request: protos.google.cloud.networksecurity.v1.IUpdateAuthzPolicyRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + updateAuthzPolicy( + request: protos.google.cloud.networksecurity.v1.IUpdateAuthzPolicyRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + updateAuthzPolicy( + request?: protos.google.cloud.networksecurity.v1.IUpdateAuthzPolicyRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'authz_policy.name': request.authzPolicy!.name ?? '', + }); + this.initialize().catch(err => {throw err}); + const wrappedCallback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('updateAuthzPolicy response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('updateAuthzPolicy request %j', request); + return this.innerApiCalls.updateAuthzPolicy(request, options, wrappedCallback) + ?.then(([response, rawResponse, _]: [ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]) => { + this._log.info('updateAuthzPolicy response %j', rawResponse); + return [response, rawResponse, _]; + }); + } +/** + * Check the status of the long running operation returned by `updateAuthzPolicy()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/network_security.update_authz_policy.js + * region_tag:networksecurity_v1_generated_NetworkSecurity_UpdateAuthzPolicy_async + */ + async checkUpdateAuthzPolicyProgress(name: string): Promise>{ + this._log.info('updateAuthzPolicy long-running'); + const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.updateAuthzPolicy, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Deletes a single AuthzPolicy. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the `AuthzPolicy` resource to delete. Must be in + * the format + * `projects/{project}/locations/{location}/authzPolicies/{authz_policy}`. + * @param {string} [request.requestId] + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server can ignore + * the request if it has already been completed. The server guarantees + * that for at least 60 minutes after the first request. + * + * For example, consider a situation where you make an initial request and the + * request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, ignores the second request. This prevents + * clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/network_security.delete_authz_policy.js + * region_tag:networksecurity_v1_generated_NetworkSecurity_DeleteAuthzPolicy_async + */ + deleteAuthzPolicy( + request?: protos.google.cloud.networksecurity.v1.IDeleteAuthzPolicyRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + deleteAuthzPolicy( + request: protos.google.cloud.networksecurity.v1.IDeleteAuthzPolicyRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + deleteAuthzPolicy( + request: protos.google.cloud.networksecurity.v1.IDeleteAuthzPolicyRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + deleteAuthzPolicy( + request?: protos.google.cloud.networksecurity.v1.IDeleteAuthzPolicyRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize().catch(err => {throw err}); + const wrappedCallback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('deleteAuthzPolicy response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('deleteAuthzPolicy request %j', request); + return this.innerApiCalls.deleteAuthzPolicy(request, options, wrappedCallback) + ?.then(([response, rawResponse, _]: [ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]) => { + this._log.info('deleteAuthzPolicy response %j', rawResponse); + return [response, rawResponse, _]; + }); + } +/** + * Check the status of the long running operation returned by `deleteAuthzPolicy()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/network_security.delete_authz_policy.js + * region_tag:networksecurity_v1_generated_NetworkSecurity_DeleteAuthzPolicy_async + */ + async checkDeleteAuthzPolicyProgress(name: string): Promise>{ + this._log.info('deleteAuthzPolicy long-running'); + const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.deleteAuthzPolicy, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } + /** + * Lists AuthorizationPolicies in a given project and location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The project and location from which the AuthorizationPolicies + * should be listed, specified in the format + * `projects/{project}/locations/{location}`. + * @param {number} request.pageSize + * Maximum number of AuthorizationPolicies to return per call. + * @param {string} request.pageToken + * The value returned by the last + * `ListAuthorizationPoliciesResponse` Indicates that this is a + * continuation of a prior `ListAuthorizationPolicies` call, and + * that the system should return the next page of data. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of {@link protos.google.cloud.networksecurity.v1.AuthorizationPolicy|AuthorizationPolicy}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listAuthorizationPoliciesAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listAuthorizationPolicies( + request?: protos.google.cloud.networksecurity.v1.IListAuthorizationPoliciesRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.networksecurity.v1.IAuthorizationPolicy[], + protos.google.cloud.networksecurity.v1.IListAuthorizationPoliciesRequest|null, + protos.google.cloud.networksecurity.v1.IListAuthorizationPoliciesResponse + ]>; + listAuthorizationPolicies( + request: protos.google.cloud.networksecurity.v1.IListAuthorizationPoliciesRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.networksecurity.v1.IListAuthorizationPoliciesRequest, + protos.google.cloud.networksecurity.v1.IListAuthorizationPoliciesResponse|null|undefined, + protos.google.cloud.networksecurity.v1.IAuthorizationPolicy>): void; + listAuthorizationPolicies( + request: protos.google.cloud.networksecurity.v1.IListAuthorizationPoliciesRequest, + callback: PaginationCallback< + protos.google.cloud.networksecurity.v1.IListAuthorizationPoliciesRequest, + protos.google.cloud.networksecurity.v1.IListAuthorizationPoliciesResponse|null|undefined, + protos.google.cloud.networksecurity.v1.IAuthorizationPolicy>): void; + listAuthorizationPolicies( + request?: protos.google.cloud.networksecurity.v1.IListAuthorizationPoliciesRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.cloud.networksecurity.v1.IListAuthorizationPoliciesRequest, + protos.google.cloud.networksecurity.v1.IListAuthorizationPoliciesResponse|null|undefined, + protos.google.cloud.networksecurity.v1.IAuthorizationPolicy>, + callback?: PaginationCallback< + protos.google.cloud.networksecurity.v1.IListAuthorizationPoliciesRequest, + protos.google.cloud.networksecurity.v1.IListAuthorizationPoliciesResponse|null|undefined, + protos.google.cloud.networksecurity.v1.IAuthorizationPolicy>): + Promise<[ + protos.google.cloud.networksecurity.v1.IAuthorizationPolicy[], + protos.google.cloud.networksecurity.v1.IListAuthorizationPoliciesRequest|null, + protos.google.cloud.networksecurity.v1.IListAuthorizationPoliciesResponse + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize().catch(err => {throw err}); + const wrappedCallback: PaginationCallback< + protos.google.cloud.networksecurity.v1.IListAuthorizationPoliciesRequest, + protos.google.cloud.networksecurity.v1.IListAuthorizationPoliciesResponse|null|undefined, + protos.google.cloud.networksecurity.v1.IAuthorizationPolicy>|undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listAuthorizationPolicies values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listAuthorizationPolicies request %j', request); + return this.innerApiCalls + .listAuthorizationPolicies(request, options, wrappedCallback) + ?.then(([response, input, output]: [ + protos.google.cloud.networksecurity.v1.IAuthorizationPolicy[], + protos.google.cloud.networksecurity.v1.IListAuthorizationPoliciesRequest|null, + protos.google.cloud.networksecurity.v1.IListAuthorizationPoliciesResponse + ]) => { + this._log.info('listAuthorizationPolicies values %j', response); + return [response, input, output]; + }); + } + +/** + * Equivalent to `listAuthorizationPolicies`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The project and location from which the AuthorizationPolicies + * should be listed, specified in the format + * `projects/{project}/locations/{location}`. + * @param {number} request.pageSize + * Maximum number of AuthorizationPolicies to return per call. + * @param {string} request.pageToken + * The value returned by the last + * `ListAuthorizationPoliciesResponse` Indicates that this is a + * continuation of a prior `ListAuthorizationPolicies` call, and + * that the system should return the next page of data. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing {@link protos.google.cloud.networksecurity.v1.AuthorizationPolicy|AuthorizationPolicy} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `listAuthorizationPoliciesAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listAuthorizationPoliciesStream( + request?: protos.google.cloud.networksecurity.v1.IListAuthorizationPoliciesRequest, + options?: CallOptions): + Transform{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listAuthorizationPolicies']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listAuthorizationPolicies stream %j', request); + return this.descriptors.page.listAuthorizationPolicies.createStream( + this.innerApiCalls.listAuthorizationPolicies as GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listAuthorizationPolicies`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The project and location from which the AuthorizationPolicies + * should be listed, specified in the format + * `projects/{project}/locations/{location}`. + * @param {number} request.pageSize + * Maximum number of AuthorizationPolicies to return per call. + * @param {string} request.pageToken + * The value returned by the last + * `ListAuthorizationPoliciesResponse` Indicates that this is a + * continuation of a prior `ListAuthorizationPolicies` call, and + * that the system should return the next page of data. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link protos.google.cloud.networksecurity.v1.AuthorizationPolicy|AuthorizationPolicy}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example include:samples/generated/v1/network_security.list_authorization_policies.js + * region_tag:networksecurity_v1_generated_NetworkSecurity_ListAuthorizationPolicies_async + */ + listAuthorizationPoliciesAsync( + request?: protos.google.cloud.networksecurity.v1.IListAuthorizationPoliciesRequest, + options?: CallOptions): + AsyncIterable{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listAuthorizationPolicies']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listAuthorizationPolicies iterate %j', request); + return this.descriptors.page.listAuthorizationPolicies.asyncIterate( + this.innerApiCalls['listAuthorizationPolicies'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Lists BackendAuthenticationConfigs in a given project and location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The project and location from which the + * BackendAuthenticationConfigs should be listed, specified in the format + * `projects/* /locations/{location}`. + * @param {number} request.pageSize + * Maximum number of BackendAuthenticationConfigs to return per call. + * @param {string} request.pageToken + * The value returned by the last `ListBackendAuthenticationConfigsResponse` + * Indicates that this is a continuation of a prior + * `ListBackendAuthenticationConfigs` call, and that the system + * should return the next page of data. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of {@link protos.google.cloud.networksecurity.v1.BackendAuthenticationConfig|BackendAuthenticationConfig}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listBackendAuthenticationConfigsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listBackendAuthenticationConfigs( + request?: protos.google.cloud.networksecurity.v1.IListBackendAuthenticationConfigsRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.networksecurity.v1.IBackendAuthenticationConfig[], + protos.google.cloud.networksecurity.v1.IListBackendAuthenticationConfigsRequest|null, + protos.google.cloud.networksecurity.v1.IListBackendAuthenticationConfigsResponse + ]>; + listBackendAuthenticationConfigs( + request: protos.google.cloud.networksecurity.v1.IListBackendAuthenticationConfigsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.networksecurity.v1.IListBackendAuthenticationConfigsRequest, + protos.google.cloud.networksecurity.v1.IListBackendAuthenticationConfigsResponse|null|undefined, + protos.google.cloud.networksecurity.v1.IBackendAuthenticationConfig>): void; + listBackendAuthenticationConfigs( + request: protos.google.cloud.networksecurity.v1.IListBackendAuthenticationConfigsRequest, + callback: PaginationCallback< + protos.google.cloud.networksecurity.v1.IListBackendAuthenticationConfigsRequest, + protos.google.cloud.networksecurity.v1.IListBackendAuthenticationConfigsResponse|null|undefined, + protos.google.cloud.networksecurity.v1.IBackendAuthenticationConfig>): void; + listBackendAuthenticationConfigs( + request?: protos.google.cloud.networksecurity.v1.IListBackendAuthenticationConfigsRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.cloud.networksecurity.v1.IListBackendAuthenticationConfigsRequest, + protos.google.cloud.networksecurity.v1.IListBackendAuthenticationConfigsResponse|null|undefined, + protos.google.cloud.networksecurity.v1.IBackendAuthenticationConfig>, + callback?: PaginationCallback< + protos.google.cloud.networksecurity.v1.IListBackendAuthenticationConfigsRequest, + protos.google.cloud.networksecurity.v1.IListBackendAuthenticationConfigsResponse|null|undefined, + protos.google.cloud.networksecurity.v1.IBackendAuthenticationConfig>): + Promise<[ + protos.google.cloud.networksecurity.v1.IBackendAuthenticationConfig[], + protos.google.cloud.networksecurity.v1.IListBackendAuthenticationConfigsRequest|null, + protos.google.cloud.networksecurity.v1.IListBackendAuthenticationConfigsResponse + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize().catch(err => {throw err}); + const wrappedCallback: PaginationCallback< + protos.google.cloud.networksecurity.v1.IListBackendAuthenticationConfigsRequest, + protos.google.cloud.networksecurity.v1.IListBackendAuthenticationConfigsResponse|null|undefined, + protos.google.cloud.networksecurity.v1.IBackendAuthenticationConfig>|undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listBackendAuthenticationConfigs values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listBackendAuthenticationConfigs request %j', request); + return this.innerApiCalls + .listBackendAuthenticationConfigs(request, options, wrappedCallback) + ?.then(([response, input, output]: [ + protos.google.cloud.networksecurity.v1.IBackendAuthenticationConfig[], + protos.google.cloud.networksecurity.v1.IListBackendAuthenticationConfigsRequest|null, + protos.google.cloud.networksecurity.v1.IListBackendAuthenticationConfigsResponse + ]) => { + this._log.info('listBackendAuthenticationConfigs values %j', response); + return [response, input, output]; + }); + } + +/** + * Equivalent to `listBackendAuthenticationConfigs`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The project and location from which the + * BackendAuthenticationConfigs should be listed, specified in the format + * `projects/* /locations/{location}`. + * @param {number} request.pageSize + * Maximum number of BackendAuthenticationConfigs to return per call. + * @param {string} request.pageToken + * The value returned by the last `ListBackendAuthenticationConfigsResponse` + * Indicates that this is a continuation of a prior + * `ListBackendAuthenticationConfigs` call, and that the system + * should return the next page of data. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing {@link protos.google.cloud.networksecurity.v1.BackendAuthenticationConfig|BackendAuthenticationConfig} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `listBackendAuthenticationConfigsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listBackendAuthenticationConfigsStream( + request?: protos.google.cloud.networksecurity.v1.IListBackendAuthenticationConfigsRequest, + options?: CallOptions): + Transform{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listBackendAuthenticationConfigs']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listBackendAuthenticationConfigs stream %j', request); + return this.descriptors.page.listBackendAuthenticationConfigs.createStream( + this.innerApiCalls.listBackendAuthenticationConfigs as GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listBackendAuthenticationConfigs`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The project and location from which the + * BackendAuthenticationConfigs should be listed, specified in the format + * `projects/* /locations/{location}`. + * @param {number} request.pageSize + * Maximum number of BackendAuthenticationConfigs to return per call. + * @param {string} request.pageToken + * The value returned by the last `ListBackendAuthenticationConfigsResponse` + * Indicates that this is a continuation of a prior + * `ListBackendAuthenticationConfigs` call, and that the system + * should return the next page of data. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link protos.google.cloud.networksecurity.v1.BackendAuthenticationConfig|BackendAuthenticationConfig}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example include:samples/generated/v1/network_security.list_backend_authentication_configs.js + * region_tag:networksecurity_v1_generated_NetworkSecurity_ListBackendAuthenticationConfigs_async + */ + listBackendAuthenticationConfigsAsync( + request?: protos.google.cloud.networksecurity.v1.IListBackendAuthenticationConfigsRequest, + options?: CallOptions): + AsyncIterable{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listBackendAuthenticationConfigs']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listBackendAuthenticationConfigs iterate %j', request); + return this.descriptors.page.listBackendAuthenticationConfigs.asyncIterate( + this.innerApiCalls['listBackendAuthenticationConfigs'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Lists ServerTlsPolicies in a given project and location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The project and location from which the ServerTlsPolicies should + * be listed, specified in the format `projects/* /locations/{location}`. + * @param {number} request.pageSize + * Maximum number of ServerTlsPolicies to return per call. + * @param {string} request.pageToken + * The value returned by the last `ListServerTlsPoliciesResponse` + * Indicates that this is a continuation of a prior + * `ListServerTlsPolicies` call, and that the system + * should return the next page of data. + * @param {boolean} [request.returnPartialSuccess] + * Optional. Setting this field to `true` will opt the request into returning + * the resources that are reachable, and into including the names of those + * that were unreachable in the [ListServerTlsPoliciesResponse.unreachable] + * field. This can only be `true` when reading across collections e.g. when + * `parent` is set to `"projects/example/locations/-"`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of {@link protos.google.cloud.networksecurity.v1.ServerTlsPolicy|ServerTlsPolicy}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listServerTlsPoliciesAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listServerTlsPolicies( + request?: protos.google.cloud.networksecurity.v1.IListServerTlsPoliciesRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.networksecurity.v1.IServerTlsPolicy[], + protos.google.cloud.networksecurity.v1.IListServerTlsPoliciesRequest|null, + protos.google.cloud.networksecurity.v1.IListServerTlsPoliciesResponse + ]>; + listServerTlsPolicies( + request: protos.google.cloud.networksecurity.v1.IListServerTlsPoliciesRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.networksecurity.v1.IListServerTlsPoliciesRequest, + protos.google.cloud.networksecurity.v1.IListServerTlsPoliciesResponse|null|undefined, + protos.google.cloud.networksecurity.v1.IServerTlsPolicy>): void; + listServerTlsPolicies( + request: protos.google.cloud.networksecurity.v1.IListServerTlsPoliciesRequest, + callback: PaginationCallback< + protos.google.cloud.networksecurity.v1.IListServerTlsPoliciesRequest, + protos.google.cloud.networksecurity.v1.IListServerTlsPoliciesResponse|null|undefined, + protos.google.cloud.networksecurity.v1.IServerTlsPolicy>): void; + listServerTlsPolicies( + request?: protos.google.cloud.networksecurity.v1.IListServerTlsPoliciesRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.cloud.networksecurity.v1.IListServerTlsPoliciesRequest, + protos.google.cloud.networksecurity.v1.IListServerTlsPoliciesResponse|null|undefined, + protos.google.cloud.networksecurity.v1.IServerTlsPolicy>, + callback?: PaginationCallback< + protos.google.cloud.networksecurity.v1.IListServerTlsPoliciesRequest, + protos.google.cloud.networksecurity.v1.IListServerTlsPoliciesResponse|null|undefined, + protos.google.cloud.networksecurity.v1.IServerTlsPolicy>): + Promise<[ + protos.google.cloud.networksecurity.v1.IServerTlsPolicy[], + protos.google.cloud.networksecurity.v1.IListServerTlsPoliciesRequest|null, + protos.google.cloud.networksecurity.v1.IListServerTlsPoliciesResponse + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize().catch(err => {throw err}); + const wrappedCallback: PaginationCallback< + protos.google.cloud.networksecurity.v1.IListServerTlsPoliciesRequest, + protos.google.cloud.networksecurity.v1.IListServerTlsPoliciesResponse|null|undefined, + protos.google.cloud.networksecurity.v1.IServerTlsPolicy>|undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listServerTlsPolicies values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listServerTlsPolicies request %j', request); + return this.innerApiCalls + .listServerTlsPolicies(request, options, wrappedCallback) + ?.then(([response, input, output]: [ + protos.google.cloud.networksecurity.v1.IServerTlsPolicy[], + protos.google.cloud.networksecurity.v1.IListServerTlsPoliciesRequest|null, + protos.google.cloud.networksecurity.v1.IListServerTlsPoliciesResponse + ]) => { + this._log.info('listServerTlsPolicies values %j', response); + return [response, input, output]; + }); + } + +/** + * Equivalent to `listServerTlsPolicies`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The project and location from which the ServerTlsPolicies should + * be listed, specified in the format `projects/* /locations/{location}`. + * @param {number} request.pageSize + * Maximum number of ServerTlsPolicies to return per call. + * @param {string} request.pageToken + * The value returned by the last `ListServerTlsPoliciesResponse` + * Indicates that this is a continuation of a prior + * `ListServerTlsPolicies` call, and that the system + * should return the next page of data. + * @param {boolean} [request.returnPartialSuccess] + * Optional. Setting this field to `true` will opt the request into returning + * the resources that are reachable, and into including the names of those + * that were unreachable in the [ListServerTlsPoliciesResponse.unreachable] + * field. This can only be `true` when reading across collections e.g. when + * `parent` is set to `"projects/example/locations/-"`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing {@link protos.google.cloud.networksecurity.v1.ServerTlsPolicy|ServerTlsPolicy} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `listServerTlsPoliciesAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listServerTlsPoliciesStream( + request?: protos.google.cloud.networksecurity.v1.IListServerTlsPoliciesRequest, + options?: CallOptions): + Transform{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listServerTlsPolicies']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listServerTlsPolicies stream %j', request); + return this.descriptors.page.listServerTlsPolicies.createStream( + this.innerApiCalls.listServerTlsPolicies as GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listServerTlsPolicies`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The project and location from which the ServerTlsPolicies should + * be listed, specified in the format `projects/* /locations/{location}`. + * @param {number} request.pageSize + * Maximum number of ServerTlsPolicies to return per call. + * @param {string} request.pageToken + * The value returned by the last `ListServerTlsPoliciesResponse` + * Indicates that this is a continuation of a prior + * `ListServerTlsPolicies` call, and that the system + * should return the next page of data. + * @param {boolean} [request.returnPartialSuccess] + * Optional. Setting this field to `true` will opt the request into returning + * the resources that are reachable, and into including the names of those + * that were unreachable in the [ListServerTlsPoliciesResponse.unreachable] + * field. This can only be `true` when reading across collections e.g. when + * `parent` is set to `"projects/example/locations/-"`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link protos.google.cloud.networksecurity.v1.ServerTlsPolicy|ServerTlsPolicy}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example include:samples/generated/v1/network_security.list_server_tls_policies.js + * region_tag:networksecurity_v1_generated_NetworkSecurity_ListServerTlsPolicies_async + */ + listServerTlsPoliciesAsync( + request?: protos.google.cloud.networksecurity.v1.IListServerTlsPoliciesRequest, + options?: CallOptions): + AsyncIterable{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listServerTlsPolicies']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listServerTlsPolicies iterate %j', request); + return this.descriptors.page.listServerTlsPolicies.asyncIterate( + this.innerApiCalls['listServerTlsPolicies'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Lists ClientTlsPolicies in a given project and location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The project and location from which the ClientTlsPolicies should + * be listed, specified in the format `projects/* /locations/{location}`. + * @param {number} request.pageSize + * Maximum number of ClientTlsPolicies to return per call. + * @param {string} request.pageToken + * The value returned by the last `ListClientTlsPoliciesResponse` + * Indicates that this is a continuation of a prior + * `ListClientTlsPolicies` call, and that the system + * should return the next page of data. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of {@link protos.google.cloud.networksecurity.v1.ClientTlsPolicy|ClientTlsPolicy}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listClientTlsPoliciesAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listClientTlsPolicies( + request?: protos.google.cloud.networksecurity.v1.IListClientTlsPoliciesRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.networksecurity.v1.IClientTlsPolicy[], + protos.google.cloud.networksecurity.v1.IListClientTlsPoliciesRequest|null, + protos.google.cloud.networksecurity.v1.IListClientTlsPoliciesResponse + ]>; + listClientTlsPolicies( + request: protos.google.cloud.networksecurity.v1.IListClientTlsPoliciesRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.networksecurity.v1.IListClientTlsPoliciesRequest, + protos.google.cloud.networksecurity.v1.IListClientTlsPoliciesResponse|null|undefined, + protos.google.cloud.networksecurity.v1.IClientTlsPolicy>): void; + listClientTlsPolicies( + request: protos.google.cloud.networksecurity.v1.IListClientTlsPoliciesRequest, + callback: PaginationCallback< + protos.google.cloud.networksecurity.v1.IListClientTlsPoliciesRequest, + protos.google.cloud.networksecurity.v1.IListClientTlsPoliciesResponse|null|undefined, + protos.google.cloud.networksecurity.v1.IClientTlsPolicy>): void; + listClientTlsPolicies( + request?: protos.google.cloud.networksecurity.v1.IListClientTlsPoliciesRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.cloud.networksecurity.v1.IListClientTlsPoliciesRequest, + protos.google.cloud.networksecurity.v1.IListClientTlsPoliciesResponse|null|undefined, + protos.google.cloud.networksecurity.v1.IClientTlsPolicy>, + callback?: PaginationCallback< + protos.google.cloud.networksecurity.v1.IListClientTlsPoliciesRequest, + protos.google.cloud.networksecurity.v1.IListClientTlsPoliciesResponse|null|undefined, + protos.google.cloud.networksecurity.v1.IClientTlsPolicy>): + Promise<[ + protos.google.cloud.networksecurity.v1.IClientTlsPolicy[], + protos.google.cloud.networksecurity.v1.IListClientTlsPoliciesRequest|null, + protos.google.cloud.networksecurity.v1.IListClientTlsPoliciesResponse + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize().catch(err => {throw err}); + const wrappedCallback: PaginationCallback< + protos.google.cloud.networksecurity.v1.IListClientTlsPoliciesRequest, + protos.google.cloud.networksecurity.v1.IListClientTlsPoliciesResponse|null|undefined, + protos.google.cloud.networksecurity.v1.IClientTlsPolicy>|undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listClientTlsPolicies values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listClientTlsPolicies request %j', request); + return this.innerApiCalls + .listClientTlsPolicies(request, options, wrappedCallback) + ?.then(([response, input, output]: [ + protos.google.cloud.networksecurity.v1.IClientTlsPolicy[], + protos.google.cloud.networksecurity.v1.IListClientTlsPoliciesRequest|null, + protos.google.cloud.networksecurity.v1.IListClientTlsPoliciesResponse + ]) => { + this._log.info('listClientTlsPolicies values %j', response); + return [response, input, output]; + }); + } + +/** + * Equivalent to `listClientTlsPolicies`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The project and location from which the ClientTlsPolicies should + * be listed, specified in the format `projects/* /locations/{location}`. + * @param {number} request.pageSize + * Maximum number of ClientTlsPolicies to return per call. + * @param {string} request.pageToken + * The value returned by the last `ListClientTlsPoliciesResponse` + * Indicates that this is a continuation of a prior + * `ListClientTlsPolicies` call, and that the system + * should return the next page of data. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing {@link protos.google.cloud.networksecurity.v1.ClientTlsPolicy|ClientTlsPolicy} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `listClientTlsPoliciesAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listClientTlsPoliciesStream( + request?: protos.google.cloud.networksecurity.v1.IListClientTlsPoliciesRequest, + options?: CallOptions): + Transform{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listClientTlsPolicies']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listClientTlsPolicies stream %j', request); + return this.descriptors.page.listClientTlsPolicies.createStream( + this.innerApiCalls.listClientTlsPolicies as GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listClientTlsPolicies`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The project and location from which the ClientTlsPolicies should + * be listed, specified in the format `projects/* /locations/{location}`. + * @param {number} request.pageSize + * Maximum number of ClientTlsPolicies to return per call. + * @param {string} request.pageToken + * The value returned by the last `ListClientTlsPoliciesResponse` + * Indicates that this is a continuation of a prior + * `ListClientTlsPolicies` call, and that the system + * should return the next page of data. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link protos.google.cloud.networksecurity.v1.ClientTlsPolicy|ClientTlsPolicy}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example include:samples/generated/v1/network_security.list_client_tls_policies.js + * region_tag:networksecurity_v1_generated_NetworkSecurity_ListClientTlsPolicies_async + */ + listClientTlsPoliciesAsync( + request?: protos.google.cloud.networksecurity.v1.IListClientTlsPoliciesRequest, + options?: CallOptions): + AsyncIterable{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listClientTlsPolicies']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listClientTlsPolicies iterate %j', request); + return this.descriptors.page.listClientTlsPolicies.asyncIterate( + this.innerApiCalls['listClientTlsPolicies'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Lists GatewaySecurityPolicies in a given project and location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The project and location from which the GatewaySecurityPolicies + * should be listed, specified in the format + * `projects/{project}/locations/{location}`. + * @param {number} request.pageSize + * Maximum number of GatewaySecurityPolicies to return per call. + * @param {string} request.pageToken + * The value returned by the last + * 'ListGatewaySecurityPoliciesResponse' Indicates that this is a + * continuation of a prior 'ListGatewaySecurityPolicies' call, and + * that the system should return the next page of data. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of {@link protos.google.cloud.networksecurity.v1.GatewaySecurityPolicy|GatewaySecurityPolicy}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listGatewaySecurityPoliciesAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listGatewaySecurityPolicies( + request?: protos.google.cloud.networksecurity.v1.IListGatewaySecurityPoliciesRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.networksecurity.v1.IGatewaySecurityPolicy[], + protos.google.cloud.networksecurity.v1.IListGatewaySecurityPoliciesRequest|null, + protos.google.cloud.networksecurity.v1.IListGatewaySecurityPoliciesResponse + ]>; + listGatewaySecurityPolicies( + request: protos.google.cloud.networksecurity.v1.IListGatewaySecurityPoliciesRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.networksecurity.v1.IListGatewaySecurityPoliciesRequest, + protos.google.cloud.networksecurity.v1.IListGatewaySecurityPoliciesResponse|null|undefined, + protos.google.cloud.networksecurity.v1.IGatewaySecurityPolicy>): void; + listGatewaySecurityPolicies( + request: protos.google.cloud.networksecurity.v1.IListGatewaySecurityPoliciesRequest, + callback: PaginationCallback< + protos.google.cloud.networksecurity.v1.IListGatewaySecurityPoliciesRequest, + protos.google.cloud.networksecurity.v1.IListGatewaySecurityPoliciesResponse|null|undefined, + protos.google.cloud.networksecurity.v1.IGatewaySecurityPolicy>): void; + listGatewaySecurityPolicies( + request?: protos.google.cloud.networksecurity.v1.IListGatewaySecurityPoliciesRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.cloud.networksecurity.v1.IListGatewaySecurityPoliciesRequest, + protos.google.cloud.networksecurity.v1.IListGatewaySecurityPoliciesResponse|null|undefined, + protos.google.cloud.networksecurity.v1.IGatewaySecurityPolicy>, + callback?: PaginationCallback< + protos.google.cloud.networksecurity.v1.IListGatewaySecurityPoliciesRequest, + protos.google.cloud.networksecurity.v1.IListGatewaySecurityPoliciesResponse|null|undefined, + protos.google.cloud.networksecurity.v1.IGatewaySecurityPolicy>): + Promise<[ + protos.google.cloud.networksecurity.v1.IGatewaySecurityPolicy[], + protos.google.cloud.networksecurity.v1.IListGatewaySecurityPoliciesRequest|null, + protos.google.cloud.networksecurity.v1.IListGatewaySecurityPoliciesResponse + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize().catch(err => {throw err}); + const wrappedCallback: PaginationCallback< + protos.google.cloud.networksecurity.v1.IListGatewaySecurityPoliciesRequest, + protos.google.cloud.networksecurity.v1.IListGatewaySecurityPoliciesResponse|null|undefined, + protos.google.cloud.networksecurity.v1.IGatewaySecurityPolicy>|undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listGatewaySecurityPolicies values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listGatewaySecurityPolicies request %j', request); + return this.innerApiCalls + .listGatewaySecurityPolicies(request, options, wrappedCallback) + ?.then(([response, input, output]: [ + protos.google.cloud.networksecurity.v1.IGatewaySecurityPolicy[], + protos.google.cloud.networksecurity.v1.IListGatewaySecurityPoliciesRequest|null, + protos.google.cloud.networksecurity.v1.IListGatewaySecurityPoliciesResponse + ]) => { + this._log.info('listGatewaySecurityPolicies values %j', response); + return [response, input, output]; + }); + } + +/** + * Equivalent to `listGatewaySecurityPolicies`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The project and location from which the GatewaySecurityPolicies + * should be listed, specified in the format + * `projects/{project}/locations/{location}`. + * @param {number} request.pageSize + * Maximum number of GatewaySecurityPolicies to return per call. + * @param {string} request.pageToken + * The value returned by the last + * 'ListGatewaySecurityPoliciesResponse' Indicates that this is a + * continuation of a prior 'ListGatewaySecurityPolicies' call, and + * that the system should return the next page of data. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing {@link protos.google.cloud.networksecurity.v1.GatewaySecurityPolicy|GatewaySecurityPolicy} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `listGatewaySecurityPoliciesAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listGatewaySecurityPoliciesStream( + request?: protos.google.cloud.networksecurity.v1.IListGatewaySecurityPoliciesRequest, + options?: CallOptions): + Transform{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listGatewaySecurityPolicies']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listGatewaySecurityPolicies stream %j', request); + return this.descriptors.page.listGatewaySecurityPolicies.createStream( + this.innerApiCalls.listGatewaySecurityPolicies as GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listGatewaySecurityPolicies`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The project and location from which the GatewaySecurityPolicies + * should be listed, specified in the format + * `projects/{project}/locations/{location}`. + * @param {number} request.pageSize + * Maximum number of GatewaySecurityPolicies to return per call. + * @param {string} request.pageToken + * The value returned by the last + * 'ListGatewaySecurityPoliciesResponse' Indicates that this is a + * continuation of a prior 'ListGatewaySecurityPolicies' call, and + * that the system should return the next page of data. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link protos.google.cloud.networksecurity.v1.GatewaySecurityPolicy|GatewaySecurityPolicy}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example include:samples/generated/v1/network_security.list_gateway_security_policies.js + * region_tag:networksecurity_v1_generated_NetworkSecurity_ListGatewaySecurityPolicies_async + */ + listGatewaySecurityPoliciesAsync( + request?: protos.google.cloud.networksecurity.v1.IListGatewaySecurityPoliciesRequest, + options?: CallOptions): + AsyncIterable{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listGatewaySecurityPolicies']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listGatewaySecurityPolicies iterate %j', request); + return this.descriptors.page.listGatewaySecurityPolicies.asyncIterate( + this.innerApiCalls['listGatewaySecurityPolicies'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Lists GatewaySecurityPolicyRules in a given project and location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The project, location and GatewaySecurityPolicy from which the + * GatewaySecurityPolicyRules should be listed, specified in the format + * `projects/{project}/locations/{location}/gatewaySecurityPolicies/{gatewaySecurityPolicy}`. + * @param {number} request.pageSize + * Maximum number of GatewaySecurityPolicyRules to return per call. + * @param {string} request.pageToken + * The value returned by the last + * 'ListGatewaySecurityPolicyRulesResponse' Indicates that this is a + * continuation of a prior 'ListGatewaySecurityPolicyRules' call, and + * that the system should return the next page of data. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of {@link protos.google.cloud.networksecurity.v1.GatewaySecurityPolicyRule|GatewaySecurityPolicyRule}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listGatewaySecurityPolicyRulesAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listGatewaySecurityPolicyRules( + request?: protos.google.cloud.networksecurity.v1.IListGatewaySecurityPolicyRulesRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.networksecurity.v1.IGatewaySecurityPolicyRule[], + protos.google.cloud.networksecurity.v1.IListGatewaySecurityPolicyRulesRequest|null, + protos.google.cloud.networksecurity.v1.IListGatewaySecurityPolicyRulesResponse + ]>; + listGatewaySecurityPolicyRules( + request: protos.google.cloud.networksecurity.v1.IListGatewaySecurityPolicyRulesRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.networksecurity.v1.IListGatewaySecurityPolicyRulesRequest, + protos.google.cloud.networksecurity.v1.IListGatewaySecurityPolicyRulesResponse|null|undefined, + protos.google.cloud.networksecurity.v1.IGatewaySecurityPolicyRule>): void; + listGatewaySecurityPolicyRules( + request: protos.google.cloud.networksecurity.v1.IListGatewaySecurityPolicyRulesRequest, + callback: PaginationCallback< + protos.google.cloud.networksecurity.v1.IListGatewaySecurityPolicyRulesRequest, + protos.google.cloud.networksecurity.v1.IListGatewaySecurityPolicyRulesResponse|null|undefined, + protos.google.cloud.networksecurity.v1.IGatewaySecurityPolicyRule>): void; + listGatewaySecurityPolicyRules( + request?: protos.google.cloud.networksecurity.v1.IListGatewaySecurityPolicyRulesRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.cloud.networksecurity.v1.IListGatewaySecurityPolicyRulesRequest, + protos.google.cloud.networksecurity.v1.IListGatewaySecurityPolicyRulesResponse|null|undefined, + protos.google.cloud.networksecurity.v1.IGatewaySecurityPolicyRule>, + callback?: PaginationCallback< + protos.google.cloud.networksecurity.v1.IListGatewaySecurityPolicyRulesRequest, + protos.google.cloud.networksecurity.v1.IListGatewaySecurityPolicyRulesResponse|null|undefined, + protos.google.cloud.networksecurity.v1.IGatewaySecurityPolicyRule>): + Promise<[ + protos.google.cloud.networksecurity.v1.IGatewaySecurityPolicyRule[], + protos.google.cloud.networksecurity.v1.IListGatewaySecurityPolicyRulesRequest|null, + protos.google.cloud.networksecurity.v1.IListGatewaySecurityPolicyRulesResponse + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize().catch(err => {throw err}); + const wrappedCallback: PaginationCallback< + protos.google.cloud.networksecurity.v1.IListGatewaySecurityPolicyRulesRequest, + protos.google.cloud.networksecurity.v1.IListGatewaySecurityPolicyRulesResponse|null|undefined, + protos.google.cloud.networksecurity.v1.IGatewaySecurityPolicyRule>|undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listGatewaySecurityPolicyRules values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listGatewaySecurityPolicyRules request %j', request); + return this.innerApiCalls + .listGatewaySecurityPolicyRules(request, options, wrappedCallback) + ?.then(([response, input, output]: [ + protos.google.cloud.networksecurity.v1.IGatewaySecurityPolicyRule[], + protos.google.cloud.networksecurity.v1.IListGatewaySecurityPolicyRulesRequest|null, + protos.google.cloud.networksecurity.v1.IListGatewaySecurityPolicyRulesResponse + ]) => { + this._log.info('listGatewaySecurityPolicyRules values %j', response); + return [response, input, output]; + }); + } + +/** + * Equivalent to `listGatewaySecurityPolicyRules`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The project, location and GatewaySecurityPolicy from which the + * GatewaySecurityPolicyRules should be listed, specified in the format + * `projects/{project}/locations/{location}/gatewaySecurityPolicies/{gatewaySecurityPolicy}`. + * @param {number} request.pageSize + * Maximum number of GatewaySecurityPolicyRules to return per call. + * @param {string} request.pageToken + * The value returned by the last + * 'ListGatewaySecurityPolicyRulesResponse' Indicates that this is a + * continuation of a prior 'ListGatewaySecurityPolicyRules' call, and + * that the system should return the next page of data. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing {@link protos.google.cloud.networksecurity.v1.GatewaySecurityPolicyRule|GatewaySecurityPolicyRule} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `listGatewaySecurityPolicyRulesAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listGatewaySecurityPolicyRulesStream( + request?: protos.google.cloud.networksecurity.v1.IListGatewaySecurityPolicyRulesRequest, + options?: CallOptions): + Transform{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listGatewaySecurityPolicyRules']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listGatewaySecurityPolicyRules stream %j', request); + return this.descriptors.page.listGatewaySecurityPolicyRules.createStream( + this.innerApiCalls.listGatewaySecurityPolicyRules as GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listGatewaySecurityPolicyRules`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The project, location and GatewaySecurityPolicy from which the + * GatewaySecurityPolicyRules should be listed, specified in the format + * `projects/{project}/locations/{location}/gatewaySecurityPolicies/{gatewaySecurityPolicy}`. + * @param {number} request.pageSize + * Maximum number of GatewaySecurityPolicyRules to return per call. + * @param {string} request.pageToken + * The value returned by the last + * 'ListGatewaySecurityPolicyRulesResponse' Indicates that this is a + * continuation of a prior 'ListGatewaySecurityPolicyRules' call, and + * that the system should return the next page of data. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link protos.google.cloud.networksecurity.v1.GatewaySecurityPolicyRule|GatewaySecurityPolicyRule}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example include:samples/generated/v1/network_security.list_gateway_security_policy_rules.js + * region_tag:networksecurity_v1_generated_NetworkSecurity_ListGatewaySecurityPolicyRules_async + */ + listGatewaySecurityPolicyRulesAsync( + request?: protos.google.cloud.networksecurity.v1.IListGatewaySecurityPolicyRulesRequest, + options?: CallOptions): + AsyncIterable{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listGatewaySecurityPolicyRules']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listGatewaySecurityPolicyRules iterate %j', request); + return this.descriptors.page.listGatewaySecurityPolicyRules.asyncIterate( + this.innerApiCalls['listGatewaySecurityPolicyRules'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Lists UrlLists in a given project and location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The project and location from which the UrlLists should + * be listed, specified in the format + * `projects/{project}/locations/{location}`. + * @param {number} request.pageSize + * Maximum number of UrlLists to return per call. + * @param {string} request.pageToken + * The value returned by the last `ListUrlListsResponse` + * Indicates that this is a continuation of a prior + * `ListUrlLists` call, and that the system + * should return the next page of data. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of {@link protos.google.cloud.networksecurity.v1.UrlList|UrlList}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listUrlListsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listUrlLists( + request?: protos.google.cloud.networksecurity.v1.IListUrlListsRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.networksecurity.v1.IUrlList[], + protos.google.cloud.networksecurity.v1.IListUrlListsRequest|null, + protos.google.cloud.networksecurity.v1.IListUrlListsResponse + ]>; + listUrlLists( + request: protos.google.cloud.networksecurity.v1.IListUrlListsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.networksecurity.v1.IListUrlListsRequest, + protos.google.cloud.networksecurity.v1.IListUrlListsResponse|null|undefined, + protos.google.cloud.networksecurity.v1.IUrlList>): void; + listUrlLists( + request: protos.google.cloud.networksecurity.v1.IListUrlListsRequest, + callback: PaginationCallback< + protos.google.cloud.networksecurity.v1.IListUrlListsRequest, + protos.google.cloud.networksecurity.v1.IListUrlListsResponse|null|undefined, + protos.google.cloud.networksecurity.v1.IUrlList>): void; + listUrlLists( + request?: protos.google.cloud.networksecurity.v1.IListUrlListsRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.cloud.networksecurity.v1.IListUrlListsRequest, + protos.google.cloud.networksecurity.v1.IListUrlListsResponse|null|undefined, + protos.google.cloud.networksecurity.v1.IUrlList>, + callback?: PaginationCallback< + protos.google.cloud.networksecurity.v1.IListUrlListsRequest, + protos.google.cloud.networksecurity.v1.IListUrlListsResponse|null|undefined, + protos.google.cloud.networksecurity.v1.IUrlList>): + Promise<[ + protos.google.cloud.networksecurity.v1.IUrlList[], + protos.google.cloud.networksecurity.v1.IListUrlListsRequest|null, + protos.google.cloud.networksecurity.v1.IListUrlListsResponse + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize().catch(err => {throw err}); + const wrappedCallback: PaginationCallback< + protos.google.cloud.networksecurity.v1.IListUrlListsRequest, + protos.google.cloud.networksecurity.v1.IListUrlListsResponse|null|undefined, + protos.google.cloud.networksecurity.v1.IUrlList>|undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listUrlLists values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listUrlLists request %j', request); + return this.innerApiCalls + .listUrlLists(request, options, wrappedCallback) + ?.then(([response, input, output]: [ + protos.google.cloud.networksecurity.v1.IUrlList[], + protos.google.cloud.networksecurity.v1.IListUrlListsRequest|null, + protos.google.cloud.networksecurity.v1.IListUrlListsResponse + ]) => { + this._log.info('listUrlLists values %j', response); + return [response, input, output]; + }); + } + +/** + * Equivalent to `listUrlLists`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The project and location from which the UrlLists should + * be listed, specified in the format + * `projects/{project}/locations/{location}`. + * @param {number} request.pageSize + * Maximum number of UrlLists to return per call. + * @param {string} request.pageToken + * The value returned by the last `ListUrlListsResponse` + * Indicates that this is a continuation of a prior + * `ListUrlLists` call, and that the system + * should return the next page of data. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing {@link protos.google.cloud.networksecurity.v1.UrlList|UrlList} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `listUrlListsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listUrlListsStream( + request?: protos.google.cloud.networksecurity.v1.IListUrlListsRequest, + options?: CallOptions): + Transform{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listUrlLists']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listUrlLists stream %j', request); + return this.descriptors.page.listUrlLists.createStream( + this.innerApiCalls.listUrlLists as GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listUrlLists`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The project and location from which the UrlLists should + * be listed, specified in the format + * `projects/{project}/locations/{location}`. + * @param {number} request.pageSize + * Maximum number of UrlLists to return per call. + * @param {string} request.pageToken + * The value returned by the last `ListUrlListsResponse` + * Indicates that this is a continuation of a prior + * `ListUrlLists` call, and that the system + * should return the next page of data. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link protos.google.cloud.networksecurity.v1.UrlList|UrlList}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example include:samples/generated/v1/network_security.list_url_lists.js + * region_tag:networksecurity_v1_generated_NetworkSecurity_ListUrlLists_async + */ + listUrlListsAsync( + request?: protos.google.cloud.networksecurity.v1.IListUrlListsRequest, + options?: CallOptions): + AsyncIterable{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listUrlLists']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listUrlLists iterate %j', request); + return this.descriptors.page.listUrlLists.asyncIterate( + this.innerApiCalls['listUrlLists'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Lists TlsInspectionPolicies in a given project and location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The project and location from which the TlsInspectionPolicies + * should be listed, specified in the format + * `projects/{project}/locations/{location}`. + * @param {number} request.pageSize + * Maximum number of TlsInspectionPolicies to return per call. + * @param {string} request.pageToken + * The value returned by the last + * 'ListTlsInspectionPoliciesResponse' Indicates that this is a + * continuation of a prior 'ListTlsInspectionPolicies' call, and + * that the system should return the next page of data. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of {@link protos.google.cloud.networksecurity.v1.TlsInspectionPolicy|TlsInspectionPolicy}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listTlsInspectionPoliciesAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listTlsInspectionPolicies( + request?: protos.google.cloud.networksecurity.v1.IListTlsInspectionPoliciesRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.networksecurity.v1.ITlsInspectionPolicy[], + protos.google.cloud.networksecurity.v1.IListTlsInspectionPoliciesRequest|null, + protos.google.cloud.networksecurity.v1.IListTlsInspectionPoliciesResponse + ]>; + listTlsInspectionPolicies( + request: protos.google.cloud.networksecurity.v1.IListTlsInspectionPoliciesRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.networksecurity.v1.IListTlsInspectionPoliciesRequest, + protos.google.cloud.networksecurity.v1.IListTlsInspectionPoliciesResponse|null|undefined, + protos.google.cloud.networksecurity.v1.ITlsInspectionPolicy>): void; + listTlsInspectionPolicies( + request: protos.google.cloud.networksecurity.v1.IListTlsInspectionPoliciesRequest, + callback: PaginationCallback< + protos.google.cloud.networksecurity.v1.IListTlsInspectionPoliciesRequest, + protos.google.cloud.networksecurity.v1.IListTlsInspectionPoliciesResponse|null|undefined, + protos.google.cloud.networksecurity.v1.ITlsInspectionPolicy>): void; + listTlsInspectionPolicies( + request?: protos.google.cloud.networksecurity.v1.IListTlsInspectionPoliciesRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.cloud.networksecurity.v1.IListTlsInspectionPoliciesRequest, + protos.google.cloud.networksecurity.v1.IListTlsInspectionPoliciesResponse|null|undefined, + protos.google.cloud.networksecurity.v1.ITlsInspectionPolicy>, + callback?: PaginationCallback< + protos.google.cloud.networksecurity.v1.IListTlsInspectionPoliciesRequest, + protos.google.cloud.networksecurity.v1.IListTlsInspectionPoliciesResponse|null|undefined, + protos.google.cloud.networksecurity.v1.ITlsInspectionPolicy>): + Promise<[ + protos.google.cloud.networksecurity.v1.ITlsInspectionPolicy[], + protos.google.cloud.networksecurity.v1.IListTlsInspectionPoliciesRequest|null, + protos.google.cloud.networksecurity.v1.IListTlsInspectionPoliciesResponse + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize().catch(err => {throw err}); + const wrappedCallback: PaginationCallback< + protos.google.cloud.networksecurity.v1.IListTlsInspectionPoliciesRequest, + protos.google.cloud.networksecurity.v1.IListTlsInspectionPoliciesResponse|null|undefined, + protos.google.cloud.networksecurity.v1.ITlsInspectionPolicy>|undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listTlsInspectionPolicies values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listTlsInspectionPolicies request %j', request); + return this.innerApiCalls + .listTlsInspectionPolicies(request, options, wrappedCallback) + ?.then(([response, input, output]: [ + protos.google.cloud.networksecurity.v1.ITlsInspectionPolicy[], + protos.google.cloud.networksecurity.v1.IListTlsInspectionPoliciesRequest|null, + protos.google.cloud.networksecurity.v1.IListTlsInspectionPoliciesResponse + ]) => { + this._log.info('listTlsInspectionPolicies values %j', response); + return [response, input, output]; + }); + } + +/** + * Equivalent to `listTlsInspectionPolicies`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The project and location from which the TlsInspectionPolicies + * should be listed, specified in the format + * `projects/{project}/locations/{location}`. + * @param {number} request.pageSize + * Maximum number of TlsInspectionPolicies to return per call. + * @param {string} request.pageToken + * The value returned by the last + * 'ListTlsInspectionPoliciesResponse' Indicates that this is a + * continuation of a prior 'ListTlsInspectionPolicies' call, and + * that the system should return the next page of data. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing {@link protos.google.cloud.networksecurity.v1.TlsInspectionPolicy|TlsInspectionPolicy} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `listTlsInspectionPoliciesAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listTlsInspectionPoliciesStream( + request?: protos.google.cloud.networksecurity.v1.IListTlsInspectionPoliciesRequest, + options?: CallOptions): + Transform{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listTlsInspectionPolicies']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listTlsInspectionPolicies stream %j', request); + return this.descriptors.page.listTlsInspectionPolicies.createStream( + this.innerApiCalls.listTlsInspectionPolicies as GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listTlsInspectionPolicies`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The project and location from which the TlsInspectionPolicies + * should be listed, specified in the format + * `projects/{project}/locations/{location}`. + * @param {number} request.pageSize + * Maximum number of TlsInspectionPolicies to return per call. + * @param {string} request.pageToken + * The value returned by the last + * 'ListTlsInspectionPoliciesResponse' Indicates that this is a + * continuation of a prior 'ListTlsInspectionPolicies' call, and + * that the system should return the next page of data. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link protos.google.cloud.networksecurity.v1.TlsInspectionPolicy|TlsInspectionPolicy}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example include:samples/generated/v1/network_security.list_tls_inspection_policies.js + * region_tag:networksecurity_v1_generated_NetworkSecurity_ListTlsInspectionPolicies_async + */ + listTlsInspectionPoliciesAsync( + request?: protos.google.cloud.networksecurity.v1.IListTlsInspectionPoliciesRequest, + options?: CallOptions): + AsyncIterable{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listTlsInspectionPolicies']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listTlsInspectionPolicies iterate %j', request); + return this.descriptors.page.listTlsInspectionPolicies.asyncIterate( + this.innerApiCalls['listTlsInspectionPolicies'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Lists AuthzPolicies in a given project and location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The project and location from which the `AuthzPolicy` resources + * are listed, specified in the following format: + * `projects/{project}/locations/{location}`. + * @param {number} [request.pageSize] + * Optional. Requested page size. The server might return fewer items than + * requested. If unspecified, the server picks an appropriate default. + * @param {string} [request.pageToken] + * Optional. A token identifying a page of results that the server returns. + * @param {string} [request.filter] + * Optional. Filtering results. + * @param {string} [request.orderBy] + * Optional. Hint for how to order the results. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of {@link protos.google.cloud.networksecurity.v1.AuthzPolicy|AuthzPolicy}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listAuthzPoliciesAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listAuthzPolicies( + request?: protos.google.cloud.networksecurity.v1.IListAuthzPoliciesRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.networksecurity.v1.IAuthzPolicy[], + protos.google.cloud.networksecurity.v1.IListAuthzPoliciesRequest|null, + protos.google.cloud.networksecurity.v1.IListAuthzPoliciesResponse + ]>; + listAuthzPolicies( + request: protos.google.cloud.networksecurity.v1.IListAuthzPoliciesRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.networksecurity.v1.IListAuthzPoliciesRequest, + protos.google.cloud.networksecurity.v1.IListAuthzPoliciesResponse|null|undefined, + protos.google.cloud.networksecurity.v1.IAuthzPolicy>): void; + listAuthzPolicies( + request: protos.google.cloud.networksecurity.v1.IListAuthzPoliciesRequest, + callback: PaginationCallback< + protos.google.cloud.networksecurity.v1.IListAuthzPoliciesRequest, + protos.google.cloud.networksecurity.v1.IListAuthzPoliciesResponse|null|undefined, + protos.google.cloud.networksecurity.v1.IAuthzPolicy>): void; + listAuthzPolicies( + request?: protos.google.cloud.networksecurity.v1.IListAuthzPoliciesRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.cloud.networksecurity.v1.IListAuthzPoliciesRequest, + protos.google.cloud.networksecurity.v1.IListAuthzPoliciesResponse|null|undefined, + protos.google.cloud.networksecurity.v1.IAuthzPolicy>, + callback?: PaginationCallback< + protos.google.cloud.networksecurity.v1.IListAuthzPoliciesRequest, + protos.google.cloud.networksecurity.v1.IListAuthzPoliciesResponse|null|undefined, + protos.google.cloud.networksecurity.v1.IAuthzPolicy>): + Promise<[ + protos.google.cloud.networksecurity.v1.IAuthzPolicy[], + protos.google.cloud.networksecurity.v1.IListAuthzPoliciesRequest|null, + protos.google.cloud.networksecurity.v1.IListAuthzPoliciesResponse + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize().catch(err => {throw err}); + const wrappedCallback: PaginationCallback< + protos.google.cloud.networksecurity.v1.IListAuthzPoliciesRequest, + protos.google.cloud.networksecurity.v1.IListAuthzPoliciesResponse|null|undefined, + protos.google.cloud.networksecurity.v1.IAuthzPolicy>|undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listAuthzPolicies values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listAuthzPolicies request %j', request); + return this.innerApiCalls + .listAuthzPolicies(request, options, wrappedCallback) + ?.then(([response, input, output]: [ + protos.google.cloud.networksecurity.v1.IAuthzPolicy[], + protos.google.cloud.networksecurity.v1.IListAuthzPoliciesRequest|null, + protos.google.cloud.networksecurity.v1.IListAuthzPoliciesResponse + ]) => { + this._log.info('listAuthzPolicies values %j', response); + return [response, input, output]; + }); + } + +/** + * Equivalent to `listAuthzPolicies`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The project and location from which the `AuthzPolicy` resources + * are listed, specified in the following format: + * `projects/{project}/locations/{location}`. + * @param {number} [request.pageSize] + * Optional. Requested page size. The server might return fewer items than + * requested. If unspecified, the server picks an appropriate default. + * @param {string} [request.pageToken] + * Optional. A token identifying a page of results that the server returns. + * @param {string} [request.filter] + * Optional. Filtering results. + * @param {string} [request.orderBy] + * Optional. Hint for how to order the results. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing {@link protos.google.cloud.networksecurity.v1.AuthzPolicy|AuthzPolicy} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `listAuthzPoliciesAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listAuthzPoliciesStream( + request?: protos.google.cloud.networksecurity.v1.IListAuthzPoliciesRequest, + options?: CallOptions): + Transform{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listAuthzPolicies']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listAuthzPolicies stream %j', request); + return this.descriptors.page.listAuthzPolicies.createStream( + this.innerApiCalls.listAuthzPolicies as GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listAuthzPolicies`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The project and location from which the `AuthzPolicy` resources + * are listed, specified in the following format: + * `projects/{project}/locations/{location}`. + * @param {number} [request.pageSize] + * Optional. Requested page size. The server might return fewer items than + * requested. If unspecified, the server picks an appropriate default. + * @param {string} [request.pageToken] + * Optional. A token identifying a page of results that the server returns. + * @param {string} [request.filter] + * Optional. Filtering results. + * @param {string} [request.orderBy] + * Optional. Hint for how to order the results. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link protos.google.cloud.networksecurity.v1.AuthzPolicy|AuthzPolicy}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example include:samples/generated/v1/network_security.list_authz_policies.js + * region_tag:networksecurity_v1_generated_NetworkSecurity_ListAuthzPolicies_async + */ + listAuthzPoliciesAsync( + request?: protos.google.cloud.networksecurity.v1.IListAuthzPoliciesRequest, + options?: CallOptions): + AsyncIterable{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listAuthzPolicies']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listAuthzPolicies iterate %j', request); + return this.descriptors.page.listAuthzPolicies.asyncIterate( + this.innerApiCalls['listAuthzPolicies'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } +/** + * Gets the access control policy for a resource. Returns an empty policy + * if the resource exists and does not have a policy set. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.resource + * REQUIRED: The resource for which the policy is being requested. + * See the operation documentation for the appropriate value for this field. + * @param {Object} [request.options] + * OPTIONAL: A `GetPolicyOptions` object for specifying options to + * `GetIamPolicy`. This field is only used by Cloud IAM. + * + * This object should have the same structure as {@link google.iam.v1.GetPolicyOptions | GetPolicyOptions}. + * @param {Object} [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.CallOptions} for the details. + * @param {function(?Error, ?Object)} [callback] + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing {@link google.iam.v1.Policy | Policy}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.iam.v1.Policy | Policy}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + getIamPolicy( + request: IamProtos.google.iam.v1.GetIamPolicyRequest, + options?: + | gax.CallOptions + | Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.GetIamPolicyRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.GetIamPolicyRequest | null | undefined, + {} | null | undefined + > + ):Promise<[IamProtos.google.iam.v1.Policy]> { + return this.iamClient.getIamPolicy(request, options, callback); + } + +/** + * Returns permissions that a caller has on the specified resource. If the + * resource does not exist, this will return an empty set of + * permissions, not a NOT_FOUND error. + * + * Note: This operation is designed to be used for building + * permission-aware UIs and command-line tools, not for authorization + * checking. This operation may "fail open" without warning. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.resource + * REQUIRED: The resource for which the policy detail is being requested. + * See the operation documentation for the appropriate value for this field. + * @param {string[]} request.permissions + * The set of permissions to check for the `resource`. Permissions with + * wildcards (such as '*' or 'storage.*') are not allowed. For more + * information see {@link https://cloud.google.com/iam/docs/overview#permissions | IAM Overview }. + * @param {Object} [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.CallOptions} for the details. + * @param {function(?Error, ?Object)} [callback] + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + setIamPolicy( + request: IamProtos.google.iam.v1.SetIamPolicyRequest, + options?: + | gax.CallOptions + | Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.SetIamPolicyRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.SetIamPolicyRequest | null | undefined, + {} | null | undefined + > + ):Promise<[IamProtos.google.iam.v1.Policy]> { + return this.iamClient.setIamPolicy(request, options, callback); + } + +/** + * Returns permissions that a caller has on the specified resource. If the + * resource does not exist, this will return an empty set of + * permissions, not a NOT_FOUND error. + * + * Note: This operation is designed to be used for building + * permission-aware UIs and command-line tools, not for authorization + * checking. This operation may "fail open" without warning. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.resource + * REQUIRED: The resource for which the policy detail is being requested. + * See the operation documentation for the appropriate value for this field. + * @param {string[]} request.permissions + * The set of permissions to check for the `resource`. Permissions with + * wildcards (such as '*' or 'storage.*') are not allowed. For more + * information see {@link https://cloud.google.com/iam/docs/overview#permissions | IAM Overview }. + * @param {Object} [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.CallOptions} for the details. + * @param {function(?Error, ?Object)} [callback] + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. + * The promise has a method named "cancel" which cancels the ongoing API call. + * */ testIamPermissions( request: IamProtos.google.iam.v1.TestIamPermissionsRequest, options?: | gax.CallOptions | Callback< - IamProtos.google.iam.v1.TestIamPermissionsResponse, - IamProtos.google.iam.v1.TestIamPermissionsRequest | null | undefined, + IamProtos.google.iam.v1.TestIamPermissionsResponse, + IamProtos.google.iam.v1.TestIamPermissionsRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + IamProtos.google.iam.v1.TestIamPermissionsResponse, + IamProtos.google.iam.v1.TestIamPermissionsRequest | null | undefined, + {} | null | undefined + > + ):Promise<[IamProtos.google.iam.v1.TestIamPermissionsResponse]> { + return this.iamClient.testIamPermissions(request, options, callback); + } + +/** + * Gets information about a location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Resource name for the location. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html | CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.cloud.location.Location | Location}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example + * ``` + * const [response] = await client.getLocation(request); + * ``` + */ + getLocation( + request: LocationProtos.google.cloud.location.IGetLocationRequest, + options?: + | gax.CallOptions + | Callback< + LocationProtos.google.cloud.location.ILocation, + | LocationProtos.google.cloud.location.IGetLocationRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + LocationProtos.google.cloud.location.ILocation, + | LocationProtos.google.cloud.location.IGetLocationRequest + | null + | undefined, + {} | null | undefined + > + ): Promise { + return this.locationsClient.getLocation(request, options, callback); + } + +/** + * Lists information about the supported locations for this service. Returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * The resource that owns the locations collection, if applicable. + * @param {string} request.filter + * The standard list filter. + * @param {number} request.pageSize + * The standard list page size. + * @param {string} request.pageToken + * The standard list page token. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link google.cloud.location.Location | Location}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example + * ``` + * const iterable = client.listLocationsAsync(request); + * for await (const response of iterable) { + * // process response + * } + * ``` + */ + listLocationsAsync( + request: LocationProtos.google.cloud.location.IListLocationsRequest, + options?: CallOptions + ): AsyncIterable { + return this.locationsClient.listLocationsAsync(request, options); + } + +/** + * Gets the latest state of a long-running operation. Clients can use this + * method to poll the operation result at intervals as recommended by the API + * service. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation resource. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions} + * for the details. + * @param {function(?Error, ?Object)=} callback + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing + * {@link google.longrunning.Operation | google.longrunning.Operation}. + * @return {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * {@link google.longrunning.Operation | google.longrunning.Operation}. + * The promise has a method named "cancel" which cancels the ongoing API call. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * const name = ''; + * const [response] = await client.getOperation({name}); + * // doThingsWith(response) + * ``` + */ + getOperation( + request: protos.google.longrunning.GetOperationRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protos.google.longrunning.Operation, + protos.google.longrunning.GetOperationRequest, + {} | null | undefined + >, + callback?: Callback< + protos.google.longrunning.Operation, + protos.google.longrunning.GetOperationRequest, + {} | null | undefined + > + ): Promise<[protos.google.longrunning.Operation]> { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + return this.operationsClient.getOperation(request, options, callback); + } + /** + * Lists operations that match the specified filter in the request. If the + * server doesn't support this method, it returns `UNIMPLEMENTED`. Returns an iterable object. + * + * For-await-of syntax is used with the iterable to recursively get response element on-demand. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation collection. + * @param {string} request.filter - The standard list filter. + * @param {number=} request.pageSize - + * The maximum number of resources contained in the underlying API + * response. If page streaming is performed per-resource, this + * parameter does not affect the return value. If page streaming is + * performed per-page, this determines the maximum number of + * resources in a page. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions} for the + * details. + * @returns {Object} + * An iterable Object that conforms to {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | iteration protocols}. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * for await (const response of client.listOperationsAsync(request)); + * // doThingsWith(response) + * ``` + */ + listOperationsAsync( + request: protos.google.longrunning.ListOperationsRequest, + options?: gax.CallOptions + ): AsyncIterable { + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + return this.operationsClient.listOperationsAsync(request, options); + } + /** + * Starts asynchronous cancellation on a long-running operation. The server + * makes a best effort to cancel the operation, but success is not + * guaranteed. If the server doesn't support this method, it returns + * `google.rpc.Code.UNIMPLEMENTED`. Clients can use + * {@link Operations.GetOperation} or + * other methods to check whether the cancellation succeeded or whether the + * operation completed despite cancellation. On successful cancellation, + * the operation is not deleted; instead, it becomes an operation with + * an {@link Operation.error} value with a {@link google.rpc.Status.code} of + * 1, corresponding to `Code.CANCELLED`. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation resource to be cancelled. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions} for the + * details. + * @param {function(?Error)=} callback + * The function which will be called with the result of the API call. + * @return {Promise} - The promise which resolves when API call finishes. + * The promise has a method named "cancel" which cancels the ongoing API + * call. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * await client.cancelOperation({name: ''}); + * ``` + */ + cancelOperation( + request: protos.google.longrunning.CancelOperationRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protos.google.longrunning.CancelOperationRequest, + protos.google.protobuf.Empty, + {} | undefined | null + >, + callback?: Callback< + protos.google.longrunning.CancelOperationRequest, + protos.google.protobuf.Empty, + {} | undefined | null + > + ): Promise { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + return this.operationsClient.cancelOperation(request, options, callback); + } + + /** + * Deletes a long-running operation. This method indicates that the client is + * no longer interested in the operation result. It does not cancel the + * operation. If the server doesn't support this method, it returns + * `google.rpc.Code.UNIMPLEMENTED`. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation resource to be deleted. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions} + * for the details. + * @param {function(?Error)=} callback + * The function which will be called with the result of the API call. + * @return {Promise} - The promise which resolves when API call finishes. + * The promise has a method named "cancel" which cancels the ongoing API + * call. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * await client.deleteOperation({name: ''}); + * ``` + */ + deleteOperation( + request: protos.google.longrunning.DeleteOperationRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protos.google.protobuf.Empty, + protos.google.longrunning.DeleteOperationRequest, {} | null | undefined >, callback?: Callback< - IamProtos.google.iam.v1.TestIamPermissionsResponse, - IamProtos.google.iam.v1.TestIamPermissionsRequest | null | undefined, + protos.google.protobuf.Empty, + protos.google.longrunning.DeleteOperationRequest, {} | null | undefined > - ):Promise<[IamProtos.google.iam.v1.TestIamPermissionsResponse]> { - return this.iamClient.testIamPermissions(request, options, callback); + ): Promise { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + return this.operationsClient.deleteOperation(request, options, callback); + } + + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified authorizationPolicy resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} authorization_policy + * @returns {string} Resource name string. + */ + authorizationPolicyPath(project:string,location:string,authorizationPolicy:string) { + return this.pathTemplates.authorizationPolicyPathTemplate.render({ + project: project, + location: location, + authorization_policy: authorizationPolicy, + }); + } + + /** + * Parse the project from AuthorizationPolicy resource. + * + * @param {string} authorizationPolicyName + * A fully-qualified path representing AuthorizationPolicy resource. + * @returns {string} A string representing the project. + */ + matchProjectFromAuthorizationPolicyName(authorizationPolicyName: string) { + return this.pathTemplates.authorizationPolicyPathTemplate.match(authorizationPolicyName).project; + } + + /** + * Parse the location from AuthorizationPolicy resource. + * + * @param {string} authorizationPolicyName + * A fully-qualified path representing AuthorizationPolicy resource. + * @returns {string} A string representing the location. + */ + matchLocationFromAuthorizationPolicyName(authorizationPolicyName: string) { + return this.pathTemplates.authorizationPolicyPathTemplate.match(authorizationPolicyName).location; + } + + /** + * Parse the authorization_policy from AuthorizationPolicy resource. + * + * @param {string} authorizationPolicyName + * A fully-qualified path representing AuthorizationPolicy resource. + * @returns {string} A string representing the authorization_policy. + */ + matchAuthorizationPolicyFromAuthorizationPolicyName(authorizationPolicyName: string) { + return this.pathTemplates.authorizationPolicyPathTemplate.match(authorizationPolicyName).authorization_policy; + } + + /** + * Return a fully-qualified authzPolicy resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} authz_policy + * @returns {string} Resource name string. + */ + authzPolicyPath(project:string,location:string,authzPolicy:string) { + return this.pathTemplates.authzPolicyPathTemplate.render({ + project: project, + location: location, + authz_policy: authzPolicy, + }); + } + + /** + * Parse the project from AuthzPolicy resource. + * + * @param {string} authzPolicyName + * A fully-qualified path representing AuthzPolicy resource. + * @returns {string} A string representing the project. + */ + matchProjectFromAuthzPolicyName(authzPolicyName: string) { + return this.pathTemplates.authzPolicyPathTemplate.match(authzPolicyName).project; + } + + /** + * Parse the location from AuthzPolicy resource. + * + * @param {string} authzPolicyName + * A fully-qualified path representing AuthzPolicy resource. + * @returns {string} A string representing the location. + */ + matchLocationFromAuthzPolicyName(authzPolicyName: string) { + return this.pathTemplates.authzPolicyPathTemplate.match(authzPolicyName).location; + } + + /** + * Parse the authz_policy from AuthzPolicy resource. + * + * @param {string} authzPolicyName + * A fully-qualified path representing AuthzPolicy resource. + * @returns {string} A string representing the authz_policy. + */ + matchAuthzPolicyFromAuthzPolicyName(authzPolicyName: string) { + return this.pathTemplates.authzPolicyPathTemplate.match(authzPolicyName).authz_policy; + } + + /** + * Return a fully-qualified backendAuthenticationConfig resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} backend_authentication_config + * @returns {string} Resource name string. + */ + backendAuthenticationConfigPath(project:string,location:string,backendAuthenticationConfig:string) { + return this.pathTemplates.backendAuthenticationConfigPathTemplate.render({ + project: project, + location: location, + backend_authentication_config: backendAuthenticationConfig, + }); + } + + /** + * Parse the project from BackendAuthenticationConfig resource. + * + * @param {string} backendAuthenticationConfigName + * A fully-qualified path representing BackendAuthenticationConfig resource. + * @returns {string} A string representing the project. + */ + matchProjectFromBackendAuthenticationConfigName(backendAuthenticationConfigName: string) { + return this.pathTemplates.backendAuthenticationConfigPathTemplate.match(backendAuthenticationConfigName).project; + } + + /** + * Parse the location from BackendAuthenticationConfig resource. + * + * @param {string} backendAuthenticationConfigName + * A fully-qualified path representing BackendAuthenticationConfig resource. + * @returns {string} A string representing the location. + */ + matchLocationFromBackendAuthenticationConfigName(backendAuthenticationConfigName: string) { + return this.pathTemplates.backendAuthenticationConfigPathTemplate.match(backendAuthenticationConfigName).location; + } + + /** + * Parse the backend_authentication_config from BackendAuthenticationConfig resource. + * + * @param {string} backendAuthenticationConfigName + * A fully-qualified path representing BackendAuthenticationConfig resource. + * @returns {string} A string representing the backend_authentication_config. + */ + matchBackendAuthenticationConfigFromBackendAuthenticationConfigName(backendAuthenticationConfigName: string) { + return this.pathTemplates.backendAuthenticationConfigPathTemplate.match(backendAuthenticationConfigName).backend_authentication_config; + } + + /** + * Return a fully-qualified clientTlsPolicy resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} client_tls_policy + * @returns {string} Resource name string. + */ + clientTlsPolicyPath(project:string,location:string,clientTlsPolicy:string) { + return this.pathTemplates.clientTlsPolicyPathTemplate.render({ + project: project, + location: location, + client_tls_policy: clientTlsPolicy, + }); + } + + /** + * Parse the project from ClientTlsPolicy resource. + * + * @param {string} clientTlsPolicyName + * A fully-qualified path representing ClientTlsPolicy resource. + * @returns {string} A string representing the project. + */ + matchProjectFromClientTlsPolicyName(clientTlsPolicyName: string) { + return this.pathTemplates.clientTlsPolicyPathTemplate.match(clientTlsPolicyName).project; + } + + /** + * Parse the location from ClientTlsPolicy resource. + * + * @param {string} clientTlsPolicyName + * A fully-qualified path representing ClientTlsPolicy resource. + * @returns {string} A string representing the location. + */ + matchLocationFromClientTlsPolicyName(clientTlsPolicyName: string) { + return this.pathTemplates.clientTlsPolicyPathTemplate.match(clientTlsPolicyName).location; + } + + /** + * Parse the client_tls_policy from ClientTlsPolicy resource. + * + * @param {string} clientTlsPolicyName + * A fully-qualified path representing ClientTlsPolicy resource. + * @returns {string} A string representing the client_tls_policy. + */ + matchClientTlsPolicyFromClientTlsPolicyName(clientTlsPolicyName: string) { + return this.pathTemplates.clientTlsPolicyPathTemplate.match(clientTlsPolicyName).client_tls_policy; + } + + /** + * Return a fully-qualified dnsThreatDetector resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} dns_threat_detector + * @returns {string} Resource name string. + */ + dnsThreatDetectorPath(project:string,location:string,dnsThreatDetector:string) { + return this.pathTemplates.dnsThreatDetectorPathTemplate.render({ + project: project, + location: location, + dns_threat_detector: dnsThreatDetector, + }); + } + + /** + * Parse the project from DnsThreatDetector resource. + * + * @param {string} dnsThreatDetectorName + * A fully-qualified path representing DnsThreatDetector resource. + * @returns {string} A string representing the project. + */ + matchProjectFromDnsThreatDetectorName(dnsThreatDetectorName: string) { + return this.pathTemplates.dnsThreatDetectorPathTemplate.match(dnsThreatDetectorName).project; + } + + /** + * Parse the location from DnsThreatDetector resource. + * + * @param {string} dnsThreatDetectorName + * A fully-qualified path representing DnsThreatDetector resource. + * @returns {string} A string representing the location. + */ + matchLocationFromDnsThreatDetectorName(dnsThreatDetectorName: string) { + return this.pathTemplates.dnsThreatDetectorPathTemplate.match(dnsThreatDetectorName).location; + } + + /** + * Parse the dns_threat_detector from DnsThreatDetector resource. + * + * @param {string} dnsThreatDetectorName + * A fully-qualified path representing DnsThreatDetector resource. + * @returns {string} A string representing the dns_threat_detector. + */ + matchDnsThreatDetectorFromDnsThreatDetectorName(dnsThreatDetectorName: string) { + return this.pathTemplates.dnsThreatDetectorPathTemplate.match(dnsThreatDetectorName).dns_threat_detector; + } + + /** + * Return a fully-qualified firewallEndpointAssociation resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} firewall_endpoint_association + * @returns {string} Resource name string. + */ + firewallEndpointAssociationPath(project:string,location:string,firewallEndpointAssociation:string) { + return this.pathTemplates.firewallEndpointAssociationPathTemplate.render({ + project: project, + location: location, + firewall_endpoint_association: firewallEndpointAssociation, + }); } -/** - * Gets information about a location. + /** + * Parse the project from FirewallEndpointAssociation resource. * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Resource name for the location. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html | CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.cloud.location.Location | Location}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * for more details and examples. - * @example - * ``` - * const [response] = await client.getLocation(request); - * ``` + * @param {string} firewallEndpointAssociationName + * A fully-qualified path representing FirewallEndpointAssociation resource. + * @returns {string} A string representing the project. */ - getLocation( - request: LocationProtos.google.cloud.location.IGetLocationRequest, - options?: - | gax.CallOptions - | Callback< - LocationProtos.google.cloud.location.ILocation, - | LocationProtos.google.cloud.location.IGetLocationRequest - | null - | undefined, - {} | null | undefined - >, - callback?: Callback< - LocationProtos.google.cloud.location.ILocation, - | LocationProtos.google.cloud.location.IGetLocationRequest - | null - | undefined, - {} | null | undefined - > - ): Promise { - return this.locationsClient.getLocation(request, options, callback); + matchProjectFromFirewallEndpointAssociationName(firewallEndpointAssociationName: string) { + return this.pathTemplates.firewallEndpointAssociationPathTemplate.match(firewallEndpointAssociationName).project; } -/** - * Lists information about the supported locations for this service. Returns an iterable object. + /** + * Parse the location from FirewallEndpointAssociation resource. * - * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * The resource that owns the locations collection, if applicable. - * @param {string} request.filter - * The standard list filter. - * @param {number} request.pageSize - * The standard list page size. - * @param {string} request.pageToken - * The standard list page token. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Object} - * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. - * When you iterate the returned iterable, each element will be an object representing - * {@link google.cloud.location.Location | Location}. The API will be called under the hood as needed, once per the page, - * so you can stop the iteration when you don't need more results. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } - * for more details and examples. - * @example - * ``` - * const iterable = client.listLocationsAsync(request); - * for await (const response of iterable) { - * // process response - * } - * ``` + * @param {string} firewallEndpointAssociationName + * A fully-qualified path representing FirewallEndpointAssociation resource. + * @returns {string} A string representing the location. */ - listLocationsAsync( - request: LocationProtos.google.cloud.location.IListLocationsRequest, - options?: CallOptions - ): AsyncIterable { - return this.locationsClient.listLocationsAsync(request, options); + matchLocationFromFirewallEndpointAssociationName(firewallEndpointAssociationName: string) { + return this.pathTemplates.firewallEndpointAssociationPathTemplate.match(firewallEndpointAssociationName).location; + } + + /** + * Parse the firewall_endpoint_association from FirewallEndpointAssociation resource. + * + * @param {string} firewallEndpointAssociationName + * A fully-qualified path representing FirewallEndpointAssociation resource. + * @returns {string} A string representing the firewall_endpoint_association. + */ + matchFirewallEndpointAssociationFromFirewallEndpointAssociationName(firewallEndpointAssociationName: string) { + return this.pathTemplates.firewallEndpointAssociationPathTemplate.match(firewallEndpointAssociationName).firewall_endpoint_association; + } + + /** + * Return a fully-qualified gatewaySecurityPolicy resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} gateway_security_policy + * @returns {string} Resource name string. + */ + gatewaySecurityPolicyPath(project:string,location:string,gatewaySecurityPolicy:string) { + return this.pathTemplates.gatewaySecurityPolicyPathTemplate.render({ + project: project, + location: location, + gateway_security_policy: gatewaySecurityPolicy, + }); + } + + /** + * Parse the project from GatewaySecurityPolicy resource. + * + * @param {string} gatewaySecurityPolicyName + * A fully-qualified path representing GatewaySecurityPolicy resource. + * @returns {string} A string representing the project. + */ + matchProjectFromGatewaySecurityPolicyName(gatewaySecurityPolicyName: string) { + return this.pathTemplates.gatewaySecurityPolicyPathTemplate.match(gatewaySecurityPolicyName).project; + } + + /** + * Parse the location from GatewaySecurityPolicy resource. + * + * @param {string} gatewaySecurityPolicyName + * A fully-qualified path representing GatewaySecurityPolicy resource. + * @returns {string} A string representing the location. + */ + matchLocationFromGatewaySecurityPolicyName(gatewaySecurityPolicyName: string) { + return this.pathTemplates.gatewaySecurityPolicyPathTemplate.match(gatewaySecurityPolicyName).location; + } + + /** + * Parse the gateway_security_policy from GatewaySecurityPolicy resource. + * + * @param {string} gatewaySecurityPolicyName + * A fully-qualified path representing GatewaySecurityPolicy resource. + * @returns {string} A string representing the gateway_security_policy. + */ + matchGatewaySecurityPolicyFromGatewaySecurityPolicyName(gatewaySecurityPolicyName: string) { + return this.pathTemplates.gatewaySecurityPolicyPathTemplate.match(gatewaySecurityPolicyName).gateway_security_policy; + } + + /** + * Return a fully-qualified gatewaySecurityPolicyRule resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} gateway_security_policy + * @param {string} rule + * @returns {string} Resource name string. + */ + gatewaySecurityPolicyRulePath(project:string,location:string,gatewaySecurityPolicy:string,rule:string) { + return this.pathTemplates.gatewaySecurityPolicyRulePathTemplate.render({ + project: project, + location: location, + gateway_security_policy: gatewaySecurityPolicy, + rule: rule, + }); + } + + /** + * Parse the project from GatewaySecurityPolicyRule resource. + * + * @param {string} gatewaySecurityPolicyRuleName + * A fully-qualified path representing GatewaySecurityPolicyRule resource. + * @returns {string} A string representing the project. + */ + matchProjectFromGatewaySecurityPolicyRuleName(gatewaySecurityPolicyRuleName: string) { + return this.pathTemplates.gatewaySecurityPolicyRulePathTemplate.match(gatewaySecurityPolicyRuleName).project; + } + + /** + * Parse the location from GatewaySecurityPolicyRule resource. + * + * @param {string} gatewaySecurityPolicyRuleName + * A fully-qualified path representing GatewaySecurityPolicyRule resource. + * @returns {string} A string representing the location. + */ + matchLocationFromGatewaySecurityPolicyRuleName(gatewaySecurityPolicyRuleName: string) { + return this.pathTemplates.gatewaySecurityPolicyRulePathTemplate.match(gatewaySecurityPolicyRuleName).location; + } + + /** + * Parse the gateway_security_policy from GatewaySecurityPolicyRule resource. + * + * @param {string} gatewaySecurityPolicyRuleName + * A fully-qualified path representing GatewaySecurityPolicyRule resource. + * @returns {string} A string representing the gateway_security_policy. + */ + matchGatewaySecurityPolicyFromGatewaySecurityPolicyRuleName(gatewaySecurityPolicyRuleName: string) { + return this.pathTemplates.gatewaySecurityPolicyRulePathTemplate.match(gatewaySecurityPolicyRuleName).gateway_security_policy; + } + + /** + * Parse the rule from GatewaySecurityPolicyRule resource. + * + * @param {string} gatewaySecurityPolicyRuleName + * A fully-qualified path representing GatewaySecurityPolicyRule resource. + * @returns {string} A string representing the rule. + */ + matchRuleFromGatewaySecurityPolicyRuleName(gatewaySecurityPolicyRuleName: string) { + return this.pathTemplates.gatewaySecurityPolicyRulePathTemplate.match(gatewaySecurityPolicyRuleName).rule; + } + + /** + * Return a fully-qualified interceptDeployment resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} intercept_deployment + * @returns {string} Resource name string. + */ + interceptDeploymentPath(project:string,location:string,interceptDeployment:string) { + return this.pathTemplates.interceptDeploymentPathTemplate.render({ + project: project, + location: location, + intercept_deployment: interceptDeployment, + }); + } + + /** + * Parse the project from InterceptDeployment resource. + * + * @param {string} interceptDeploymentName + * A fully-qualified path representing InterceptDeployment resource. + * @returns {string} A string representing the project. + */ + matchProjectFromInterceptDeploymentName(interceptDeploymentName: string) { + return this.pathTemplates.interceptDeploymentPathTemplate.match(interceptDeploymentName).project; + } + + /** + * Parse the location from InterceptDeployment resource. + * + * @param {string} interceptDeploymentName + * A fully-qualified path representing InterceptDeployment resource. + * @returns {string} A string representing the location. + */ + matchLocationFromInterceptDeploymentName(interceptDeploymentName: string) { + return this.pathTemplates.interceptDeploymentPathTemplate.match(interceptDeploymentName).location; + } + + /** + * Parse the intercept_deployment from InterceptDeployment resource. + * + * @param {string} interceptDeploymentName + * A fully-qualified path representing InterceptDeployment resource. + * @returns {string} A string representing the intercept_deployment. + */ + matchInterceptDeploymentFromInterceptDeploymentName(interceptDeploymentName: string) { + return this.pathTemplates.interceptDeploymentPathTemplate.match(interceptDeploymentName).intercept_deployment; + } + + /** + * Return a fully-qualified interceptDeploymentGroup resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} intercept_deployment_group + * @returns {string} Resource name string. + */ + interceptDeploymentGroupPath(project:string,location:string,interceptDeploymentGroup:string) { + return this.pathTemplates.interceptDeploymentGroupPathTemplate.render({ + project: project, + location: location, + intercept_deployment_group: interceptDeploymentGroup, + }); + } + + /** + * Parse the project from InterceptDeploymentGroup resource. + * + * @param {string} interceptDeploymentGroupName + * A fully-qualified path representing InterceptDeploymentGroup resource. + * @returns {string} A string representing the project. + */ + matchProjectFromInterceptDeploymentGroupName(interceptDeploymentGroupName: string) { + return this.pathTemplates.interceptDeploymentGroupPathTemplate.match(interceptDeploymentGroupName).project; + } + + /** + * Parse the location from InterceptDeploymentGroup resource. + * + * @param {string} interceptDeploymentGroupName + * A fully-qualified path representing InterceptDeploymentGroup resource. + * @returns {string} A string representing the location. + */ + matchLocationFromInterceptDeploymentGroupName(interceptDeploymentGroupName: string) { + return this.pathTemplates.interceptDeploymentGroupPathTemplate.match(interceptDeploymentGroupName).location; + } + + /** + * Parse the intercept_deployment_group from InterceptDeploymentGroup resource. + * + * @param {string} interceptDeploymentGroupName + * A fully-qualified path representing InterceptDeploymentGroup resource. + * @returns {string} A string representing the intercept_deployment_group. + */ + matchInterceptDeploymentGroupFromInterceptDeploymentGroupName(interceptDeploymentGroupName: string) { + return this.pathTemplates.interceptDeploymentGroupPathTemplate.match(interceptDeploymentGroupName).intercept_deployment_group; + } + + /** + * Return a fully-qualified interceptEndpointGroup resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} intercept_endpoint_group + * @returns {string} Resource name string. + */ + interceptEndpointGroupPath(project:string,location:string,interceptEndpointGroup:string) { + return this.pathTemplates.interceptEndpointGroupPathTemplate.render({ + project: project, + location: location, + intercept_endpoint_group: interceptEndpointGroup, + }); + } + + /** + * Parse the project from InterceptEndpointGroup resource. + * + * @param {string} interceptEndpointGroupName + * A fully-qualified path representing InterceptEndpointGroup resource. + * @returns {string} A string representing the project. + */ + matchProjectFromInterceptEndpointGroupName(interceptEndpointGroupName: string) { + return this.pathTemplates.interceptEndpointGroupPathTemplate.match(interceptEndpointGroupName).project; + } + + /** + * Parse the location from InterceptEndpointGroup resource. + * + * @param {string} interceptEndpointGroupName + * A fully-qualified path representing InterceptEndpointGroup resource. + * @returns {string} A string representing the location. + */ + matchLocationFromInterceptEndpointGroupName(interceptEndpointGroupName: string) { + return this.pathTemplates.interceptEndpointGroupPathTemplate.match(interceptEndpointGroupName).location; + } + + /** + * Parse the intercept_endpoint_group from InterceptEndpointGroup resource. + * + * @param {string} interceptEndpointGroupName + * A fully-qualified path representing InterceptEndpointGroup resource. + * @returns {string} A string representing the intercept_endpoint_group. + */ + matchInterceptEndpointGroupFromInterceptEndpointGroupName(interceptEndpointGroupName: string) { + return this.pathTemplates.interceptEndpointGroupPathTemplate.match(interceptEndpointGroupName).intercept_endpoint_group; + } + + /** + * Return a fully-qualified interceptEndpointGroupAssociation resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} intercept_endpoint_group_association + * @returns {string} Resource name string. + */ + interceptEndpointGroupAssociationPath(project:string,location:string,interceptEndpointGroupAssociation:string) { + return this.pathTemplates.interceptEndpointGroupAssociationPathTemplate.render({ + project: project, + location: location, + intercept_endpoint_group_association: interceptEndpointGroupAssociation, + }); + } + + /** + * Parse the project from InterceptEndpointGroupAssociation resource. + * + * @param {string} interceptEndpointGroupAssociationName + * A fully-qualified path representing InterceptEndpointGroupAssociation resource. + * @returns {string} A string representing the project. + */ + matchProjectFromInterceptEndpointGroupAssociationName(interceptEndpointGroupAssociationName: string) { + return this.pathTemplates.interceptEndpointGroupAssociationPathTemplate.match(interceptEndpointGroupAssociationName).project; + } + + /** + * Parse the location from InterceptEndpointGroupAssociation resource. + * + * @param {string} interceptEndpointGroupAssociationName + * A fully-qualified path representing InterceptEndpointGroupAssociation resource. + * @returns {string} A string representing the location. + */ + matchLocationFromInterceptEndpointGroupAssociationName(interceptEndpointGroupAssociationName: string) { + return this.pathTemplates.interceptEndpointGroupAssociationPathTemplate.match(interceptEndpointGroupAssociationName).location; } -/** - * Gets the latest state of a long-running operation. Clients can use this - * method to poll the operation result at intervals as recommended by the API - * service. - * - * @param {Object} request - The request object that will be sent. - * @param {string} request.name - The name of the operation resource. - * @param {Object=} options - * Optional parameters. You can override the default settings for this call, - * e.g, timeout, retries, paginations, etc. See {@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions} - * for the details. - * @param {function(?Error, ?Object)=} callback - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is an object representing - * {@link google.longrunning.Operation | google.longrunning.Operation}. - * @return {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * {@link google.longrunning.Operation | google.longrunning.Operation}. - * The promise has a method named "cancel" which cancels the ongoing API call. + /** + * Parse the intercept_endpoint_group_association from InterceptEndpointGroupAssociation resource. * - * @example - * ``` - * const client = longrunning.operationsClient(); - * const name = ''; - * const [response] = await client.getOperation({name}); - * // doThingsWith(response) - * ``` + * @param {string} interceptEndpointGroupAssociationName + * A fully-qualified path representing InterceptEndpointGroupAssociation resource. + * @returns {string} A string representing the intercept_endpoint_group_association. */ - getOperation( - request: protos.google.longrunning.GetOperationRequest, - optionsOrCallback?: - | gax.CallOptions - | Callback< - protos.google.longrunning.Operation, - protos.google.longrunning.GetOperationRequest, - {} | null | undefined - >, - callback?: Callback< - protos.google.longrunning.Operation, - protos.google.longrunning.GetOperationRequest, - {} | null | undefined - > - ): Promise<[protos.google.longrunning.Operation]> { - let options: gax.CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } else { - options = optionsOrCallback as gax.CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers['x-goog-request-params'] = - this._gaxModule.routingHeader.fromParams({ - name: request.name ?? '', - }); - return this.operationsClient.getOperation(request, options, callback); + matchInterceptEndpointGroupAssociationFromInterceptEndpointGroupAssociationName(interceptEndpointGroupAssociationName: string) { + return this.pathTemplates.interceptEndpointGroupAssociationPathTemplate.match(interceptEndpointGroupAssociationName).intercept_endpoint_group_association; } + /** - * Lists operations that match the specified filter in the request. If the - * server doesn't support this method, it returns `UNIMPLEMENTED`. Returns an iterable object. + * Return a fully-qualified mirroringDeployment resource name string. * - * For-await-of syntax is used with the iterable to recursively get response element on-demand. + * @param {string} project + * @param {string} location + * @param {string} mirroring_deployment + * @returns {string} Resource name string. + */ + mirroringDeploymentPath(project:string,location:string,mirroringDeployment:string) { + return this.pathTemplates.mirroringDeploymentPathTemplate.render({ + project: project, + location: location, + mirroring_deployment: mirroringDeployment, + }); + } + + /** + * Parse the project from MirroringDeployment resource. * - * @param {Object} request - The request object that will be sent. - * @param {string} request.name - The name of the operation collection. - * @param {string} request.filter - The standard list filter. - * @param {number=} request.pageSize - - * The maximum number of resources contained in the underlying API - * response. If page streaming is performed per-resource, this - * parameter does not affect the return value. If page streaming is - * performed per-page, this determines the maximum number of - * resources in a page. - * @param {Object=} options - * Optional parameters. You can override the default settings for this call, - * e.g, timeout, retries, paginations, etc. See {@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions} for the - * details. - * @returns {Object} - * An iterable Object that conforms to {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | iteration protocols}. + * @param {string} mirroringDeploymentName + * A fully-qualified path representing MirroringDeployment resource. + * @returns {string} A string representing the project. + */ + matchProjectFromMirroringDeploymentName(mirroringDeploymentName: string) { + return this.pathTemplates.mirroringDeploymentPathTemplate.match(mirroringDeploymentName).project; + } + + /** + * Parse the location from MirroringDeployment resource. * - * @example - * ``` - * const client = longrunning.operationsClient(); - * for await (const response of client.listOperationsAsync(request)); - * // doThingsWith(response) - * ``` + * @param {string} mirroringDeploymentName + * A fully-qualified path representing MirroringDeployment resource. + * @returns {string} A string representing the location. */ - listOperationsAsync( - request: protos.google.longrunning.ListOperationsRequest, - options?: gax.CallOptions - ): AsyncIterable { - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers['x-goog-request-params'] = - this._gaxModule.routingHeader.fromParams({ - name: request.name ?? '', - }); - return this.operationsClient.listOperationsAsync(request, options); + matchLocationFromMirroringDeploymentName(mirroringDeploymentName: string) { + return this.pathTemplates.mirroringDeploymentPathTemplate.match(mirroringDeploymentName).location; } + /** - * Starts asynchronous cancellation on a long-running operation. The server - * makes a best effort to cancel the operation, but success is not - * guaranteed. If the server doesn't support this method, it returns - * `google.rpc.Code.UNIMPLEMENTED`. Clients can use - * {@link Operations.GetOperation} or - * other methods to check whether the cancellation succeeded or whether the - * operation completed despite cancellation. On successful cancellation, - * the operation is not deleted; instead, it becomes an operation with - * an {@link Operation.error} value with a {@link google.rpc.Status.code} of - * 1, corresponding to `Code.CANCELLED`. + * Parse the mirroring_deployment from MirroringDeployment resource. * - * @param {Object} request - The request object that will be sent. - * @param {string} request.name - The name of the operation resource to be cancelled. - * @param {Object=} options - * Optional parameters. You can override the default settings for this call, - * e.g, timeout, retries, paginations, etc. See {@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions} for the - * details. - * @param {function(?Error)=} callback - * The function which will be called with the result of the API call. - * @return {Promise} - The promise which resolves when API call finishes. - * The promise has a method named "cancel" which cancels the ongoing API - * call. + * @param {string} mirroringDeploymentName + * A fully-qualified path representing MirroringDeployment resource. + * @returns {string} A string representing the mirroring_deployment. + */ + matchMirroringDeploymentFromMirroringDeploymentName(mirroringDeploymentName: string) { + return this.pathTemplates.mirroringDeploymentPathTemplate.match(mirroringDeploymentName).mirroring_deployment; + } + + /** + * Return a fully-qualified mirroringDeploymentGroup resource name string. * - * @example - * ``` - * const client = longrunning.operationsClient(); - * await client.cancelOperation({name: ''}); - * ``` + * @param {string} project + * @param {string} location + * @param {string} mirroring_deployment_group + * @returns {string} Resource name string. */ - cancelOperation( - request: protos.google.longrunning.CancelOperationRequest, - optionsOrCallback?: - | gax.CallOptions - | Callback< - protos.google.longrunning.CancelOperationRequest, - protos.google.protobuf.Empty, - {} | undefined | null - >, - callback?: Callback< - protos.google.longrunning.CancelOperationRequest, - protos.google.protobuf.Empty, - {} | undefined | null - > - ): Promise { - let options: gax.CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } else { - options = optionsOrCallback as gax.CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers['x-goog-request-params'] = - this._gaxModule.routingHeader.fromParams({ - name: request.name ?? '', - }); - return this.operationsClient.cancelOperation(request, options, callback); + mirroringDeploymentGroupPath(project:string,location:string,mirroringDeploymentGroup:string) { + return this.pathTemplates.mirroringDeploymentGroupPathTemplate.render({ + project: project, + location: location, + mirroring_deployment_group: mirroringDeploymentGroup, + }); } /** - * Deletes a long-running operation. This method indicates that the client is - * no longer interested in the operation result. It does not cancel the - * operation. If the server doesn't support this method, it returns - * `google.rpc.Code.UNIMPLEMENTED`. + * Parse the project from MirroringDeploymentGroup resource. * - * @param {Object} request - The request object that will be sent. - * @param {string} request.name - The name of the operation resource to be deleted. - * @param {Object=} options - * Optional parameters. You can override the default settings for this call, - * e.g, timeout, retries, paginations, etc. See {@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions} - * for the details. - * @param {function(?Error)=} callback - * The function which will be called with the result of the API call. - * @return {Promise} - The promise which resolves when API call finishes. - * The promise has a method named "cancel" which cancels the ongoing API - * call. + * @param {string} mirroringDeploymentGroupName + * A fully-qualified path representing MirroringDeploymentGroup resource. + * @returns {string} A string representing the project. + */ + matchProjectFromMirroringDeploymentGroupName(mirroringDeploymentGroupName: string) { + return this.pathTemplates.mirroringDeploymentGroupPathTemplate.match(mirroringDeploymentGroupName).project; + } + + /** + * Parse the location from MirroringDeploymentGroup resource. * - * @example - * ``` - * const client = longrunning.operationsClient(); - * await client.deleteOperation({name: ''}); - * ``` + * @param {string} mirroringDeploymentGroupName + * A fully-qualified path representing MirroringDeploymentGroup resource. + * @returns {string} A string representing the location. */ - deleteOperation( - request: protos.google.longrunning.DeleteOperationRequest, - optionsOrCallback?: - | gax.CallOptions - | Callback< - protos.google.protobuf.Empty, - protos.google.longrunning.DeleteOperationRequest, - {} | null | undefined - >, - callback?: Callback< - protos.google.protobuf.Empty, - protos.google.longrunning.DeleteOperationRequest, - {} | null | undefined - > - ): Promise { - let options: gax.CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } else { - options = optionsOrCallback as gax.CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers['x-goog-request-params'] = - this._gaxModule.routingHeader.fromParams({ - name: request.name ?? '', - }); - return this.operationsClient.deleteOperation(request, options, callback); + matchLocationFromMirroringDeploymentGroupName(mirroringDeploymentGroupName: string) { + return this.pathTemplates.mirroringDeploymentGroupPathTemplate.match(mirroringDeploymentGroupName).location; } - // -------------------- - // -- Path templates -- - // -------------------- + /** + * Parse the mirroring_deployment_group from MirroringDeploymentGroup resource. + * + * @param {string} mirroringDeploymentGroupName + * A fully-qualified path representing MirroringDeploymentGroup resource. + * @returns {string} A string representing the mirroring_deployment_group. + */ + matchMirroringDeploymentGroupFromMirroringDeploymentGroupName(mirroringDeploymentGroupName: string) { + return this.pathTemplates.mirroringDeploymentGroupPathTemplate.match(mirroringDeploymentGroupName).mirroring_deployment_group; + } /** - * Return a fully-qualified authorizationPolicy resource name string. + * Return a fully-qualified mirroringEndpointGroup resource name string. * * @param {string} project * @param {string} location - * @param {string} authorization_policy + * @param {string} mirroring_endpoint_group * @returns {string} Resource name string. */ - authorizationPolicyPath(project:string,location:string,authorizationPolicy:string) { - return this.pathTemplates.authorizationPolicyPathTemplate.render({ + mirroringEndpointGroupPath(project:string,location:string,mirroringEndpointGroup:string) { + return this.pathTemplates.mirroringEndpointGroupPathTemplate.render({ project: project, location: location, - authorization_policy: authorizationPolicy, + mirroring_endpoint_group: mirroringEndpointGroup, }); } /** - * Parse the project from AuthorizationPolicy resource. + * Parse the project from MirroringEndpointGroup resource. * - * @param {string} authorizationPolicyName - * A fully-qualified path representing AuthorizationPolicy resource. + * @param {string} mirroringEndpointGroupName + * A fully-qualified path representing MirroringEndpointGroup resource. * @returns {string} A string representing the project. */ - matchProjectFromAuthorizationPolicyName(authorizationPolicyName: string) { - return this.pathTemplates.authorizationPolicyPathTemplate.match(authorizationPolicyName).project; + matchProjectFromMirroringEndpointGroupName(mirroringEndpointGroupName: string) { + return this.pathTemplates.mirroringEndpointGroupPathTemplate.match(mirroringEndpointGroupName).project; } /** - * Parse the location from AuthorizationPolicy resource. + * Parse the location from MirroringEndpointGroup resource. * - * @param {string} authorizationPolicyName - * A fully-qualified path representing AuthorizationPolicy resource. + * @param {string} mirroringEndpointGroupName + * A fully-qualified path representing MirroringEndpointGroup resource. * @returns {string} A string representing the location. */ - matchLocationFromAuthorizationPolicyName(authorizationPolicyName: string) { - return this.pathTemplates.authorizationPolicyPathTemplate.match(authorizationPolicyName).location; + matchLocationFromMirroringEndpointGroupName(mirroringEndpointGroupName: string) { + return this.pathTemplates.mirroringEndpointGroupPathTemplate.match(mirroringEndpointGroupName).location; } /** - * Parse the authorization_policy from AuthorizationPolicy resource. + * Parse the mirroring_endpoint_group from MirroringEndpointGroup resource. * - * @param {string} authorizationPolicyName - * A fully-qualified path representing AuthorizationPolicy resource. - * @returns {string} A string representing the authorization_policy. + * @param {string} mirroringEndpointGroupName + * A fully-qualified path representing MirroringEndpointGroup resource. + * @returns {string} A string representing the mirroring_endpoint_group. */ - matchAuthorizationPolicyFromAuthorizationPolicyName(authorizationPolicyName: string) { - return this.pathTemplates.authorizationPolicyPathTemplate.match(authorizationPolicyName).authorization_policy; + matchMirroringEndpointGroupFromMirroringEndpointGroupName(mirroringEndpointGroupName: string) { + return this.pathTemplates.mirroringEndpointGroupPathTemplate.match(mirroringEndpointGroupName).mirroring_endpoint_group; } /** - * Return a fully-qualified clientTlsPolicy resource name string. + * Return a fully-qualified mirroringEndpointGroupAssociation resource name string. * * @param {string} project * @param {string} location - * @param {string} client_tls_policy + * @param {string} mirroring_endpoint_group_association * @returns {string} Resource name string. */ - clientTlsPolicyPath(project:string,location:string,clientTlsPolicy:string) { - return this.pathTemplates.clientTlsPolicyPathTemplate.render({ + mirroringEndpointGroupAssociationPath(project:string,location:string,mirroringEndpointGroupAssociation:string) { + return this.pathTemplates.mirroringEndpointGroupAssociationPathTemplate.render({ project: project, location: location, - client_tls_policy: clientTlsPolicy, + mirroring_endpoint_group_association: mirroringEndpointGroupAssociation, }); } /** - * Parse the project from ClientTlsPolicy resource. + * Parse the project from MirroringEndpointGroupAssociation resource. * - * @param {string} clientTlsPolicyName - * A fully-qualified path representing ClientTlsPolicy resource. + * @param {string} mirroringEndpointGroupAssociationName + * A fully-qualified path representing MirroringEndpointGroupAssociation resource. * @returns {string} A string representing the project. */ - matchProjectFromClientTlsPolicyName(clientTlsPolicyName: string) { - return this.pathTemplates.clientTlsPolicyPathTemplate.match(clientTlsPolicyName).project; + matchProjectFromMirroringEndpointGroupAssociationName(mirroringEndpointGroupAssociationName: string) { + return this.pathTemplates.mirroringEndpointGroupAssociationPathTemplate.match(mirroringEndpointGroupAssociationName).project; } /** - * Parse the location from ClientTlsPolicy resource. + * Parse the location from MirroringEndpointGroupAssociation resource. * - * @param {string} clientTlsPolicyName - * A fully-qualified path representing ClientTlsPolicy resource. + * @param {string} mirroringEndpointGroupAssociationName + * A fully-qualified path representing MirroringEndpointGroupAssociation resource. * @returns {string} A string representing the location. */ - matchLocationFromClientTlsPolicyName(clientTlsPolicyName: string) { - return this.pathTemplates.clientTlsPolicyPathTemplate.match(clientTlsPolicyName).location; + matchLocationFromMirroringEndpointGroupAssociationName(mirroringEndpointGroupAssociationName: string) { + return this.pathTemplates.mirroringEndpointGroupAssociationPathTemplate.match(mirroringEndpointGroupAssociationName).location; } /** - * Parse the client_tls_policy from ClientTlsPolicy resource. + * Parse the mirroring_endpoint_group_association from MirroringEndpointGroupAssociation resource. * - * @param {string} clientTlsPolicyName - * A fully-qualified path representing ClientTlsPolicy resource. - * @returns {string} A string representing the client_tls_policy. + * @param {string} mirroringEndpointGroupAssociationName + * A fully-qualified path representing MirroringEndpointGroupAssociation resource. + * @returns {string} A string representing the mirroring_endpoint_group_association. */ - matchClientTlsPolicyFromClientTlsPolicyName(clientTlsPolicyName: string) { - return this.pathTemplates.clientTlsPolicyPathTemplate.match(clientTlsPolicyName).client_tls_policy; + matchMirroringEndpointGroupAssociationFromMirroringEndpointGroupAssociationName(mirroringEndpointGroupAssociationName: string) { + return this.pathTemplates.mirroringEndpointGroupAssociationPathTemplate.match(mirroringEndpointGroupAssociationName).mirroring_endpoint_group_association; } /** @@ -2960,6 +7786,153 @@ export class NetworkSecurityClient { return this.pathTemplates.organizationLocationAddressGroupPathTemplate.match(organizationLocationAddressGroupName).address_group; } + /** + * Return a fully-qualified organizationLocationFirewallEndpoints resource name string. + * + * @param {string} organization + * @param {string} location + * @param {string} firewall_endpoint + * @returns {string} Resource name string. + */ + organizationLocationFirewallEndpointsPath(organization:string,location:string,firewallEndpoint:string) { + return this.pathTemplates.organizationLocationFirewallEndpointsPathTemplate.render({ + organization: organization, + location: location, + firewall_endpoint: firewallEndpoint, + }); + } + + /** + * Parse the organization from OrganizationLocationFirewallEndpoints resource. + * + * @param {string} organizationLocationFirewallEndpointsName + * A fully-qualified path representing organization_location_firewallEndpoints resource. + * @returns {string} A string representing the organization. + */ + matchOrganizationFromOrganizationLocationFirewallEndpointsName(organizationLocationFirewallEndpointsName: string) { + return this.pathTemplates.organizationLocationFirewallEndpointsPathTemplate.match(organizationLocationFirewallEndpointsName).organization; + } + + /** + * Parse the location from OrganizationLocationFirewallEndpoints resource. + * + * @param {string} organizationLocationFirewallEndpointsName + * A fully-qualified path representing organization_location_firewallEndpoints resource. + * @returns {string} A string representing the location. + */ + matchLocationFromOrganizationLocationFirewallEndpointsName(organizationLocationFirewallEndpointsName: string) { + return this.pathTemplates.organizationLocationFirewallEndpointsPathTemplate.match(organizationLocationFirewallEndpointsName).location; + } + + /** + * Parse the firewall_endpoint from OrganizationLocationFirewallEndpoints resource. + * + * @param {string} organizationLocationFirewallEndpointsName + * A fully-qualified path representing organization_location_firewallEndpoints resource. + * @returns {string} A string representing the firewall_endpoint. + */ + matchFirewallEndpointFromOrganizationLocationFirewallEndpointsName(organizationLocationFirewallEndpointsName: string) { + return this.pathTemplates.organizationLocationFirewallEndpointsPathTemplate.match(organizationLocationFirewallEndpointsName).firewall_endpoint; + } + + /** + * Return a fully-qualified organizationLocationSecurityProfile resource name string. + * + * @param {string} organization + * @param {string} location + * @param {string} security_profile + * @returns {string} Resource name string. + */ + organizationLocationSecurityProfilePath(organization:string,location:string,securityProfile:string) { + return this.pathTemplates.organizationLocationSecurityProfilePathTemplate.render({ + organization: organization, + location: location, + security_profile: securityProfile, + }); + } + + /** + * Parse the organization from OrganizationLocationSecurityProfile resource. + * + * @param {string} organizationLocationSecurityProfileName + * A fully-qualified path representing organization_location_security_profile resource. + * @returns {string} A string representing the organization. + */ + matchOrganizationFromOrganizationLocationSecurityProfileName(organizationLocationSecurityProfileName: string) { + return this.pathTemplates.organizationLocationSecurityProfilePathTemplate.match(organizationLocationSecurityProfileName).organization; + } + + /** + * Parse the location from OrganizationLocationSecurityProfile resource. + * + * @param {string} organizationLocationSecurityProfileName + * A fully-qualified path representing organization_location_security_profile resource. + * @returns {string} A string representing the location. + */ + matchLocationFromOrganizationLocationSecurityProfileName(organizationLocationSecurityProfileName: string) { + return this.pathTemplates.organizationLocationSecurityProfilePathTemplate.match(organizationLocationSecurityProfileName).location; + } + + /** + * Parse the security_profile from OrganizationLocationSecurityProfile resource. + * + * @param {string} organizationLocationSecurityProfileName + * A fully-qualified path representing organization_location_security_profile resource. + * @returns {string} A string representing the security_profile. + */ + matchSecurityProfileFromOrganizationLocationSecurityProfileName(organizationLocationSecurityProfileName: string) { + return this.pathTemplates.organizationLocationSecurityProfilePathTemplate.match(organizationLocationSecurityProfileName).security_profile; + } + + /** + * Return a fully-qualified organizationLocationSecurityProfileGroup resource name string. + * + * @param {string} organization + * @param {string} location + * @param {string} security_profile_group + * @returns {string} Resource name string. + */ + organizationLocationSecurityProfileGroupPath(organization:string,location:string,securityProfileGroup:string) { + return this.pathTemplates.organizationLocationSecurityProfileGroupPathTemplate.render({ + organization: organization, + location: location, + security_profile_group: securityProfileGroup, + }); + } + + /** + * Parse the organization from OrganizationLocationSecurityProfileGroup resource. + * + * @param {string} organizationLocationSecurityProfileGroupName + * A fully-qualified path representing organization_location_security_profile_group resource. + * @returns {string} A string representing the organization. + */ + matchOrganizationFromOrganizationLocationSecurityProfileGroupName(organizationLocationSecurityProfileGroupName: string) { + return this.pathTemplates.organizationLocationSecurityProfileGroupPathTemplate.match(organizationLocationSecurityProfileGroupName).organization; + } + + /** + * Parse the location from OrganizationLocationSecurityProfileGroup resource. + * + * @param {string} organizationLocationSecurityProfileGroupName + * A fully-qualified path representing organization_location_security_profile_group resource. + * @returns {string} A string representing the location. + */ + matchLocationFromOrganizationLocationSecurityProfileGroupName(organizationLocationSecurityProfileGroupName: string) { + return this.pathTemplates.organizationLocationSecurityProfileGroupPathTemplate.match(organizationLocationSecurityProfileGroupName).location; + } + + /** + * Parse the security_profile_group from OrganizationLocationSecurityProfileGroup resource. + * + * @param {string} organizationLocationSecurityProfileGroupName + * A fully-qualified path representing organization_location_security_profile_group resource. + * @returns {string} A string representing the security_profile_group. + */ + matchSecurityProfileGroupFromOrganizationLocationSecurityProfileGroupName(organizationLocationSecurityProfileGroupName: string) { + return this.pathTemplates.organizationLocationSecurityProfileGroupPathTemplate.match(organizationLocationSecurityProfileGroupName).security_profile_group; + } + /** * Return a fully-qualified projectLocationAddressGroup resource name string. * @@ -3009,6 +7982,153 @@ export class NetworkSecurityClient { return this.pathTemplates.projectLocationAddressGroupPathTemplate.match(projectLocationAddressGroupName).address_group; } + /** + * Return a fully-qualified projectLocationFirewallEndpoints resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} firewall_endpoint + * @returns {string} Resource name string. + */ + projectLocationFirewallEndpointsPath(project:string,location:string,firewallEndpoint:string) { + return this.pathTemplates.projectLocationFirewallEndpointsPathTemplate.render({ + project: project, + location: location, + firewall_endpoint: firewallEndpoint, + }); + } + + /** + * Parse the project from ProjectLocationFirewallEndpoints resource. + * + * @param {string} projectLocationFirewallEndpointsName + * A fully-qualified path representing project_location_firewallEndpoints resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationFirewallEndpointsName(projectLocationFirewallEndpointsName: string) { + return this.pathTemplates.projectLocationFirewallEndpointsPathTemplate.match(projectLocationFirewallEndpointsName).project; + } + + /** + * Parse the location from ProjectLocationFirewallEndpoints resource. + * + * @param {string} projectLocationFirewallEndpointsName + * A fully-qualified path representing project_location_firewallEndpoints resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationFirewallEndpointsName(projectLocationFirewallEndpointsName: string) { + return this.pathTemplates.projectLocationFirewallEndpointsPathTemplate.match(projectLocationFirewallEndpointsName).location; + } + + /** + * Parse the firewall_endpoint from ProjectLocationFirewallEndpoints resource. + * + * @param {string} projectLocationFirewallEndpointsName + * A fully-qualified path representing project_location_firewallEndpoints resource. + * @returns {string} A string representing the firewall_endpoint. + */ + matchFirewallEndpointFromProjectLocationFirewallEndpointsName(projectLocationFirewallEndpointsName: string) { + return this.pathTemplates.projectLocationFirewallEndpointsPathTemplate.match(projectLocationFirewallEndpointsName).firewall_endpoint; + } + + /** + * Return a fully-qualified projectLocationSecurityProfile resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} security_profile + * @returns {string} Resource name string. + */ + projectLocationSecurityProfilePath(project:string,location:string,securityProfile:string) { + return this.pathTemplates.projectLocationSecurityProfilePathTemplate.render({ + project: project, + location: location, + security_profile: securityProfile, + }); + } + + /** + * Parse the project from ProjectLocationSecurityProfile resource. + * + * @param {string} projectLocationSecurityProfileName + * A fully-qualified path representing project_location_security_profile resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationSecurityProfileName(projectLocationSecurityProfileName: string) { + return this.pathTemplates.projectLocationSecurityProfilePathTemplate.match(projectLocationSecurityProfileName).project; + } + + /** + * Parse the location from ProjectLocationSecurityProfile resource. + * + * @param {string} projectLocationSecurityProfileName + * A fully-qualified path representing project_location_security_profile resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationSecurityProfileName(projectLocationSecurityProfileName: string) { + return this.pathTemplates.projectLocationSecurityProfilePathTemplate.match(projectLocationSecurityProfileName).location; + } + + /** + * Parse the security_profile from ProjectLocationSecurityProfile resource. + * + * @param {string} projectLocationSecurityProfileName + * A fully-qualified path representing project_location_security_profile resource. + * @returns {string} A string representing the security_profile. + */ + matchSecurityProfileFromProjectLocationSecurityProfileName(projectLocationSecurityProfileName: string) { + return this.pathTemplates.projectLocationSecurityProfilePathTemplate.match(projectLocationSecurityProfileName).security_profile; + } + + /** + * Return a fully-qualified projectLocationSecurityProfileGroup resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} security_profile_group + * @returns {string} Resource name string. + */ + projectLocationSecurityProfileGroupPath(project:string,location:string,securityProfileGroup:string) { + return this.pathTemplates.projectLocationSecurityProfileGroupPathTemplate.render({ + project: project, + location: location, + security_profile_group: securityProfileGroup, + }); + } + + /** + * Parse the project from ProjectLocationSecurityProfileGroup resource. + * + * @param {string} projectLocationSecurityProfileGroupName + * A fully-qualified path representing project_location_security_profile_group resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationSecurityProfileGroupName(projectLocationSecurityProfileGroupName: string) { + return this.pathTemplates.projectLocationSecurityProfileGroupPathTemplate.match(projectLocationSecurityProfileGroupName).project; + } + + /** + * Parse the location from ProjectLocationSecurityProfileGroup resource. + * + * @param {string} projectLocationSecurityProfileGroupName + * A fully-qualified path representing project_location_security_profile_group resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationSecurityProfileGroupName(projectLocationSecurityProfileGroupName: string) { + return this.pathTemplates.projectLocationSecurityProfileGroupPathTemplate.match(projectLocationSecurityProfileGroupName).location; + } + + /** + * Parse the security_profile_group from ProjectLocationSecurityProfileGroup resource. + * + * @param {string} projectLocationSecurityProfileGroupName + * A fully-qualified path representing project_location_security_profile_group resource. + * @returns {string} A string representing the security_profile_group. + */ + matchSecurityProfileGroupFromProjectLocationSecurityProfileGroupName(projectLocationSecurityProfileGroupName: string) { + return this.pathTemplates.projectLocationSecurityProfileGroupPathTemplate.match(projectLocationSecurityProfileGroupName).security_profile_group; + } + /** * Return a fully-qualified serverTlsPolicy resource name string. * @@ -3058,6 +8178,104 @@ export class NetworkSecurityClient { return this.pathTemplates.serverTlsPolicyPathTemplate.match(serverTlsPolicyName).server_tls_policy; } + /** + * Return a fully-qualified tlsInspectionPolicy resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} tls_inspection_policy + * @returns {string} Resource name string. + */ + tlsInspectionPolicyPath(project:string,location:string,tlsInspectionPolicy:string) { + return this.pathTemplates.tlsInspectionPolicyPathTemplate.render({ + project: project, + location: location, + tls_inspection_policy: tlsInspectionPolicy, + }); + } + + /** + * Parse the project from TlsInspectionPolicy resource. + * + * @param {string} tlsInspectionPolicyName + * A fully-qualified path representing TlsInspectionPolicy resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTlsInspectionPolicyName(tlsInspectionPolicyName: string) { + return this.pathTemplates.tlsInspectionPolicyPathTemplate.match(tlsInspectionPolicyName).project; + } + + /** + * Parse the location from TlsInspectionPolicy resource. + * + * @param {string} tlsInspectionPolicyName + * A fully-qualified path representing TlsInspectionPolicy resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTlsInspectionPolicyName(tlsInspectionPolicyName: string) { + return this.pathTemplates.tlsInspectionPolicyPathTemplate.match(tlsInspectionPolicyName).location; + } + + /** + * Parse the tls_inspection_policy from TlsInspectionPolicy resource. + * + * @param {string} tlsInspectionPolicyName + * A fully-qualified path representing TlsInspectionPolicy resource. + * @returns {string} A string representing the tls_inspection_policy. + */ + matchTlsInspectionPolicyFromTlsInspectionPolicyName(tlsInspectionPolicyName: string) { + return this.pathTemplates.tlsInspectionPolicyPathTemplate.match(tlsInspectionPolicyName).tls_inspection_policy; + } + + /** + * Return a fully-qualified urlList resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} url_list + * @returns {string} Resource name string. + */ + urlListPath(project:string,location:string,urlList:string) { + return this.pathTemplates.urlListPathTemplate.render({ + project: project, + location: location, + url_list: urlList, + }); + } + + /** + * Parse the project from UrlList resource. + * + * @param {string} urlListName + * A fully-qualified path representing UrlList resource. + * @returns {string} A string representing the project. + */ + matchProjectFromUrlListName(urlListName: string) { + return this.pathTemplates.urlListPathTemplate.match(urlListName).project; + } + + /** + * Parse the location from UrlList resource. + * + * @param {string} urlListName + * A fully-qualified path representing UrlList resource. + * @returns {string} A string representing the location. + */ + matchLocationFromUrlListName(urlListName: string) { + return this.pathTemplates.urlListPathTemplate.match(urlListName).location; + } + + /** + * Parse the url_list from UrlList resource. + * + * @param {string} urlListName + * A fully-qualified path representing UrlList resource. + * @returns {string} A string representing the url_list. + */ + matchUrlListFromUrlListName(urlListName: string) { + return this.pathTemplates.urlListPathTemplate.match(urlListName).url_list; + } + /** * Terminate the gRPC channel and close the client. * diff --git a/packages/google-cloud-networksecurity/src/v1/network_security_client_config.json b/packages/google-cloud-networksecurity/src/v1/network_security_client_config.json index eb0689a8517..09db0797f98 100644 --- a/packages/google-cloud-networksecurity/src/v1/network_security_client_config.json +++ b/packages/google-cloud-networksecurity/src/v1/network_security_client_config.json @@ -45,6 +45,31 @@ "retry_codes_name": "non_idempotent", "retry_params_name": "default" }, + "ListBackendAuthenticationConfigs": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetBackendAuthenticationConfig": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "CreateBackendAuthenticationConfig": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UpdateBackendAuthenticationConfig": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteBackendAuthenticationConfig": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, "ListServerTlsPolicies": { "timeout_millis": 60000, "retry_codes_name": "non_idempotent", @@ -94,6 +119,131 @@ "timeout_millis": 60000, "retry_codes_name": "non_idempotent", "retry_params_name": "default" + }, + "ListGatewaySecurityPolicies": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetGatewaySecurityPolicy": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "CreateGatewaySecurityPolicy": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UpdateGatewaySecurityPolicy": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteGatewaySecurityPolicy": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListGatewaySecurityPolicyRules": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetGatewaySecurityPolicyRule": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "CreateGatewaySecurityPolicyRule": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UpdateGatewaySecurityPolicyRule": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteGatewaySecurityPolicyRule": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListUrlLists": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetUrlList": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "CreateUrlList": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UpdateUrlList": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteUrlList": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListTlsInspectionPolicies": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetTlsInspectionPolicy": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "CreateTlsInspectionPolicy": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UpdateTlsInspectionPolicy": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteTlsInspectionPolicy": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListAuthzPolicies": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetAuthzPolicy": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "CreateAuthzPolicy": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UpdateAuthzPolicy": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteAuthzPolicy": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" } } } diff --git a/packages/google-cloud-networksecurity/src/v1/network_security_proto_list.json b/packages/google-cloud-networksecurity/src/v1/network_security_proto_list.json index c43ec4cef17..1451adf6674 100644 --- a/packages/google-cloud-networksecurity/src/v1/network_security_proto_list.json +++ b/packages/google-cloud-networksecurity/src/v1/network_security_proto_list.json @@ -1,9 +1,25 @@ [ "../../protos/google/cloud/networksecurity/v1/address_group.proto", "../../protos/google/cloud/networksecurity/v1/authorization_policy.proto", + "../../protos/google/cloud/networksecurity/v1/authz_policy.proto", + "../../protos/google/cloud/networksecurity/v1/backend_authentication_config.proto", "../../protos/google/cloud/networksecurity/v1/client_tls_policy.proto", "../../protos/google/cloud/networksecurity/v1/common.proto", + "../../protos/google/cloud/networksecurity/v1/dns_threat_detector.proto", + "../../protos/google/cloud/networksecurity/v1/firewall_activation.proto", + "../../protos/google/cloud/networksecurity/v1/gateway_security_policy.proto", + "../../protos/google/cloud/networksecurity/v1/gateway_security_policy_rule.proto", + "../../protos/google/cloud/networksecurity/v1/intercept.proto", + "../../protos/google/cloud/networksecurity/v1/mirroring.proto", "../../protos/google/cloud/networksecurity/v1/network_security.proto", + "../../protos/google/cloud/networksecurity/v1/security_profile_group.proto", + "../../protos/google/cloud/networksecurity/v1/security_profile_group_intercept.proto", + "../../protos/google/cloud/networksecurity/v1/security_profile_group_mirroring.proto", + "../../protos/google/cloud/networksecurity/v1/security_profile_group_service.proto", + "../../protos/google/cloud/networksecurity/v1/security_profile_group_threatprevention.proto", + "../../protos/google/cloud/networksecurity/v1/security_profile_group_urlfiltering.proto", "../../protos/google/cloud/networksecurity/v1/server_tls_policy.proto", - "../../protos/google/cloud/networksecurity/v1/tls.proto" + "../../protos/google/cloud/networksecurity/v1/tls.proto", + "../../protos/google/cloud/networksecurity/v1/tls_inspection_policy.proto", + "../../protos/google/cloud/networksecurity/v1/url_list.proto" ] diff --git a/packages/google-cloud-networksecurity/src/v1/organization_address_group_service_client.ts b/packages/google-cloud-networksecurity/src/v1/organization_address_group_service_client.ts index 36ba4c0bc7e..7ff2cd21c11 100644 --- a/packages/google-cloud-networksecurity/src/v1/organization_address_group_service_client.ts +++ b/packages/google-cloud-networksecurity/src/v1/organization_address_group_service_client.ts @@ -192,24 +192,90 @@ export class OrganizationAddressGroupServiceClient { authorizationPolicyPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/authorizationPolicies/{authorization_policy}' ), + authzPolicyPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/authzPolicies/{authz_policy}' + ), + backendAuthenticationConfigPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/backendAuthenticationConfigs/{backend_authentication_config}' + ), clientTlsPolicyPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/clientTlsPolicies/{client_tls_policy}' ), + dnsThreatDetectorPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/dnsThreatDetectors/{dns_threat_detector}' + ), + firewallEndpointAssociationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/firewallEndpointAssociations/{firewall_endpoint_association}' + ), + gatewaySecurityPolicyPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/gatewaySecurityPolicies/{gateway_security_policy}' + ), + gatewaySecurityPolicyRulePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/gatewaySecurityPolicies/{gateway_security_policy}/rules/{rule}' + ), + interceptDeploymentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/interceptDeployments/{intercept_deployment}' + ), + interceptDeploymentGroupPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/interceptDeploymentGroups/{intercept_deployment_group}' + ), + interceptEndpointGroupPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/interceptEndpointGroups/{intercept_endpoint_group}' + ), + interceptEndpointGroupAssociationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/interceptEndpointGroupAssociations/{intercept_endpoint_group_association}' + ), locationPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}' ), + mirroringDeploymentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/mirroringDeployments/{mirroring_deployment}' + ), + mirroringDeploymentGroupPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/mirroringDeploymentGroups/{mirroring_deployment_group}' + ), + mirroringEndpointGroupPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/mirroringEndpointGroups/{mirroring_endpoint_group}' + ), + mirroringEndpointGroupAssociationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/mirroringEndpointGroupAssociations/{mirroring_endpoint_group_association}' + ), organizationLocationAddressGroupPathTemplate: new this._gaxModule.PathTemplate( 'organizations/{organization}/locations/{location}/addressGroups/{address_group}' ), + organizationLocationFirewallEndpointsPathTemplate: new this._gaxModule.PathTemplate( + 'organizations/{organization}/locations/{location}/firewallEndpoints/{firewall_endpoint}' + ), + organizationLocationSecurityProfilePathTemplate: new this._gaxModule.PathTemplate( + 'organizations/{organization}/locations/{location}/securityProfiles/{security_profile}' + ), + organizationLocationSecurityProfileGroupPathTemplate: new this._gaxModule.PathTemplate( + 'organizations/{organization}/locations/{location}/securityProfileGroups/{security_profile_group}' + ), projectPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}' ), projectLocationAddressGroupPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/addressGroups/{address_group}' ), + projectLocationFirewallEndpointsPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/firewallEndpoints/{firewall_endpoint}' + ), + projectLocationSecurityProfilePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/securityProfiles/{security_profile}' + ), + projectLocationSecurityProfileGroupPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/securityProfileGroups/{security_profile_group}' + ), serverTlsPolicyPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/serverTlsPolicies/{server_tls_policy}' ), + tlsInspectionPolicyPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/tlsInspectionPolicies/{tls_inspection_policy}' + ), + urlListPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/urlLists/{url_list}' + ), }; // Some of the methods on this service return "paged" results, @@ -234,9 +300,9 @@ export class OrganizationAddressGroupServiceClient { lroOptions.protoJson = protoFilesRoot; lroOptions.httpRules = [{selector: 'google.cloud.location.Locations.GetLocation',get: '/v1/{name=projects/*/locations/*}',additional_bindings: [{get: '/v1/{name=organizations/*/locations/*}',}], },{selector: 'google.cloud.location.Locations.ListLocations',get: '/v1/{name=projects/*}/locations',additional_bindings: [{get: '/v1/{name=organizations/*/locations/*}',}], - },{selector: 'google.iam.v1.IAMPolicy.GetIamPolicy',get: '/v1/{resource=projects/*/locations/*/authorizationPolicies/*}:getIamPolicy',additional_bindings: [{get: '/v1/{resource=projects/*/locations/*/addressGroups/*}:getIamPolicy',},{get: '/v1/{resource=organizations/*/locations/*/addressGroups/*}:getIamPolicy',},{get: '/v1/{resource=projects/*/locations/*/serverTlsPolicies/*}:getIamPolicy',},{get: '/v1/{resource=projects/*/locations/*/clientTlsPolicies/*}:getIamPolicy',}], - },{selector: 'google.iam.v1.IAMPolicy.SetIamPolicy',post: '/v1/{resource=projects/*/locations/*/authorizationPolicies/*}:setIamPolicy',body: '*',additional_bindings: [{post: '/v1/{resource=projects/*/locations/*/addressGroups/*}:setIamPolicy',body: '*',},{post: '/v1/{resource=organizations/*/locations/*/addressGroups/*}:setIamPolicy',body: '*',},{post: '/v1/{resource=projects/*/locations/*/serverTlsPolicies/*}:setIamPolicy',body: '*',},{post: '/v1/{resource=projects/*/locations/*/clientTlsPolicies/*}:setIamPolicy',body: '*',}], - },{selector: 'google.iam.v1.IAMPolicy.TestIamPermissions',post: '/v1/{resource=projects/*/locations/*/authorizationPolicies/*}:testIamPermissions',body: '*',additional_bindings: [{post: '/v1/{resource=projects/*/locations/*/addressGroups/*}:testIamPermissions',body: '*',},{post: '/v1/{resource=organizations/*/locations/*/addressGroups/*}:testIamPermissions',body: '*',},{post: '/v1/{resource=projects/*/locations/*/serverTlsPolicies/*}:testIamPermissions',body: '*',},{post: '/v1/{resource=projects/*/locations/*/clientTlsPolicies/*}:testIamPermissions',body: '*',}], + },{selector: 'google.iam.v1.IAMPolicy.GetIamPolicy',get: '/v1/{resource=projects/*/locations/*/addressGroups/*}:getIamPolicy',additional_bindings: [{get: '/v1/{resource=projects/*/locations/*/authorizationPolicies/*}:getIamPolicy',},{get: '/v1/{resource=organizations/*/locations/*/addressGroups/*}:getIamPolicy',},{get: '/v1/{resource=projects/*/locations/*/serverTlsPolicies/*}:getIamPolicy',},{get: '/v1/{resource=projects/*/locations/*/clientTlsPolicies/*}:getIamPolicy',},{get: '/v1/{resource=projects/*/locations/*/authzPolicies/*}:getIamPolicy',}], + },{selector: 'google.iam.v1.IAMPolicy.SetIamPolicy',post: '/v1/{resource=projects/*/locations/*/addressGroups/*}:setIamPolicy',body: '*',additional_bindings: [{post: '/v1/{resource=projects/*/locations/*/authorizationPolicies/*}:setIamPolicy',body: '*',},{post: '/v1/{resource=organizations/*/locations/*/addressGroups/*}:setIamPolicy',body: '*',},{post: '/v1/{resource=projects/*/locations/*/serverTlsPolicies/*}:setIamPolicy',body: '*',},{post: '/v1/{resource=projects/*/locations/*/clientTlsPolicies/*}:setIamPolicy',body: '*',},{post: '/v1/{resource=projects/*/locations/*/authzPolicies/*}:setIamPolicy',body: '*',}], + },{selector: 'google.iam.v1.IAMPolicy.TestIamPermissions',post: '/v1/{resource=projects/*/locations/*/addressGroups/*}:testIamPermissions',body: '*',additional_bindings: [{post: '/v1/{resource=projects/*/locations/*/authorizationPolicies/*}:testIamPermissions',body: '*',},{post: '/v1/{resource=organizations/*/locations/*/addressGroups/*}:testIamPermissions',body: '*',},{post: '/v1/{resource=projects/*/locations/*/serverTlsPolicies/*}:testIamPermissions',body: '*',},{post: '/v1/{resource=projects/*/locations/*/clientTlsPolicies/*}:testIamPermissions',body: '*',},{post: '/v1/{resource=projects/*/locations/*/authzPolicies/*}:testIamPermissions',body: '*',}], },{selector: 'google.longrunning.Operations.CancelOperation',post: '/v1/{name=projects/*/locations/*/operations/*}:cancel',body: '*',additional_bindings: [{post: '/v1/{name=organizations/*/locations/*/operations/*}:cancel',body: '*',}], },{selector: 'google.longrunning.Operations.DeleteOperation',delete: '/v1/{name=projects/*/locations/*/operations/*}',additional_bindings: [{delete: '/v1/{name=organizations/*/locations/*/operations/*}',}], },{selector: 'google.longrunning.Operations.GetOperation',get: '/v1/{name=projects/*/locations/*/operations/*}',additional_bindings: [{get: '/v1/{name=organizations/*/locations/*/operations/*}',}], @@ -2206,6 +2272,104 @@ export class OrganizationAddressGroupServiceClient { return this.pathTemplates.authorizationPolicyPathTemplate.match(authorizationPolicyName).authorization_policy; } + /** + * Return a fully-qualified authzPolicy resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} authz_policy + * @returns {string} Resource name string. + */ + authzPolicyPath(project:string,location:string,authzPolicy:string) { + return this.pathTemplates.authzPolicyPathTemplate.render({ + project: project, + location: location, + authz_policy: authzPolicy, + }); + } + + /** + * Parse the project from AuthzPolicy resource. + * + * @param {string} authzPolicyName + * A fully-qualified path representing AuthzPolicy resource. + * @returns {string} A string representing the project. + */ + matchProjectFromAuthzPolicyName(authzPolicyName: string) { + return this.pathTemplates.authzPolicyPathTemplate.match(authzPolicyName).project; + } + + /** + * Parse the location from AuthzPolicy resource. + * + * @param {string} authzPolicyName + * A fully-qualified path representing AuthzPolicy resource. + * @returns {string} A string representing the location. + */ + matchLocationFromAuthzPolicyName(authzPolicyName: string) { + return this.pathTemplates.authzPolicyPathTemplate.match(authzPolicyName).location; + } + + /** + * Parse the authz_policy from AuthzPolicy resource. + * + * @param {string} authzPolicyName + * A fully-qualified path representing AuthzPolicy resource. + * @returns {string} A string representing the authz_policy. + */ + matchAuthzPolicyFromAuthzPolicyName(authzPolicyName: string) { + return this.pathTemplates.authzPolicyPathTemplate.match(authzPolicyName).authz_policy; + } + + /** + * Return a fully-qualified backendAuthenticationConfig resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} backend_authentication_config + * @returns {string} Resource name string. + */ + backendAuthenticationConfigPath(project:string,location:string,backendAuthenticationConfig:string) { + return this.pathTemplates.backendAuthenticationConfigPathTemplate.render({ + project: project, + location: location, + backend_authentication_config: backendAuthenticationConfig, + }); + } + + /** + * Parse the project from BackendAuthenticationConfig resource. + * + * @param {string} backendAuthenticationConfigName + * A fully-qualified path representing BackendAuthenticationConfig resource. + * @returns {string} A string representing the project. + */ + matchProjectFromBackendAuthenticationConfigName(backendAuthenticationConfigName: string) { + return this.pathTemplates.backendAuthenticationConfigPathTemplate.match(backendAuthenticationConfigName).project; + } + + /** + * Parse the location from BackendAuthenticationConfig resource. + * + * @param {string} backendAuthenticationConfigName + * A fully-qualified path representing BackendAuthenticationConfig resource. + * @returns {string} A string representing the location. + */ + matchLocationFromBackendAuthenticationConfigName(backendAuthenticationConfigName: string) { + return this.pathTemplates.backendAuthenticationConfigPathTemplate.match(backendAuthenticationConfigName).location; + } + + /** + * Parse the backend_authentication_config from BackendAuthenticationConfig resource. + * + * @param {string} backendAuthenticationConfigName + * A fully-qualified path representing BackendAuthenticationConfig resource. + * @returns {string} A string representing the backend_authentication_config. + */ + matchBackendAuthenticationConfigFromBackendAuthenticationConfigName(backendAuthenticationConfigName: string) { + return this.pathTemplates.backendAuthenticationConfigPathTemplate.match(backendAuthenticationConfigName).backend_authentication_config; + } + /** * Return a fully-qualified clientTlsPolicy resource name string. * @@ -2256,209 +2420,1202 @@ export class OrganizationAddressGroupServiceClient { } /** - * Return a fully-qualified location resource name string. + * Return a fully-qualified dnsThreatDetector resource name string. * * @param {string} project * @param {string} location + * @param {string} dns_threat_detector * @returns {string} Resource name string. */ - locationPath(project:string,location:string) { - return this.pathTemplates.locationPathTemplate.render({ + dnsThreatDetectorPath(project:string,location:string,dnsThreatDetector:string) { + return this.pathTemplates.dnsThreatDetectorPathTemplate.render({ project: project, location: location, + dns_threat_detector: dnsThreatDetector, }); } /** - * Parse the project from Location resource. + * Parse the project from DnsThreatDetector resource. * - * @param {string} locationName - * A fully-qualified path representing Location resource. + * @param {string} dnsThreatDetectorName + * A fully-qualified path representing DnsThreatDetector resource. * @returns {string} A string representing the project. */ - matchProjectFromLocationName(locationName: string) { - return this.pathTemplates.locationPathTemplate.match(locationName).project; + matchProjectFromDnsThreatDetectorName(dnsThreatDetectorName: string) { + return this.pathTemplates.dnsThreatDetectorPathTemplate.match(dnsThreatDetectorName).project; } /** - * Parse the location from Location resource. + * Parse the location from DnsThreatDetector resource. * - * @param {string} locationName - * A fully-qualified path representing Location resource. + * @param {string} dnsThreatDetectorName + * A fully-qualified path representing DnsThreatDetector resource. * @returns {string} A string representing the location. */ - matchLocationFromLocationName(locationName: string) { - return this.pathTemplates.locationPathTemplate.match(locationName).location; + matchLocationFromDnsThreatDetectorName(dnsThreatDetectorName: string) { + return this.pathTemplates.dnsThreatDetectorPathTemplate.match(dnsThreatDetectorName).location; } /** - * Return a fully-qualified organizationLocationAddressGroup resource name string. + * Parse the dns_threat_detector from DnsThreatDetector resource. * - * @param {string} organization + * @param {string} dnsThreatDetectorName + * A fully-qualified path representing DnsThreatDetector resource. + * @returns {string} A string representing the dns_threat_detector. + */ + matchDnsThreatDetectorFromDnsThreatDetectorName(dnsThreatDetectorName: string) { + return this.pathTemplates.dnsThreatDetectorPathTemplate.match(dnsThreatDetectorName).dns_threat_detector; + } + + /** + * Return a fully-qualified firewallEndpointAssociation resource name string. + * + * @param {string} project * @param {string} location - * @param {string} address_group + * @param {string} firewall_endpoint_association * @returns {string} Resource name string. */ - organizationLocationAddressGroupPath(organization:string,location:string,addressGroup:string) { - return this.pathTemplates.organizationLocationAddressGroupPathTemplate.render({ - organization: organization, + firewallEndpointAssociationPath(project:string,location:string,firewallEndpointAssociation:string) { + return this.pathTemplates.firewallEndpointAssociationPathTemplate.render({ + project: project, location: location, - address_group: addressGroup, + firewall_endpoint_association: firewallEndpointAssociation, }); } /** - * Parse the organization from OrganizationLocationAddressGroup resource. + * Parse the project from FirewallEndpointAssociation resource. * - * @param {string} organizationLocationAddressGroupName - * A fully-qualified path representing organization_location_address_group resource. - * @returns {string} A string representing the organization. + * @param {string} firewallEndpointAssociationName + * A fully-qualified path representing FirewallEndpointAssociation resource. + * @returns {string} A string representing the project. */ - matchOrganizationFromOrganizationLocationAddressGroupName(organizationLocationAddressGroupName: string) { - return this.pathTemplates.organizationLocationAddressGroupPathTemplate.match(organizationLocationAddressGroupName).organization; + matchProjectFromFirewallEndpointAssociationName(firewallEndpointAssociationName: string) { + return this.pathTemplates.firewallEndpointAssociationPathTemplate.match(firewallEndpointAssociationName).project; } /** - * Parse the location from OrganizationLocationAddressGroup resource. + * Parse the location from FirewallEndpointAssociation resource. * - * @param {string} organizationLocationAddressGroupName - * A fully-qualified path representing organization_location_address_group resource. + * @param {string} firewallEndpointAssociationName + * A fully-qualified path representing FirewallEndpointAssociation resource. * @returns {string} A string representing the location. */ - matchLocationFromOrganizationLocationAddressGroupName(organizationLocationAddressGroupName: string) { - return this.pathTemplates.organizationLocationAddressGroupPathTemplate.match(organizationLocationAddressGroupName).location; + matchLocationFromFirewallEndpointAssociationName(firewallEndpointAssociationName: string) { + return this.pathTemplates.firewallEndpointAssociationPathTemplate.match(firewallEndpointAssociationName).location; } /** - * Parse the address_group from OrganizationLocationAddressGroup resource. + * Parse the firewall_endpoint_association from FirewallEndpointAssociation resource. * - * @param {string} organizationLocationAddressGroupName - * A fully-qualified path representing organization_location_address_group resource. - * @returns {string} A string representing the address_group. + * @param {string} firewallEndpointAssociationName + * A fully-qualified path representing FirewallEndpointAssociation resource. + * @returns {string} A string representing the firewall_endpoint_association. */ - matchAddressGroupFromOrganizationLocationAddressGroupName(organizationLocationAddressGroupName: string) { - return this.pathTemplates.organizationLocationAddressGroupPathTemplate.match(organizationLocationAddressGroupName).address_group; + matchFirewallEndpointAssociationFromFirewallEndpointAssociationName(firewallEndpointAssociationName: string) { + return this.pathTemplates.firewallEndpointAssociationPathTemplate.match(firewallEndpointAssociationName).firewall_endpoint_association; } /** - * Return a fully-qualified project resource name string. + * Return a fully-qualified gatewaySecurityPolicy resource name string. * * @param {string} project + * @param {string} location + * @param {string} gateway_security_policy * @returns {string} Resource name string. */ - projectPath(project:string) { - return this.pathTemplates.projectPathTemplate.render({ + gatewaySecurityPolicyPath(project:string,location:string,gatewaySecurityPolicy:string) { + return this.pathTemplates.gatewaySecurityPolicyPathTemplate.render({ + project: project, + location: location, + gateway_security_policy: gatewaySecurityPolicy, + }); + } + + /** + * Parse the project from GatewaySecurityPolicy resource. + * + * @param {string} gatewaySecurityPolicyName + * A fully-qualified path representing GatewaySecurityPolicy resource. + * @returns {string} A string representing the project. + */ + matchProjectFromGatewaySecurityPolicyName(gatewaySecurityPolicyName: string) { + return this.pathTemplates.gatewaySecurityPolicyPathTemplate.match(gatewaySecurityPolicyName).project; + } + + /** + * Parse the location from GatewaySecurityPolicy resource. + * + * @param {string} gatewaySecurityPolicyName + * A fully-qualified path representing GatewaySecurityPolicy resource. + * @returns {string} A string representing the location. + */ + matchLocationFromGatewaySecurityPolicyName(gatewaySecurityPolicyName: string) { + return this.pathTemplates.gatewaySecurityPolicyPathTemplate.match(gatewaySecurityPolicyName).location; + } + + /** + * Parse the gateway_security_policy from GatewaySecurityPolicy resource. + * + * @param {string} gatewaySecurityPolicyName + * A fully-qualified path representing GatewaySecurityPolicy resource. + * @returns {string} A string representing the gateway_security_policy. + */ + matchGatewaySecurityPolicyFromGatewaySecurityPolicyName(gatewaySecurityPolicyName: string) { + return this.pathTemplates.gatewaySecurityPolicyPathTemplate.match(gatewaySecurityPolicyName).gateway_security_policy; + } + + /** + * Return a fully-qualified gatewaySecurityPolicyRule resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} gateway_security_policy + * @param {string} rule + * @returns {string} Resource name string. + */ + gatewaySecurityPolicyRulePath(project:string,location:string,gatewaySecurityPolicy:string,rule:string) { + return this.pathTemplates.gatewaySecurityPolicyRulePathTemplate.render({ project: project, + location: location, + gateway_security_policy: gatewaySecurityPolicy, + rule: rule, }); } /** - * Parse the project from Project resource. + * Parse the project from GatewaySecurityPolicyRule resource. * - * @param {string} projectName - * A fully-qualified path representing Project resource. + * @param {string} gatewaySecurityPolicyRuleName + * A fully-qualified path representing GatewaySecurityPolicyRule resource. * @returns {string} A string representing the project. */ - matchProjectFromProjectName(projectName: string) { - return this.pathTemplates.projectPathTemplate.match(projectName).project; + matchProjectFromGatewaySecurityPolicyRuleName(gatewaySecurityPolicyRuleName: string) { + return this.pathTemplates.gatewaySecurityPolicyRulePathTemplate.match(gatewaySecurityPolicyRuleName).project; } /** - * Return a fully-qualified projectLocationAddressGroup resource name string. + * Parse the location from GatewaySecurityPolicyRule resource. + * + * @param {string} gatewaySecurityPolicyRuleName + * A fully-qualified path representing GatewaySecurityPolicyRule resource. + * @returns {string} A string representing the location. + */ + matchLocationFromGatewaySecurityPolicyRuleName(gatewaySecurityPolicyRuleName: string) { + return this.pathTemplates.gatewaySecurityPolicyRulePathTemplate.match(gatewaySecurityPolicyRuleName).location; + } + + /** + * Parse the gateway_security_policy from GatewaySecurityPolicyRule resource. + * + * @param {string} gatewaySecurityPolicyRuleName + * A fully-qualified path representing GatewaySecurityPolicyRule resource. + * @returns {string} A string representing the gateway_security_policy. + */ + matchGatewaySecurityPolicyFromGatewaySecurityPolicyRuleName(gatewaySecurityPolicyRuleName: string) { + return this.pathTemplates.gatewaySecurityPolicyRulePathTemplate.match(gatewaySecurityPolicyRuleName).gateway_security_policy; + } + + /** + * Parse the rule from GatewaySecurityPolicyRule resource. + * + * @param {string} gatewaySecurityPolicyRuleName + * A fully-qualified path representing GatewaySecurityPolicyRule resource. + * @returns {string} A string representing the rule. + */ + matchRuleFromGatewaySecurityPolicyRuleName(gatewaySecurityPolicyRuleName: string) { + return this.pathTemplates.gatewaySecurityPolicyRulePathTemplate.match(gatewaySecurityPolicyRuleName).rule; + } + + /** + * Return a fully-qualified interceptDeployment resource name string. * * @param {string} project * @param {string} location - * @param {string} address_group + * @param {string} intercept_deployment * @returns {string} Resource name string. */ - projectLocationAddressGroupPath(project:string,location:string,addressGroup:string) { - return this.pathTemplates.projectLocationAddressGroupPathTemplate.render({ + interceptDeploymentPath(project:string,location:string,interceptDeployment:string) { + return this.pathTemplates.interceptDeploymentPathTemplate.render({ project: project, location: location, - address_group: addressGroup, + intercept_deployment: interceptDeployment, }); } /** - * Parse the project from ProjectLocationAddressGroup resource. + * Parse the project from InterceptDeployment resource. * - * @param {string} projectLocationAddressGroupName - * A fully-qualified path representing project_location_address_group resource. + * @param {string} interceptDeploymentName + * A fully-qualified path representing InterceptDeployment resource. * @returns {string} A string representing the project. */ - matchProjectFromProjectLocationAddressGroupName(projectLocationAddressGroupName: string) { - return this.pathTemplates.projectLocationAddressGroupPathTemplate.match(projectLocationAddressGroupName).project; + matchProjectFromInterceptDeploymentName(interceptDeploymentName: string) { + return this.pathTemplates.interceptDeploymentPathTemplate.match(interceptDeploymentName).project; } /** - * Parse the location from ProjectLocationAddressGroup resource. + * Parse the location from InterceptDeployment resource. * - * @param {string} projectLocationAddressGroupName - * A fully-qualified path representing project_location_address_group resource. + * @param {string} interceptDeploymentName + * A fully-qualified path representing InterceptDeployment resource. * @returns {string} A string representing the location. */ - matchLocationFromProjectLocationAddressGroupName(projectLocationAddressGroupName: string) { - return this.pathTemplates.projectLocationAddressGroupPathTemplate.match(projectLocationAddressGroupName).location; + matchLocationFromInterceptDeploymentName(interceptDeploymentName: string) { + return this.pathTemplates.interceptDeploymentPathTemplate.match(interceptDeploymentName).location; } /** - * Parse the address_group from ProjectLocationAddressGroup resource. + * Parse the intercept_deployment from InterceptDeployment resource. * - * @param {string} projectLocationAddressGroupName - * A fully-qualified path representing project_location_address_group resource. - * @returns {string} A string representing the address_group. + * @param {string} interceptDeploymentName + * A fully-qualified path representing InterceptDeployment resource. + * @returns {string} A string representing the intercept_deployment. */ - matchAddressGroupFromProjectLocationAddressGroupName(projectLocationAddressGroupName: string) { - return this.pathTemplates.projectLocationAddressGroupPathTemplate.match(projectLocationAddressGroupName).address_group; + matchInterceptDeploymentFromInterceptDeploymentName(interceptDeploymentName: string) { + return this.pathTemplates.interceptDeploymentPathTemplate.match(interceptDeploymentName).intercept_deployment; } /** - * Return a fully-qualified serverTlsPolicy resource name string. + * Return a fully-qualified interceptDeploymentGroup resource name string. * * @param {string} project * @param {string} location - * @param {string} server_tls_policy + * @param {string} intercept_deployment_group * @returns {string} Resource name string. */ - serverTlsPolicyPath(project:string,location:string,serverTlsPolicy:string) { - return this.pathTemplates.serverTlsPolicyPathTemplate.render({ + interceptDeploymentGroupPath(project:string,location:string,interceptDeploymentGroup:string) { + return this.pathTemplates.interceptDeploymentGroupPathTemplate.render({ project: project, location: location, - server_tls_policy: serverTlsPolicy, + intercept_deployment_group: interceptDeploymentGroup, }); } /** - * Parse the project from ServerTlsPolicy resource. + * Parse the project from InterceptDeploymentGroup resource. * - * @param {string} serverTlsPolicyName - * A fully-qualified path representing ServerTlsPolicy resource. + * @param {string} interceptDeploymentGroupName + * A fully-qualified path representing InterceptDeploymentGroup resource. * @returns {string} A string representing the project. */ - matchProjectFromServerTlsPolicyName(serverTlsPolicyName: string) { - return this.pathTemplates.serverTlsPolicyPathTemplate.match(serverTlsPolicyName).project; + matchProjectFromInterceptDeploymentGroupName(interceptDeploymentGroupName: string) { + return this.pathTemplates.interceptDeploymentGroupPathTemplate.match(interceptDeploymentGroupName).project; } /** - * Parse the location from ServerTlsPolicy resource. + * Parse the location from InterceptDeploymentGroup resource. * - * @param {string} serverTlsPolicyName - * A fully-qualified path representing ServerTlsPolicy resource. + * @param {string} interceptDeploymentGroupName + * A fully-qualified path representing InterceptDeploymentGroup resource. * @returns {string} A string representing the location. */ - matchLocationFromServerTlsPolicyName(serverTlsPolicyName: string) { - return this.pathTemplates.serverTlsPolicyPathTemplate.match(serverTlsPolicyName).location; + matchLocationFromInterceptDeploymentGroupName(interceptDeploymentGroupName: string) { + return this.pathTemplates.interceptDeploymentGroupPathTemplate.match(interceptDeploymentGroupName).location; } /** - * Parse the server_tls_policy from ServerTlsPolicy resource. + * Parse the intercept_deployment_group from InterceptDeploymentGroup resource. * - * @param {string} serverTlsPolicyName - * A fully-qualified path representing ServerTlsPolicy resource. - * @returns {string} A string representing the server_tls_policy. + * @param {string} interceptDeploymentGroupName + * A fully-qualified path representing InterceptDeploymentGroup resource. + * @returns {string} A string representing the intercept_deployment_group. */ - matchServerTlsPolicyFromServerTlsPolicyName(serverTlsPolicyName: string) { - return this.pathTemplates.serverTlsPolicyPathTemplate.match(serverTlsPolicyName).server_tls_policy; + matchInterceptDeploymentGroupFromInterceptDeploymentGroupName(interceptDeploymentGroupName: string) { + return this.pathTemplates.interceptDeploymentGroupPathTemplate.match(interceptDeploymentGroupName).intercept_deployment_group; + } + + /** + * Return a fully-qualified interceptEndpointGroup resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} intercept_endpoint_group + * @returns {string} Resource name string. + */ + interceptEndpointGroupPath(project:string,location:string,interceptEndpointGroup:string) { + return this.pathTemplates.interceptEndpointGroupPathTemplate.render({ + project: project, + location: location, + intercept_endpoint_group: interceptEndpointGroup, + }); + } + + /** + * Parse the project from InterceptEndpointGroup resource. + * + * @param {string} interceptEndpointGroupName + * A fully-qualified path representing InterceptEndpointGroup resource. + * @returns {string} A string representing the project. + */ + matchProjectFromInterceptEndpointGroupName(interceptEndpointGroupName: string) { + return this.pathTemplates.interceptEndpointGroupPathTemplate.match(interceptEndpointGroupName).project; + } + + /** + * Parse the location from InterceptEndpointGroup resource. + * + * @param {string} interceptEndpointGroupName + * A fully-qualified path representing InterceptEndpointGroup resource. + * @returns {string} A string representing the location. + */ + matchLocationFromInterceptEndpointGroupName(interceptEndpointGroupName: string) { + return this.pathTemplates.interceptEndpointGroupPathTemplate.match(interceptEndpointGroupName).location; + } + + /** + * Parse the intercept_endpoint_group from InterceptEndpointGroup resource. + * + * @param {string} interceptEndpointGroupName + * A fully-qualified path representing InterceptEndpointGroup resource. + * @returns {string} A string representing the intercept_endpoint_group. + */ + matchInterceptEndpointGroupFromInterceptEndpointGroupName(interceptEndpointGroupName: string) { + return this.pathTemplates.interceptEndpointGroupPathTemplate.match(interceptEndpointGroupName).intercept_endpoint_group; + } + + /** + * Return a fully-qualified interceptEndpointGroupAssociation resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} intercept_endpoint_group_association + * @returns {string} Resource name string. + */ + interceptEndpointGroupAssociationPath(project:string,location:string,interceptEndpointGroupAssociation:string) { + return this.pathTemplates.interceptEndpointGroupAssociationPathTemplate.render({ + project: project, + location: location, + intercept_endpoint_group_association: interceptEndpointGroupAssociation, + }); + } + + /** + * Parse the project from InterceptEndpointGroupAssociation resource. + * + * @param {string} interceptEndpointGroupAssociationName + * A fully-qualified path representing InterceptEndpointGroupAssociation resource. + * @returns {string} A string representing the project. + */ + matchProjectFromInterceptEndpointGroupAssociationName(interceptEndpointGroupAssociationName: string) { + return this.pathTemplates.interceptEndpointGroupAssociationPathTemplate.match(interceptEndpointGroupAssociationName).project; + } + + /** + * Parse the location from InterceptEndpointGroupAssociation resource. + * + * @param {string} interceptEndpointGroupAssociationName + * A fully-qualified path representing InterceptEndpointGroupAssociation resource. + * @returns {string} A string representing the location. + */ + matchLocationFromInterceptEndpointGroupAssociationName(interceptEndpointGroupAssociationName: string) { + return this.pathTemplates.interceptEndpointGroupAssociationPathTemplate.match(interceptEndpointGroupAssociationName).location; + } + + /** + * Parse the intercept_endpoint_group_association from InterceptEndpointGroupAssociation resource. + * + * @param {string} interceptEndpointGroupAssociationName + * A fully-qualified path representing InterceptEndpointGroupAssociation resource. + * @returns {string} A string representing the intercept_endpoint_group_association. + */ + matchInterceptEndpointGroupAssociationFromInterceptEndpointGroupAssociationName(interceptEndpointGroupAssociationName: string) { + return this.pathTemplates.interceptEndpointGroupAssociationPathTemplate.match(interceptEndpointGroupAssociationName).intercept_endpoint_group_association; + } + + /** + * Return a fully-qualified location resource name string. + * + * @param {string} project + * @param {string} location + * @returns {string} Resource name string. + */ + locationPath(project:string,location:string) { + return this.pathTemplates.locationPathTemplate.render({ + project: project, + location: location, + }); + } + + /** + * Parse the project from Location resource. + * + * @param {string} locationName + * A fully-qualified path representing Location resource. + * @returns {string} A string representing the project. + */ + matchProjectFromLocationName(locationName: string) { + return this.pathTemplates.locationPathTemplate.match(locationName).project; + } + + /** + * Parse the location from Location resource. + * + * @param {string} locationName + * A fully-qualified path representing Location resource. + * @returns {string} A string representing the location. + */ + matchLocationFromLocationName(locationName: string) { + return this.pathTemplates.locationPathTemplate.match(locationName).location; + } + + /** + * Return a fully-qualified mirroringDeployment resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} mirroring_deployment + * @returns {string} Resource name string. + */ + mirroringDeploymentPath(project:string,location:string,mirroringDeployment:string) { + return this.pathTemplates.mirroringDeploymentPathTemplate.render({ + project: project, + location: location, + mirroring_deployment: mirroringDeployment, + }); + } + + /** + * Parse the project from MirroringDeployment resource. + * + * @param {string} mirroringDeploymentName + * A fully-qualified path representing MirroringDeployment resource. + * @returns {string} A string representing the project. + */ + matchProjectFromMirroringDeploymentName(mirroringDeploymentName: string) { + return this.pathTemplates.mirroringDeploymentPathTemplate.match(mirroringDeploymentName).project; + } + + /** + * Parse the location from MirroringDeployment resource. + * + * @param {string} mirroringDeploymentName + * A fully-qualified path representing MirroringDeployment resource. + * @returns {string} A string representing the location. + */ + matchLocationFromMirroringDeploymentName(mirroringDeploymentName: string) { + return this.pathTemplates.mirroringDeploymentPathTemplate.match(mirroringDeploymentName).location; + } + + /** + * Parse the mirroring_deployment from MirroringDeployment resource. + * + * @param {string} mirroringDeploymentName + * A fully-qualified path representing MirroringDeployment resource. + * @returns {string} A string representing the mirroring_deployment. + */ + matchMirroringDeploymentFromMirroringDeploymentName(mirroringDeploymentName: string) { + return this.pathTemplates.mirroringDeploymentPathTemplate.match(mirroringDeploymentName).mirroring_deployment; + } + + /** + * Return a fully-qualified mirroringDeploymentGroup resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} mirroring_deployment_group + * @returns {string} Resource name string. + */ + mirroringDeploymentGroupPath(project:string,location:string,mirroringDeploymentGroup:string) { + return this.pathTemplates.mirroringDeploymentGroupPathTemplate.render({ + project: project, + location: location, + mirroring_deployment_group: mirroringDeploymentGroup, + }); + } + + /** + * Parse the project from MirroringDeploymentGroup resource. + * + * @param {string} mirroringDeploymentGroupName + * A fully-qualified path representing MirroringDeploymentGroup resource. + * @returns {string} A string representing the project. + */ + matchProjectFromMirroringDeploymentGroupName(mirroringDeploymentGroupName: string) { + return this.pathTemplates.mirroringDeploymentGroupPathTemplate.match(mirroringDeploymentGroupName).project; + } + + /** + * Parse the location from MirroringDeploymentGroup resource. + * + * @param {string} mirroringDeploymentGroupName + * A fully-qualified path representing MirroringDeploymentGroup resource. + * @returns {string} A string representing the location. + */ + matchLocationFromMirroringDeploymentGroupName(mirroringDeploymentGroupName: string) { + return this.pathTemplates.mirroringDeploymentGroupPathTemplate.match(mirroringDeploymentGroupName).location; + } + + /** + * Parse the mirroring_deployment_group from MirroringDeploymentGroup resource. + * + * @param {string} mirroringDeploymentGroupName + * A fully-qualified path representing MirroringDeploymentGroup resource. + * @returns {string} A string representing the mirroring_deployment_group. + */ + matchMirroringDeploymentGroupFromMirroringDeploymentGroupName(mirroringDeploymentGroupName: string) { + return this.pathTemplates.mirroringDeploymentGroupPathTemplate.match(mirroringDeploymentGroupName).mirroring_deployment_group; + } + + /** + * Return a fully-qualified mirroringEndpointGroup resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} mirroring_endpoint_group + * @returns {string} Resource name string. + */ + mirroringEndpointGroupPath(project:string,location:string,mirroringEndpointGroup:string) { + return this.pathTemplates.mirroringEndpointGroupPathTemplate.render({ + project: project, + location: location, + mirroring_endpoint_group: mirroringEndpointGroup, + }); + } + + /** + * Parse the project from MirroringEndpointGroup resource. + * + * @param {string} mirroringEndpointGroupName + * A fully-qualified path representing MirroringEndpointGroup resource. + * @returns {string} A string representing the project. + */ + matchProjectFromMirroringEndpointGroupName(mirroringEndpointGroupName: string) { + return this.pathTemplates.mirroringEndpointGroupPathTemplate.match(mirroringEndpointGroupName).project; + } + + /** + * Parse the location from MirroringEndpointGroup resource. + * + * @param {string} mirroringEndpointGroupName + * A fully-qualified path representing MirroringEndpointGroup resource. + * @returns {string} A string representing the location. + */ + matchLocationFromMirroringEndpointGroupName(mirroringEndpointGroupName: string) { + return this.pathTemplates.mirroringEndpointGroupPathTemplate.match(mirroringEndpointGroupName).location; + } + + /** + * Parse the mirroring_endpoint_group from MirroringEndpointGroup resource. + * + * @param {string} mirroringEndpointGroupName + * A fully-qualified path representing MirroringEndpointGroup resource. + * @returns {string} A string representing the mirroring_endpoint_group. + */ + matchMirroringEndpointGroupFromMirroringEndpointGroupName(mirroringEndpointGroupName: string) { + return this.pathTemplates.mirroringEndpointGroupPathTemplate.match(mirroringEndpointGroupName).mirroring_endpoint_group; + } + + /** + * Return a fully-qualified mirroringEndpointGroupAssociation resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} mirroring_endpoint_group_association + * @returns {string} Resource name string. + */ + mirroringEndpointGroupAssociationPath(project:string,location:string,mirroringEndpointGroupAssociation:string) { + return this.pathTemplates.mirroringEndpointGroupAssociationPathTemplate.render({ + project: project, + location: location, + mirroring_endpoint_group_association: mirroringEndpointGroupAssociation, + }); + } + + /** + * Parse the project from MirroringEndpointGroupAssociation resource. + * + * @param {string} mirroringEndpointGroupAssociationName + * A fully-qualified path representing MirroringEndpointGroupAssociation resource. + * @returns {string} A string representing the project. + */ + matchProjectFromMirroringEndpointGroupAssociationName(mirroringEndpointGroupAssociationName: string) { + return this.pathTemplates.mirroringEndpointGroupAssociationPathTemplate.match(mirroringEndpointGroupAssociationName).project; + } + + /** + * Parse the location from MirroringEndpointGroupAssociation resource. + * + * @param {string} mirroringEndpointGroupAssociationName + * A fully-qualified path representing MirroringEndpointGroupAssociation resource. + * @returns {string} A string representing the location. + */ + matchLocationFromMirroringEndpointGroupAssociationName(mirroringEndpointGroupAssociationName: string) { + return this.pathTemplates.mirroringEndpointGroupAssociationPathTemplate.match(mirroringEndpointGroupAssociationName).location; + } + + /** + * Parse the mirroring_endpoint_group_association from MirroringEndpointGroupAssociation resource. + * + * @param {string} mirroringEndpointGroupAssociationName + * A fully-qualified path representing MirroringEndpointGroupAssociation resource. + * @returns {string} A string representing the mirroring_endpoint_group_association. + */ + matchMirroringEndpointGroupAssociationFromMirroringEndpointGroupAssociationName(mirroringEndpointGroupAssociationName: string) { + return this.pathTemplates.mirroringEndpointGroupAssociationPathTemplate.match(mirroringEndpointGroupAssociationName).mirroring_endpoint_group_association; + } + + /** + * Return a fully-qualified organizationLocationAddressGroup resource name string. + * + * @param {string} organization + * @param {string} location + * @param {string} address_group + * @returns {string} Resource name string. + */ + organizationLocationAddressGroupPath(organization:string,location:string,addressGroup:string) { + return this.pathTemplates.organizationLocationAddressGroupPathTemplate.render({ + organization: organization, + location: location, + address_group: addressGroup, + }); + } + + /** + * Parse the organization from OrganizationLocationAddressGroup resource. + * + * @param {string} organizationLocationAddressGroupName + * A fully-qualified path representing organization_location_address_group resource. + * @returns {string} A string representing the organization. + */ + matchOrganizationFromOrganizationLocationAddressGroupName(organizationLocationAddressGroupName: string) { + return this.pathTemplates.organizationLocationAddressGroupPathTemplate.match(organizationLocationAddressGroupName).organization; + } + + /** + * Parse the location from OrganizationLocationAddressGroup resource. + * + * @param {string} organizationLocationAddressGroupName + * A fully-qualified path representing organization_location_address_group resource. + * @returns {string} A string representing the location. + */ + matchLocationFromOrganizationLocationAddressGroupName(organizationLocationAddressGroupName: string) { + return this.pathTemplates.organizationLocationAddressGroupPathTemplate.match(organizationLocationAddressGroupName).location; + } + + /** + * Parse the address_group from OrganizationLocationAddressGroup resource. + * + * @param {string} organizationLocationAddressGroupName + * A fully-qualified path representing organization_location_address_group resource. + * @returns {string} A string representing the address_group. + */ + matchAddressGroupFromOrganizationLocationAddressGroupName(organizationLocationAddressGroupName: string) { + return this.pathTemplates.organizationLocationAddressGroupPathTemplate.match(organizationLocationAddressGroupName).address_group; + } + + /** + * Return a fully-qualified organizationLocationFirewallEndpoints resource name string. + * + * @param {string} organization + * @param {string} location + * @param {string} firewall_endpoint + * @returns {string} Resource name string. + */ + organizationLocationFirewallEndpointsPath(organization:string,location:string,firewallEndpoint:string) { + return this.pathTemplates.organizationLocationFirewallEndpointsPathTemplate.render({ + organization: organization, + location: location, + firewall_endpoint: firewallEndpoint, + }); + } + + /** + * Parse the organization from OrganizationLocationFirewallEndpoints resource. + * + * @param {string} organizationLocationFirewallEndpointsName + * A fully-qualified path representing organization_location_firewallEndpoints resource. + * @returns {string} A string representing the organization. + */ + matchOrganizationFromOrganizationLocationFirewallEndpointsName(organizationLocationFirewallEndpointsName: string) { + return this.pathTemplates.organizationLocationFirewallEndpointsPathTemplate.match(organizationLocationFirewallEndpointsName).organization; + } + + /** + * Parse the location from OrganizationLocationFirewallEndpoints resource. + * + * @param {string} organizationLocationFirewallEndpointsName + * A fully-qualified path representing organization_location_firewallEndpoints resource. + * @returns {string} A string representing the location. + */ + matchLocationFromOrganizationLocationFirewallEndpointsName(organizationLocationFirewallEndpointsName: string) { + return this.pathTemplates.organizationLocationFirewallEndpointsPathTemplate.match(organizationLocationFirewallEndpointsName).location; + } + + /** + * Parse the firewall_endpoint from OrganizationLocationFirewallEndpoints resource. + * + * @param {string} organizationLocationFirewallEndpointsName + * A fully-qualified path representing organization_location_firewallEndpoints resource. + * @returns {string} A string representing the firewall_endpoint. + */ + matchFirewallEndpointFromOrganizationLocationFirewallEndpointsName(organizationLocationFirewallEndpointsName: string) { + return this.pathTemplates.organizationLocationFirewallEndpointsPathTemplate.match(organizationLocationFirewallEndpointsName).firewall_endpoint; + } + + /** + * Return a fully-qualified organizationLocationSecurityProfile resource name string. + * + * @param {string} organization + * @param {string} location + * @param {string} security_profile + * @returns {string} Resource name string. + */ + organizationLocationSecurityProfilePath(organization:string,location:string,securityProfile:string) { + return this.pathTemplates.organizationLocationSecurityProfilePathTemplate.render({ + organization: organization, + location: location, + security_profile: securityProfile, + }); + } + + /** + * Parse the organization from OrganizationLocationSecurityProfile resource. + * + * @param {string} organizationLocationSecurityProfileName + * A fully-qualified path representing organization_location_security_profile resource. + * @returns {string} A string representing the organization. + */ + matchOrganizationFromOrganizationLocationSecurityProfileName(organizationLocationSecurityProfileName: string) { + return this.pathTemplates.organizationLocationSecurityProfilePathTemplate.match(organizationLocationSecurityProfileName).organization; + } + + /** + * Parse the location from OrganizationLocationSecurityProfile resource. + * + * @param {string} organizationLocationSecurityProfileName + * A fully-qualified path representing organization_location_security_profile resource. + * @returns {string} A string representing the location. + */ + matchLocationFromOrganizationLocationSecurityProfileName(organizationLocationSecurityProfileName: string) { + return this.pathTemplates.organizationLocationSecurityProfilePathTemplate.match(organizationLocationSecurityProfileName).location; + } + + /** + * Parse the security_profile from OrganizationLocationSecurityProfile resource. + * + * @param {string} organizationLocationSecurityProfileName + * A fully-qualified path representing organization_location_security_profile resource. + * @returns {string} A string representing the security_profile. + */ + matchSecurityProfileFromOrganizationLocationSecurityProfileName(organizationLocationSecurityProfileName: string) { + return this.pathTemplates.organizationLocationSecurityProfilePathTemplate.match(organizationLocationSecurityProfileName).security_profile; + } + + /** + * Return a fully-qualified organizationLocationSecurityProfileGroup resource name string. + * + * @param {string} organization + * @param {string} location + * @param {string} security_profile_group + * @returns {string} Resource name string. + */ + organizationLocationSecurityProfileGroupPath(organization:string,location:string,securityProfileGroup:string) { + return this.pathTemplates.organizationLocationSecurityProfileGroupPathTemplate.render({ + organization: organization, + location: location, + security_profile_group: securityProfileGroup, + }); + } + + /** + * Parse the organization from OrganizationLocationSecurityProfileGroup resource. + * + * @param {string} organizationLocationSecurityProfileGroupName + * A fully-qualified path representing organization_location_security_profile_group resource. + * @returns {string} A string representing the organization. + */ + matchOrganizationFromOrganizationLocationSecurityProfileGroupName(organizationLocationSecurityProfileGroupName: string) { + return this.pathTemplates.organizationLocationSecurityProfileGroupPathTemplate.match(organizationLocationSecurityProfileGroupName).organization; + } + + /** + * Parse the location from OrganizationLocationSecurityProfileGroup resource. + * + * @param {string} organizationLocationSecurityProfileGroupName + * A fully-qualified path representing organization_location_security_profile_group resource. + * @returns {string} A string representing the location. + */ + matchLocationFromOrganizationLocationSecurityProfileGroupName(organizationLocationSecurityProfileGroupName: string) { + return this.pathTemplates.organizationLocationSecurityProfileGroupPathTemplate.match(organizationLocationSecurityProfileGroupName).location; + } + + /** + * Parse the security_profile_group from OrganizationLocationSecurityProfileGroup resource. + * + * @param {string} organizationLocationSecurityProfileGroupName + * A fully-qualified path representing organization_location_security_profile_group resource. + * @returns {string} A string representing the security_profile_group. + */ + matchSecurityProfileGroupFromOrganizationLocationSecurityProfileGroupName(organizationLocationSecurityProfileGroupName: string) { + return this.pathTemplates.organizationLocationSecurityProfileGroupPathTemplate.match(organizationLocationSecurityProfileGroupName).security_profile_group; + } + + /** + * Return a fully-qualified project resource name string. + * + * @param {string} project + * @returns {string} Resource name string. + */ + projectPath(project:string) { + return this.pathTemplates.projectPathTemplate.render({ + project: project, + }); + } + + /** + * Parse the project from Project resource. + * + * @param {string} projectName + * A fully-qualified path representing Project resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectName(projectName: string) { + return this.pathTemplates.projectPathTemplate.match(projectName).project; + } + + /** + * Return a fully-qualified projectLocationAddressGroup resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} address_group + * @returns {string} Resource name string. + */ + projectLocationAddressGroupPath(project:string,location:string,addressGroup:string) { + return this.pathTemplates.projectLocationAddressGroupPathTemplate.render({ + project: project, + location: location, + address_group: addressGroup, + }); + } + + /** + * Parse the project from ProjectLocationAddressGroup resource. + * + * @param {string} projectLocationAddressGroupName + * A fully-qualified path representing project_location_address_group resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationAddressGroupName(projectLocationAddressGroupName: string) { + return this.pathTemplates.projectLocationAddressGroupPathTemplate.match(projectLocationAddressGroupName).project; + } + + /** + * Parse the location from ProjectLocationAddressGroup resource. + * + * @param {string} projectLocationAddressGroupName + * A fully-qualified path representing project_location_address_group resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationAddressGroupName(projectLocationAddressGroupName: string) { + return this.pathTemplates.projectLocationAddressGroupPathTemplate.match(projectLocationAddressGroupName).location; + } + + /** + * Parse the address_group from ProjectLocationAddressGroup resource. + * + * @param {string} projectLocationAddressGroupName + * A fully-qualified path representing project_location_address_group resource. + * @returns {string} A string representing the address_group. + */ + matchAddressGroupFromProjectLocationAddressGroupName(projectLocationAddressGroupName: string) { + return this.pathTemplates.projectLocationAddressGroupPathTemplate.match(projectLocationAddressGroupName).address_group; + } + + /** + * Return a fully-qualified projectLocationFirewallEndpoints resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} firewall_endpoint + * @returns {string} Resource name string. + */ + projectLocationFirewallEndpointsPath(project:string,location:string,firewallEndpoint:string) { + return this.pathTemplates.projectLocationFirewallEndpointsPathTemplate.render({ + project: project, + location: location, + firewall_endpoint: firewallEndpoint, + }); + } + + /** + * Parse the project from ProjectLocationFirewallEndpoints resource. + * + * @param {string} projectLocationFirewallEndpointsName + * A fully-qualified path representing project_location_firewallEndpoints resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationFirewallEndpointsName(projectLocationFirewallEndpointsName: string) { + return this.pathTemplates.projectLocationFirewallEndpointsPathTemplate.match(projectLocationFirewallEndpointsName).project; + } + + /** + * Parse the location from ProjectLocationFirewallEndpoints resource. + * + * @param {string} projectLocationFirewallEndpointsName + * A fully-qualified path representing project_location_firewallEndpoints resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationFirewallEndpointsName(projectLocationFirewallEndpointsName: string) { + return this.pathTemplates.projectLocationFirewallEndpointsPathTemplate.match(projectLocationFirewallEndpointsName).location; + } + + /** + * Parse the firewall_endpoint from ProjectLocationFirewallEndpoints resource. + * + * @param {string} projectLocationFirewallEndpointsName + * A fully-qualified path representing project_location_firewallEndpoints resource. + * @returns {string} A string representing the firewall_endpoint. + */ + matchFirewallEndpointFromProjectLocationFirewallEndpointsName(projectLocationFirewallEndpointsName: string) { + return this.pathTemplates.projectLocationFirewallEndpointsPathTemplate.match(projectLocationFirewallEndpointsName).firewall_endpoint; + } + + /** + * Return a fully-qualified projectLocationSecurityProfile resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} security_profile + * @returns {string} Resource name string. + */ + projectLocationSecurityProfilePath(project:string,location:string,securityProfile:string) { + return this.pathTemplates.projectLocationSecurityProfilePathTemplate.render({ + project: project, + location: location, + security_profile: securityProfile, + }); + } + + /** + * Parse the project from ProjectLocationSecurityProfile resource. + * + * @param {string} projectLocationSecurityProfileName + * A fully-qualified path representing project_location_security_profile resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationSecurityProfileName(projectLocationSecurityProfileName: string) { + return this.pathTemplates.projectLocationSecurityProfilePathTemplate.match(projectLocationSecurityProfileName).project; + } + + /** + * Parse the location from ProjectLocationSecurityProfile resource. + * + * @param {string} projectLocationSecurityProfileName + * A fully-qualified path representing project_location_security_profile resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationSecurityProfileName(projectLocationSecurityProfileName: string) { + return this.pathTemplates.projectLocationSecurityProfilePathTemplate.match(projectLocationSecurityProfileName).location; + } + + /** + * Parse the security_profile from ProjectLocationSecurityProfile resource. + * + * @param {string} projectLocationSecurityProfileName + * A fully-qualified path representing project_location_security_profile resource. + * @returns {string} A string representing the security_profile. + */ + matchSecurityProfileFromProjectLocationSecurityProfileName(projectLocationSecurityProfileName: string) { + return this.pathTemplates.projectLocationSecurityProfilePathTemplate.match(projectLocationSecurityProfileName).security_profile; + } + + /** + * Return a fully-qualified projectLocationSecurityProfileGroup resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} security_profile_group + * @returns {string} Resource name string. + */ + projectLocationSecurityProfileGroupPath(project:string,location:string,securityProfileGroup:string) { + return this.pathTemplates.projectLocationSecurityProfileGroupPathTemplate.render({ + project: project, + location: location, + security_profile_group: securityProfileGroup, + }); + } + + /** + * Parse the project from ProjectLocationSecurityProfileGroup resource. + * + * @param {string} projectLocationSecurityProfileGroupName + * A fully-qualified path representing project_location_security_profile_group resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationSecurityProfileGroupName(projectLocationSecurityProfileGroupName: string) { + return this.pathTemplates.projectLocationSecurityProfileGroupPathTemplate.match(projectLocationSecurityProfileGroupName).project; + } + + /** + * Parse the location from ProjectLocationSecurityProfileGroup resource. + * + * @param {string} projectLocationSecurityProfileGroupName + * A fully-qualified path representing project_location_security_profile_group resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationSecurityProfileGroupName(projectLocationSecurityProfileGroupName: string) { + return this.pathTemplates.projectLocationSecurityProfileGroupPathTemplate.match(projectLocationSecurityProfileGroupName).location; + } + + /** + * Parse the security_profile_group from ProjectLocationSecurityProfileGroup resource. + * + * @param {string} projectLocationSecurityProfileGroupName + * A fully-qualified path representing project_location_security_profile_group resource. + * @returns {string} A string representing the security_profile_group. + */ + matchSecurityProfileGroupFromProjectLocationSecurityProfileGroupName(projectLocationSecurityProfileGroupName: string) { + return this.pathTemplates.projectLocationSecurityProfileGroupPathTemplate.match(projectLocationSecurityProfileGroupName).security_profile_group; + } + + /** + * Return a fully-qualified serverTlsPolicy resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} server_tls_policy + * @returns {string} Resource name string. + */ + serverTlsPolicyPath(project:string,location:string,serverTlsPolicy:string) { + return this.pathTemplates.serverTlsPolicyPathTemplate.render({ + project: project, + location: location, + server_tls_policy: serverTlsPolicy, + }); + } + + /** + * Parse the project from ServerTlsPolicy resource. + * + * @param {string} serverTlsPolicyName + * A fully-qualified path representing ServerTlsPolicy resource. + * @returns {string} A string representing the project. + */ + matchProjectFromServerTlsPolicyName(serverTlsPolicyName: string) { + return this.pathTemplates.serverTlsPolicyPathTemplate.match(serverTlsPolicyName).project; + } + + /** + * Parse the location from ServerTlsPolicy resource. + * + * @param {string} serverTlsPolicyName + * A fully-qualified path representing ServerTlsPolicy resource. + * @returns {string} A string representing the location. + */ + matchLocationFromServerTlsPolicyName(serverTlsPolicyName: string) { + return this.pathTemplates.serverTlsPolicyPathTemplate.match(serverTlsPolicyName).location; + } + + /** + * Parse the server_tls_policy from ServerTlsPolicy resource. + * + * @param {string} serverTlsPolicyName + * A fully-qualified path representing ServerTlsPolicy resource. + * @returns {string} A string representing the server_tls_policy. + */ + matchServerTlsPolicyFromServerTlsPolicyName(serverTlsPolicyName: string) { + return this.pathTemplates.serverTlsPolicyPathTemplate.match(serverTlsPolicyName).server_tls_policy; + } + + /** + * Return a fully-qualified tlsInspectionPolicy resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} tls_inspection_policy + * @returns {string} Resource name string. + */ + tlsInspectionPolicyPath(project:string,location:string,tlsInspectionPolicy:string) { + return this.pathTemplates.tlsInspectionPolicyPathTemplate.render({ + project: project, + location: location, + tls_inspection_policy: tlsInspectionPolicy, + }); + } + + /** + * Parse the project from TlsInspectionPolicy resource. + * + * @param {string} tlsInspectionPolicyName + * A fully-qualified path representing TlsInspectionPolicy resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTlsInspectionPolicyName(tlsInspectionPolicyName: string) { + return this.pathTemplates.tlsInspectionPolicyPathTemplate.match(tlsInspectionPolicyName).project; + } + + /** + * Parse the location from TlsInspectionPolicy resource. + * + * @param {string} tlsInspectionPolicyName + * A fully-qualified path representing TlsInspectionPolicy resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTlsInspectionPolicyName(tlsInspectionPolicyName: string) { + return this.pathTemplates.tlsInspectionPolicyPathTemplate.match(tlsInspectionPolicyName).location; + } + + /** + * Parse the tls_inspection_policy from TlsInspectionPolicy resource. + * + * @param {string} tlsInspectionPolicyName + * A fully-qualified path representing TlsInspectionPolicy resource. + * @returns {string} A string representing the tls_inspection_policy. + */ + matchTlsInspectionPolicyFromTlsInspectionPolicyName(tlsInspectionPolicyName: string) { + return this.pathTemplates.tlsInspectionPolicyPathTemplate.match(tlsInspectionPolicyName).tls_inspection_policy; + } + + /** + * Return a fully-qualified urlList resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} url_list + * @returns {string} Resource name string. + */ + urlListPath(project:string,location:string,urlList:string) { + return this.pathTemplates.urlListPathTemplate.render({ + project: project, + location: location, + url_list: urlList, + }); + } + + /** + * Parse the project from UrlList resource. + * + * @param {string} urlListName + * A fully-qualified path representing UrlList resource. + * @returns {string} A string representing the project. + */ + matchProjectFromUrlListName(urlListName: string) { + return this.pathTemplates.urlListPathTemplate.match(urlListName).project; + } + + /** + * Parse the location from UrlList resource. + * + * @param {string} urlListName + * A fully-qualified path representing UrlList resource. + * @returns {string} A string representing the location. + */ + matchLocationFromUrlListName(urlListName: string) { + return this.pathTemplates.urlListPathTemplate.match(urlListName).location; + } + + /** + * Parse the url_list from UrlList resource. + * + * @param {string} urlListName + * A fully-qualified path representing UrlList resource. + * @returns {string} A string representing the url_list. + */ + matchUrlListFromUrlListName(urlListName: string) { + return this.pathTemplates.urlListPathTemplate.match(urlListName).url_list; } /** diff --git a/packages/google-cloud-networksecurity/src/v1/organization_address_group_service_proto_list.json b/packages/google-cloud-networksecurity/src/v1/organization_address_group_service_proto_list.json index c43ec4cef17..1451adf6674 100644 --- a/packages/google-cloud-networksecurity/src/v1/organization_address_group_service_proto_list.json +++ b/packages/google-cloud-networksecurity/src/v1/organization_address_group_service_proto_list.json @@ -1,9 +1,25 @@ [ "../../protos/google/cloud/networksecurity/v1/address_group.proto", "../../protos/google/cloud/networksecurity/v1/authorization_policy.proto", + "../../protos/google/cloud/networksecurity/v1/authz_policy.proto", + "../../protos/google/cloud/networksecurity/v1/backend_authentication_config.proto", "../../protos/google/cloud/networksecurity/v1/client_tls_policy.proto", "../../protos/google/cloud/networksecurity/v1/common.proto", + "../../protos/google/cloud/networksecurity/v1/dns_threat_detector.proto", + "../../protos/google/cloud/networksecurity/v1/firewall_activation.proto", + "../../protos/google/cloud/networksecurity/v1/gateway_security_policy.proto", + "../../protos/google/cloud/networksecurity/v1/gateway_security_policy_rule.proto", + "../../protos/google/cloud/networksecurity/v1/intercept.proto", + "../../protos/google/cloud/networksecurity/v1/mirroring.proto", "../../protos/google/cloud/networksecurity/v1/network_security.proto", + "../../protos/google/cloud/networksecurity/v1/security_profile_group.proto", + "../../protos/google/cloud/networksecurity/v1/security_profile_group_intercept.proto", + "../../protos/google/cloud/networksecurity/v1/security_profile_group_mirroring.proto", + "../../protos/google/cloud/networksecurity/v1/security_profile_group_service.proto", + "../../protos/google/cloud/networksecurity/v1/security_profile_group_threatprevention.proto", + "../../protos/google/cloud/networksecurity/v1/security_profile_group_urlfiltering.proto", "../../protos/google/cloud/networksecurity/v1/server_tls_policy.proto", - "../../protos/google/cloud/networksecurity/v1/tls.proto" + "../../protos/google/cloud/networksecurity/v1/tls.proto", + "../../protos/google/cloud/networksecurity/v1/tls_inspection_policy.proto", + "../../protos/google/cloud/networksecurity/v1/url_list.proto" ] diff --git a/packages/google-cloud-networksecurity/src/v1/organization_security_profile_group_service_client.ts b/packages/google-cloud-networksecurity/src/v1/organization_security_profile_group_service_client.ts new file mode 100644 index 00000000000..9b711ea83e1 --- /dev/null +++ b/packages/google-cloud-networksecurity/src/v1/organization_security_profile_group_service_client.ts @@ -0,0 +1,3648 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +/* global window */ +import type * as gax from 'google-gax'; +import type {Callback, CallOptions, Descriptors, ClientOptions, GrpcClientOptions, LROperation, PaginationCallback, GaxCall, IamClient, IamProtos, LocationsClient, LocationProtos} from 'google-gax'; +import {Transform} from 'stream'; +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +import {loggingUtils as logging, decodeAnyProtosInArray} from 'google-gax'; + +/** + * Client JSON configuration object, loaded from + * `src/v1/organization_security_profile_group_service_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './organization_security_profile_group_service_client_config.json'; +const version = require('../../../package.json').version; + +/** + * Organization SecurityProfileGroup is created under organization. + * @class + * @memberof v1 + */ +export class OrganizationSecurityProfileGroupServiceClient { + private _terminated = false; + private _opts: ClientOptions; + private _providedCustomServicePath: boolean; + private _gaxModule: typeof gax | typeof gax.fallback; + private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; + private _protos: {}; + private _defaults: {[method: string]: gax.CallSettings}; + private _universeDomain: string; + private _servicePath: string; + private _log = logging.log('network-security'); + + auth: gax.GoogleAuth; + descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; + warn: (code: string, message: string, warnType?: string) => void; + innerApiCalls: {[name: string]: Function}; + iamClient: IamClient; + locationsClient: LocationsClient; + pathTemplates: {[name: string]: gax.PathTemplate}; + operationsClient: gax.OperationsClient; + organizationSecurityProfileGroupServiceStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of OrganizationSecurityProfileGroupServiceClient. + * + * @param {object} [options] - The configuration object. + * The options accepted by the constructor are described in detail + * in [this document](https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#creating-the-client-instance). + * The common options are: + * @param {object} [options.credentials] - Credentials object. + * @param {string} [options.credentials.client_email] + * @param {string} [options.credentials.private_key] + * @param {string} [options.email] - Account email address. Required when + * using a .pem or .p12 keyFilename. + * @param {string} [options.keyFilename] - Full path to the a .json, .pem, or + * .p12 key downloaded from the Google Developers Console. If you provide + * a path to a JSON file, the projectId option below is not necessary. + * NOTE: .pem and .p12 require you to specify options.email as well. + * @param {number} [options.port] - The port on which to connect to + * the remote host. + * @param {string} [options.projectId] - The project ID from the Google + * Developer's Console, e.g. 'grape-spaceship-123'. We will also check + * the environment variable GCLOUD_PROJECT for your project ID. If your + * app is running in an environment which supports + * {@link https://cloud.google.com/docs/authentication/application-default-credentials Application Default Credentials}, + * your project ID will be detected automatically. + * @param {string} [options.apiEndpoint] - The domain name of the + * API remote host. + * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. + * Follows the structure of {@link gapicConfig}. + * @param {boolean} [options.fallback] - Use HTTP/1.1 REST mode. + * For more information, please check the + * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. + * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you + * need to avoid loading the default gRPC version and want to use the fallback + * HTTP implementation. Load only fallback version and pass it to the constructor: + * ``` + * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC + * const client = new OrganizationSecurityProfileGroupServiceClient({fallback: true}, gax); + * ``` + */ + constructor(opts?: ClientOptions, gaxInstance?: typeof gax | typeof gax.fallback) { + // Ensure that options include all the required fields. + const staticMembers = this.constructor as typeof OrganizationSecurityProfileGroupServiceClient; + if (opts?.universe_domain && opts?.universeDomain && opts?.universe_domain !== opts?.universeDomain) { + throw new Error('Please set either universe_domain or universeDomain, but not both.'); + } + const universeDomainEnvVar = (typeof process === 'object' && typeof process.env === 'object') ? process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] : undefined; + this._universeDomain = opts?.universeDomain ?? opts?.universe_domain ?? universeDomainEnvVar ?? 'googleapis.com'; + this._servicePath = 'networksecurity.' + this._universeDomain; + const servicePath = opts?.servicePath || opts?.apiEndpoint || this._servicePath; + this._providedCustomServicePath = !!(opts?.servicePath || opts?.apiEndpoint); + const port = opts?.port || staticMembers.port; + const clientConfig = opts?.clientConfig ?? {}; + const fallback = opts?.fallback ?? (typeof window !== 'undefined' && typeof window?.fetch === 'function'); + opts = Object.assign({servicePath, port, clientConfig, fallback}, opts); + + // Request numeric enum values if REST transport is used. + opts.numericEnums = true; + + // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. + if (servicePath !== this._servicePath && !('scopes' in opts)) { + opts['scopes'] = staticMembers.scopes; + } + + // Load google-gax module synchronously if needed + if (!gaxInstance) { + gaxInstance = require('google-gax') as typeof gax; + } + + // Choose either gRPC or proto-over-HTTP implementation of google-gax. + this._gaxModule = opts.fallback ? gaxInstance.fallback : gaxInstance; + + // Create a `gaxGrpc` object, with any grpc-specific options sent to the client. + this._gaxGrpc = new this._gaxModule.GrpcClient(opts); + + // Save options to use in initialize() method. + this._opts = opts; + + // Save the auth object to the client, for use by other methods. + this.auth = (this._gaxGrpc.auth as gax.GoogleAuth); + + // Set useJWTAccessWithScope on the auth object. + this.auth.useJWTAccessWithScope = true; + + // Set defaultServicePath on the auth object. + this.auth.defaultServicePath = this._servicePath; + + // Set the default scopes in auth client if needed. + if (servicePath === this._servicePath) { + this.auth.defaultScopes = staticMembers.scopes; + } + this.iamClient = new this._gaxModule.IamClient(this._gaxGrpc, opts); + + this.locationsClient = new this._gaxModule.LocationsClient( + this._gaxGrpc, + opts + ); + + + // Determine the client header string. + const clientHeader = [ + `gax/${this._gaxModule.version}`, + `gapic/${version}`, + ]; + if (typeof process === 'object' && 'versions' in process) { + clientHeader.push(`gl-node/${process.versions.node}`); + } else { + clientHeader.push(`gl-web/${this._gaxModule.version}`); + } + if (!opts.fallback) { + clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); + } else { + clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); + } + if (opts.libName && opts.libVersion) { + clientHeader.push(`${opts.libName}/${opts.libVersion}`); + } + // Load the applicable protos. + this._protos = this._gaxGrpc.loadProtoJSON(jsonProtos); + + // This API contains "path templates"; forward-slash-separated + // identifiers to uniquely identify resources within the API. + // Create useful helper objects for these. + this.pathTemplates = { + authorizationPolicyPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/authorizationPolicies/{authorization_policy}' + ), + authzPolicyPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/authzPolicies/{authz_policy}' + ), + backendAuthenticationConfigPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/backendAuthenticationConfigs/{backend_authentication_config}' + ), + clientTlsPolicyPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/clientTlsPolicies/{client_tls_policy}' + ), + dnsThreatDetectorPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/dnsThreatDetectors/{dns_threat_detector}' + ), + firewallEndpointAssociationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/firewallEndpointAssociations/{firewall_endpoint_association}' + ), + gatewaySecurityPolicyPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/gatewaySecurityPolicies/{gateway_security_policy}' + ), + gatewaySecurityPolicyRulePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/gatewaySecurityPolicies/{gateway_security_policy}/rules/{rule}' + ), + interceptDeploymentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/interceptDeployments/{intercept_deployment}' + ), + interceptDeploymentGroupPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/interceptDeploymentGroups/{intercept_deployment_group}' + ), + interceptEndpointGroupPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/interceptEndpointGroups/{intercept_endpoint_group}' + ), + interceptEndpointGroupAssociationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/interceptEndpointGroupAssociations/{intercept_endpoint_group_association}' + ), + mirroringDeploymentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/mirroringDeployments/{mirroring_deployment}' + ), + mirroringDeploymentGroupPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/mirroringDeploymentGroups/{mirroring_deployment_group}' + ), + mirroringEndpointGroupPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/mirroringEndpointGroups/{mirroring_endpoint_group}' + ), + mirroringEndpointGroupAssociationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/mirroringEndpointGroupAssociations/{mirroring_endpoint_group_association}' + ), + organizationPathTemplate: new this._gaxModule.PathTemplate( + 'organizations/{organization}' + ), + organizationLocationPathTemplate: new this._gaxModule.PathTemplate( + 'organizations/{organization}/locations/{location}' + ), + organizationLocationAddressGroupPathTemplate: new this._gaxModule.PathTemplate( + 'organizations/{organization}/locations/{location}/addressGroups/{address_group}' + ), + organizationLocationFirewallEndpointsPathTemplate: new this._gaxModule.PathTemplate( + 'organizations/{organization}/locations/{location}/firewallEndpoints/{firewall_endpoint}' + ), + organizationLocationSecurityProfilePathTemplate: new this._gaxModule.PathTemplate( + 'organizations/{organization}/locations/{location}/securityProfiles/{security_profile}' + ), + organizationLocationSecurityProfileGroupPathTemplate: new this._gaxModule.PathTemplate( + 'organizations/{organization}/locations/{location}/securityProfileGroups/{security_profile_group}' + ), + projectLocationAddressGroupPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/addressGroups/{address_group}' + ), + projectLocationFirewallEndpointsPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/firewallEndpoints/{firewall_endpoint}' + ), + projectLocationSecurityProfilePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/securityProfiles/{security_profile}' + ), + projectLocationSecurityProfileGroupPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/securityProfileGroups/{security_profile_group}' + ), + serverTlsPolicyPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/serverTlsPolicies/{server_tls_policy}' + ), + tlsInspectionPolicyPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/tlsInspectionPolicies/{tls_inspection_policy}' + ), + urlListPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/urlLists/{url_list}' + ), + }; + + // Some of the methods on this service return "paged" results, + // (e.g. 50 results at a time, with tokens to get subsequent + // pages). Denote the keys used for pagination and results. + this.descriptors.page = { + listSecurityProfileGroups: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'securityProfileGroups'), + listSecurityProfiles: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'securityProfiles') + }; + + const protoFilesRoot = this._gaxModule.protobufFromJSON(jsonProtos); + // This API contains "long-running operations", which return a + // an Operation object that allows for tracking of the operation, + // rather than holding a request open. + const lroOptions: GrpcClientOptions = { + auth: this.auth, + grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined + }; + if (opts.fallback) { + lroOptions.protoJson = protoFilesRoot; + lroOptions.httpRules = [{selector: 'google.cloud.location.Locations.GetLocation',get: '/v1/{name=projects/*/locations/*}',additional_bindings: [{get: '/v1/{name=organizations/*/locations/*}',}], + },{selector: 'google.cloud.location.Locations.ListLocations',get: '/v1/{name=projects/*}/locations',additional_bindings: [{get: '/v1/{name=organizations/*/locations/*}',}], + },{selector: 'google.iam.v1.IAMPolicy.GetIamPolicy',get: '/v1/{resource=projects/*/locations/*/addressGroups/*}:getIamPolicy',additional_bindings: [{get: '/v1/{resource=projects/*/locations/*/authorizationPolicies/*}:getIamPolicy',},{get: '/v1/{resource=organizations/*/locations/*/addressGroups/*}:getIamPolicy',},{get: '/v1/{resource=projects/*/locations/*/serverTlsPolicies/*}:getIamPolicy',},{get: '/v1/{resource=projects/*/locations/*/clientTlsPolicies/*}:getIamPolicy',},{get: '/v1/{resource=projects/*/locations/*/authzPolicies/*}:getIamPolicy',}], + },{selector: 'google.iam.v1.IAMPolicy.SetIamPolicy',post: '/v1/{resource=projects/*/locations/*/addressGroups/*}:setIamPolicy',body: '*',additional_bindings: [{post: '/v1/{resource=projects/*/locations/*/authorizationPolicies/*}:setIamPolicy',body: '*',},{post: '/v1/{resource=organizations/*/locations/*/addressGroups/*}:setIamPolicy',body: '*',},{post: '/v1/{resource=projects/*/locations/*/serverTlsPolicies/*}:setIamPolicy',body: '*',},{post: '/v1/{resource=projects/*/locations/*/clientTlsPolicies/*}:setIamPolicy',body: '*',},{post: '/v1/{resource=projects/*/locations/*/authzPolicies/*}:setIamPolicy',body: '*',}], + },{selector: 'google.iam.v1.IAMPolicy.TestIamPermissions',post: '/v1/{resource=projects/*/locations/*/addressGroups/*}:testIamPermissions',body: '*',additional_bindings: [{post: '/v1/{resource=projects/*/locations/*/authorizationPolicies/*}:testIamPermissions',body: '*',},{post: '/v1/{resource=organizations/*/locations/*/addressGroups/*}:testIamPermissions',body: '*',},{post: '/v1/{resource=projects/*/locations/*/serverTlsPolicies/*}:testIamPermissions',body: '*',},{post: '/v1/{resource=projects/*/locations/*/clientTlsPolicies/*}:testIamPermissions',body: '*',},{post: '/v1/{resource=projects/*/locations/*/authzPolicies/*}:testIamPermissions',body: '*',}], + },{selector: 'google.longrunning.Operations.CancelOperation',post: '/v1/{name=projects/*/locations/*/operations/*}:cancel',body: '*',additional_bindings: [{post: '/v1/{name=organizations/*/locations/*/operations/*}:cancel',body: '*',}], + },{selector: 'google.longrunning.Operations.DeleteOperation',delete: '/v1/{name=projects/*/locations/*/operations/*}',additional_bindings: [{delete: '/v1/{name=organizations/*/locations/*/operations/*}',}], + },{selector: 'google.longrunning.Operations.GetOperation',get: '/v1/{name=projects/*/locations/*/operations/*}',additional_bindings: [{get: '/v1/{name=organizations/*/locations/*/operations/*}',}], + },{selector: 'google.longrunning.Operations.ListOperations',get: '/v1/{name=projects/*/locations/*}/operations',additional_bindings: [{get: '/v1/{name=organizations/*/locations/*}/operations',}], + }]; + } + this.operationsClient = this._gaxModule.lro(lroOptions).operationsClient(opts); + const createSecurityProfileGroupResponse = protoFilesRoot.lookup( + '.google.cloud.networksecurity.v1.SecurityProfileGroup') as gax.protobuf.Type; + const createSecurityProfileGroupMetadata = protoFilesRoot.lookup( + '.google.cloud.networksecurity.v1.OperationMetadata') as gax.protobuf.Type; + const updateSecurityProfileGroupResponse = protoFilesRoot.lookup( + '.google.cloud.networksecurity.v1.SecurityProfileGroup') as gax.protobuf.Type; + const updateSecurityProfileGroupMetadata = protoFilesRoot.lookup( + '.google.cloud.networksecurity.v1.OperationMetadata') as gax.protobuf.Type; + const deleteSecurityProfileGroupResponse = protoFilesRoot.lookup( + '.google.protobuf.Empty') as gax.protobuf.Type; + const deleteSecurityProfileGroupMetadata = protoFilesRoot.lookup( + '.google.cloud.networksecurity.v1.OperationMetadata') as gax.protobuf.Type; + const createSecurityProfileResponse = protoFilesRoot.lookup( + '.google.cloud.networksecurity.v1.SecurityProfile') as gax.protobuf.Type; + const createSecurityProfileMetadata = protoFilesRoot.lookup( + '.google.cloud.networksecurity.v1.OperationMetadata') as gax.protobuf.Type; + const updateSecurityProfileResponse = protoFilesRoot.lookup( + '.google.cloud.networksecurity.v1.SecurityProfile') as gax.protobuf.Type; + const updateSecurityProfileMetadata = protoFilesRoot.lookup( + '.google.cloud.networksecurity.v1.OperationMetadata') as gax.protobuf.Type; + const deleteSecurityProfileResponse = protoFilesRoot.lookup( + '.google.protobuf.Empty') as gax.protobuf.Type; + const deleteSecurityProfileMetadata = protoFilesRoot.lookup( + '.google.cloud.networksecurity.v1.OperationMetadata') as gax.protobuf.Type; + + this.descriptors.longrunning = { + createSecurityProfileGroup: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + createSecurityProfileGroupResponse.decode.bind(createSecurityProfileGroupResponse), + createSecurityProfileGroupMetadata.decode.bind(createSecurityProfileGroupMetadata)), + updateSecurityProfileGroup: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + updateSecurityProfileGroupResponse.decode.bind(updateSecurityProfileGroupResponse), + updateSecurityProfileGroupMetadata.decode.bind(updateSecurityProfileGroupMetadata)), + deleteSecurityProfileGroup: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + deleteSecurityProfileGroupResponse.decode.bind(deleteSecurityProfileGroupResponse), + deleteSecurityProfileGroupMetadata.decode.bind(deleteSecurityProfileGroupMetadata)), + createSecurityProfile: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + createSecurityProfileResponse.decode.bind(createSecurityProfileResponse), + createSecurityProfileMetadata.decode.bind(createSecurityProfileMetadata)), + updateSecurityProfile: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + updateSecurityProfileResponse.decode.bind(updateSecurityProfileResponse), + updateSecurityProfileMetadata.decode.bind(updateSecurityProfileMetadata)), + deleteSecurityProfile: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + deleteSecurityProfileResponse.decode.bind(deleteSecurityProfileResponse), + deleteSecurityProfileMetadata.decode.bind(deleteSecurityProfileMetadata)) + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.networksecurity.v1.OrganizationSecurityProfileGroupService', gapicConfig as gax.ClientConfig, + opts.clientConfig || {}, {'x-goog-api-client': clientHeader.join(' ')}); + + // Set up a dictionary of "inner API calls"; the core implementation + // of calling the API is handled in `google-gax`, with this code + // merely providing the destination and request information. + this.innerApiCalls = {}; + + // Add a warn function to the client constructor so it can be easily tested. + this.warn = this._gaxModule.warn; + } + + /** + * Initialize the client. + * Performs asynchronous operations (such as authentication) and prepares the client. + * This function will be called automatically when any class method is called for the + * first time, but if you need to initialize it before calling an actual method, + * feel free to call initialize() directly. + * + * You can await on this method if you want to make sure the client is initialized. + * + * @returns {Promise} A promise that resolves to an authenticated service stub. + */ + initialize() { + // If the client stub promise is already initialized, return immediately. + if (this.organizationSecurityProfileGroupServiceStub) { + return this.organizationSecurityProfileGroupServiceStub; + } + + // Put together the "service stub" for + // google.cloud.networksecurity.v1.OrganizationSecurityProfileGroupService. + this.organizationSecurityProfileGroupServiceStub = this._gaxGrpc.createStub( + this._opts.fallback ? + (this._protos as protobuf.Root).lookupService('google.cloud.networksecurity.v1.OrganizationSecurityProfileGroupService') : + // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.networksecurity.v1.OrganizationSecurityProfileGroupService, + this._opts, this._providedCustomServicePath) as Promise<{[method: string]: Function}>; + + // Iterate over each of the methods that the service provides + // and create an API call method for each. + const organizationSecurityProfileGroupServiceStubMethods = + ['listSecurityProfileGroups', 'getSecurityProfileGroup', 'createSecurityProfileGroup', 'updateSecurityProfileGroup', 'deleteSecurityProfileGroup', 'listSecurityProfiles', 'getSecurityProfile', 'createSecurityProfile', 'updateSecurityProfile', 'deleteSecurityProfile']; + for (const methodName of organizationSecurityProfileGroupServiceStubMethods) { + const callPromise = this.organizationSecurityProfileGroupServiceStub.then( + stub => (...args: Array<{}>) => { + if (this._terminated) { + return Promise.reject('The client has already been closed.'); + } + const func = stub[methodName]; + return func.apply(stub, args); + }, + (err: Error|null|undefined) => () => { + throw err; + }); + + const descriptor = + this.descriptors.page[methodName] || + this.descriptors.longrunning[methodName] || + undefined; + const apiCall = this._gaxModule.createApiCall( + callPromise, + this._defaults[methodName], + descriptor, + this._opts.fallback + ); + + this.innerApiCalls[methodName] = apiCall; + } + + return this.organizationSecurityProfileGroupServiceStub; + } + + /** + * The DNS address for this API service. + * @deprecated Use the apiEndpoint method of the client instance. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + if (typeof process === 'object' && typeof process.emitWarning === 'function') { + process.emitWarning('Static servicePath is deprecated, please use the instance method instead.', 'DeprecationWarning'); + } + return 'networksecurity.googleapis.com'; + } + + /** + * The DNS address for this API service - same as servicePath. + * @deprecated Use the apiEndpoint method of the client instance. + * @returns {string} The DNS address for this service. + */ + static get apiEndpoint() { + if (typeof process === 'object' && typeof process.emitWarning === 'function') { + process.emitWarning('Static apiEndpoint is deprecated, please use the instance method instead.', 'DeprecationWarning'); + } + return 'networksecurity.googleapis.com'; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + get apiEndpoint() { + return this._servicePath; + } + + get universeDomain() { + return this._universeDomain; + } + + /** + * The port for this API service. + * @returns {number} The default port for this service. + */ + static get port() { + return 443; + } + + /** + * The scopes needed to make gRPC calls for every method defined + * in this service. + * @returns {string[]} List of default scopes. + */ + static get scopes() { + return [ + 'https://www.googleapis.com/auth/cloud-platform' + ]; + } + + getProjectId(): Promise; + getProjectId(callback: Callback): void; + /** + * Return the project ID used by this class. + * @returns {Promise} A promise that resolves to string containing the project ID. + */ + getProjectId(callback?: Callback): + Promise|void { + if (callback) { + this.auth.getProjectId(callback); + return; + } + return this.auth.getProjectId(); + } + + // ------------------- + // -- Service calls -- + // ------------------- +/** + * Gets details of a single SecurityProfileGroup. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. A name of the SecurityProfileGroup to get. Must be in the format + * `projects|organizations/* /locations/{location}/securityProfileGroups/{security_profile_group}`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.cloud.networksecurity.v1.SecurityProfileGroup|SecurityProfileGroup}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1/organization_security_profile_group_service.get_security_profile_group.js + * region_tag:networksecurity_v1_generated_OrganizationSecurityProfileGroupService_GetSecurityProfileGroup_async + */ + getSecurityProfileGroup( + request?: protos.google.cloud.networksecurity.v1.IGetSecurityProfileGroupRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.networksecurity.v1.ISecurityProfileGroup, + protos.google.cloud.networksecurity.v1.IGetSecurityProfileGroupRequest|undefined, {}|undefined + ]>; + getSecurityProfileGroup( + request: protos.google.cloud.networksecurity.v1.IGetSecurityProfileGroupRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.networksecurity.v1.ISecurityProfileGroup, + protos.google.cloud.networksecurity.v1.IGetSecurityProfileGroupRequest|null|undefined, + {}|null|undefined>): void; + getSecurityProfileGroup( + request: protos.google.cloud.networksecurity.v1.IGetSecurityProfileGroupRequest, + callback: Callback< + protos.google.cloud.networksecurity.v1.ISecurityProfileGroup, + protos.google.cloud.networksecurity.v1.IGetSecurityProfileGroupRequest|null|undefined, + {}|null|undefined>): void; + getSecurityProfileGroup( + request?: protos.google.cloud.networksecurity.v1.IGetSecurityProfileGroupRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.networksecurity.v1.ISecurityProfileGroup, + protos.google.cloud.networksecurity.v1.IGetSecurityProfileGroupRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.networksecurity.v1.ISecurityProfileGroup, + protos.google.cloud.networksecurity.v1.IGetSecurityProfileGroupRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.networksecurity.v1.ISecurityProfileGroup, + protos.google.cloud.networksecurity.v1.IGetSecurityProfileGroupRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('getSecurityProfileGroup request %j', request); + const wrappedCallback: Callback< + protos.google.cloud.networksecurity.v1.ISecurityProfileGroup, + protos.google.cloud.networksecurity.v1.IGetSecurityProfileGroupRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getSecurityProfileGroup response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.getSecurityProfileGroup(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.cloud.networksecurity.v1.ISecurityProfileGroup, + protos.google.cloud.networksecurity.v1.IGetSecurityProfileGroupRequest|undefined, + {}|undefined + ]) => { + this._log.info('getSecurityProfileGroup response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * Gets details of a single SecurityProfile. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. A name of the SecurityProfile to get. Must be in the format + * `projects|organizations/* /locations/{location}/securityProfiles/{security_profile_id}`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.cloud.networksecurity.v1.SecurityProfile|SecurityProfile}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1/organization_security_profile_group_service.get_security_profile.js + * region_tag:networksecurity_v1_generated_OrganizationSecurityProfileGroupService_GetSecurityProfile_async + */ + getSecurityProfile( + request?: protos.google.cloud.networksecurity.v1.IGetSecurityProfileRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.networksecurity.v1.ISecurityProfile, + protos.google.cloud.networksecurity.v1.IGetSecurityProfileRequest|undefined, {}|undefined + ]>; + getSecurityProfile( + request: protos.google.cloud.networksecurity.v1.IGetSecurityProfileRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.networksecurity.v1.ISecurityProfile, + protos.google.cloud.networksecurity.v1.IGetSecurityProfileRequest|null|undefined, + {}|null|undefined>): void; + getSecurityProfile( + request: protos.google.cloud.networksecurity.v1.IGetSecurityProfileRequest, + callback: Callback< + protos.google.cloud.networksecurity.v1.ISecurityProfile, + protos.google.cloud.networksecurity.v1.IGetSecurityProfileRequest|null|undefined, + {}|null|undefined>): void; + getSecurityProfile( + request?: protos.google.cloud.networksecurity.v1.IGetSecurityProfileRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.networksecurity.v1.ISecurityProfile, + protos.google.cloud.networksecurity.v1.IGetSecurityProfileRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.networksecurity.v1.ISecurityProfile, + protos.google.cloud.networksecurity.v1.IGetSecurityProfileRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.networksecurity.v1.ISecurityProfile, + protos.google.cloud.networksecurity.v1.IGetSecurityProfileRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('getSecurityProfile request %j', request); + const wrappedCallback: Callback< + protos.google.cloud.networksecurity.v1.ISecurityProfile, + protos.google.cloud.networksecurity.v1.IGetSecurityProfileRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getSecurityProfile response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.getSecurityProfile(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.cloud.networksecurity.v1.ISecurityProfile, + protos.google.cloud.networksecurity.v1.IGetSecurityProfileRequest|undefined, + {}|undefined + ]) => { + this._log.info('getSecurityProfile response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } + +/** + * Creates a new SecurityProfileGroup in a given organization and location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent resource of the SecurityProfileGroup. Must be in the + * format `projects|organizations/* /locations/{location}`. + * @param {string} request.securityProfileGroupId + * Required. Short name of the SecurityProfileGroup resource to be created. + * This value should be 1-63 characters long, containing only + * letters, numbers, hyphens, and underscores, and should not start + * with a number. E.g. "security_profile_group1". + * @param {google.cloud.networksecurity.v1.SecurityProfileGroup} request.securityProfileGroup + * Required. SecurityProfileGroup resource to be created. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/organization_security_profile_group_service.create_security_profile_group.js + * region_tag:networksecurity_v1_generated_OrganizationSecurityProfileGroupService_CreateSecurityProfileGroup_async + */ + createSecurityProfileGroup( + request?: protos.google.cloud.networksecurity.v1.ICreateSecurityProfileGroupRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + createSecurityProfileGroup( + request: protos.google.cloud.networksecurity.v1.ICreateSecurityProfileGroupRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + createSecurityProfileGroup( + request: protos.google.cloud.networksecurity.v1.ICreateSecurityProfileGroupRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + createSecurityProfileGroup( + request?: protos.google.cloud.networksecurity.v1.ICreateSecurityProfileGroupRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize().catch(err => {throw err}); + const wrappedCallback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('createSecurityProfileGroup response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('createSecurityProfileGroup request %j', request); + return this.innerApiCalls.createSecurityProfileGroup(request, options, wrappedCallback) + ?.then(([response, rawResponse, _]: [ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]) => { + this._log.info('createSecurityProfileGroup response %j', rawResponse); + return [response, rawResponse, _]; + }); + } +/** + * Check the status of the long running operation returned by `createSecurityProfileGroup()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/organization_security_profile_group_service.create_security_profile_group.js + * region_tag:networksecurity_v1_generated_OrganizationSecurityProfileGroupService_CreateSecurityProfileGroup_async + */ + async checkCreateSecurityProfileGroupProgress(name: string): Promise>{ + this._log.info('createSecurityProfileGroup long-running'); + const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.createSecurityProfileGroup, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Updates the parameters of a single SecurityProfileGroup. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.protobuf.FieldMask} request.updateMask + * Required. Field mask is used to specify the fields to be overwritten in the + * SecurityProfileGroup resource by the update. + * The fields specified in the update_mask are relative to the resource, not + * the full request. A field will be overwritten if it is in the mask. + * @param {google.cloud.networksecurity.v1.SecurityProfileGroup} request.securityProfileGroup + * Required. Updated SecurityProfileGroup resource. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/organization_security_profile_group_service.update_security_profile_group.js + * region_tag:networksecurity_v1_generated_OrganizationSecurityProfileGroupService_UpdateSecurityProfileGroup_async + */ + updateSecurityProfileGroup( + request?: protos.google.cloud.networksecurity.v1.IUpdateSecurityProfileGroupRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + updateSecurityProfileGroup( + request: protos.google.cloud.networksecurity.v1.IUpdateSecurityProfileGroupRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + updateSecurityProfileGroup( + request: protos.google.cloud.networksecurity.v1.IUpdateSecurityProfileGroupRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + updateSecurityProfileGroup( + request?: protos.google.cloud.networksecurity.v1.IUpdateSecurityProfileGroupRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'security_profile_group.name': request.securityProfileGroup!.name ?? '', + }); + this.initialize().catch(err => {throw err}); + const wrappedCallback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('updateSecurityProfileGroup response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('updateSecurityProfileGroup request %j', request); + return this.innerApiCalls.updateSecurityProfileGroup(request, options, wrappedCallback) + ?.then(([response, rawResponse, _]: [ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]) => { + this._log.info('updateSecurityProfileGroup response %j', rawResponse); + return [response, rawResponse, _]; + }); + } +/** + * Check the status of the long running operation returned by `updateSecurityProfileGroup()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/organization_security_profile_group_service.update_security_profile_group.js + * region_tag:networksecurity_v1_generated_OrganizationSecurityProfileGroupService_UpdateSecurityProfileGroup_async + */ + async checkUpdateSecurityProfileGroupProgress(name: string): Promise>{ + this._log.info('updateSecurityProfileGroup long-running'); + const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.updateSecurityProfileGroup, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Deletes a single SecurityProfileGroup. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. A name of the SecurityProfileGroup to delete. Must be in the + * format + * `projects|organizations/* /locations/{location}/securityProfileGroups/{security_profile_group}`. + * @param {string} [request.etag] + * Optional. If client provided etag is out of date, delete will return + * FAILED_PRECONDITION error. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/organization_security_profile_group_service.delete_security_profile_group.js + * region_tag:networksecurity_v1_generated_OrganizationSecurityProfileGroupService_DeleteSecurityProfileGroup_async + */ + deleteSecurityProfileGroup( + request?: protos.google.cloud.networksecurity.v1.IDeleteSecurityProfileGroupRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + deleteSecurityProfileGroup( + request: protos.google.cloud.networksecurity.v1.IDeleteSecurityProfileGroupRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + deleteSecurityProfileGroup( + request: protos.google.cloud.networksecurity.v1.IDeleteSecurityProfileGroupRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + deleteSecurityProfileGroup( + request?: protos.google.cloud.networksecurity.v1.IDeleteSecurityProfileGroupRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize().catch(err => {throw err}); + const wrappedCallback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('deleteSecurityProfileGroup response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('deleteSecurityProfileGroup request %j', request); + return this.innerApiCalls.deleteSecurityProfileGroup(request, options, wrappedCallback) + ?.then(([response, rawResponse, _]: [ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]) => { + this._log.info('deleteSecurityProfileGroup response %j', rawResponse); + return [response, rawResponse, _]; + }); + } +/** + * Check the status of the long running operation returned by `deleteSecurityProfileGroup()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/organization_security_profile_group_service.delete_security_profile_group.js + * region_tag:networksecurity_v1_generated_OrganizationSecurityProfileGroupService_DeleteSecurityProfileGroup_async + */ + async checkDeleteSecurityProfileGroupProgress(name: string): Promise>{ + this._log.info('deleteSecurityProfileGroup long-running'); + const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.deleteSecurityProfileGroup, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Creates a new SecurityProfile in a given organization and location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent resource of the SecurityProfile. Must be in the format + * `projects|organizations/* /locations/{location}`. + * @param {string} request.securityProfileId + * Required. Short name of the SecurityProfile resource to be created. This + * value should be 1-63 characters long, containing only letters, numbers, + * hyphens, and underscores, and should not start with a number. E.g. + * "security_profile1". + * @param {google.cloud.networksecurity.v1.SecurityProfile} request.securityProfile + * Required. SecurityProfile resource to be created. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/organization_security_profile_group_service.create_security_profile.js + * region_tag:networksecurity_v1_generated_OrganizationSecurityProfileGroupService_CreateSecurityProfile_async + */ + createSecurityProfile( + request?: protos.google.cloud.networksecurity.v1.ICreateSecurityProfileRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + createSecurityProfile( + request: protos.google.cloud.networksecurity.v1.ICreateSecurityProfileRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + createSecurityProfile( + request: protos.google.cloud.networksecurity.v1.ICreateSecurityProfileRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + createSecurityProfile( + request?: protos.google.cloud.networksecurity.v1.ICreateSecurityProfileRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize().catch(err => {throw err}); + const wrappedCallback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('createSecurityProfile response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('createSecurityProfile request %j', request); + return this.innerApiCalls.createSecurityProfile(request, options, wrappedCallback) + ?.then(([response, rawResponse, _]: [ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]) => { + this._log.info('createSecurityProfile response %j', rawResponse); + return [response, rawResponse, _]; + }); + } +/** + * Check the status of the long running operation returned by `createSecurityProfile()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/organization_security_profile_group_service.create_security_profile.js + * region_tag:networksecurity_v1_generated_OrganizationSecurityProfileGroupService_CreateSecurityProfile_async + */ + async checkCreateSecurityProfileProgress(name: string): Promise>{ + this._log.info('createSecurityProfile long-running'); + const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.createSecurityProfile, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Updates the parameters of a single SecurityProfile. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.protobuf.FieldMask} request.updateMask + * Required. Field mask is used to specify the fields to be overwritten in the + * SecurityProfile resource by the update. + * The fields specified in the update_mask are relative to the resource, not + * the full request. A field will be overwritten if it is in the mask. + * @param {google.cloud.networksecurity.v1.SecurityProfile} request.securityProfile + * Required. Updated SecurityProfile resource. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/organization_security_profile_group_service.update_security_profile.js + * region_tag:networksecurity_v1_generated_OrganizationSecurityProfileGroupService_UpdateSecurityProfile_async + */ + updateSecurityProfile( + request?: protos.google.cloud.networksecurity.v1.IUpdateSecurityProfileRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + updateSecurityProfile( + request: protos.google.cloud.networksecurity.v1.IUpdateSecurityProfileRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + updateSecurityProfile( + request: protos.google.cloud.networksecurity.v1.IUpdateSecurityProfileRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + updateSecurityProfile( + request?: protos.google.cloud.networksecurity.v1.IUpdateSecurityProfileRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'security_profile.name': request.securityProfile!.name ?? '', + }); + this.initialize().catch(err => {throw err}); + const wrappedCallback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('updateSecurityProfile response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('updateSecurityProfile request %j', request); + return this.innerApiCalls.updateSecurityProfile(request, options, wrappedCallback) + ?.then(([response, rawResponse, _]: [ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]) => { + this._log.info('updateSecurityProfile response %j', rawResponse); + return [response, rawResponse, _]; + }); + } +/** + * Check the status of the long running operation returned by `updateSecurityProfile()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/organization_security_profile_group_service.update_security_profile.js + * region_tag:networksecurity_v1_generated_OrganizationSecurityProfileGroupService_UpdateSecurityProfile_async + */ + async checkUpdateSecurityProfileProgress(name: string): Promise>{ + this._log.info('updateSecurityProfile long-running'); + const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.updateSecurityProfile, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Deletes a single SecurityProfile. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. A name of the SecurityProfile to delete. Must be in the format + * `projects|organizations/* /locations/{location}/securityProfiles/{security_profile_id}`. + * @param {string} [request.etag] + * Optional. If client provided etag is out of date, delete will return + * FAILED_PRECONDITION error. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/organization_security_profile_group_service.delete_security_profile.js + * region_tag:networksecurity_v1_generated_OrganizationSecurityProfileGroupService_DeleteSecurityProfile_async + */ + deleteSecurityProfile( + request?: protos.google.cloud.networksecurity.v1.IDeleteSecurityProfileRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + deleteSecurityProfile( + request: protos.google.cloud.networksecurity.v1.IDeleteSecurityProfileRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + deleteSecurityProfile( + request: protos.google.cloud.networksecurity.v1.IDeleteSecurityProfileRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + deleteSecurityProfile( + request?: protos.google.cloud.networksecurity.v1.IDeleteSecurityProfileRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize().catch(err => {throw err}); + const wrappedCallback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('deleteSecurityProfile response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('deleteSecurityProfile request %j', request); + return this.innerApiCalls.deleteSecurityProfile(request, options, wrappedCallback) + ?.then(([response, rawResponse, _]: [ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]) => { + this._log.info('deleteSecurityProfile response %j', rawResponse); + return [response, rawResponse, _]; + }); + } +/** + * Check the status of the long running operation returned by `deleteSecurityProfile()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/organization_security_profile_group_service.delete_security_profile.js + * region_tag:networksecurity_v1_generated_OrganizationSecurityProfileGroupService_DeleteSecurityProfile_async + */ + async checkDeleteSecurityProfileProgress(name: string): Promise>{ + this._log.info('deleteSecurityProfile long-running'); + const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.deleteSecurityProfile, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } + /** + * Lists SecurityProfileGroups in a given organization and location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The project or organization and location from which the + * SecurityProfileGroups should be listed, specified in the format + * `projects|organizations/* /locations/{location}`. + * @param {number} [request.pageSize] + * Optional. Maximum number of SecurityProfileGroups to return per call. + * @param {string} [request.pageToken] + * Optional. The value returned by the last + * `ListSecurityProfileGroupsResponse` Indicates that this is a + * continuation of a prior `ListSecurityProfileGroups` call, and + * that the system should return the next page of data. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of {@link protos.google.cloud.networksecurity.v1.SecurityProfileGroup|SecurityProfileGroup}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listSecurityProfileGroupsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listSecurityProfileGroups( + request?: protos.google.cloud.networksecurity.v1.IListSecurityProfileGroupsRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.networksecurity.v1.ISecurityProfileGroup[], + protos.google.cloud.networksecurity.v1.IListSecurityProfileGroupsRequest|null, + protos.google.cloud.networksecurity.v1.IListSecurityProfileGroupsResponse + ]>; + listSecurityProfileGroups( + request: protos.google.cloud.networksecurity.v1.IListSecurityProfileGroupsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.networksecurity.v1.IListSecurityProfileGroupsRequest, + protos.google.cloud.networksecurity.v1.IListSecurityProfileGroupsResponse|null|undefined, + protos.google.cloud.networksecurity.v1.ISecurityProfileGroup>): void; + listSecurityProfileGroups( + request: protos.google.cloud.networksecurity.v1.IListSecurityProfileGroupsRequest, + callback: PaginationCallback< + protos.google.cloud.networksecurity.v1.IListSecurityProfileGroupsRequest, + protos.google.cloud.networksecurity.v1.IListSecurityProfileGroupsResponse|null|undefined, + protos.google.cloud.networksecurity.v1.ISecurityProfileGroup>): void; + listSecurityProfileGroups( + request?: protos.google.cloud.networksecurity.v1.IListSecurityProfileGroupsRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.cloud.networksecurity.v1.IListSecurityProfileGroupsRequest, + protos.google.cloud.networksecurity.v1.IListSecurityProfileGroupsResponse|null|undefined, + protos.google.cloud.networksecurity.v1.ISecurityProfileGroup>, + callback?: PaginationCallback< + protos.google.cloud.networksecurity.v1.IListSecurityProfileGroupsRequest, + protos.google.cloud.networksecurity.v1.IListSecurityProfileGroupsResponse|null|undefined, + protos.google.cloud.networksecurity.v1.ISecurityProfileGroup>): + Promise<[ + protos.google.cloud.networksecurity.v1.ISecurityProfileGroup[], + protos.google.cloud.networksecurity.v1.IListSecurityProfileGroupsRequest|null, + protos.google.cloud.networksecurity.v1.IListSecurityProfileGroupsResponse + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize().catch(err => {throw err}); + const wrappedCallback: PaginationCallback< + protos.google.cloud.networksecurity.v1.IListSecurityProfileGroupsRequest, + protos.google.cloud.networksecurity.v1.IListSecurityProfileGroupsResponse|null|undefined, + protos.google.cloud.networksecurity.v1.ISecurityProfileGroup>|undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listSecurityProfileGroups values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listSecurityProfileGroups request %j', request); + return this.innerApiCalls + .listSecurityProfileGroups(request, options, wrappedCallback) + ?.then(([response, input, output]: [ + protos.google.cloud.networksecurity.v1.ISecurityProfileGroup[], + protos.google.cloud.networksecurity.v1.IListSecurityProfileGroupsRequest|null, + protos.google.cloud.networksecurity.v1.IListSecurityProfileGroupsResponse + ]) => { + this._log.info('listSecurityProfileGroups values %j', response); + return [response, input, output]; + }); + } + +/** + * Equivalent to `listSecurityProfileGroups`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The project or organization and location from which the + * SecurityProfileGroups should be listed, specified in the format + * `projects|organizations/* /locations/{location}`. + * @param {number} [request.pageSize] + * Optional. Maximum number of SecurityProfileGroups to return per call. + * @param {string} [request.pageToken] + * Optional. The value returned by the last + * `ListSecurityProfileGroupsResponse` Indicates that this is a + * continuation of a prior `ListSecurityProfileGroups` call, and + * that the system should return the next page of data. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing {@link protos.google.cloud.networksecurity.v1.SecurityProfileGroup|SecurityProfileGroup} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `listSecurityProfileGroupsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listSecurityProfileGroupsStream( + request?: protos.google.cloud.networksecurity.v1.IListSecurityProfileGroupsRequest, + options?: CallOptions): + Transform{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listSecurityProfileGroups']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listSecurityProfileGroups stream %j', request); + return this.descriptors.page.listSecurityProfileGroups.createStream( + this.innerApiCalls.listSecurityProfileGroups as GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listSecurityProfileGroups`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The project or organization and location from which the + * SecurityProfileGroups should be listed, specified in the format + * `projects|organizations/* /locations/{location}`. + * @param {number} [request.pageSize] + * Optional. Maximum number of SecurityProfileGroups to return per call. + * @param {string} [request.pageToken] + * Optional. The value returned by the last + * `ListSecurityProfileGroupsResponse` Indicates that this is a + * continuation of a prior `ListSecurityProfileGroups` call, and + * that the system should return the next page of data. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link protos.google.cloud.networksecurity.v1.SecurityProfileGroup|SecurityProfileGroup}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example include:samples/generated/v1/organization_security_profile_group_service.list_security_profile_groups.js + * region_tag:networksecurity_v1_generated_OrganizationSecurityProfileGroupService_ListSecurityProfileGroups_async + */ + listSecurityProfileGroupsAsync( + request?: protos.google.cloud.networksecurity.v1.IListSecurityProfileGroupsRequest, + options?: CallOptions): + AsyncIterable{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listSecurityProfileGroups']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listSecurityProfileGroups iterate %j', request); + return this.descriptors.page.listSecurityProfileGroups.asyncIterate( + this.innerApiCalls['listSecurityProfileGroups'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Lists SecurityProfiles in a given organization and location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The project or organization and location from which the + * SecurityProfiles should be listed, specified in the format + * `projects|organizations/* /locations/{location}`. + * @param {number} [request.pageSize] + * Optional. Maximum number of SecurityProfiles to return per call. + * @param {string} [request.pageToken] + * Optional. The value returned by the last + * `ListSecurityProfilesResponse` Indicates that this is a continuation of a + * prior `ListSecurityProfiles` call, and that the system should return the + * next page of data. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of {@link protos.google.cloud.networksecurity.v1.SecurityProfile|SecurityProfile}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listSecurityProfilesAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listSecurityProfiles( + request?: protos.google.cloud.networksecurity.v1.IListSecurityProfilesRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.networksecurity.v1.ISecurityProfile[], + protos.google.cloud.networksecurity.v1.IListSecurityProfilesRequest|null, + protos.google.cloud.networksecurity.v1.IListSecurityProfilesResponse + ]>; + listSecurityProfiles( + request: protos.google.cloud.networksecurity.v1.IListSecurityProfilesRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.networksecurity.v1.IListSecurityProfilesRequest, + protos.google.cloud.networksecurity.v1.IListSecurityProfilesResponse|null|undefined, + protos.google.cloud.networksecurity.v1.ISecurityProfile>): void; + listSecurityProfiles( + request: protos.google.cloud.networksecurity.v1.IListSecurityProfilesRequest, + callback: PaginationCallback< + protos.google.cloud.networksecurity.v1.IListSecurityProfilesRequest, + protos.google.cloud.networksecurity.v1.IListSecurityProfilesResponse|null|undefined, + protos.google.cloud.networksecurity.v1.ISecurityProfile>): void; + listSecurityProfiles( + request?: protos.google.cloud.networksecurity.v1.IListSecurityProfilesRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.cloud.networksecurity.v1.IListSecurityProfilesRequest, + protos.google.cloud.networksecurity.v1.IListSecurityProfilesResponse|null|undefined, + protos.google.cloud.networksecurity.v1.ISecurityProfile>, + callback?: PaginationCallback< + protos.google.cloud.networksecurity.v1.IListSecurityProfilesRequest, + protos.google.cloud.networksecurity.v1.IListSecurityProfilesResponse|null|undefined, + protos.google.cloud.networksecurity.v1.ISecurityProfile>): + Promise<[ + protos.google.cloud.networksecurity.v1.ISecurityProfile[], + protos.google.cloud.networksecurity.v1.IListSecurityProfilesRequest|null, + protos.google.cloud.networksecurity.v1.IListSecurityProfilesResponse + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize().catch(err => {throw err}); + const wrappedCallback: PaginationCallback< + protos.google.cloud.networksecurity.v1.IListSecurityProfilesRequest, + protos.google.cloud.networksecurity.v1.IListSecurityProfilesResponse|null|undefined, + protos.google.cloud.networksecurity.v1.ISecurityProfile>|undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listSecurityProfiles values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listSecurityProfiles request %j', request); + return this.innerApiCalls + .listSecurityProfiles(request, options, wrappedCallback) + ?.then(([response, input, output]: [ + protos.google.cloud.networksecurity.v1.ISecurityProfile[], + protos.google.cloud.networksecurity.v1.IListSecurityProfilesRequest|null, + protos.google.cloud.networksecurity.v1.IListSecurityProfilesResponse + ]) => { + this._log.info('listSecurityProfiles values %j', response); + return [response, input, output]; + }); + } + +/** + * Equivalent to `listSecurityProfiles`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The project or organization and location from which the + * SecurityProfiles should be listed, specified in the format + * `projects|organizations/* /locations/{location}`. + * @param {number} [request.pageSize] + * Optional. Maximum number of SecurityProfiles to return per call. + * @param {string} [request.pageToken] + * Optional. The value returned by the last + * `ListSecurityProfilesResponse` Indicates that this is a continuation of a + * prior `ListSecurityProfiles` call, and that the system should return the + * next page of data. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing {@link protos.google.cloud.networksecurity.v1.SecurityProfile|SecurityProfile} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `listSecurityProfilesAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listSecurityProfilesStream( + request?: protos.google.cloud.networksecurity.v1.IListSecurityProfilesRequest, + options?: CallOptions): + Transform{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listSecurityProfiles']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listSecurityProfiles stream %j', request); + return this.descriptors.page.listSecurityProfiles.createStream( + this.innerApiCalls.listSecurityProfiles as GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listSecurityProfiles`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The project or organization and location from which the + * SecurityProfiles should be listed, specified in the format + * `projects|organizations/* /locations/{location}`. + * @param {number} [request.pageSize] + * Optional. Maximum number of SecurityProfiles to return per call. + * @param {string} [request.pageToken] + * Optional. The value returned by the last + * `ListSecurityProfilesResponse` Indicates that this is a continuation of a + * prior `ListSecurityProfiles` call, and that the system should return the + * next page of data. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link protos.google.cloud.networksecurity.v1.SecurityProfile|SecurityProfile}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example include:samples/generated/v1/organization_security_profile_group_service.list_security_profiles.js + * region_tag:networksecurity_v1_generated_OrganizationSecurityProfileGroupService_ListSecurityProfiles_async + */ + listSecurityProfilesAsync( + request?: protos.google.cloud.networksecurity.v1.IListSecurityProfilesRequest, + options?: CallOptions): + AsyncIterable{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listSecurityProfiles']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listSecurityProfiles iterate %j', request); + return this.descriptors.page.listSecurityProfiles.asyncIterate( + this.innerApiCalls['listSecurityProfiles'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } +/** + * Gets the access control policy for a resource. Returns an empty policy + * if the resource exists and does not have a policy set. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.resource + * REQUIRED: The resource for which the policy is being requested. + * See the operation documentation for the appropriate value for this field. + * @param {Object} [request.options] + * OPTIONAL: A `GetPolicyOptions` object for specifying options to + * `GetIamPolicy`. This field is only used by Cloud IAM. + * + * This object should have the same structure as {@link google.iam.v1.GetPolicyOptions | GetPolicyOptions}. + * @param {Object} [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.CallOptions} for the details. + * @param {function(?Error, ?Object)} [callback] + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing {@link google.iam.v1.Policy | Policy}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.iam.v1.Policy | Policy}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + getIamPolicy( + request: IamProtos.google.iam.v1.GetIamPolicyRequest, + options?: + | gax.CallOptions + | Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.GetIamPolicyRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.GetIamPolicyRequest | null | undefined, + {} | null | undefined + > + ):Promise<[IamProtos.google.iam.v1.Policy]> { + return this.iamClient.getIamPolicy(request, options, callback); + } + +/** + * Returns permissions that a caller has on the specified resource. If the + * resource does not exist, this will return an empty set of + * permissions, not a NOT_FOUND error. + * + * Note: This operation is designed to be used for building + * permission-aware UIs and command-line tools, not for authorization + * checking. This operation may "fail open" without warning. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.resource + * REQUIRED: The resource for which the policy detail is being requested. + * See the operation documentation for the appropriate value for this field. + * @param {string[]} request.permissions + * The set of permissions to check for the `resource`. Permissions with + * wildcards (such as '*' or 'storage.*') are not allowed. For more + * information see {@link https://cloud.google.com/iam/docs/overview#permissions | IAM Overview }. + * @param {Object} [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.CallOptions} for the details. + * @param {function(?Error, ?Object)} [callback] + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + setIamPolicy( + request: IamProtos.google.iam.v1.SetIamPolicyRequest, + options?: + | gax.CallOptions + | Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.SetIamPolicyRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.SetIamPolicyRequest | null | undefined, + {} | null | undefined + > + ):Promise<[IamProtos.google.iam.v1.Policy]> { + return this.iamClient.setIamPolicy(request, options, callback); + } + +/** + * Returns permissions that a caller has on the specified resource. If the + * resource does not exist, this will return an empty set of + * permissions, not a NOT_FOUND error. + * + * Note: This operation is designed to be used for building + * permission-aware UIs and command-line tools, not for authorization + * checking. This operation may "fail open" without warning. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.resource + * REQUIRED: The resource for which the policy detail is being requested. + * See the operation documentation for the appropriate value for this field. + * @param {string[]} request.permissions + * The set of permissions to check for the `resource`. Permissions with + * wildcards (such as '*' or 'storage.*') are not allowed. For more + * information see {@link https://cloud.google.com/iam/docs/overview#permissions | IAM Overview }. + * @param {Object} [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.CallOptions} for the details. + * @param {function(?Error, ?Object)} [callback] + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. + * The promise has a method named "cancel" which cancels the ongoing API call. + * + */ + testIamPermissions( + request: IamProtos.google.iam.v1.TestIamPermissionsRequest, + options?: + | gax.CallOptions + | Callback< + IamProtos.google.iam.v1.TestIamPermissionsResponse, + IamProtos.google.iam.v1.TestIamPermissionsRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + IamProtos.google.iam.v1.TestIamPermissionsResponse, + IamProtos.google.iam.v1.TestIamPermissionsRequest | null | undefined, + {} | null | undefined + > + ):Promise<[IamProtos.google.iam.v1.TestIamPermissionsResponse]> { + return this.iamClient.testIamPermissions(request, options, callback); + } + +/** + * Gets information about a location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Resource name for the location. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html | CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.cloud.location.Location | Location}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example + * ``` + * const [response] = await client.getLocation(request); + * ``` + */ + getLocation( + request: LocationProtos.google.cloud.location.IGetLocationRequest, + options?: + | gax.CallOptions + | Callback< + LocationProtos.google.cloud.location.ILocation, + | LocationProtos.google.cloud.location.IGetLocationRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + LocationProtos.google.cloud.location.ILocation, + | LocationProtos.google.cloud.location.IGetLocationRequest + | null + | undefined, + {} | null | undefined + > + ): Promise { + return this.locationsClient.getLocation(request, options, callback); + } + +/** + * Lists information about the supported locations for this service. Returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * The resource that owns the locations collection, if applicable. + * @param {string} request.filter + * The standard list filter. + * @param {number} request.pageSize + * The standard list page size. + * @param {string} request.pageToken + * The standard list page token. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link google.cloud.location.Location | Location}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example + * ``` + * const iterable = client.listLocationsAsync(request); + * for await (const response of iterable) { + * // process response + * } + * ``` + */ + listLocationsAsync( + request: LocationProtos.google.cloud.location.IListLocationsRequest, + options?: CallOptions + ): AsyncIterable { + return this.locationsClient.listLocationsAsync(request, options); + } + +/** + * Gets the latest state of a long-running operation. Clients can use this + * method to poll the operation result at intervals as recommended by the API + * service. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation resource. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions} + * for the details. + * @param {function(?Error, ?Object)=} callback + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing + * {@link google.longrunning.Operation | google.longrunning.Operation}. + * @return {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * {@link google.longrunning.Operation | google.longrunning.Operation}. + * The promise has a method named "cancel" which cancels the ongoing API call. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * const name = ''; + * const [response] = await client.getOperation({name}); + * // doThingsWith(response) + * ``` + */ + getOperation( + request: protos.google.longrunning.GetOperationRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protos.google.longrunning.Operation, + protos.google.longrunning.GetOperationRequest, + {} | null | undefined + >, + callback?: Callback< + protos.google.longrunning.Operation, + protos.google.longrunning.GetOperationRequest, + {} | null | undefined + > + ): Promise<[protos.google.longrunning.Operation]> { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + return this.operationsClient.getOperation(request, options, callback); + } + /** + * Lists operations that match the specified filter in the request. If the + * server doesn't support this method, it returns `UNIMPLEMENTED`. Returns an iterable object. + * + * For-await-of syntax is used with the iterable to recursively get response element on-demand. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation collection. + * @param {string} request.filter - The standard list filter. + * @param {number=} request.pageSize - + * The maximum number of resources contained in the underlying API + * response. If page streaming is performed per-resource, this + * parameter does not affect the return value. If page streaming is + * performed per-page, this determines the maximum number of + * resources in a page. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions} for the + * details. + * @returns {Object} + * An iterable Object that conforms to {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | iteration protocols}. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * for await (const response of client.listOperationsAsync(request)); + * // doThingsWith(response) + * ``` + */ + listOperationsAsync( + request: protos.google.longrunning.ListOperationsRequest, + options?: gax.CallOptions + ): AsyncIterable { + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + return this.operationsClient.listOperationsAsync(request, options); + } + /** + * Starts asynchronous cancellation on a long-running operation. The server + * makes a best effort to cancel the operation, but success is not + * guaranteed. If the server doesn't support this method, it returns + * `google.rpc.Code.UNIMPLEMENTED`. Clients can use + * {@link Operations.GetOperation} or + * other methods to check whether the cancellation succeeded or whether the + * operation completed despite cancellation. On successful cancellation, + * the operation is not deleted; instead, it becomes an operation with + * an {@link Operation.error} value with a {@link google.rpc.Status.code} of + * 1, corresponding to `Code.CANCELLED`. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation resource to be cancelled. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions} for the + * details. + * @param {function(?Error)=} callback + * The function which will be called with the result of the API call. + * @return {Promise} - The promise which resolves when API call finishes. + * The promise has a method named "cancel" which cancels the ongoing API + * call. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * await client.cancelOperation({name: ''}); + * ``` + */ + cancelOperation( + request: protos.google.longrunning.CancelOperationRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protos.google.longrunning.CancelOperationRequest, + protos.google.protobuf.Empty, + {} | undefined | null + >, + callback?: Callback< + protos.google.longrunning.CancelOperationRequest, + protos.google.protobuf.Empty, + {} | undefined | null + > + ): Promise { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + return this.operationsClient.cancelOperation(request, options, callback); + } + + /** + * Deletes a long-running operation. This method indicates that the client is + * no longer interested in the operation result. It does not cancel the + * operation. If the server doesn't support this method, it returns + * `google.rpc.Code.UNIMPLEMENTED`. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation resource to be deleted. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions} + * for the details. + * @param {function(?Error)=} callback + * The function which will be called with the result of the API call. + * @return {Promise} - The promise which resolves when API call finishes. + * The promise has a method named "cancel" which cancels the ongoing API + * call. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * await client.deleteOperation({name: ''}); + * ``` + */ + deleteOperation( + request: protos.google.longrunning.DeleteOperationRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protos.google.protobuf.Empty, + protos.google.longrunning.DeleteOperationRequest, + {} | null | undefined + >, + callback?: Callback< + protos.google.protobuf.Empty, + protos.google.longrunning.DeleteOperationRequest, + {} | null | undefined + > + ): Promise { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + return this.operationsClient.deleteOperation(request, options, callback); + } + + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified authorizationPolicy resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} authorization_policy + * @returns {string} Resource name string. + */ + authorizationPolicyPath(project:string,location:string,authorizationPolicy:string) { + return this.pathTemplates.authorizationPolicyPathTemplate.render({ + project: project, + location: location, + authorization_policy: authorizationPolicy, + }); + } + + /** + * Parse the project from AuthorizationPolicy resource. + * + * @param {string} authorizationPolicyName + * A fully-qualified path representing AuthorizationPolicy resource. + * @returns {string} A string representing the project. + */ + matchProjectFromAuthorizationPolicyName(authorizationPolicyName: string) { + return this.pathTemplates.authorizationPolicyPathTemplate.match(authorizationPolicyName).project; + } + + /** + * Parse the location from AuthorizationPolicy resource. + * + * @param {string} authorizationPolicyName + * A fully-qualified path representing AuthorizationPolicy resource. + * @returns {string} A string representing the location. + */ + matchLocationFromAuthorizationPolicyName(authorizationPolicyName: string) { + return this.pathTemplates.authorizationPolicyPathTemplate.match(authorizationPolicyName).location; + } + + /** + * Parse the authorization_policy from AuthorizationPolicy resource. + * + * @param {string} authorizationPolicyName + * A fully-qualified path representing AuthorizationPolicy resource. + * @returns {string} A string representing the authorization_policy. + */ + matchAuthorizationPolicyFromAuthorizationPolicyName(authorizationPolicyName: string) { + return this.pathTemplates.authorizationPolicyPathTemplate.match(authorizationPolicyName).authorization_policy; + } + + /** + * Return a fully-qualified authzPolicy resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} authz_policy + * @returns {string} Resource name string. + */ + authzPolicyPath(project:string,location:string,authzPolicy:string) { + return this.pathTemplates.authzPolicyPathTemplate.render({ + project: project, + location: location, + authz_policy: authzPolicy, + }); + } + + /** + * Parse the project from AuthzPolicy resource. + * + * @param {string} authzPolicyName + * A fully-qualified path representing AuthzPolicy resource. + * @returns {string} A string representing the project. + */ + matchProjectFromAuthzPolicyName(authzPolicyName: string) { + return this.pathTemplates.authzPolicyPathTemplate.match(authzPolicyName).project; + } + + /** + * Parse the location from AuthzPolicy resource. + * + * @param {string} authzPolicyName + * A fully-qualified path representing AuthzPolicy resource. + * @returns {string} A string representing the location. + */ + matchLocationFromAuthzPolicyName(authzPolicyName: string) { + return this.pathTemplates.authzPolicyPathTemplate.match(authzPolicyName).location; + } + + /** + * Parse the authz_policy from AuthzPolicy resource. + * + * @param {string} authzPolicyName + * A fully-qualified path representing AuthzPolicy resource. + * @returns {string} A string representing the authz_policy. + */ + matchAuthzPolicyFromAuthzPolicyName(authzPolicyName: string) { + return this.pathTemplates.authzPolicyPathTemplate.match(authzPolicyName).authz_policy; + } + + /** + * Return a fully-qualified backendAuthenticationConfig resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} backend_authentication_config + * @returns {string} Resource name string. + */ + backendAuthenticationConfigPath(project:string,location:string,backendAuthenticationConfig:string) { + return this.pathTemplates.backendAuthenticationConfigPathTemplate.render({ + project: project, + location: location, + backend_authentication_config: backendAuthenticationConfig, + }); + } + + /** + * Parse the project from BackendAuthenticationConfig resource. + * + * @param {string} backendAuthenticationConfigName + * A fully-qualified path representing BackendAuthenticationConfig resource. + * @returns {string} A string representing the project. + */ + matchProjectFromBackendAuthenticationConfigName(backendAuthenticationConfigName: string) { + return this.pathTemplates.backendAuthenticationConfigPathTemplate.match(backendAuthenticationConfigName).project; + } + + /** + * Parse the location from BackendAuthenticationConfig resource. + * + * @param {string} backendAuthenticationConfigName + * A fully-qualified path representing BackendAuthenticationConfig resource. + * @returns {string} A string representing the location. + */ + matchLocationFromBackendAuthenticationConfigName(backendAuthenticationConfigName: string) { + return this.pathTemplates.backendAuthenticationConfigPathTemplate.match(backendAuthenticationConfigName).location; + } + + /** + * Parse the backend_authentication_config from BackendAuthenticationConfig resource. + * + * @param {string} backendAuthenticationConfigName + * A fully-qualified path representing BackendAuthenticationConfig resource. + * @returns {string} A string representing the backend_authentication_config. + */ + matchBackendAuthenticationConfigFromBackendAuthenticationConfigName(backendAuthenticationConfigName: string) { + return this.pathTemplates.backendAuthenticationConfigPathTemplate.match(backendAuthenticationConfigName).backend_authentication_config; + } + + /** + * Return a fully-qualified clientTlsPolicy resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} client_tls_policy + * @returns {string} Resource name string. + */ + clientTlsPolicyPath(project:string,location:string,clientTlsPolicy:string) { + return this.pathTemplates.clientTlsPolicyPathTemplate.render({ + project: project, + location: location, + client_tls_policy: clientTlsPolicy, + }); + } + + /** + * Parse the project from ClientTlsPolicy resource. + * + * @param {string} clientTlsPolicyName + * A fully-qualified path representing ClientTlsPolicy resource. + * @returns {string} A string representing the project. + */ + matchProjectFromClientTlsPolicyName(clientTlsPolicyName: string) { + return this.pathTemplates.clientTlsPolicyPathTemplate.match(clientTlsPolicyName).project; + } + + /** + * Parse the location from ClientTlsPolicy resource. + * + * @param {string} clientTlsPolicyName + * A fully-qualified path representing ClientTlsPolicy resource. + * @returns {string} A string representing the location. + */ + matchLocationFromClientTlsPolicyName(clientTlsPolicyName: string) { + return this.pathTemplates.clientTlsPolicyPathTemplate.match(clientTlsPolicyName).location; + } + + /** + * Parse the client_tls_policy from ClientTlsPolicy resource. + * + * @param {string} clientTlsPolicyName + * A fully-qualified path representing ClientTlsPolicy resource. + * @returns {string} A string representing the client_tls_policy. + */ + matchClientTlsPolicyFromClientTlsPolicyName(clientTlsPolicyName: string) { + return this.pathTemplates.clientTlsPolicyPathTemplate.match(clientTlsPolicyName).client_tls_policy; + } + + /** + * Return a fully-qualified dnsThreatDetector resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} dns_threat_detector + * @returns {string} Resource name string. + */ + dnsThreatDetectorPath(project:string,location:string,dnsThreatDetector:string) { + return this.pathTemplates.dnsThreatDetectorPathTemplate.render({ + project: project, + location: location, + dns_threat_detector: dnsThreatDetector, + }); + } + + /** + * Parse the project from DnsThreatDetector resource. + * + * @param {string} dnsThreatDetectorName + * A fully-qualified path representing DnsThreatDetector resource. + * @returns {string} A string representing the project. + */ + matchProjectFromDnsThreatDetectorName(dnsThreatDetectorName: string) { + return this.pathTemplates.dnsThreatDetectorPathTemplate.match(dnsThreatDetectorName).project; + } + + /** + * Parse the location from DnsThreatDetector resource. + * + * @param {string} dnsThreatDetectorName + * A fully-qualified path representing DnsThreatDetector resource. + * @returns {string} A string representing the location. + */ + matchLocationFromDnsThreatDetectorName(dnsThreatDetectorName: string) { + return this.pathTemplates.dnsThreatDetectorPathTemplate.match(dnsThreatDetectorName).location; + } + + /** + * Parse the dns_threat_detector from DnsThreatDetector resource. + * + * @param {string} dnsThreatDetectorName + * A fully-qualified path representing DnsThreatDetector resource. + * @returns {string} A string representing the dns_threat_detector. + */ + matchDnsThreatDetectorFromDnsThreatDetectorName(dnsThreatDetectorName: string) { + return this.pathTemplates.dnsThreatDetectorPathTemplate.match(dnsThreatDetectorName).dns_threat_detector; + } + + /** + * Return a fully-qualified firewallEndpointAssociation resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} firewall_endpoint_association + * @returns {string} Resource name string. + */ + firewallEndpointAssociationPath(project:string,location:string,firewallEndpointAssociation:string) { + return this.pathTemplates.firewallEndpointAssociationPathTemplate.render({ + project: project, + location: location, + firewall_endpoint_association: firewallEndpointAssociation, + }); + } + + /** + * Parse the project from FirewallEndpointAssociation resource. + * + * @param {string} firewallEndpointAssociationName + * A fully-qualified path representing FirewallEndpointAssociation resource. + * @returns {string} A string representing the project. + */ + matchProjectFromFirewallEndpointAssociationName(firewallEndpointAssociationName: string) { + return this.pathTemplates.firewallEndpointAssociationPathTemplate.match(firewallEndpointAssociationName).project; + } + + /** + * Parse the location from FirewallEndpointAssociation resource. + * + * @param {string} firewallEndpointAssociationName + * A fully-qualified path representing FirewallEndpointAssociation resource. + * @returns {string} A string representing the location. + */ + matchLocationFromFirewallEndpointAssociationName(firewallEndpointAssociationName: string) { + return this.pathTemplates.firewallEndpointAssociationPathTemplate.match(firewallEndpointAssociationName).location; + } + + /** + * Parse the firewall_endpoint_association from FirewallEndpointAssociation resource. + * + * @param {string} firewallEndpointAssociationName + * A fully-qualified path representing FirewallEndpointAssociation resource. + * @returns {string} A string representing the firewall_endpoint_association. + */ + matchFirewallEndpointAssociationFromFirewallEndpointAssociationName(firewallEndpointAssociationName: string) { + return this.pathTemplates.firewallEndpointAssociationPathTemplate.match(firewallEndpointAssociationName).firewall_endpoint_association; + } + + /** + * Return a fully-qualified gatewaySecurityPolicy resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} gateway_security_policy + * @returns {string} Resource name string. + */ + gatewaySecurityPolicyPath(project:string,location:string,gatewaySecurityPolicy:string) { + return this.pathTemplates.gatewaySecurityPolicyPathTemplate.render({ + project: project, + location: location, + gateway_security_policy: gatewaySecurityPolicy, + }); + } + + /** + * Parse the project from GatewaySecurityPolicy resource. + * + * @param {string} gatewaySecurityPolicyName + * A fully-qualified path representing GatewaySecurityPolicy resource. + * @returns {string} A string representing the project. + */ + matchProjectFromGatewaySecurityPolicyName(gatewaySecurityPolicyName: string) { + return this.pathTemplates.gatewaySecurityPolicyPathTemplate.match(gatewaySecurityPolicyName).project; + } + + /** + * Parse the location from GatewaySecurityPolicy resource. + * + * @param {string} gatewaySecurityPolicyName + * A fully-qualified path representing GatewaySecurityPolicy resource. + * @returns {string} A string representing the location. + */ + matchLocationFromGatewaySecurityPolicyName(gatewaySecurityPolicyName: string) { + return this.pathTemplates.gatewaySecurityPolicyPathTemplate.match(gatewaySecurityPolicyName).location; + } + + /** + * Parse the gateway_security_policy from GatewaySecurityPolicy resource. + * + * @param {string} gatewaySecurityPolicyName + * A fully-qualified path representing GatewaySecurityPolicy resource. + * @returns {string} A string representing the gateway_security_policy. + */ + matchGatewaySecurityPolicyFromGatewaySecurityPolicyName(gatewaySecurityPolicyName: string) { + return this.pathTemplates.gatewaySecurityPolicyPathTemplate.match(gatewaySecurityPolicyName).gateway_security_policy; + } + + /** + * Return a fully-qualified gatewaySecurityPolicyRule resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} gateway_security_policy + * @param {string} rule + * @returns {string} Resource name string. + */ + gatewaySecurityPolicyRulePath(project:string,location:string,gatewaySecurityPolicy:string,rule:string) { + return this.pathTemplates.gatewaySecurityPolicyRulePathTemplate.render({ + project: project, + location: location, + gateway_security_policy: gatewaySecurityPolicy, + rule: rule, + }); + } + + /** + * Parse the project from GatewaySecurityPolicyRule resource. + * + * @param {string} gatewaySecurityPolicyRuleName + * A fully-qualified path representing GatewaySecurityPolicyRule resource. + * @returns {string} A string representing the project. + */ + matchProjectFromGatewaySecurityPolicyRuleName(gatewaySecurityPolicyRuleName: string) { + return this.pathTemplates.gatewaySecurityPolicyRulePathTemplate.match(gatewaySecurityPolicyRuleName).project; + } + + /** + * Parse the location from GatewaySecurityPolicyRule resource. + * + * @param {string} gatewaySecurityPolicyRuleName + * A fully-qualified path representing GatewaySecurityPolicyRule resource. + * @returns {string} A string representing the location. + */ + matchLocationFromGatewaySecurityPolicyRuleName(gatewaySecurityPolicyRuleName: string) { + return this.pathTemplates.gatewaySecurityPolicyRulePathTemplate.match(gatewaySecurityPolicyRuleName).location; + } + + /** + * Parse the gateway_security_policy from GatewaySecurityPolicyRule resource. + * + * @param {string} gatewaySecurityPolicyRuleName + * A fully-qualified path representing GatewaySecurityPolicyRule resource. + * @returns {string} A string representing the gateway_security_policy. + */ + matchGatewaySecurityPolicyFromGatewaySecurityPolicyRuleName(gatewaySecurityPolicyRuleName: string) { + return this.pathTemplates.gatewaySecurityPolicyRulePathTemplate.match(gatewaySecurityPolicyRuleName).gateway_security_policy; + } + + /** + * Parse the rule from GatewaySecurityPolicyRule resource. + * + * @param {string} gatewaySecurityPolicyRuleName + * A fully-qualified path representing GatewaySecurityPolicyRule resource. + * @returns {string} A string representing the rule. + */ + matchRuleFromGatewaySecurityPolicyRuleName(gatewaySecurityPolicyRuleName: string) { + return this.pathTemplates.gatewaySecurityPolicyRulePathTemplate.match(gatewaySecurityPolicyRuleName).rule; + } + + /** + * Return a fully-qualified interceptDeployment resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} intercept_deployment + * @returns {string} Resource name string. + */ + interceptDeploymentPath(project:string,location:string,interceptDeployment:string) { + return this.pathTemplates.interceptDeploymentPathTemplate.render({ + project: project, + location: location, + intercept_deployment: interceptDeployment, + }); + } + + /** + * Parse the project from InterceptDeployment resource. + * + * @param {string} interceptDeploymentName + * A fully-qualified path representing InterceptDeployment resource. + * @returns {string} A string representing the project. + */ + matchProjectFromInterceptDeploymentName(interceptDeploymentName: string) { + return this.pathTemplates.interceptDeploymentPathTemplate.match(interceptDeploymentName).project; + } + + /** + * Parse the location from InterceptDeployment resource. + * + * @param {string} interceptDeploymentName + * A fully-qualified path representing InterceptDeployment resource. + * @returns {string} A string representing the location. + */ + matchLocationFromInterceptDeploymentName(interceptDeploymentName: string) { + return this.pathTemplates.interceptDeploymentPathTemplate.match(interceptDeploymentName).location; + } + + /** + * Parse the intercept_deployment from InterceptDeployment resource. + * + * @param {string} interceptDeploymentName + * A fully-qualified path representing InterceptDeployment resource. + * @returns {string} A string representing the intercept_deployment. + */ + matchInterceptDeploymentFromInterceptDeploymentName(interceptDeploymentName: string) { + return this.pathTemplates.interceptDeploymentPathTemplate.match(interceptDeploymentName).intercept_deployment; + } + + /** + * Return a fully-qualified interceptDeploymentGroup resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} intercept_deployment_group + * @returns {string} Resource name string. + */ + interceptDeploymentGroupPath(project:string,location:string,interceptDeploymentGroup:string) { + return this.pathTemplates.interceptDeploymentGroupPathTemplate.render({ + project: project, + location: location, + intercept_deployment_group: interceptDeploymentGroup, + }); + } + + /** + * Parse the project from InterceptDeploymentGroup resource. + * + * @param {string} interceptDeploymentGroupName + * A fully-qualified path representing InterceptDeploymentGroup resource. + * @returns {string} A string representing the project. + */ + matchProjectFromInterceptDeploymentGroupName(interceptDeploymentGroupName: string) { + return this.pathTemplates.interceptDeploymentGroupPathTemplate.match(interceptDeploymentGroupName).project; + } + + /** + * Parse the location from InterceptDeploymentGroup resource. + * + * @param {string} interceptDeploymentGroupName + * A fully-qualified path representing InterceptDeploymentGroup resource. + * @returns {string} A string representing the location. + */ + matchLocationFromInterceptDeploymentGroupName(interceptDeploymentGroupName: string) { + return this.pathTemplates.interceptDeploymentGroupPathTemplate.match(interceptDeploymentGroupName).location; + } + + /** + * Parse the intercept_deployment_group from InterceptDeploymentGroup resource. + * + * @param {string} interceptDeploymentGroupName + * A fully-qualified path representing InterceptDeploymentGroup resource. + * @returns {string} A string representing the intercept_deployment_group. + */ + matchInterceptDeploymentGroupFromInterceptDeploymentGroupName(interceptDeploymentGroupName: string) { + return this.pathTemplates.interceptDeploymentGroupPathTemplate.match(interceptDeploymentGroupName).intercept_deployment_group; + } + + /** + * Return a fully-qualified interceptEndpointGroup resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} intercept_endpoint_group + * @returns {string} Resource name string. + */ + interceptEndpointGroupPath(project:string,location:string,interceptEndpointGroup:string) { + return this.pathTemplates.interceptEndpointGroupPathTemplate.render({ + project: project, + location: location, + intercept_endpoint_group: interceptEndpointGroup, + }); + } + + /** + * Parse the project from InterceptEndpointGroup resource. + * + * @param {string} interceptEndpointGroupName + * A fully-qualified path representing InterceptEndpointGroup resource. + * @returns {string} A string representing the project. + */ + matchProjectFromInterceptEndpointGroupName(interceptEndpointGroupName: string) { + return this.pathTemplates.interceptEndpointGroupPathTemplate.match(interceptEndpointGroupName).project; + } + + /** + * Parse the location from InterceptEndpointGroup resource. + * + * @param {string} interceptEndpointGroupName + * A fully-qualified path representing InterceptEndpointGroup resource. + * @returns {string} A string representing the location. + */ + matchLocationFromInterceptEndpointGroupName(interceptEndpointGroupName: string) { + return this.pathTemplates.interceptEndpointGroupPathTemplate.match(interceptEndpointGroupName).location; + } + + /** + * Parse the intercept_endpoint_group from InterceptEndpointGroup resource. + * + * @param {string} interceptEndpointGroupName + * A fully-qualified path representing InterceptEndpointGroup resource. + * @returns {string} A string representing the intercept_endpoint_group. + */ + matchInterceptEndpointGroupFromInterceptEndpointGroupName(interceptEndpointGroupName: string) { + return this.pathTemplates.interceptEndpointGroupPathTemplate.match(interceptEndpointGroupName).intercept_endpoint_group; + } + + /** + * Return a fully-qualified interceptEndpointGroupAssociation resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} intercept_endpoint_group_association + * @returns {string} Resource name string. + */ + interceptEndpointGroupAssociationPath(project:string,location:string,interceptEndpointGroupAssociation:string) { + return this.pathTemplates.interceptEndpointGroupAssociationPathTemplate.render({ + project: project, + location: location, + intercept_endpoint_group_association: interceptEndpointGroupAssociation, + }); + } + + /** + * Parse the project from InterceptEndpointGroupAssociation resource. + * + * @param {string} interceptEndpointGroupAssociationName + * A fully-qualified path representing InterceptEndpointGroupAssociation resource. + * @returns {string} A string representing the project. + */ + matchProjectFromInterceptEndpointGroupAssociationName(interceptEndpointGroupAssociationName: string) { + return this.pathTemplates.interceptEndpointGroupAssociationPathTemplate.match(interceptEndpointGroupAssociationName).project; + } + + /** + * Parse the location from InterceptEndpointGroupAssociation resource. + * + * @param {string} interceptEndpointGroupAssociationName + * A fully-qualified path representing InterceptEndpointGroupAssociation resource. + * @returns {string} A string representing the location. + */ + matchLocationFromInterceptEndpointGroupAssociationName(interceptEndpointGroupAssociationName: string) { + return this.pathTemplates.interceptEndpointGroupAssociationPathTemplate.match(interceptEndpointGroupAssociationName).location; + } + + /** + * Parse the intercept_endpoint_group_association from InterceptEndpointGroupAssociation resource. + * + * @param {string} interceptEndpointGroupAssociationName + * A fully-qualified path representing InterceptEndpointGroupAssociation resource. + * @returns {string} A string representing the intercept_endpoint_group_association. + */ + matchInterceptEndpointGroupAssociationFromInterceptEndpointGroupAssociationName(interceptEndpointGroupAssociationName: string) { + return this.pathTemplates.interceptEndpointGroupAssociationPathTemplate.match(interceptEndpointGroupAssociationName).intercept_endpoint_group_association; + } + + /** + * Return a fully-qualified mirroringDeployment resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} mirroring_deployment + * @returns {string} Resource name string. + */ + mirroringDeploymentPath(project:string,location:string,mirroringDeployment:string) { + return this.pathTemplates.mirroringDeploymentPathTemplate.render({ + project: project, + location: location, + mirroring_deployment: mirroringDeployment, + }); + } + + /** + * Parse the project from MirroringDeployment resource. + * + * @param {string} mirroringDeploymentName + * A fully-qualified path representing MirroringDeployment resource. + * @returns {string} A string representing the project. + */ + matchProjectFromMirroringDeploymentName(mirroringDeploymentName: string) { + return this.pathTemplates.mirroringDeploymentPathTemplate.match(mirroringDeploymentName).project; + } + + /** + * Parse the location from MirroringDeployment resource. + * + * @param {string} mirroringDeploymentName + * A fully-qualified path representing MirroringDeployment resource. + * @returns {string} A string representing the location. + */ + matchLocationFromMirroringDeploymentName(mirroringDeploymentName: string) { + return this.pathTemplates.mirroringDeploymentPathTemplate.match(mirroringDeploymentName).location; + } + + /** + * Parse the mirroring_deployment from MirroringDeployment resource. + * + * @param {string} mirroringDeploymentName + * A fully-qualified path representing MirroringDeployment resource. + * @returns {string} A string representing the mirroring_deployment. + */ + matchMirroringDeploymentFromMirroringDeploymentName(mirroringDeploymentName: string) { + return this.pathTemplates.mirroringDeploymentPathTemplate.match(mirroringDeploymentName).mirroring_deployment; + } + + /** + * Return a fully-qualified mirroringDeploymentGroup resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} mirroring_deployment_group + * @returns {string} Resource name string. + */ + mirroringDeploymentGroupPath(project:string,location:string,mirroringDeploymentGroup:string) { + return this.pathTemplates.mirroringDeploymentGroupPathTemplate.render({ + project: project, + location: location, + mirroring_deployment_group: mirroringDeploymentGroup, + }); + } + + /** + * Parse the project from MirroringDeploymentGroup resource. + * + * @param {string} mirroringDeploymentGroupName + * A fully-qualified path representing MirroringDeploymentGroup resource. + * @returns {string} A string representing the project. + */ + matchProjectFromMirroringDeploymentGroupName(mirroringDeploymentGroupName: string) { + return this.pathTemplates.mirroringDeploymentGroupPathTemplate.match(mirroringDeploymentGroupName).project; + } + + /** + * Parse the location from MirroringDeploymentGroup resource. + * + * @param {string} mirroringDeploymentGroupName + * A fully-qualified path representing MirroringDeploymentGroup resource. + * @returns {string} A string representing the location. + */ + matchLocationFromMirroringDeploymentGroupName(mirroringDeploymentGroupName: string) { + return this.pathTemplates.mirroringDeploymentGroupPathTemplate.match(mirroringDeploymentGroupName).location; + } + + /** + * Parse the mirroring_deployment_group from MirroringDeploymentGroup resource. + * + * @param {string} mirroringDeploymentGroupName + * A fully-qualified path representing MirroringDeploymentGroup resource. + * @returns {string} A string representing the mirroring_deployment_group. + */ + matchMirroringDeploymentGroupFromMirroringDeploymentGroupName(mirroringDeploymentGroupName: string) { + return this.pathTemplates.mirroringDeploymentGroupPathTemplate.match(mirroringDeploymentGroupName).mirroring_deployment_group; + } + + /** + * Return a fully-qualified mirroringEndpointGroup resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} mirroring_endpoint_group + * @returns {string} Resource name string. + */ + mirroringEndpointGroupPath(project:string,location:string,mirroringEndpointGroup:string) { + return this.pathTemplates.mirroringEndpointGroupPathTemplate.render({ + project: project, + location: location, + mirroring_endpoint_group: mirroringEndpointGroup, + }); + } + + /** + * Parse the project from MirroringEndpointGroup resource. + * + * @param {string} mirroringEndpointGroupName + * A fully-qualified path representing MirroringEndpointGroup resource. + * @returns {string} A string representing the project. + */ + matchProjectFromMirroringEndpointGroupName(mirroringEndpointGroupName: string) { + return this.pathTemplates.mirroringEndpointGroupPathTemplate.match(mirroringEndpointGroupName).project; + } + + /** + * Parse the location from MirroringEndpointGroup resource. + * + * @param {string} mirroringEndpointGroupName + * A fully-qualified path representing MirroringEndpointGroup resource. + * @returns {string} A string representing the location. + */ + matchLocationFromMirroringEndpointGroupName(mirroringEndpointGroupName: string) { + return this.pathTemplates.mirroringEndpointGroupPathTemplate.match(mirroringEndpointGroupName).location; + } + + /** + * Parse the mirroring_endpoint_group from MirroringEndpointGroup resource. + * + * @param {string} mirroringEndpointGroupName + * A fully-qualified path representing MirroringEndpointGroup resource. + * @returns {string} A string representing the mirroring_endpoint_group. + */ + matchMirroringEndpointGroupFromMirroringEndpointGroupName(mirroringEndpointGroupName: string) { + return this.pathTemplates.mirroringEndpointGroupPathTemplate.match(mirroringEndpointGroupName).mirroring_endpoint_group; + } + + /** + * Return a fully-qualified mirroringEndpointGroupAssociation resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} mirroring_endpoint_group_association + * @returns {string} Resource name string. + */ + mirroringEndpointGroupAssociationPath(project:string,location:string,mirroringEndpointGroupAssociation:string) { + return this.pathTemplates.mirroringEndpointGroupAssociationPathTemplate.render({ + project: project, + location: location, + mirroring_endpoint_group_association: mirroringEndpointGroupAssociation, + }); + } + + /** + * Parse the project from MirroringEndpointGroupAssociation resource. + * + * @param {string} mirroringEndpointGroupAssociationName + * A fully-qualified path representing MirroringEndpointGroupAssociation resource. + * @returns {string} A string representing the project. + */ + matchProjectFromMirroringEndpointGroupAssociationName(mirroringEndpointGroupAssociationName: string) { + return this.pathTemplates.mirroringEndpointGroupAssociationPathTemplate.match(mirroringEndpointGroupAssociationName).project; + } + + /** + * Parse the location from MirroringEndpointGroupAssociation resource. + * + * @param {string} mirroringEndpointGroupAssociationName + * A fully-qualified path representing MirroringEndpointGroupAssociation resource. + * @returns {string} A string representing the location. + */ + matchLocationFromMirroringEndpointGroupAssociationName(mirroringEndpointGroupAssociationName: string) { + return this.pathTemplates.mirroringEndpointGroupAssociationPathTemplate.match(mirroringEndpointGroupAssociationName).location; + } + + /** + * Parse the mirroring_endpoint_group_association from MirroringEndpointGroupAssociation resource. + * + * @param {string} mirroringEndpointGroupAssociationName + * A fully-qualified path representing MirroringEndpointGroupAssociation resource. + * @returns {string} A string representing the mirroring_endpoint_group_association. + */ + matchMirroringEndpointGroupAssociationFromMirroringEndpointGroupAssociationName(mirroringEndpointGroupAssociationName: string) { + return this.pathTemplates.mirroringEndpointGroupAssociationPathTemplate.match(mirroringEndpointGroupAssociationName).mirroring_endpoint_group_association; + } + + /** + * Return a fully-qualified organization resource name string. + * + * @param {string} organization + * @returns {string} Resource name string. + */ + organizationPath(organization:string) { + return this.pathTemplates.organizationPathTemplate.render({ + organization: organization, + }); + } + + /** + * Parse the organization from Organization resource. + * + * @param {string} organizationName + * A fully-qualified path representing Organization resource. + * @returns {string} A string representing the organization. + */ + matchOrganizationFromOrganizationName(organizationName: string) { + return this.pathTemplates.organizationPathTemplate.match(organizationName).organization; + } + + /** + * Return a fully-qualified organizationLocation resource name string. + * + * @param {string} organization + * @param {string} location + * @returns {string} Resource name string. + */ + organizationLocationPath(organization:string,location:string) { + return this.pathTemplates.organizationLocationPathTemplate.render({ + organization: organization, + location: location, + }); + } + + /** + * Parse the organization from OrganizationLocation resource. + * + * @param {string} organizationLocationName + * A fully-qualified path representing OrganizationLocation resource. + * @returns {string} A string representing the organization. + */ + matchOrganizationFromOrganizationLocationName(organizationLocationName: string) { + return this.pathTemplates.organizationLocationPathTemplate.match(organizationLocationName).organization; + } + + /** + * Parse the location from OrganizationLocation resource. + * + * @param {string} organizationLocationName + * A fully-qualified path representing OrganizationLocation resource. + * @returns {string} A string representing the location. + */ + matchLocationFromOrganizationLocationName(organizationLocationName: string) { + return this.pathTemplates.organizationLocationPathTemplate.match(organizationLocationName).location; + } + + /** + * Return a fully-qualified organizationLocationAddressGroup resource name string. + * + * @param {string} organization + * @param {string} location + * @param {string} address_group + * @returns {string} Resource name string. + */ + organizationLocationAddressGroupPath(organization:string,location:string,addressGroup:string) { + return this.pathTemplates.organizationLocationAddressGroupPathTemplate.render({ + organization: organization, + location: location, + address_group: addressGroup, + }); + } + + /** + * Parse the organization from OrganizationLocationAddressGroup resource. + * + * @param {string} organizationLocationAddressGroupName + * A fully-qualified path representing organization_location_address_group resource. + * @returns {string} A string representing the organization. + */ + matchOrganizationFromOrganizationLocationAddressGroupName(organizationLocationAddressGroupName: string) { + return this.pathTemplates.organizationLocationAddressGroupPathTemplate.match(organizationLocationAddressGroupName).organization; + } + + /** + * Parse the location from OrganizationLocationAddressGroup resource. + * + * @param {string} organizationLocationAddressGroupName + * A fully-qualified path representing organization_location_address_group resource. + * @returns {string} A string representing the location. + */ + matchLocationFromOrganizationLocationAddressGroupName(organizationLocationAddressGroupName: string) { + return this.pathTemplates.organizationLocationAddressGroupPathTemplate.match(organizationLocationAddressGroupName).location; + } + + /** + * Parse the address_group from OrganizationLocationAddressGroup resource. + * + * @param {string} organizationLocationAddressGroupName + * A fully-qualified path representing organization_location_address_group resource. + * @returns {string} A string representing the address_group. + */ + matchAddressGroupFromOrganizationLocationAddressGroupName(organizationLocationAddressGroupName: string) { + return this.pathTemplates.organizationLocationAddressGroupPathTemplate.match(organizationLocationAddressGroupName).address_group; + } + + /** + * Return a fully-qualified organizationLocationFirewallEndpoints resource name string. + * + * @param {string} organization + * @param {string} location + * @param {string} firewall_endpoint + * @returns {string} Resource name string. + */ + organizationLocationFirewallEndpointsPath(organization:string,location:string,firewallEndpoint:string) { + return this.pathTemplates.organizationLocationFirewallEndpointsPathTemplate.render({ + organization: organization, + location: location, + firewall_endpoint: firewallEndpoint, + }); + } + + /** + * Parse the organization from OrganizationLocationFirewallEndpoints resource. + * + * @param {string} organizationLocationFirewallEndpointsName + * A fully-qualified path representing organization_location_firewallEndpoints resource. + * @returns {string} A string representing the organization. + */ + matchOrganizationFromOrganizationLocationFirewallEndpointsName(organizationLocationFirewallEndpointsName: string) { + return this.pathTemplates.organizationLocationFirewallEndpointsPathTemplate.match(organizationLocationFirewallEndpointsName).organization; + } + + /** + * Parse the location from OrganizationLocationFirewallEndpoints resource. + * + * @param {string} organizationLocationFirewallEndpointsName + * A fully-qualified path representing organization_location_firewallEndpoints resource. + * @returns {string} A string representing the location. + */ + matchLocationFromOrganizationLocationFirewallEndpointsName(organizationLocationFirewallEndpointsName: string) { + return this.pathTemplates.organizationLocationFirewallEndpointsPathTemplate.match(organizationLocationFirewallEndpointsName).location; + } + + /** + * Parse the firewall_endpoint from OrganizationLocationFirewallEndpoints resource. + * + * @param {string} organizationLocationFirewallEndpointsName + * A fully-qualified path representing organization_location_firewallEndpoints resource. + * @returns {string} A string representing the firewall_endpoint. + */ + matchFirewallEndpointFromOrganizationLocationFirewallEndpointsName(organizationLocationFirewallEndpointsName: string) { + return this.pathTemplates.organizationLocationFirewallEndpointsPathTemplate.match(organizationLocationFirewallEndpointsName).firewall_endpoint; + } + + /** + * Return a fully-qualified organizationLocationSecurityProfile resource name string. + * + * @param {string} organization + * @param {string} location + * @param {string} security_profile + * @returns {string} Resource name string. + */ + organizationLocationSecurityProfilePath(organization:string,location:string,securityProfile:string) { + return this.pathTemplates.organizationLocationSecurityProfilePathTemplate.render({ + organization: organization, + location: location, + security_profile: securityProfile, + }); + } + + /** + * Parse the organization from OrganizationLocationSecurityProfile resource. + * + * @param {string} organizationLocationSecurityProfileName + * A fully-qualified path representing organization_location_security_profile resource. + * @returns {string} A string representing the organization. + */ + matchOrganizationFromOrganizationLocationSecurityProfileName(organizationLocationSecurityProfileName: string) { + return this.pathTemplates.organizationLocationSecurityProfilePathTemplate.match(organizationLocationSecurityProfileName).organization; + } + + /** + * Parse the location from OrganizationLocationSecurityProfile resource. + * + * @param {string} organizationLocationSecurityProfileName + * A fully-qualified path representing organization_location_security_profile resource. + * @returns {string} A string representing the location. + */ + matchLocationFromOrganizationLocationSecurityProfileName(organizationLocationSecurityProfileName: string) { + return this.pathTemplates.organizationLocationSecurityProfilePathTemplate.match(organizationLocationSecurityProfileName).location; + } + + /** + * Parse the security_profile from OrganizationLocationSecurityProfile resource. + * + * @param {string} organizationLocationSecurityProfileName + * A fully-qualified path representing organization_location_security_profile resource. + * @returns {string} A string representing the security_profile. + */ + matchSecurityProfileFromOrganizationLocationSecurityProfileName(organizationLocationSecurityProfileName: string) { + return this.pathTemplates.organizationLocationSecurityProfilePathTemplate.match(organizationLocationSecurityProfileName).security_profile; + } + + /** + * Return a fully-qualified organizationLocationSecurityProfileGroup resource name string. + * + * @param {string} organization + * @param {string} location + * @param {string} security_profile_group + * @returns {string} Resource name string. + */ + organizationLocationSecurityProfileGroupPath(organization:string,location:string,securityProfileGroup:string) { + return this.pathTemplates.organizationLocationSecurityProfileGroupPathTemplate.render({ + organization: organization, + location: location, + security_profile_group: securityProfileGroup, + }); + } + + /** + * Parse the organization from OrganizationLocationSecurityProfileGroup resource. + * + * @param {string} organizationLocationSecurityProfileGroupName + * A fully-qualified path representing organization_location_security_profile_group resource. + * @returns {string} A string representing the organization. + */ + matchOrganizationFromOrganizationLocationSecurityProfileGroupName(organizationLocationSecurityProfileGroupName: string) { + return this.pathTemplates.organizationLocationSecurityProfileGroupPathTemplate.match(organizationLocationSecurityProfileGroupName).organization; + } + + /** + * Parse the location from OrganizationLocationSecurityProfileGroup resource. + * + * @param {string} organizationLocationSecurityProfileGroupName + * A fully-qualified path representing organization_location_security_profile_group resource. + * @returns {string} A string representing the location. + */ + matchLocationFromOrganizationLocationSecurityProfileGroupName(organizationLocationSecurityProfileGroupName: string) { + return this.pathTemplates.organizationLocationSecurityProfileGroupPathTemplate.match(organizationLocationSecurityProfileGroupName).location; + } + + /** + * Parse the security_profile_group from OrganizationLocationSecurityProfileGroup resource. + * + * @param {string} organizationLocationSecurityProfileGroupName + * A fully-qualified path representing organization_location_security_profile_group resource. + * @returns {string} A string representing the security_profile_group. + */ + matchSecurityProfileGroupFromOrganizationLocationSecurityProfileGroupName(organizationLocationSecurityProfileGroupName: string) { + return this.pathTemplates.organizationLocationSecurityProfileGroupPathTemplate.match(organizationLocationSecurityProfileGroupName).security_profile_group; + } + + /** + * Return a fully-qualified projectLocationAddressGroup resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} address_group + * @returns {string} Resource name string. + */ + projectLocationAddressGroupPath(project:string,location:string,addressGroup:string) { + return this.pathTemplates.projectLocationAddressGroupPathTemplate.render({ + project: project, + location: location, + address_group: addressGroup, + }); + } + + /** + * Parse the project from ProjectLocationAddressGroup resource. + * + * @param {string} projectLocationAddressGroupName + * A fully-qualified path representing project_location_address_group resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationAddressGroupName(projectLocationAddressGroupName: string) { + return this.pathTemplates.projectLocationAddressGroupPathTemplate.match(projectLocationAddressGroupName).project; + } + + /** + * Parse the location from ProjectLocationAddressGroup resource. + * + * @param {string} projectLocationAddressGroupName + * A fully-qualified path representing project_location_address_group resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationAddressGroupName(projectLocationAddressGroupName: string) { + return this.pathTemplates.projectLocationAddressGroupPathTemplate.match(projectLocationAddressGroupName).location; + } + + /** + * Parse the address_group from ProjectLocationAddressGroup resource. + * + * @param {string} projectLocationAddressGroupName + * A fully-qualified path representing project_location_address_group resource. + * @returns {string} A string representing the address_group. + */ + matchAddressGroupFromProjectLocationAddressGroupName(projectLocationAddressGroupName: string) { + return this.pathTemplates.projectLocationAddressGroupPathTemplate.match(projectLocationAddressGroupName).address_group; + } + + /** + * Return a fully-qualified projectLocationFirewallEndpoints resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} firewall_endpoint + * @returns {string} Resource name string. + */ + projectLocationFirewallEndpointsPath(project:string,location:string,firewallEndpoint:string) { + return this.pathTemplates.projectLocationFirewallEndpointsPathTemplate.render({ + project: project, + location: location, + firewall_endpoint: firewallEndpoint, + }); + } + + /** + * Parse the project from ProjectLocationFirewallEndpoints resource. + * + * @param {string} projectLocationFirewallEndpointsName + * A fully-qualified path representing project_location_firewallEndpoints resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationFirewallEndpointsName(projectLocationFirewallEndpointsName: string) { + return this.pathTemplates.projectLocationFirewallEndpointsPathTemplate.match(projectLocationFirewallEndpointsName).project; + } + + /** + * Parse the location from ProjectLocationFirewallEndpoints resource. + * + * @param {string} projectLocationFirewallEndpointsName + * A fully-qualified path representing project_location_firewallEndpoints resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationFirewallEndpointsName(projectLocationFirewallEndpointsName: string) { + return this.pathTemplates.projectLocationFirewallEndpointsPathTemplate.match(projectLocationFirewallEndpointsName).location; + } + + /** + * Parse the firewall_endpoint from ProjectLocationFirewallEndpoints resource. + * + * @param {string} projectLocationFirewallEndpointsName + * A fully-qualified path representing project_location_firewallEndpoints resource. + * @returns {string} A string representing the firewall_endpoint. + */ + matchFirewallEndpointFromProjectLocationFirewallEndpointsName(projectLocationFirewallEndpointsName: string) { + return this.pathTemplates.projectLocationFirewallEndpointsPathTemplate.match(projectLocationFirewallEndpointsName).firewall_endpoint; + } + + /** + * Return a fully-qualified projectLocationSecurityProfile resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} security_profile + * @returns {string} Resource name string. + */ + projectLocationSecurityProfilePath(project:string,location:string,securityProfile:string) { + return this.pathTemplates.projectLocationSecurityProfilePathTemplate.render({ + project: project, + location: location, + security_profile: securityProfile, + }); + } + + /** + * Parse the project from ProjectLocationSecurityProfile resource. + * + * @param {string} projectLocationSecurityProfileName + * A fully-qualified path representing project_location_security_profile resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationSecurityProfileName(projectLocationSecurityProfileName: string) { + return this.pathTemplates.projectLocationSecurityProfilePathTemplate.match(projectLocationSecurityProfileName).project; + } + + /** + * Parse the location from ProjectLocationSecurityProfile resource. + * + * @param {string} projectLocationSecurityProfileName + * A fully-qualified path representing project_location_security_profile resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationSecurityProfileName(projectLocationSecurityProfileName: string) { + return this.pathTemplates.projectLocationSecurityProfilePathTemplate.match(projectLocationSecurityProfileName).location; + } + + /** + * Parse the security_profile from ProjectLocationSecurityProfile resource. + * + * @param {string} projectLocationSecurityProfileName + * A fully-qualified path representing project_location_security_profile resource. + * @returns {string} A string representing the security_profile. + */ + matchSecurityProfileFromProjectLocationSecurityProfileName(projectLocationSecurityProfileName: string) { + return this.pathTemplates.projectLocationSecurityProfilePathTemplate.match(projectLocationSecurityProfileName).security_profile; + } + + /** + * Return a fully-qualified projectLocationSecurityProfileGroup resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} security_profile_group + * @returns {string} Resource name string. + */ + projectLocationSecurityProfileGroupPath(project:string,location:string,securityProfileGroup:string) { + return this.pathTemplates.projectLocationSecurityProfileGroupPathTemplate.render({ + project: project, + location: location, + security_profile_group: securityProfileGroup, + }); + } + + /** + * Parse the project from ProjectLocationSecurityProfileGroup resource. + * + * @param {string} projectLocationSecurityProfileGroupName + * A fully-qualified path representing project_location_security_profile_group resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationSecurityProfileGroupName(projectLocationSecurityProfileGroupName: string) { + return this.pathTemplates.projectLocationSecurityProfileGroupPathTemplate.match(projectLocationSecurityProfileGroupName).project; + } + + /** + * Parse the location from ProjectLocationSecurityProfileGroup resource. + * + * @param {string} projectLocationSecurityProfileGroupName + * A fully-qualified path representing project_location_security_profile_group resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationSecurityProfileGroupName(projectLocationSecurityProfileGroupName: string) { + return this.pathTemplates.projectLocationSecurityProfileGroupPathTemplate.match(projectLocationSecurityProfileGroupName).location; + } + + /** + * Parse the security_profile_group from ProjectLocationSecurityProfileGroup resource. + * + * @param {string} projectLocationSecurityProfileGroupName + * A fully-qualified path representing project_location_security_profile_group resource. + * @returns {string} A string representing the security_profile_group. + */ + matchSecurityProfileGroupFromProjectLocationSecurityProfileGroupName(projectLocationSecurityProfileGroupName: string) { + return this.pathTemplates.projectLocationSecurityProfileGroupPathTemplate.match(projectLocationSecurityProfileGroupName).security_profile_group; + } + + /** + * Return a fully-qualified serverTlsPolicy resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} server_tls_policy + * @returns {string} Resource name string. + */ + serverTlsPolicyPath(project:string,location:string,serverTlsPolicy:string) { + return this.pathTemplates.serverTlsPolicyPathTemplate.render({ + project: project, + location: location, + server_tls_policy: serverTlsPolicy, + }); + } + + /** + * Parse the project from ServerTlsPolicy resource. + * + * @param {string} serverTlsPolicyName + * A fully-qualified path representing ServerTlsPolicy resource. + * @returns {string} A string representing the project. + */ + matchProjectFromServerTlsPolicyName(serverTlsPolicyName: string) { + return this.pathTemplates.serverTlsPolicyPathTemplate.match(serverTlsPolicyName).project; + } + + /** + * Parse the location from ServerTlsPolicy resource. + * + * @param {string} serverTlsPolicyName + * A fully-qualified path representing ServerTlsPolicy resource. + * @returns {string} A string representing the location. + */ + matchLocationFromServerTlsPolicyName(serverTlsPolicyName: string) { + return this.pathTemplates.serverTlsPolicyPathTemplate.match(serverTlsPolicyName).location; + } + + /** + * Parse the server_tls_policy from ServerTlsPolicy resource. + * + * @param {string} serverTlsPolicyName + * A fully-qualified path representing ServerTlsPolicy resource. + * @returns {string} A string representing the server_tls_policy. + */ + matchServerTlsPolicyFromServerTlsPolicyName(serverTlsPolicyName: string) { + return this.pathTemplates.serverTlsPolicyPathTemplate.match(serverTlsPolicyName).server_tls_policy; + } + + /** + * Return a fully-qualified tlsInspectionPolicy resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} tls_inspection_policy + * @returns {string} Resource name string. + */ + tlsInspectionPolicyPath(project:string,location:string,tlsInspectionPolicy:string) { + return this.pathTemplates.tlsInspectionPolicyPathTemplate.render({ + project: project, + location: location, + tls_inspection_policy: tlsInspectionPolicy, + }); + } + + /** + * Parse the project from TlsInspectionPolicy resource. + * + * @param {string} tlsInspectionPolicyName + * A fully-qualified path representing TlsInspectionPolicy resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTlsInspectionPolicyName(tlsInspectionPolicyName: string) { + return this.pathTemplates.tlsInspectionPolicyPathTemplate.match(tlsInspectionPolicyName).project; + } + + /** + * Parse the location from TlsInspectionPolicy resource. + * + * @param {string} tlsInspectionPolicyName + * A fully-qualified path representing TlsInspectionPolicy resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTlsInspectionPolicyName(tlsInspectionPolicyName: string) { + return this.pathTemplates.tlsInspectionPolicyPathTemplate.match(tlsInspectionPolicyName).location; + } + + /** + * Parse the tls_inspection_policy from TlsInspectionPolicy resource. + * + * @param {string} tlsInspectionPolicyName + * A fully-qualified path representing TlsInspectionPolicy resource. + * @returns {string} A string representing the tls_inspection_policy. + */ + matchTlsInspectionPolicyFromTlsInspectionPolicyName(tlsInspectionPolicyName: string) { + return this.pathTemplates.tlsInspectionPolicyPathTemplate.match(tlsInspectionPolicyName).tls_inspection_policy; + } + + /** + * Return a fully-qualified urlList resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} url_list + * @returns {string} Resource name string. + */ + urlListPath(project:string,location:string,urlList:string) { + return this.pathTemplates.urlListPathTemplate.render({ + project: project, + location: location, + url_list: urlList, + }); + } + + /** + * Parse the project from UrlList resource. + * + * @param {string} urlListName + * A fully-qualified path representing UrlList resource. + * @returns {string} A string representing the project. + */ + matchProjectFromUrlListName(urlListName: string) { + return this.pathTemplates.urlListPathTemplate.match(urlListName).project; + } + + /** + * Parse the location from UrlList resource. + * + * @param {string} urlListName + * A fully-qualified path representing UrlList resource. + * @returns {string} A string representing the location. + */ + matchLocationFromUrlListName(urlListName: string) { + return this.pathTemplates.urlListPathTemplate.match(urlListName).location; + } + + /** + * Parse the url_list from UrlList resource. + * + * @param {string} urlListName + * A fully-qualified path representing UrlList resource. + * @returns {string} A string representing the url_list. + */ + matchUrlListFromUrlListName(urlListName: string) { + return this.pathTemplates.urlListPathTemplate.match(urlListName).url_list; + } + + /** + * Terminate the gRPC channel and close the client. + * + * The client will no longer be usable and all future behavior is undefined. + * @returns {Promise} A promise that resolves when the client is closed. + */ + close(): Promise { + if (this.organizationSecurityProfileGroupServiceStub && !this._terminated) { + return this.organizationSecurityProfileGroupServiceStub.then(stub => { + this._log.info('ending gRPC channel'); + this._terminated = true; + stub.close(); + this.iamClient.close().catch(err => {throw err}); + this.locationsClient.close().catch(err => {throw err}); + void this.operationsClient.close(); + }); + } + return Promise.resolve(); + } +} \ No newline at end of file diff --git a/packages/google-cloud-networksecurity/src/v1/organization_security_profile_group_service_client_config.json b/packages/google-cloud-networksecurity/src/v1/organization_security_profile_group_service_client_config.json new file mode 100644 index 00000000000..11cbd1a060e --- /dev/null +++ b/packages/google-cloud-networksecurity/src/v1/organization_security_profile_group_service_client_config.json @@ -0,0 +1,66 @@ +{ + "interfaces": { + "google.cloud.networksecurity.v1.OrganizationSecurityProfileGroupService": { + "retry_codes": { + "non_idempotent": [], + "idempotent": [ + "DEADLINE_EXCEEDED", + "UNAVAILABLE" + ] + }, + "retry_params": { + "default": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + } + }, + "methods": { + "ListSecurityProfileGroups": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetSecurityProfileGroup": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "CreateSecurityProfileGroup": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UpdateSecurityProfileGroup": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteSecurityProfileGroup": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListSecurityProfiles": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetSecurityProfile": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "CreateSecurityProfile": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UpdateSecurityProfile": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteSecurityProfile": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/packages/google-cloud-networksecurity/src/v1/organization_security_profile_group_service_proto_list.json b/packages/google-cloud-networksecurity/src/v1/organization_security_profile_group_service_proto_list.json new file mode 100644 index 00000000000..1451adf6674 --- /dev/null +++ b/packages/google-cloud-networksecurity/src/v1/organization_security_profile_group_service_proto_list.json @@ -0,0 +1,25 @@ +[ + "../../protos/google/cloud/networksecurity/v1/address_group.proto", + "../../protos/google/cloud/networksecurity/v1/authorization_policy.proto", + "../../protos/google/cloud/networksecurity/v1/authz_policy.proto", + "../../protos/google/cloud/networksecurity/v1/backend_authentication_config.proto", + "../../protos/google/cloud/networksecurity/v1/client_tls_policy.proto", + "../../protos/google/cloud/networksecurity/v1/common.proto", + "../../protos/google/cloud/networksecurity/v1/dns_threat_detector.proto", + "../../protos/google/cloud/networksecurity/v1/firewall_activation.proto", + "../../protos/google/cloud/networksecurity/v1/gateway_security_policy.proto", + "../../protos/google/cloud/networksecurity/v1/gateway_security_policy_rule.proto", + "../../protos/google/cloud/networksecurity/v1/intercept.proto", + "../../protos/google/cloud/networksecurity/v1/mirroring.proto", + "../../protos/google/cloud/networksecurity/v1/network_security.proto", + "../../protos/google/cloud/networksecurity/v1/security_profile_group.proto", + "../../protos/google/cloud/networksecurity/v1/security_profile_group_intercept.proto", + "../../protos/google/cloud/networksecurity/v1/security_profile_group_mirroring.proto", + "../../protos/google/cloud/networksecurity/v1/security_profile_group_service.proto", + "../../protos/google/cloud/networksecurity/v1/security_profile_group_threatprevention.proto", + "../../protos/google/cloud/networksecurity/v1/security_profile_group_urlfiltering.proto", + "../../protos/google/cloud/networksecurity/v1/server_tls_policy.proto", + "../../protos/google/cloud/networksecurity/v1/tls.proto", + "../../protos/google/cloud/networksecurity/v1/tls_inspection_policy.proto", + "../../protos/google/cloud/networksecurity/v1/url_list.proto" +] diff --git a/packages/google-cloud-networksecurity/test/gapic_address_group_service_v1.ts b/packages/google-cloud-networksecurity/test/gapic_address_group_service_v1.ts index e954eef36cb..1c7b11ee05e 100644 --- a/packages/google-cloud-networksecurity/test/gapic_address_group_service_v1.ts +++ b/packages/google-cloud-networksecurity/test/gapic_address_group_service_v1.ts @@ -2546,86 +2546,738 @@ describe('v1.AddressGroupServiceClient', () => { }); }); + describe('authzPolicy', async () => { + const fakePath = "/rendered/path/authzPolicy"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + authz_policy: "authzPolicyValue", + }; + const client = new addressgroupserviceModule.v1.AddressGroupServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.authzPolicyPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.authzPolicyPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('authzPolicyPath', () => { + const result = client.authzPolicyPath("projectValue", "locationValue", "authzPolicyValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.authzPolicyPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromAuthzPolicyName', () => { + const result = client.matchProjectFromAuthzPolicyName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.authzPolicyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromAuthzPolicyName', () => { + const result = client.matchLocationFromAuthzPolicyName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.authzPolicyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchAuthzPolicyFromAuthzPolicyName', () => { + const result = client.matchAuthzPolicyFromAuthzPolicyName(fakePath); + assert.strictEqual(result, "authzPolicyValue"); + assert((client.pathTemplates.authzPolicyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('backendAuthenticationConfig', async () => { + const fakePath = "/rendered/path/backendAuthenticationConfig"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + backend_authentication_config: "backendAuthenticationConfigValue", + }; + const client = new addressgroupserviceModule.v1.AddressGroupServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.backendAuthenticationConfigPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.backendAuthenticationConfigPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('backendAuthenticationConfigPath', () => { + const result = client.backendAuthenticationConfigPath("projectValue", "locationValue", "backendAuthenticationConfigValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.backendAuthenticationConfigPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromBackendAuthenticationConfigName', () => { + const result = client.matchProjectFromBackendAuthenticationConfigName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.backendAuthenticationConfigPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromBackendAuthenticationConfigName', () => { + const result = client.matchLocationFromBackendAuthenticationConfigName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.backendAuthenticationConfigPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchBackendAuthenticationConfigFromBackendAuthenticationConfigName', () => { + const result = client.matchBackendAuthenticationConfigFromBackendAuthenticationConfigName(fakePath); + assert.strictEqual(result, "backendAuthenticationConfigValue"); + assert((client.pathTemplates.backendAuthenticationConfigPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + describe('clientTlsPolicy', async () => { const fakePath = "/rendered/path/clientTlsPolicy"; const expectedParameters = { project: "projectValue", location: "locationValue", - client_tls_policy: "clientTlsPolicyValue", + client_tls_policy: "clientTlsPolicyValue", + }; + const client = new addressgroupserviceModule.v1.AddressGroupServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.clientTlsPolicyPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.clientTlsPolicyPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('clientTlsPolicyPath', () => { + const result = client.clientTlsPolicyPath("projectValue", "locationValue", "clientTlsPolicyValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.clientTlsPolicyPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromClientTlsPolicyName', () => { + const result = client.matchProjectFromClientTlsPolicyName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.clientTlsPolicyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromClientTlsPolicyName', () => { + const result = client.matchLocationFromClientTlsPolicyName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.clientTlsPolicyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchClientTlsPolicyFromClientTlsPolicyName', () => { + const result = client.matchClientTlsPolicyFromClientTlsPolicyName(fakePath); + assert.strictEqual(result, "clientTlsPolicyValue"); + assert((client.pathTemplates.clientTlsPolicyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('dnsThreatDetector', async () => { + const fakePath = "/rendered/path/dnsThreatDetector"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + dns_threat_detector: "dnsThreatDetectorValue", + }; + const client = new addressgroupserviceModule.v1.AddressGroupServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.dnsThreatDetectorPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.dnsThreatDetectorPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('dnsThreatDetectorPath', () => { + const result = client.dnsThreatDetectorPath("projectValue", "locationValue", "dnsThreatDetectorValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.dnsThreatDetectorPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromDnsThreatDetectorName', () => { + const result = client.matchProjectFromDnsThreatDetectorName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.dnsThreatDetectorPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromDnsThreatDetectorName', () => { + const result = client.matchLocationFromDnsThreatDetectorName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.dnsThreatDetectorPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDnsThreatDetectorFromDnsThreatDetectorName', () => { + const result = client.matchDnsThreatDetectorFromDnsThreatDetectorName(fakePath); + assert.strictEqual(result, "dnsThreatDetectorValue"); + assert((client.pathTemplates.dnsThreatDetectorPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('firewallEndpointAssociation', async () => { + const fakePath = "/rendered/path/firewallEndpointAssociation"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + firewall_endpoint_association: "firewallEndpointAssociationValue", + }; + const client = new addressgroupserviceModule.v1.AddressGroupServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.firewallEndpointAssociationPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.firewallEndpointAssociationPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('firewallEndpointAssociationPath', () => { + const result = client.firewallEndpointAssociationPath("projectValue", "locationValue", "firewallEndpointAssociationValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.firewallEndpointAssociationPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromFirewallEndpointAssociationName', () => { + const result = client.matchProjectFromFirewallEndpointAssociationName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.firewallEndpointAssociationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromFirewallEndpointAssociationName', () => { + const result = client.matchLocationFromFirewallEndpointAssociationName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.firewallEndpointAssociationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchFirewallEndpointAssociationFromFirewallEndpointAssociationName', () => { + const result = client.matchFirewallEndpointAssociationFromFirewallEndpointAssociationName(fakePath); + assert.strictEqual(result, "firewallEndpointAssociationValue"); + assert((client.pathTemplates.firewallEndpointAssociationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('gatewaySecurityPolicy', async () => { + const fakePath = "/rendered/path/gatewaySecurityPolicy"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + gateway_security_policy: "gatewaySecurityPolicyValue", + }; + const client = new addressgroupserviceModule.v1.AddressGroupServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.gatewaySecurityPolicyPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.gatewaySecurityPolicyPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('gatewaySecurityPolicyPath', () => { + const result = client.gatewaySecurityPolicyPath("projectValue", "locationValue", "gatewaySecurityPolicyValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.gatewaySecurityPolicyPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromGatewaySecurityPolicyName', () => { + const result = client.matchProjectFromGatewaySecurityPolicyName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.gatewaySecurityPolicyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromGatewaySecurityPolicyName', () => { + const result = client.matchLocationFromGatewaySecurityPolicyName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.gatewaySecurityPolicyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchGatewaySecurityPolicyFromGatewaySecurityPolicyName', () => { + const result = client.matchGatewaySecurityPolicyFromGatewaySecurityPolicyName(fakePath); + assert.strictEqual(result, "gatewaySecurityPolicyValue"); + assert((client.pathTemplates.gatewaySecurityPolicyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('gatewaySecurityPolicyRule', async () => { + const fakePath = "/rendered/path/gatewaySecurityPolicyRule"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + gateway_security_policy: "gatewaySecurityPolicyValue", + rule: "ruleValue", + }; + const client = new addressgroupserviceModule.v1.AddressGroupServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.gatewaySecurityPolicyRulePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.gatewaySecurityPolicyRulePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('gatewaySecurityPolicyRulePath', () => { + const result = client.gatewaySecurityPolicyRulePath("projectValue", "locationValue", "gatewaySecurityPolicyValue", "ruleValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.gatewaySecurityPolicyRulePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromGatewaySecurityPolicyRuleName', () => { + const result = client.matchProjectFromGatewaySecurityPolicyRuleName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.gatewaySecurityPolicyRulePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromGatewaySecurityPolicyRuleName', () => { + const result = client.matchLocationFromGatewaySecurityPolicyRuleName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.gatewaySecurityPolicyRulePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchGatewaySecurityPolicyFromGatewaySecurityPolicyRuleName', () => { + const result = client.matchGatewaySecurityPolicyFromGatewaySecurityPolicyRuleName(fakePath); + assert.strictEqual(result, "gatewaySecurityPolicyValue"); + assert((client.pathTemplates.gatewaySecurityPolicyRulePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchRuleFromGatewaySecurityPolicyRuleName', () => { + const result = client.matchRuleFromGatewaySecurityPolicyRuleName(fakePath); + assert.strictEqual(result, "ruleValue"); + assert((client.pathTemplates.gatewaySecurityPolicyRulePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('interceptDeployment', async () => { + const fakePath = "/rendered/path/interceptDeployment"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + intercept_deployment: "interceptDeploymentValue", + }; + const client = new addressgroupserviceModule.v1.AddressGroupServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.interceptDeploymentPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.interceptDeploymentPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('interceptDeploymentPath', () => { + const result = client.interceptDeploymentPath("projectValue", "locationValue", "interceptDeploymentValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.interceptDeploymentPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromInterceptDeploymentName', () => { + const result = client.matchProjectFromInterceptDeploymentName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.interceptDeploymentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromInterceptDeploymentName', () => { + const result = client.matchLocationFromInterceptDeploymentName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.interceptDeploymentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchInterceptDeploymentFromInterceptDeploymentName', () => { + const result = client.matchInterceptDeploymentFromInterceptDeploymentName(fakePath); + assert.strictEqual(result, "interceptDeploymentValue"); + assert((client.pathTemplates.interceptDeploymentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('interceptDeploymentGroup', async () => { + const fakePath = "/rendered/path/interceptDeploymentGroup"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + intercept_deployment_group: "interceptDeploymentGroupValue", + }; + const client = new addressgroupserviceModule.v1.AddressGroupServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.interceptDeploymentGroupPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.interceptDeploymentGroupPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('interceptDeploymentGroupPath', () => { + const result = client.interceptDeploymentGroupPath("projectValue", "locationValue", "interceptDeploymentGroupValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.interceptDeploymentGroupPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromInterceptDeploymentGroupName', () => { + const result = client.matchProjectFromInterceptDeploymentGroupName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.interceptDeploymentGroupPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromInterceptDeploymentGroupName', () => { + const result = client.matchLocationFromInterceptDeploymentGroupName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.interceptDeploymentGroupPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchInterceptDeploymentGroupFromInterceptDeploymentGroupName', () => { + const result = client.matchInterceptDeploymentGroupFromInterceptDeploymentGroupName(fakePath); + assert.strictEqual(result, "interceptDeploymentGroupValue"); + assert((client.pathTemplates.interceptDeploymentGroupPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('interceptEndpointGroup', async () => { + const fakePath = "/rendered/path/interceptEndpointGroup"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + intercept_endpoint_group: "interceptEndpointGroupValue", + }; + const client = new addressgroupserviceModule.v1.AddressGroupServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.interceptEndpointGroupPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.interceptEndpointGroupPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('interceptEndpointGroupPath', () => { + const result = client.interceptEndpointGroupPath("projectValue", "locationValue", "interceptEndpointGroupValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.interceptEndpointGroupPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromInterceptEndpointGroupName', () => { + const result = client.matchProjectFromInterceptEndpointGroupName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.interceptEndpointGroupPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromInterceptEndpointGroupName', () => { + const result = client.matchLocationFromInterceptEndpointGroupName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.interceptEndpointGroupPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchInterceptEndpointGroupFromInterceptEndpointGroupName', () => { + const result = client.matchInterceptEndpointGroupFromInterceptEndpointGroupName(fakePath); + assert.strictEqual(result, "interceptEndpointGroupValue"); + assert((client.pathTemplates.interceptEndpointGroupPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('interceptEndpointGroupAssociation', async () => { + const fakePath = "/rendered/path/interceptEndpointGroupAssociation"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + intercept_endpoint_group_association: "interceptEndpointGroupAssociationValue", + }; + const client = new addressgroupserviceModule.v1.AddressGroupServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.interceptEndpointGroupAssociationPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.interceptEndpointGroupAssociationPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('interceptEndpointGroupAssociationPath', () => { + const result = client.interceptEndpointGroupAssociationPath("projectValue", "locationValue", "interceptEndpointGroupAssociationValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.interceptEndpointGroupAssociationPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromInterceptEndpointGroupAssociationName', () => { + const result = client.matchProjectFromInterceptEndpointGroupAssociationName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.interceptEndpointGroupAssociationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromInterceptEndpointGroupAssociationName', () => { + const result = client.matchLocationFromInterceptEndpointGroupAssociationName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.interceptEndpointGroupAssociationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchInterceptEndpointGroupAssociationFromInterceptEndpointGroupAssociationName', () => { + const result = client.matchInterceptEndpointGroupAssociationFromInterceptEndpointGroupAssociationName(fakePath); + assert.strictEqual(result, "interceptEndpointGroupAssociationValue"); + assert((client.pathTemplates.interceptEndpointGroupAssociationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('location', async () => { + const fakePath = "/rendered/path/location"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + }; + const client = new addressgroupserviceModule.v1.AddressGroupServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.locationPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.locationPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('locationPath', () => { + const result = client.locationPath("projectValue", "locationValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.locationPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromLocationName', () => { + const result = client.matchProjectFromLocationName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.locationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromLocationName', () => { + const result = client.matchLocationFromLocationName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.locationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('mirroringDeployment', async () => { + const fakePath = "/rendered/path/mirroringDeployment"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + mirroring_deployment: "mirroringDeploymentValue", + }; + const client = new addressgroupserviceModule.v1.AddressGroupServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.mirroringDeploymentPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.mirroringDeploymentPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('mirroringDeploymentPath', () => { + const result = client.mirroringDeploymentPath("projectValue", "locationValue", "mirroringDeploymentValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.mirroringDeploymentPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromMirroringDeploymentName', () => { + const result = client.matchProjectFromMirroringDeploymentName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.mirroringDeploymentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromMirroringDeploymentName', () => { + const result = client.matchLocationFromMirroringDeploymentName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.mirroringDeploymentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchMirroringDeploymentFromMirroringDeploymentName', () => { + const result = client.matchMirroringDeploymentFromMirroringDeploymentName(fakePath); + assert.strictEqual(result, "mirroringDeploymentValue"); + assert((client.pathTemplates.mirroringDeploymentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('mirroringDeploymentGroup', async () => { + const fakePath = "/rendered/path/mirroringDeploymentGroup"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + mirroring_deployment_group: "mirroringDeploymentGroupValue", + }; + const client = new addressgroupserviceModule.v1.AddressGroupServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.mirroringDeploymentGroupPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.mirroringDeploymentGroupPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('mirroringDeploymentGroupPath', () => { + const result = client.mirroringDeploymentGroupPath("projectValue", "locationValue", "mirroringDeploymentGroupValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.mirroringDeploymentGroupPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromMirroringDeploymentGroupName', () => { + const result = client.matchProjectFromMirroringDeploymentGroupName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.mirroringDeploymentGroupPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromMirroringDeploymentGroupName', () => { + const result = client.matchLocationFromMirroringDeploymentGroupName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.mirroringDeploymentGroupPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchMirroringDeploymentGroupFromMirroringDeploymentGroupName', () => { + const result = client.matchMirroringDeploymentGroupFromMirroringDeploymentGroupName(fakePath); + assert.strictEqual(result, "mirroringDeploymentGroupValue"); + assert((client.pathTemplates.mirroringDeploymentGroupPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('mirroringEndpointGroup', async () => { + const fakePath = "/rendered/path/mirroringEndpointGroup"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + mirroring_endpoint_group: "mirroringEndpointGroupValue", }; const client = new addressgroupserviceModule.v1.AddressGroupServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); await client.initialize(); - client.pathTemplates.clientTlsPolicyPathTemplate.render = + client.pathTemplates.mirroringEndpointGroupPathTemplate.render = sinon.stub().returns(fakePath); - client.pathTemplates.clientTlsPolicyPathTemplate.match = + client.pathTemplates.mirroringEndpointGroupPathTemplate.match = sinon.stub().returns(expectedParameters); - it('clientTlsPolicyPath', () => { - const result = client.clientTlsPolicyPath("projectValue", "locationValue", "clientTlsPolicyValue"); + it('mirroringEndpointGroupPath', () => { + const result = client.mirroringEndpointGroupPath("projectValue", "locationValue", "mirroringEndpointGroupValue"); assert.strictEqual(result, fakePath); - assert((client.pathTemplates.clientTlsPolicyPathTemplate.render as SinonStub) + assert((client.pathTemplates.mirroringEndpointGroupPathTemplate.render as SinonStub) .getCall(-1).calledWith(expectedParameters)); }); - it('matchProjectFromClientTlsPolicyName', () => { - const result = client.matchProjectFromClientTlsPolicyName(fakePath); + it('matchProjectFromMirroringEndpointGroupName', () => { + const result = client.matchProjectFromMirroringEndpointGroupName(fakePath); assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.clientTlsPolicyPathTemplate.match as SinonStub) + assert((client.pathTemplates.mirroringEndpointGroupPathTemplate.match as SinonStub) .getCall(-1).calledWith(fakePath)); }); - it('matchLocationFromClientTlsPolicyName', () => { - const result = client.matchLocationFromClientTlsPolicyName(fakePath); + it('matchLocationFromMirroringEndpointGroupName', () => { + const result = client.matchLocationFromMirroringEndpointGroupName(fakePath); assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.clientTlsPolicyPathTemplate.match as SinonStub) + assert((client.pathTemplates.mirroringEndpointGroupPathTemplate.match as SinonStub) .getCall(-1).calledWith(fakePath)); }); - it('matchClientTlsPolicyFromClientTlsPolicyName', () => { - const result = client.matchClientTlsPolicyFromClientTlsPolicyName(fakePath); - assert.strictEqual(result, "clientTlsPolicyValue"); - assert((client.pathTemplates.clientTlsPolicyPathTemplate.match as SinonStub) + it('matchMirroringEndpointGroupFromMirroringEndpointGroupName', () => { + const result = client.matchMirroringEndpointGroupFromMirroringEndpointGroupName(fakePath); + assert.strictEqual(result, "mirroringEndpointGroupValue"); + assert((client.pathTemplates.mirroringEndpointGroupPathTemplate.match as SinonStub) .getCall(-1).calledWith(fakePath)); }); }); - describe('location', async () => { - const fakePath = "/rendered/path/location"; + describe('mirroringEndpointGroupAssociation', async () => { + const fakePath = "/rendered/path/mirroringEndpointGroupAssociation"; const expectedParameters = { project: "projectValue", location: "locationValue", + mirroring_endpoint_group_association: "mirroringEndpointGroupAssociationValue", }; const client = new addressgroupserviceModule.v1.AddressGroupServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); await client.initialize(); - client.pathTemplates.locationPathTemplate.render = + client.pathTemplates.mirroringEndpointGroupAssociationPathTemplate.render = sinon.stub().returns(fakePath); - client.pathTemplates.locationPathTemplate.match = + client.pathTemplates.mirroringEndpointGroupAssociationPathTemplate.match = sinon.stub().returns(expectedParameters); - it('locationPath', () => { - const result = client.locationPath("projectValue", "locationValue"); + it('mirroringEndpointGroupAssociationPath', () => { + const result = client.mirroringEndpointGroupAssociationPath("projectValue", "locationValue", "mirroringEndpointGroupAssociationValue"); assert.strictEqual(result, fakePath); - assert((client.pathTemplates.locationPathTemplate.render as SinonStub) + assert((client.pathTemplates.mirroringEndpointGroupAssociationPathTemplate.render as SinonStub) .getCall(-1).calledWith(expectedParameters)); }); - it('matchProjectFromLocationName', () => { - const result = client.matchProjectFromLocationName(fakePath); + it('matchProjectFromMirroringEndpointGroupAssociationName', () => { + const result = client.matchProjectFromMirroringEndpointGroupAssociationName(fakePath); assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.locationPathTemplate.match as SinonStub) + assert((client.pathTemplates.mirroringEndpointGroupAssociationPathTemplate.match as SinonStub) .getCall(-1).calledWith(fakePath)); }); - it('matchLocationFromLocationName', () => { - const result = client.matchLocationFromLocationName(fakePath); + it('matchLocationFromMirroringEndpointGroupAssociationName', () => { + const result = client.matchLocationFromMirroringEndpointGroupAssociationName(fakePath); assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.locationPathTemplate.match as SinonStub) + assert((client.pathTemplates.mirroringEndpointGroupAssociationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchMirroringEndpointGroupAssociationFromMirroringEndpointGroupAssociationName', () => { + const result = client.matchMirroringEndpointGroupAssociationFromMirroringEndpointGroupAssociationName(fakePath); + assert.strictEqual(result, "mirroringEndpointGroupAssociationValue"); + assert((client.pathTemplates.mirroringEndpointGroupAssociationPathTemplate.match as SinonStub) .getCall(-1).calledWith(fakePath)); }); }); @@ -2676,6 +3328,144 @@ describe('v1.AddressGroupServiceClient', () => { }); }); + describe('organizationLocationFirewallEndpoints', async () => { + const fakePath = "/rendered/path/organizationLocationFirewallEndpoints"; + const expectedParameters = { + organization: "organizationValue", + location: "locationValue", + firewall_endpoint: "firewallEndpointValue", + }; + const client = new addressgroupserviceModule.v1.AddressGroupServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.organizationLocationFirewallEndpointsPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.organizationLocationFirewallEndpointsPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('organizationLocationFirewallEndpointsPath', () => { + const result = client.organizationLocationFirewallEndpointsPath("organizationValue", "locationValue", "firewallEndpointValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.organizationLocationFirewallEndpointsPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchOrganizationFromOrganizationLocationFirewallEndpointsName', () => { + const result = client.matchOrganizationFromOrganizationLocationFirewallEndpointsName(fakePath); + assert.strictEqual(result, "organizationValue"); + assert((client.pathTemplates.organizationLocationFirewallEndpointsPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromOrganizationLocationFirewallEndpointsName', () => { + const result = client.matchLocationFromOrganizationLocationFirewallEndpointsName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.organizationLocationFirewallEndpointsPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchFirewallEndpointFromOrganizationLocationFirewallEndpointsName', () => { + const result = client.matchFirewallEndpointFromOrganizationLocationFirewallEndpointsName(fakePath); + assert.strictEqual(result, "firewallEndpointValue"); + assert((client.pathTemplates.organizationLocationFirewallEndpointsPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('organizationLocationSecurityProfile', async () => { + const fakePath = "/rendered/path/organizationLocationSecurityProfile"; + const expectedParameters = { + organization: "organizationValue", + location: "locationValue", + security_profile: "securityProfileValue", + }; + const client = new addressgroupserviceModule.v1.AddressGroupServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.organizationLocationSecurityProfilePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.organizationLocationSecurityProfilePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('organizationLocationSecurityProfilePath', () => { + const result = client.organizationLocationSecurityProfilePath("organizationValue", "locationValue", "securityProfileValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.organizationLocationSecurityProfilePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchOrganizationFromOrganizationLocationSecurityProfileName', () => { + const result = client.matchOrganizationFromOrganizationLocationSecurityProfileName(fakePath); + assert.strictEqual(result, "organizationValue"); + assert((client.pathTemplates.organizationLocationSecurityProfilePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromOrganizationLocationSecurityProfileName', () => { + const result = client.matchLocationFromOrganizationLocationSecurityProfileName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.organizationLocationSecurityProfilePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchSecurityProfileFromOrganizationLocationSecurityProfileName', () => { + const result = client.matchSecurityProfileFromOrganizationLocationSecurityProfileName(fakePath); + assert.strictEqual(result, "securityProfileValue"); + assert((client.pathTemplates.organizationLocationSecurityProfilePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('organizationLocationSecurityProfileGroup', async () => { + const fakePath = "/rendered/path/organizationLocationSecurityProfileGroup"; + const expectedParameters = { + organization: "organizationValue", + location: "locationValue", + security_profile_group: "securityProfileGroupValue", + }; + const client = new addressgroupserviceModule.v1.AddressGroupServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.organizationLocationSecurityProfileGroupPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.organizationLocationSecurityProfileGroupPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('organizationLocationSecurityProfileGroupPath', () => { + const result = client.organizationLocationSecurityProfileGroupPath("organizationValue", "locationValue", "securityProfileGroupValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.organizationLocationSecurityProfileGroupPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchOrganizationFromOrganizationLocationSecurityProfileGroupName', () => { + const result = client.matchOrganizationFromOrganizationLocationSecurityProfileGroupName(fakePath); + assert.strictEqual(result, "organizationValue"); + assert((client.pathTemplates.organizationLocationSecurityProfileGroupPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromOrganizationLocationSecurityProfileGroupName', () => { + const result = client.matchLocationFromOrganizationLocationSecurityProfileGroupName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.organizationLocationSecurityProfileGroupPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchSecurityProfileGroupFromOrganizationLocationSecurityProfileGroupName', () => { + const result = client.matchSecurityProfileGroupFromOrganizationLocationSecurityProfileGroupName(fakePath); + assert.strictEqual(result, "securityProfileGroupValue"); + assert((client.pathTemplates.organizationLocationSecurityProfileGroupPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + describe('project', async () => { const fakePath = "/rendered/path/project"; const expectedParameters = { @@ -2752,6 +3542,144 @@ describe('v1.AddressGroupServiceClient', () => { }); }); + describe('projectLocationFirewallEndpoints', async () => { + const fakePath = "/rendered/path/projectLocationFirewallEndpoints"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + firewall_endpoint: "firewallEndpointValue", + }; + const client = new addressgroupserviceModule.v1.AddressGroupServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectLocationFirewallEndpointsPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationFirewallEndpointsPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationFirewallEndpointsPath', () => { + const result = client.projectLocationFirewallEndpointsPath("projectValue", "locationValue", "firewallEndpointValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.projectLocationFirewallEndpointsPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromProjectLocationFirewallEndpointsName', () => { + const result = client.matchProjectFromProjectLocationFirewallEndpointsName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.projectLocationFirewallEndpointsPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromProjectLocationFirewallEndpointsName', () => { + const result = client.matchLocationFromProjectLocationFirewallEndpointsName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.projectLocationFirewallEndpointsPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchFirewallEndpointFromProjectLocationFirewallEndpointsName', () => { + const result = client.matchFirewallEndpointFromProjectLocationFirewallEndpointsName(fakePath); + assert.strictEqual(result, "firewallEndpointValue"); + assert((client.pathTemplates.projectLocationFirewallEndpointsPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('projectLocationSecurityProfile', async () => { + const fakePath = "/rendered/path/projectLocationSecurityProfile"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + security_profile: "securityProfileValue", + }; + const client = new addressgroupserviceModule.v1.AddressGroupServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectLocationSecurityProfilePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationSecurityProfilePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationSecurityProfilePath', () => { + const result = client.projectLocationSecurityProfilePath("projectValue", "locationValue", "securityProfileValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.projectLocationSecurityProfilePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromProjectLocationSecurityProfileName', () => { + const result = client.matchProjectFromProjectLocationSecurityProfileName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.projectLocationSecurityProfilePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromProjectLocationSecurityProfileName', () => { + const result = client.matchLocationFromProjectLocationSecurityProfileName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.projectLocationSecurityProfilePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchSecurityProfileFromProjectLocationSecurityProfileName', () => { + const result = client.matchSecurityProfileFromProjectLocationSecurityProfileName(fakePath); + assert.strictEqual(result, "securityProfileValue"); + assert((client.pathTemplates.projectLocationSecurityProfilePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('projectLocationSecurityProfileGroup', async () => { + const fakePath = "/rendered/path/projectLocationSecurityProfileGroup"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + security_profile_group: "securityProfileGroupValue", + }; + const client = new addressgroupserviceModule.v1.AddressGroupServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectLocationSecurityProfileGroupPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationSecurityProfileGroupPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationSecurityProfileGroupPath', () => { + const result = client.projectLocationSecurityProfileGroupPath("projectValue", "locationValue", "securityProfileGroupValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.projectLocationSecurityProfileGroupPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromProjectLocationSecurityProfileGroupName', () => { + const result = client.matchProjectFromProjectLocationSecurityProfileGroupName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.projectLocationSecurityProfileGroupPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromProjectLocationSecurityProfileGroupName', () => { + const result = client.matchLocationFromProjectLocationSecurityProfileGroupName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.projectLocationSecurityProfileGroupPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchSecurityProfileGroupFromProjectLocationSecurityProfileGroupName', () => { + const result = client.matchSecurityProfileGroupFromProjectLocationSecurityProfileGroupName(fakePath); + assert.strictEqual(result, "securityProfileGroupValue"); + assert((client.pathTemplates.projectLocationSecurityProfileGroupPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + describe('serverTlsPolicy', async () => { const fakePath = "/rendered/path/serverTlsPolicy"; const expectedParameters = { @@ -2797,5 +3725,97 @@ describe('v1.AddressGroupServiceClient', () => { .getCall(-1).calledWith(fakePath)); }); }); + + describe('tlsInspectionPolicy', async () => { + const fakePath = "/rendered/path/tlsInspectionPolicy"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + tls_inspection_policy: "tlsInspectionPolicyValue", + }; + const client = new addressgroupserviceModule.v1.AddressGroupServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.tlsInspectionPolicyPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.tlsInspectionPolicyPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('tlsInspectionPolicyPath', () => { + const result = client.tlsInspectionPolicyPath("projectValue", "locationValue", "tlsInspectionPolicyValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.tlsInspectionPolicyPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromTlsInspectionPolicyName', () => { + const result = client.matchProjectFromTlsInspectionPolicyName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.tlsInspectionPolicyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromTlsInspectionPolicyName', () => { + const result = client.matchLocationFromTlsInspectionPolicyName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.tlsInspectionPolicyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchTlsInspectionPolicyFromTlsInspectionPolicyName', () => { + const result = client.matchTlsInspectionPolicyFromTlsInspectionPolicyName(fakePath); + assert.strictEqual(result, "tlsInspectionPolicyValue"); + assert((client.pathTemplates.tlsInspectionPolicyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('urlList', async () => { + const fakePath = "/rendered/path/urlList"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + url_list: "urlListValue", + }; + const client = new addressgroupserviceModule.v1.AddressGroupServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.urlListPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.urlListPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('urlListPath', () => { + const result = client.urlListPath("projectValue", "locationValue", "urlListValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.urlListPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromUrlListName', () => { + const result = client.matchProjectFromUrlListName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.urlListPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromUrlListName', () => { + const result = client.matchLocationFromUrlListName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.urlListPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchUrlListFromUrlListName', () => { + const result = client.matchUrlListFromUrlListName(fakePath); + assert.strictEqual(result, "urlListValue"); + assert((client.pathTemplates.urlListPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); }); }); diff --git a/packages/google-cloud-networksecurity/test/gapic_dns_threat_detector_service_v1.ts b/packages/google-cloud-networksecurity/test/gapic_dns_threat_detector_service_v1.ts new file mode 100644 index 00000000000..9cec0bb006d --- /dev/null +++ b/packages/google-cloud-networksecurity/test/gapic_dns_threat_detector_service_v1.ts @@ -0,0 +1,2743 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import * as protos from '../protos/protos'; +import * as assert from 'assert'; +import * as sinon from 'sinon'; +import {SinonStub} from 'sinon'; +import {describe, it} from 'mocha'; +import * as dnsthreatdetectorserviceModule from '../src'; + +import {PassThrough} from 'stream'; + +import {protobuf, IamProtos, LocationProtos} from 'google-gax'; + +// Dynamically loaded proto JSON is needed to get the type information +// to fill in default values for request objects +const root = protobuf.Root.fromJSON(require('../protos/protos.json')).resolveAll(); + +// eslint-disable-next-line @typescript-eslint/no-unused-vars +function getTypeDefaultValue(typeName: string, fields: string[]) { + let type = root.lookupType(typeName) as protobuf.Type; + for (const field of fields.slice(0, -1)) { + type = type.fields[field]?.resolvedType as protobuf.Type; + } + return type.fields[fields[fields.length - 1]]?.defaultValue; +} + +function generateSampleMessage(instance: T) { + const filledObject = (instance.constructor as typeof protobuf.Message) + .toObject(instance as protobuf.Message, {defaults: true}); + return (instance.constructor as typeof protobuf.Message).fromObject(filledObject) as T; +} + +function stubSimpleCall(response?: ResponseType, error?: Error) { + return error ? sinon.stub().rejects(error) : sinon.stub().resolves([response]); +} + +function stubSimpleCallWithCallback(response?: ResponseType, error?: Error) { + return error ? sinon.stub().callsArgWith(2, error) : sinon.stub().callsArgWith(2, null, response); +} + +function stubPageStreamingCall(responses?: ResponseType[], error?: Error) { + const pagingStub = sinon.stub(); + if (responses) { + for (let i = 0; i < responses.length; ++i) { + pagingStub.onCall(i).callsArgWith(2, null, responses[i]); + } + } + const transformStub = error ? sinon.stub().callsArgWith(2, error) : pagingStub; + const mockStream = new PassThrough({ + objectMode: true, + transform: transformStub, + }); + // trigger as many responses as needed + if (responses) { + for (let i = 0; i < responses.length; ++i) { + setImmediate(() => { mockStream.write({}); }); + } + setImmediate(() => { mockStream.end(); }); + } else { + setImmediate(() => { mockStream.write({}); }); + setImmediate(() => { mockStream.end(); }); + } + return sinon.stub().returns(mockStream); +} + +function stubAsyncIterationCall(responses?: ResponseType[], error?: Error) { + let counter = 0; + const asyncIterable = { + [Symbol.asyncIterator]() { + return { + async next() { + if (error) { + return Promise.reject(error); + } + if (counter >= responses!.length) { + return Promise.resolve({done: true, value: undefined}); + } + return Promise.resolve({done: false, value: responses![counter++]}); + } + }; + } + }; + return sinon.stub().returns(asyncIterable); +} + +describe('v1.DnsThreatDetectorServiceClient', () => { + describe('Common methods', () => { + it('has apiEndpoint', () => { + const client = new dnsthreatdetectorserviceModule.v1.DnsThreatDetectorServiceClient(); + const apiEndpoint = client.apiEndpoint; + assert.strictEqual(apiEndpoint, 'networksecurity.googleapis.com'); + }); + + it('has universeDomain', () => { + const client = new dnsthreatdetectorserviceModule.v1.DnsThreatDetectorServiceClient(); + const universeDomain = client.universeDomain; + assert.strictEqual(universeDomain, "googleapis.com"); + }); + + if (typeof process === 'object' && typeof process.emitWarning === 'function') { + it('throws DeprecationWarning if static servicePath is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const servicePath = dnsthreatdetectorserviceModule.v1.DnsThreatDetectorServiceClient.servicePath; + assert.strictEqual(servicePath, 'networksecurity.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + + it('throws DeprecationWarning if static apiEndpoint is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const apiEndpoint = dnsthreatdetectorserviceModule.v1.DnsThreatDetectorServiceClient.apiEndpoint; + assert.strictEqual(apiEndpoint, 'networksecurity.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + } + it('sets apiEndpoint according to universe domain camelCase', () => { + const client = new dnsthreatdetectorserviceModule.v1.DnsThreatDetectorServiceClient({universeDomain: 'example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'networksecurity.example.com'); + }); + + it('sets apiEndpoint according to universe domain snakeCase', () => { + const client = new dnsthreatdetectorserviceModule.v1.DnsThreatDetectorServiceClient({universe_domain: 'example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'networksecurity.example.com'); + }); + + if (typeof process === 'object' && 'env' in process) { + describe('GOOGLE_CLOUD_UNIVERSE_DOMAIN environment variable', () => { + it('sets apiEndpoint from environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = new dnsthreatdetectorserviceModule.v1.DnsThreatDetectorServiceClient(); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'networksecurity.example.com'); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + + it('value configured in code has priority over environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = new dnsthreatdetectorserviceModule.v1.DnsThreatDetectorServiceClient({universeDomain: 'configured.example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'networksecurity.configured.example.com'); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + }); + } + it('does not allow setting both universeDomain and universe_domain', () => { + assert.throws(() => { new dnsthreatdetectorserviceModule.v1.DnsThreatDetectorServiceClient({universe_domain: 'example.com', universeDomain: 'example.net'}); }); + }); + + it('has port', () => { + const port = dnsthreatdetectorserviceModule.v1.DnsThreatDetectorServiceClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new dnsthreatdetectorserviceModule.v1.DnsThreatDetectorServiceClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new dnsthreatdetectorserviceModule.v1.DnsThreatDetectorServiceClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new dnsthreatdetectorserviceModule.v1.DnsThreatDetectorServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.dnsThreatDetectorServiceStub, undefined); + await client.initialize(); + assert(client.dnsThreatDetectorServiceStub); + }); + + it('has close method for the initialized client', done => { + const client = new dnsthreatdetectorserviceModule.v1.DnsThreatDetectorServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize().catch(err => {throw err}); + assert(client.dnsThreatDetectorServiceStub); + client.close().then(() => { + done(); + }).catch(err => {throw err}); + }); + + it('has close method for the non-initialized client', done => { + const client = new dnsthreatdetectorserviceModule.v1.DnsThreatDetectorServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.dnsThreatDetectorServiceStub, undefined); + client.close().then(() => { + done(); + }).catch(err => {throw err}); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new dnsthreatdetectorserviceModule.v1.DnsThreatDetectorServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.auth.getProjectId = sinon.stub().resolves(fakeProjectId); + const result = await client.getProjectId(); + assert.strictEqual(result, fakeProjectId); + assert((client.auth.getProjectId as SinonStub).calledWithExactly()); + }); + + it('has getProjectId method with callback', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new dnsthreatdetectorserviceModule.v1.DnsThreatDetectorServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.auth.getProjectId = sinon.stub().callsArgWith(0, null, fakeProjectId); + const promise = new Promise((resolve, reject) => { + client.getProjectId((err?: Error|null, projectId?: string|null) => { + if (err) { + reject(err); + } else { + resolve(projectId); + } + }); + }); + const result = await promise; + assert.strictEqual(result, fakeProjectId); + }); + }); + + describe('getDnsThreatDetector', () => { + it('invokes getDnsThreatDetector without error', async () => { + const client = new dnsthreatdetectorserviceModule.v1.DnsThreatDetectorServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.GetDnsThreatDetectorRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.GetDnsThreatDetectorRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.DnsThreatDetector() + ); + client.innerApiCalls.getDnsThreatDetector = stubSimpleCall(expectedResponse); + const [response] = await client.getDnsThreatDetector(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getDnsThreatDetector as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getDnsThreatDetector as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getDnsThreatDetector without error using callback', async () => { + const client = new dnsthreatdetectorserviceModule.v1.DnsThreatDetectorServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.GetDnsThreatDetectorRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.GetDnsThreatDetectorRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.DnsThreatDetector() + ); + client.innerApiCalls.getDnsThreatDetector = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getDnsThreatDetector( + request, + (err?: Error|null, result?: protos.google.cloud.networksecurity.v1.IDnsThreatDetector|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getDnsThreatDetector as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getDnsThreatDetector as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getDnsThreatDetector with error', async () => { + const client = new dnsthreatdetectorserviceModule.v1.DnsThreatDetectorServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.GetDnsThreatDetectorRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.GetDnsThreatDetectorRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.getDnsThreatDetector = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getDnsThreatDetector(request), expectedError); + const actualRequest = (client.innerApiCalls.getDnsThreatDetector as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getDnsThreatDetector as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getDnsThreatDetector with closed client', async () => { + const client = new dnsthreatdetectorserviceModule.v1.DnsThreatDetectorServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.GetDnsThreatDetectorRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.GetDnsThreatDetectorRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.getDnsThreatDetector(request), expectedError); + }); + }); + + describe('createDnsThreatDetector', () => { + it('invokes createDnsThreatDetector without error', async () => { + const client = new dnsthreatdetectorserviceModule.v1.DnsThreatDetectorServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.CreateDnsThreatDetectorRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.CreateDnsThreatDetectorRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.DnsThreatDetector() + ); + client.innerApiCalls.createDnsThreatDetector = stubSimpleCall(expectedResponse); + const [response] = await client.createDnsThreatDetector(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createDnsThreatDetector as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createDnsThreatDetector as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createDnsThreatDetector without error using callback', async () => { + const client = new dnsthreatdetectorserviceModule.v1.DnsThreatDetectorServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.CreateDnsThreatDetectorRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.CreateDnsThreatDetectorRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.DnsThreatDetector() + ); + client.innerApiCalls.createDnsThreatDetector = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createDnsThreatDetector( + request, + (err?: Error|null, result?: protos.google.cloud.networksecurity.v1.IDnsThreatDetector|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createDnsThreatDetector as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createDnsThreatDetector as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createDnsThreatDetector with error', async () => { + const client = new dnsthreatdetectorserviceModule.v1.DnsThreatDetectorServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.CreateDnsThreatDetectorRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.CreateDnsThreatDetectorRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.createDnsThreatDetector = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.createDnsThreatDetector(request), expectedError); + const actualRequest = (client.innerApiCalls.createDnsThreatDetector as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createDnsThreatDetector as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createDnsThreatDetector with closed client', async () => { + const client = new dnsthreatdetectorserviceModule.v1.DnsThreatDetectorServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.CreateDnsThreatDetectorRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.CreateDnsThreatDetectorRequest', ['parent']); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.createDnsThreatDetector(request), expectedError); + }); + }); + + describe('updateDnsThreatDetector', () => { + it('invokes updateDnsThreatDetector without error', async () => { + const client = new dnsthreatdetectorserviceModule.v1.DnsThreatDetectorServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.UpdateDnsThreatDetectorRequest() + ); + request.dnsThreatDetector ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.UpdateDnsThreatDetectorRequest', ['dnsThreatDetector', 'name']); + request.dnsThreatDetector.name = defaultValue1; + const expectedHeaderRequestParams = `dns_threat_detector.name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.DnsThreatDetector() + ); + client.innerApiCalls.updateDnsThreatDetector = stubSimpleCall(expectedResponse); + const [response] = await client.updateDnsThreatDetector(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateDnsThreatDetector as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateDnsThreatDetector as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateDnsThreatDetector without error using callback', async () => { + const client = new dnsthreatdetectorserviceModule.v1.DnsThreatDetectorServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.UpdateDnsThreatDetectorRequest() + ); + request.dnsThreatDetector ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.UpdateDnsThreatDetectorRequest', ['dnsThreatDetector', 'name']); + request.dnsThreatDetector.name = defaultValue1; + const expectedHeaderRequestParams = `dns_threat_detector.name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.DnsThreatDetector() + ); + client.innerApiCalls.updateDnsThreatDetector = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateDnsThreatDetector( + request, + (err?: Error|null, result?: protos.google.cloud.networksecurity.v1.IDnsThreatDetector|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateDnsThreatDetector as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateDnsThreatDetector as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateDnsThreatDetector with error', async () => { + const client = new dnsthreatdetectorserviceModule.v1.DnsThreatDetectorServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.UpdateDnsThreatDetectorRequest() + ); + request.dnsThreatDetector ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.UpdateDnsThreatDetectorRequest', ['dnsThreatDetector', 'name']); + request.dnsThreatDetector.name = defaultValue1; + const expectedHeaderRequestParams = `dns_threat_detector.name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateDnsThreatDetector = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.updateDnsThreatDetector(request), expectedError); + const actualRequest = (client.innerApiCalls.updateDnsThreatDetector as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateDnsThreatDetector as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateDnsThreatDetector with closed client', async () => { + const client = new dnsthreatdetectorserviceModule.v1.DnsThreatDetectorServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.UpdateDnsThreatDetectorRequest() + ); + request.dnsThreatDetector ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.UpdateDnsThreatDetectorRequest', ['dnsThreatDetector', 'name']); + request.dnsThreatDetector.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.updateDnsThreatDetector(request), expectedError); + }); + }); + + describe('deleteDnsThreatDetector', () => { + it('invokes deleteDnsThreatDetector without error', async () => { + const client = new dnsthreatdetectorserviceModule.v1.DnsThreatDetectorServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.DeleteDnsThreatDetectorRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.DeleteDnsThreatDetectorRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteDnsThreatDetector = stubSimpleCall(expectedResponse); + const [response] = await client.deleteDnsThreatDetector(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.deleteDnsThreatDetector as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteDnsThreatDetector as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteDnsThreatDetector without error using callback', async () => { + const client = new dnsthreatdetectorserviceModule.v1.DnsThreatDetectorServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.DeleteDnsThreatDetectorRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.DeleteDnsThreatDetectorRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteDnsThreatDetector = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteDnsThreatDetector( + request, + (err?: Error|null, result?: protos.google.protobuf.IEmpty|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.deleteDnsThreatDetector as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteDnsThreatDetector as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteDnsThreatDetector with error', async () => { + const client = new dnsthreatdetectorserviceModule.v1.DnsThreatDetectorServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.DeleteDnsThreatDetectorRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.DeleteDnsThreatDetectorRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteDnsThreatDetector = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.deleteDnsThreatDetector(request), expectedError); + const actualRequest = (client.innerApiCalls.deleteDnsThreatDetector as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteDnsThreatDetector as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteDnsThreatDetector with closed client', async () => { + const client = new dnsthreatdetectorserviceModule.v1.DnsThreatDetectorServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.DeleteDnsThreatDetectorRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.DeleteDnsThreatDetectorRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.deleteDnsThreatDetector(request), expectedError); + }); + }); + + describe('listDnsThreatDetectors', () => { + it('invokes listDnsThreatDetectors without error', async () => { + const client = new dnsthreatdetectorserviceModule.v1.DnsThreatDetectorServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.ListDnsThreatDetectorsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.ListDnsThreatDetectorsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.networksecurity.v1.DnsThreatDetector()), + generateSampleMessage(new protos.google.cloud.networksecurity.v1.DnsThreatDetector()), + generateSampleMessage(new protos.google.cloud.networksecurity.v1.DnsThreatDetector()), + ]; + client.innerApiCalls.listDnsThreatDetectors = stubSimpleCall(expectedResponse); + const [response] = await client.listDnsThreatDetectors(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listDnsThreatDetectors as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listDnsThreatDetectors as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listDnsThreatDetectors without error using callback', async () => { + const client = new dnsthreatdetectorserviceModule.v1.DnsThreatDetectorServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.ListDnsThreatDetectorsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.ListDnsThreatDetectorsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.networksecurity.v1.DnsThreatDetector()), + generateSampleMessage(new protos.google.cloud.networksecurity.v1.DnsThreatDetector()), + generateSampleMessage(new protos.google.cloud.networksecurity.v1.DnsThreatDetector()), + ]; + client.innerApiCalls.listDnsThreatDetectors = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listDnsThreatDetectors( + request, + (err?: Error|null, result?: protos.google.cloud.networksecurity.v1.IDnsThreatDetector[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listDnsThreatDetectors as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listDnsThreatDetectors as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listDnsThreatDetectors with error', async () => { + const client = new dnsthreatdetectorserviceModule.v1.DnsThreatDetectorServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.ListDnsThreatDetectorsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.ListDnsThreatDetectorsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.listDnsThreatDetectors = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listDnsThreatDetectors(request), expectedError); + const actualRequest = (client.innerApiCalls.listDnsThreatDetectors as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listDnsThreatDetectors as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listDnsThreatDetectorsStream without error', async () => { + const client = new dnsthreatdetectorserviceModule.v1.DnsThreatDetectorServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.ListDnsThreatDetectorsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.ListDnsThreatDetectorsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.networksecurity.v1.DnsThreatDetector()), + generateSampleMessage(new protos.google.cloud.networksecurity.v1.DnsThreatDetector()), + generateSampleMessage(new protos.google.cloud.networksecurity.v1.DnsThreatDetector()), + ]; + client.descriptors.page.listDnsThreatDetectors.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listDnsThreatDetectorsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.networksecurity.v1.DnsThreatDetector[] = []; + stream.on('data', (response: protos.google.cloud.networksecurity.v1.DnsThreatDetector) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert((client.descriptors.page.listDnsThreatDetectors.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listDnsThreatDetectors, request)); + assert( + (client.descriptors.page.listDnsThreatDetectors.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listDnsThreatDetectorsStream with error', async () => { + const client = new dnsthreatdetectorserviceModule.v1.DnsThreatDetectorServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.ListDnsThreatDetectorsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.ListDnsThreatDetectorsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.descriptors.page.listDnsThreatDetectors.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listDnsThreatDetectorsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.networksecurity.v1.DnsThreatDetector[] = []; + stream.on('data', (response: protos.google.cloud.networksecurity.v1.DnsThreatDetector) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listDnsThreatDetectors.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listDnsThreatDetectors, request)); + assert( + (client.descriptors.page.listDnsThreatDetectors.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listDnsThreatDetectors without error', async () => { + const client = new dnsthreatdetectorserviceModule.v1.DnsThreatDetectorServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.ListDnsThreatDetectorsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.ListDnsThreatDetectorsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.networksecurity.v1.DnsThreatDetector()), + generateSampleMessage(new protos.google.cloud.networksecurity.v1.DnsThreatDetector()), + generateSampleMessage(new protos.google.cloud.networksecurity.v1.DnsThreatDetector()), + ]; + client.descriptors.page.listDnsThreatDetectors.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.networksecurity.v1.IDnsThreatDetector[] = []; + const iterable = client.listDnsThreatDetectorsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listDnsThreatDetectors.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listDnsThreatDetectors.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listDnsThreatDetectors with error', async () => { + const client = new dnsthreatdetectorserviceModule.v1.DnsThreatDetectorServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.ListDnsThreatDetectorsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.ListDnsThreatDetectorsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.descriptors.page.listDnsThreatDetectors.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listDnsThreatDetectorsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.networksecurity.v1.IDnsThreatDetector[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listDnsThreatDetectors.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listDnsThreatDetectors.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + describe('getIamPolicy', () => { + it('invokes getIamPolicy without error', async () => { + const client = new dnsthreatdetectorserviceModule.v1.DnsThreatDetectorServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.GetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy() + ); + client.iamClient.getIamPolicy = stubSimpleCall(expectedResponse); + const response = await client.getIamPolicy(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.iamClient.getIamPolicy as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + it('invokes getIamPolicy without error using callback', async () => { + const client = new dnsthreatdetectorserviceModule.v1.DnsThreatDetectorServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.GetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy() + ); + client.iamClient.getIamPolicy = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getIamPolicy( + request, + expectedOptions, + (err?: Error|null, result?: IamProtos.google.iam.v1.Policy|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }).catch(err => {throw err}); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.iamClient.getIamPolicy as SinonStub) + .getCall(0)); + }); + it('invokes getIamPolicy with error', async () => { + const client = new dnsthreatdetectorserviceModule.v1.DnsThreatDetectorServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.GetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.iamClient.getIamPolicy = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getIamPolicy(request, expectedOptions), expectedError); + assert((client.iamClient.getIamPolicy as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + }); + describe('setIamPolicy', () => { + it('invokes setIamPolicy without error', async () => { + const client = new dnsthreatdetectorserviceModule.v1.DnsThreatDetectorServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.SetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy() + ); + client.iamClient.setIamPolicy = stubSimpleCall(expectedResponse); + const response = await client.setIamPolicy(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.iamClient.setIamPolicy as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + it('invokes setIamPolicy without error using callback', async () => { + const client = new dnsthreatdetectorserviceModule.v1.DnsThreatDetectorServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.SetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy() + ); + client.iamClient.setIamPolicy = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.setIamPolicy( + request, + expectedOptions, + (err?: Error|null, result?: IamProtos.google.iam.v1.Policy|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }).catch(err => {throw err}); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.iamClient.setIamPolicy as SinonStub) + .getCall(0)); + }); + it('invokes setIamPolicy with error', async () => { + const client = new dnsthreatdetectorserviceModule.v1.DnsThreatDetectorServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.SetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.iamClient.setIamPolicy = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.setIamPolicy(request, expectedOptions), expectedError); + assert((client.iamClient.setIamPolicy as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + }); + describe('testIamPermissions', () => { + it('invokes testIamPermissions without error', async () => { + const client = new dnsthreatdetectorserviceModule.v1.DnsThreatDetectorServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsResponse() + ); + client.iamClient.testIamPermissions = stubSimpleCall(expectedResponse); + const response = await client.testIamPermissions(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.iamClient.testIamPermissions as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + it('invokes testIamPermissions without error using callback', async () => { + const client = new dnsthreatdetectorserviceModule.v1.DnsThreatDetectorServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsResponse() + ); + client.iamClient.testIamPermissions = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.testIamPermissions( + request, + expectedOptions, + (err?: Error|null, result?: IamProtos.google.iam.v1.TestIamPermissionsResponse|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }).catch(err => {throw err}); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.iamClient.testIamPermissions as SinonStub) + .getCall(0)); + }); + it('invokes testIamPermissions with error', async () => { + const client = new dnsthreatdetectorserviceModule.v1.DnsThreatDetectorServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.iamClient.testIamPermissions = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.testIamPermissions(request, expectedOptions), expectedError); + assert((client.iamClient.testIamPermissions as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + }); + describe('getLocation', () => { + it('invokes getLocation without error', async () => { + const client = new dnsthreatdetectorserviceModule.v1.DnsThreatDetectorServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ); + client.locationsClient.getLocation = stubSimpleCall(expectedResponse); + const response = await client.getLocation(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.locationsClient.getLocation as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + it('invokes getLocation without error using callback', async () => { + const client = new dnsthreatdetectorserviceModule.v1.DnsThreatDetectorServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ); + client.locationsClient.getLocation = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getLocation( + request, + expectedOptions, + ( + err?: Error | null, + result?: LocationProtos.google.cloud.location.ILocation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.locationsClient.getLocation as SinonStub) + .getCall(0)); + }); + it('invokes getLocation with error', async () => { + const client = new dnsthreatdetectorserviceModule.v1.DnsThreatDetectorServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.locationsClient.getLocation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getLocation(request, expectedOptions), expectedError); + assert((client.locationsClient.getLocation as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + }); + describe('listLocationsAsync', () => { + it('uses async iteration with listLocations without error', async () => { + const client = new dnsthreatdetectorserviceModule.v1.DnsThreatDetectorServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.ListLocationsRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedResponse = [ + generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ), + generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ), + generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ), + ]; + client.locationsClient.descriptors.page.listLocations.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: LocationProtos.google.cloud.location.ILocation[] = []; + const iterable = client.listLocationsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + it('uses async iteration with listLocations with error', async () => { + const client = new dnsthreatdetectorserviceModule.v1.DnsThreatDetectorServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.ListLocationsRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedError = new Error('expected'); + client.locationsClient.descriptors.page.listLocations.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listLocationsAsync(request); + await assert.rejects(async () => { + const responses: LocationProtos.google.cloud.location.ILocation[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('Path templates', () => { + + describe('authorizationPolicy', async () => { + const fakePath = "/rendered/path/authorizationPolicy"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + authorization_policy: "authorizationPolicyValue", + }; + const client = new dnsthreatdetectorserviceModule.v1.DnsThreatDetectorServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.authorizationPolicyPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.authorizationPolicyPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('authorizationPolicyPath', () => { + const result = client.authorizationPolicyPath("projectValue", "locationValue", "authorizationPolicyValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.authorizationPolicyPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromAuthorizationPolicyName', () => { + const result = client.matchProjectFromAuthorizationPolicyName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.authorizationPolicyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromAuthorizationPolicyName', () => { + const result = client.matchLocationFromAuthorizationPolicyName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.authorizationPolicyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchAuthorizationPolicyFromAuthorizationPolicyName', () => { + const result = client.matchAuthorizationPolicyFromAuthorizationPolicyName(fakePath); + assert.strictEqual(result, "authorizationPolicyValue"); + assert((client.pathTemplates.authorizationPolicyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('authzPolicy', async () => { + const fakePath = "/rendered/path/authzPolicy"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + authz_policy: "authzPolicyValue", + }; + const client = new dnsthreatdetectorserviceModule.v1.DnsThreatDetectorServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.authzPolicyPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.authzPolicyPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('authzPolicyPath', () => { + const result = client.authzPolicyPath("projectValue", "locationValue", "authzPolicyValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.authzPolicyPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromAuthzPolicyName', () => { + const result = client.matchProjectFromAuthzPolicyName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.authzPolicyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromAuthzPolicyName', () => { + const result = client.matchLocationFromAuthzPolicyName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.authzPolicyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchAuthzPolicyFromAuthzPolicyName', () => { + const result = client.matchAuthzPolicyFromAuthzPolicyName(fakePath); + assert.strictEqual(result, "authzPolicyValue"); + assert((client.pathTemplates.authzPolicyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('backendAuthenticationConfig', async () => { + const fakePath = "/rendered/path/backendAuthenticationConfig"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + backend_authentication_config: "backendAuthenticationConfigValue", + }; + const client = new dnsthreatdetectorserviceModule.v1.DnsThreatDetectorServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.backendAuthenticationConfigPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.backendAuthenticationConfigPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('backendAuthenticationConfigPath', () => { + const result = client.backendAuthenticationConfigPath("projectValue", "locationValue", "backendAuthenticationConfigValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.backendAuthenticationConfigPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromBackendAuthenticationConfigName', () => { + const result = client.matchProjectFromBackendAuthenticationConfigName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.backendAuthenticationConfigPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromBackendAuthenticationConfigName', () => { + const result = client.matchLocationFromBackendAuthenticationConfigName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.backendAuthenticationConfigPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchBackendAuthenticationConfigFromBackendAuthenticationConfigName', () => { + const result = client.matchBackendAuthenticationConfigFromBackendAuthenticationConfigName(fakePath); + assert.strictEqual(result, "backendAuthenticationConfigValue"); + assert((client.pathTemplates.backendAuthenticationConfigPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('clientTlsPolicy', async () => { + const fakePath = "/rendered/path/clientTlsPolicy"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + client_tls_policy: "clientTlsPolicyValue", + }; + const client = new dnsthreatdetectorserviceModule.v1.DnsThreatDetectorServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.clientTlsPolicyPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.clientTlsPolicyPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('clientTlsPolicyPath', () => { + const result = client.clientTlsPolicyPath("projectValue", "locationValue", "clientTlsPolicyValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.clientTlsPolicyPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromClientTlsPolicyName', () => { + const result = client.matchProjectFromClientTlsPolicyName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.clientTlsPolicyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromClientTlsPolicyName', () => { + const result = client.matchLocationFromClientTlsPolicyName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.clientTlsPolicyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchClientTlsPolicyFromClientTlsPolicyName', () => { + const result = client.matchClientTlsPolicyFromClientTlsPolicyName(fakePath); + assert.strictEqual(result, "clientTlsPolicyValue"); + assert((client.pathTemplates.clientTlsPolicyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('dnsThreatDetector', async () => { + const fakePath = "/rendered/path/dnsThreatDetector"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + dns_threat_detector: "dnsThreatDetectorValue", + }; + const client = new dnsthreatdetectorserviceModule.v1.DnsThreatDetectorServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.dnsThreatDetectorPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.dnsThreatDetectorPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('dnsThreatDetectorPath', () => { + const result = client.dnsThreatDetectorPath("projectValue", "locationValue", "dnsThreatDetectorValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.dnsThreatDetectorPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromDnsThreatDetectorName', () => { + const result = client.matchProjectFromDnsThreatDetectorName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.dnsThreatDetectorPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromDnsThreatDetectorName', () => { + const result = client.matchLocationFromDnsThreatDetectorName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.dnsThreatDetectorPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDnsThreatDetectorFromDnsThreatDetectorName', () => { + const result = client.matchDnsThreatDetectorFromDnsThreatDetectorName(fakePath); + assert.strictEqual(result, "dnsThreatDetectorValue"); + assert((client.pathTemplates.dnsThreatDetectorPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('firewallEndpointAssociation', async () => { + const fakePath = "/rendered/path/firewallEndpointAssociation"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + firewall_endpoint_association: "firewallEndpointAssociationValue", + }; + const client = new dnsthreatdetectorserviceModule.v1.DnsThreatDetectorServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.firewallEndpointAssociationPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.firewallEndpointAssociationPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('firewallEndpointAssociationPath', () => { + const result = client.firewallEndpointAssociationPath("projectValue", "locationValue", "firewallEndpointAssociationValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.firewallEndpointAssociationPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromFirewallEndpointAssociationName', () => { + const result = client.matchProjectFromFirewallEndpointAssociationName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.firewallEndpointAssociationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromFirewallEndpointAssociationName', () => { + const result = client.matchLocationFromFirewallEndpointAssociationName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.firewallEndpointAssociationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchFirewallEndpointAssociationFromFirewallEndpointAssociationName', () => { + const result = client.matchFirewallEndpointAssociationFromFirewallEndpointAssociationName(fakePath); + assert.strictEqual(result, "firewallEndpointAssociationValue"); + assert((client.pathTemplates.firewallEndpointAssociationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('gatewaySecurityPolicy', async () => { + const fakePath = "/rendered/path/gatewaySecurityPolicy"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + gateway_security_policy: "gatewaySecurityPolicyValue", + }; + const client = new dnsthreatdetectorserviceModule.v1.DnsThreatDetectorServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.gatewaySecurityPolicyPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.gatewaySecurityPolicyPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('gatewaySecurityPolicyPath', () => { + const result = client.gatewaySecurityPolicyPath("projectValue", "locationValue", "gatewaySecurityPolicyValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.gatewaySecurityPolicyPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromGatewaySecurityPolicyName', () => { + const result = client.matchProjectFromGatewaySecurityPolicyName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.gatewaySecurityPolicyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromGatewaySecurityPolicyName', () => { + const result = client.matchLocationFromGatewaySecurityPolicyName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.gatewaySecurityPolicyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchGatewaySecurityPolicyFromGatewaySecurityPolicyName', () => { + const result = client.matchGatewaySecurityPolicyFromGatewaySecurityPolicyName(fakePath); + assert.strictEqual(result, "gatewaySecurityPolicyValue"); + assert((client.pathTemplates.gatewaySecurityPolicyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('gatewaySecurityPolicyRule', async () => { + const fakePath = "/rendered/path/gatewaySecurityPolicyRule"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + gateway_security_policy: "gatewaySecurityPolicyValue", + rule: "ruleValue", + }; + const client = new dnsthreatdetectorserviceModule.v1.DnsThreatDetectorServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.gatewaySecurityPolicyRulePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.gatewaySecurityPolicyRulePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('gatewaySecurityPolicyRulePath', () => { + const result = client.gatewaySecurityPolicyRulePath("projectValue", "locationValue", "gatewaySecurityPolicyValue", "ruleValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.gatewaySecurityPolicyRulePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromGatewaySecurityPolicyRuleName', () => { + const result = client.matchProjectFromGatewaySecurityPolicyRuleName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.gatewaySecurityPolicyRulePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromGatewaySecurityPolicyRuleName', () => { + const result = client.matchLocationFromGatewaySecurityPolicyRuleName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.gatewaySecurityPolicyRulePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchGatewaySecurityPolicyFromGatewaySecurityPolicyRuleName', () => { + const result = client.matchGatewaySecurityPolicyFromGatewaySecurityPolicyRuleName(fakePath); + assert.strictEqual(result, "gatewaySecurityPolicyValue"); + assert((client.pathTemplates.gatewaySecurityPolicyRulePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchRuleFromGatewaySecurityPolicyRuleName', () => { + const result = client.matchRuleFromGatewaySecurityPolicyRuleName(fakePath); + assert.strictEqual(result, "ruleValue"); + assert((client.pathTemplates.gatewaySecurityPolicyRulePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('interceptDeployment', async () => { + const fakePath = "/rendered/path/interceptDeployment"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + intercept_deployment: "interceptDeploymentValue", + }; + const client = new dnsthreatdetectorserviceModule.v1.DnsThreatDetectorServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.interceptDeploymentPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.interceptDeploymentPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('interceptDeploymentPath', () => { + const result = client.interceptDeploymentPath("projectValue", "locationValue", "interceptDeploymentValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.interceptDeploymentPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromInterceptDeploymentName', () => { + const result = client.matchProjectFromInterceptDeploymentName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.interceptDeploymentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromInterceptDeploymentName', () => { + const result = client.matchLocationFromInterceptDeploymentName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.interceptDeploymentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchInterceptDeploymentFromInterceptDeploymentName', () => { + const result = client.matchInterceptDeploymentFromInterceptDeploymentName(fakePath); + assert.strictEqual(result, "interceptDeploymentValue"); + assert((client.pathTemplates.interceptDeploymentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('interceptDeploymentGroup', async () => { + const fakePath = "/rendered/path/interceptDeploymentGroup"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + intercept_deployment_group: "interceptDeploymentGroupValue", + }; + const client = new dnsthreatdetectorserviceModule.v1.DnsThreatDetectorServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.interceptDeploymentGroupPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.interceptDeploymentGroupPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('interceptDeploymentGroupPath', () => { + const result = client.interceptDeploymentGroupPath("projectValue", "locationValue", "interceptDeploymentGroupValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.interceptDeploymentGroupPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromInterceptDeploymentGroupName', () => { + const result = client.matchProjectFromInterceptDeploymentGroupName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.interceptDeploymentGroupPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromInterceptDeploymentGroupName', () => { + const result = client.matchLocationFromInterceptDeploymentGroupName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.interceptDeploymentGroupPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchInterceptDeploymentGroupFromInterceptDeploymentGroupName', () => { + const result = client.matchInterceptDeploymentGroupFromInterceptDeploymentGroupName(fakePath); + assert.strictEqual(result, "interceptDeploymentGroupValue"); + assert((client.pathTemplates.interceptDeploymentGroupPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('interceptEndpointGroup', async () => { + const fakePath = "/rendered/path/interceptEndpointGroup"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + intercept_endpoint_group: "interceptEndpointGroupValue", + }; + const client = new dnsthreatdetectorserviceModule.v1.DnsThreatDetectorServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.interceptEndpointGroupPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.interceptEndpointGroupPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('interceptEndpointGroupPath', () => { + const result = client.interceptEndpointGroupPath("projectValue", "locationValue", "interceptEndpointGroupValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.interceptEndpointGroupPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromInterceptEndpointGroupName', () => { + const result = client.matchProjectFromInterceptEndpointGroupName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.interceptEndpointGroupPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromInterceptEndpointGroupName', () => { + const result = client.matchLocationFromInterceptEndpointGroupName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.interceptEndpointGroupPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchInterceptEndpointGroupFromInterceptEndpointGroupName', () => { + const result = client.matchInterceptEndpointGroupFromInterceptEndpointGroupName(fakePath); + assert.strictEqual(result, "interceptEndpointGroupValue"); + assert((client.pathTemplates.interceptEndpointGroupPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('interceptEndpointGroupAssociation', async () => { + const fakePath = "/rendered/path/interceptEndpointGroupAssociation"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + intercept_endpoint_group_association: "interceptEndpointGroupAssociationValue", + }; + const client = new dnsthreatdetectorserviceModule.v1.DnsThreatDetectorServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.interceptEndpointGroupAssociationPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.interceptEndpointGroupAssociationPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('interceptEndpointGroupAssociationPath', () => { + const result = client.interceptEndpointGroupAssociationPath("projectValue", "locationValue", "interceptEndpointGroupAssociationValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.interceptEndpointGroupAssociationPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromInterceptEndpointGroupAssociationName', () => { + const result = client.matchProjectFromInterceptEndpointGroupAssociationName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.interceptEndpointGroupAssociationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromInterceptEndpointGroupAssociationName', () => { + const result = client.matchLocationFromInterceptEndpointGroupAssociationName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.interceptEndpointGroupAssociationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchInterceptEndpointGroupAssociationFromInterceptEndpointGroupAssociationName', () => { + const result = client.matchInterceptEndpointGroupAssociationFromInterceptEndpointGroupAssociationName(fakePath); + assert.strictEqual(result, "interceptEndpointGroupAssociationValue"); + assert((client.pathTemplates.interceptEndpointGroupAssociationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('location', async () => { + const fakePath = "/rendered/path/location"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + }; + const client = new dnsthreatdetectorserviceModule.v1.DnsThreatDetectorServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.locationPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.locationPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('locationPath', () => { + const result = client.locationPath("projectValue", "locationValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.locationPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromLocationName', () => { + const result = client.matchProjectFromLocationName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.locationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromLocationName', () => { + const result = client.matchLocationFromLocationName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.locationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('mirroringDeployment', async () => { + const fakePath = "/rendered/path/mirroringDeployment"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + mirroring_deployment: "mirroringDeploymentValue", + }; + const client = new dnsthreatdetectorserviceModule.v1.DnsThreatDetectorServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.mirroringDeploymentPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.mirroringDeploymentPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('mirroringDeploymentPath', () => { + const result = client.mirroringDeploymentPath("projectValue", "locationValue", "mirroringDeploymentValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.mirroringDeploymentPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromMirroringDeploymentName', () => { + const result = client.matchProjectFromMirroringDeploymentName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.mirroringDeploymentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromMirroringDeploymentName', () => { + const result = client.matchLocationFromMirroringDeploymentName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.mirroringDeploymentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchMirroringDeploymentFromMirroringDeploymentName', () => { + const result = client.matchMirroringDeploymentFromMirroringDeploymentName(fakePath); + assert.strictEqual(result, "mirroringDeploymentValue"); + assert((client.pathTemplates.mirroringDeploymentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('mirroringDeploymentGroup', async () => { + const fakePath = "/rendered/path/mirroringDeploymentGroup"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + mirroring_deployment_group: "mirroringDeploymentGroupValue", + }; + const client = new dnsthreatdetectorserviceModule.v1.DnsThreatDetectorServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.mirroringDeploymentGroupPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.mirroringDeploymentGroupPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('mirroringDeploymentGroupPath', () => { + const result = client.mirroringDeploymentGroupPath("projectValue", "locationValue", "mirroringDeploymentGroupValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.mirroringDeploymentGroupPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromMirroringDeploymentGroupName', () => { + const result = client.matchProjectFromMirroringDeploymentGroupName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.mirroringDeploymentGroupPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromMirroringDeploymentGroupName', () => { + const result = client.matchLocationFromMirroringDeploymentGroupName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.mirroringDeploymentGroupPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchMirroringDeploymentGroupFromMirroringDeploymentGroupName', () => { + const result = client.matchMirroringDeploymentGroupFromMirroringDeploymentGroupName(fakePath); + assert.strictEqual(result, "mirroringDeploymentGroupValue"); + assert((client.pathTemplates.mirroringDeploymentGroupPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('mirroringEndpointGroup', async () => { + const fakePath = "/rendered/path/mirroringEndpointGroup"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + mirroring_endpoint_group: "mirroringEndpointGroupValue", + }; + const client = new dnsthreatdetectorserviceModule.v1.DnsThreatDetectorServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.mirroringEndpointGroupPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.mirroringEndpointGroupPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('mirroringEndpointGroupPath', () => { + const result = client.mirroringEndpointGroupPath("projectValue", "locationValue", "mirroringEndpointGroupValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.mirroringEndpointGroupPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromMirroringEndpointGroupName', () => { + const result = client.matchProjectFromMirroringEndpointGroupName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.mirroringEndpointGroupPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromMirroringEndpointGroupName', () => { + const result = client.matchLocationFromMirroringEndpointGroupName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.mirroringEndpointGroupPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchMirroringEndpointGroupFromMirroringEndpointGroupName', () => { + const result = client.matchMirroringEndpointGroupFromMirroringEndpointGroupName(fakePath); + assert.strictEqual(result, "mirroringEndpointGroupValue"); + assert((client.pathTemplates.mirroringEndpointGroupPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('mirroringEndpointGroupAssociation', async () => { + const fakePath = "/rendered/path/mirroringEndpointGroupAssociation"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + mirroring_endpoint_group_association: "mirroringEndpointGroupAssociationValue", + }; + const client = new dnsthreatdetectorserviceModule.v1.DnsThreatDetectorServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.mirroringEndpointGroupAssociationPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.mirroringEndpointGroupAssociationPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('mirroringEndpointGroupAssociationPath', () => { + const result = client.mirroringEndpointGroupAssociationPath("projectValue", "locationValue", "mirroringEndpointGroupAssociationValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.mirroringEndpointGroupAssociationPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromMirroringEndpointGroupAssociationName', () => { + const result = client.matchProjectFromMirroringEndpointGroupAssociationName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.mirroringEndpointGroupAssociationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromMirroringEndpointGroupAssociationName', () => { + const result = client.matchLocationFromMirroringEndpointGroupAssociationName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.mirroringEndpointGroupAssociationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchMirroringEndpointGroupAssociationFromMirroringEndpointGroupAssociationName', () => { + const result = client.matchMirroringEndpointGroupAssociationFromMirroringEndpointGroupAssociationName(fakePath); + assert.strictEqual(result, "mirroringEndpointGroupAssociationValue"); + assert((client.pathTemplates.mirroringEndpointGroupAssociationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('network', async () => { + const fakePath = "/rendered/path/network"; + const expectedParameters = { + project: "projectValue", + network: "networkValue", + }; + const client = new dnsthreatdetectorserviceModule.v1.DnsThreatDetectorServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.networkPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.networkPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('networkPath', () => { + const result = client.networkPath("projectValue", "networkValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.networkPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromNetworkName', () => { + const result = client.matchProjectFromNetworkName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.networkPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchNetworkFromNetworkName', () => { + const result = client.matchNetworkFromNetworkName(fakePath); + assert.strictEqual(result, "networkValue"); + assert((client.pathTemplates.networkPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('organizationLocationAddressGroup', async () => { + const fakePath = "/rendered/path/organizationLocationAddressGroup"; + const expectedParameters = { + organization: "organizationValue", + location: "locationValue", + address_group: "addressGroupValue", + }; + const client = new dnsthreatdetectorserviceModule.v1.DnsThreatDetectorServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.organizationLocationAddressGroupPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.organizationLocationAddressGroupPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('organizationLocationAddressGroupPath', () => { + const result = client.organizationLocationAddressGroupPath("organizationValue", "locationValue", "addressGroupValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.organizationLocationAddressGroupPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchOrganizationFromOrganizationLocationAddressGroupName', () => { + const result = client.matchOrganizationFromOrganizationLocationAddressGroupName(fakePath); + assert.strictEqual(result, "organizationValue"); + assert((client.pathTemplates.organizationLocationAddressGroupPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromOrganizationLocationAddressGroupName', () => { + const result = client.matchLocationFromOrganizationLocationAddressGroupName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.organizationLocationAddressGroupPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchAddressGroupFromOrganizationLocationAddressGroupName', () => { + const result = client.matchAddressGroupFromOrganizationLocationAddressGroupName(fakePath); + assert.strictEqual(result, "addressGroupValue"); + assert((client.pathTemplates.organizationLocationAddressGroupPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('organizationLocationFirewallEndpoints', async () => { + const fakePath = "/rendered/path/organizationLocationFirewallEndpoints"; + const expectedParameters = { + organization: "organizationValue", + location: "locationValue", + firewall_endpoint: "firewallEndpointValue", + }; + const client = new dnsthreatdetectorserviceModule.v1.DnsThreatDetectorServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.organizationLocationFirewallEndpointsPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.organizationLocationFirewallEndpointsPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('organizationLocationFirewallEndpointsPath', () => { + const result = client.organizationLocationFirewallEndpointsPath("organizationValue", "locationValue", "firewallEndpointValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.organizationLocationFirewallEndpointsPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchOrganizationFromOrganizationLocationFirewallEndpointsName', () => { + const result = client.matchOrganizationFromOrganizationLocationFirewallEndpointsName(fakePath); + assert.strictEqual(result, "organizationValue"); + assert((client.pathTemplates.organizationLocationFirewallEndpointsPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromOrganizationLocationFirewallEndpointsName', () => { + const result = client.matchLocationFromOrganizationLocationFirewallEndpointsName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.organizationLocationFirewallEndpointsPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchFirewallEndpointFromOrganizationLocationFirewallEndpointsName', () => { + const result = client.matchFirewallEndpointFromOrganizationLocationFirewallEndpointsName(fakePath); + assert.strictEqual(result, "firewallEndpointValue"); + assert((client.pathTemplates.organizationLocationFirewallEndpointsPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('organizationLocationSecurityProfile', async () => { + const fakePath = "/rendered/path/organizationLocationSecurityProfile"; + const expectedParameters = { + organization: "organizationValue", + location: "locationValue", + security_profile: "securityProfileValue", + }; + const client = new dnsthreatdetectorserviceModule.v1.DnsThreatDetectorServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.organizationLocationSecurityProfilePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.organizationLocationSecurityProfilePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('organizationLocationSecurityProfilePath', () => { + const result = client.organizationLocationSecurityProfilePath("organizationValue", "locationValue", "securityProfileValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.organizationLocationSecurityProfilePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchOrganizationFromOrganizationLocationSecurityProfileName', () => { + const result = client.matchOrganizationFromOrganizationLocationSecurityProfileName(fakePath); + assert.strictEqual(result, "organizationValue"); + assert((client.pathTemplates.organizationLocationSecurityProfilePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromOrganizationLocationSecurityProfileName', () => { + const result = client.matchLocationFromOrganizationLocationSecurityProfileName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.organizationLocationSecurityProfilePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchSecurityProfileFromOrganizationLocationSecurityProfileName', () => { + const result = client.matchSecurityProfileFromOrganizationLocationSecurityProfileName(fakePath); + assert.strictEqual(result, "securityProfileValue"); + assert((client.pathTemplates.organizationLocationSecurityProfilePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('organizationLocationSecurityProfileGroup', async () => { + const fakePath = "/rendered/path/organizationLocationSecurityProfileGroup"; + const expectedParameters = { + organization: "organizationValue", + location: "locationValue", + security_profile_group: "securityProfileGroupValue", + }; + const client = new dnsthreatdetectorserviceModule.v1.DnsThreatDetectorServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.organizationLocationSecurityProfileGroupPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.organizationLocationSecurityProfileGroupPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('organizationLocationSecurityProfileGroupPath', () => { + const result = client.organizationLocationSecurityProfileGroupPath("organizationValue", "locationValue", "securityProfileGroupValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.organizationLocationSecurityProfileGroupPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchOrganizationFromOrganizationLocationSecurityProfileGroupName', () => { + const result = client.matchOrganizationFromOrganizationLocationSecurityProfileGroupName(fakePath); + assert.strictEqual(result, "organizationValue"); + assert((client.pathTemplates.organizationLocationSecurityProfileGroupPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromOrganizationLocationSecurityProfileGroupName', () => { + const result = client.matchLocationFromOrganizationLocationSecurityProfileGroupName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.organizationLocationSecurityProfileGroupPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchSecurityProfileGroupFromOrganizationLocationSecurityProfileGroupName', () => { + const result = client.matchSecurityProfileGroupFromOrganizationLocationSecurityProfileGroupName(fakePath); + assert.strictEqual(result, "securityProfileGroupValue"); + assert((client.pathTemplates.organizationLocationSecurityProfileGroupPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('project', async () => { + const fakePath = "/rendered/path/project"; + const expectedParameters = { + project: "projectValue", + }; + const client = new dnsthreatdetectorserviceModule.v1.DnsThreatDetectorServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectPath', () => { + const result = client.projectPath("projectValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.projectPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromProjectName', () => { + const result = client.matchProjectFromProjectName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.projectPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('projectLocationAddressGroup', async () => { + const fakePath = "/rendered/path/projectLocationAddressGroup"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + address_group: "addressGroupValue", + }; + const client = new dnsthreatdetectorserviceModule.v1.DnsThreatDetectorServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectLocationAddressGroupPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationAddressGroupPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationAddressGroupPath', () => { + const result = client.projectLocationAddressGroupPath("projectValue", "locationValue", "addressGroupValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.projectLocationAddressGroupPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromProjectLocationAddressGroupName', () => { + const result = client.matchProjectFromProjectLocationAddressGroupName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.projectLocationAddressGroupPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromProjectLocationAddressGroupName', () => { + const result = client.matchLocationFromProjectLocationAddressGroupName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.projectLocationAddressGroupPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchAddressGroupFromProjectLocationAddressGroupName', () => { + const result = client.matchAddressGroupFromProjectLocationAddressGroupName(fakePath); + assert.strictEqual(result, "addressGroupValue"); + assert((client.pathTemplates.projectLocationAddressGroupPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('projectLocationFirewallEndpoints', async () => { + const fakePath = "/rendered/path/projectLocationFirewallEndpoints"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + firewall_endpoint: "firewallEndpointValue", + }; + const client = new dnsthreatdetectorserviceModule.v1.DnsThreatDetectorServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectLocationFirewallEndpointsPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationFirewallEndpointsPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationFirewallEndpointsPath', () => { + const result = client.projectLocationFirewallEndpointsPath("projectValue", "locationValue", "firewallEndpointValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.projectLocationFirewallEndpointsPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromProjectLocationFirewallEndpointsName', () => { + const result = client.matchProjectFromProjectLocationFirewallEndpointsName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.projectLocationFirewallEndpointsPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromProjectLocationFirewallEndpointsName', () => { + const result = client.matchLocationFromProjectLocationFirewallEndpointsName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.projectLocationFirewallEndpointsPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchFirewallEndpointFromProjectLocationFirewallEndpointsName', () => { + const result = client.matchFirewallEndpointFromProjectLocationFirewallEndpointsName(fakePath); + assert.strictEqual(result, "firewallEndpointValue"); + assert((client.pathTemplates.projectLocationFirewallEndpointsPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('projectLocationSecurityProfile', async () => { + const fakePath = "/rendered/path/projectLocationSecurityProfile"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + security_profile: "securityProfileValue", + }; + const client = new dnsthreatdetectorserviceModule.v1.DnsThreatDetectorServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectLocationSecurityProfilePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationSecurityProfilePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationSecurityProfilePath', () => { + const result = client.projectLocationSecurityProfilePath("projectValue", "locationValue", "securityProfileValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.projectLocationSecurityProfilePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromProjectLocationSecurityProfileName', () => { + const result = client.matchProjectFromProjectLocationSecurityProfileName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.projectLocationSecurityProfilePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromProjectLocationSecurityProfileName', () => { + const result = client.matchLocationFromProjectLocationSecurityProfileName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.projectLocationSecurityProfilePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchSecurityProfileFromProjectLocationSecurityProfileName', () => { + const result = client.matchSecurityProfileFromProjectLocationSecurityProfileName(fakePath); + assert.strictEqual(result, "securityProfileValue"); + assert((client.pathTemplates.projectLocationSecurityProfilePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('projectLocationSecurityProfileGroup', async () => { + const fakePath = "/rendered/path/projectLocationSecurityProfileGroup"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + security_profile_group: "securityProfileGroupValue", + }; + const client = new dnsthreatdetectorserviceModule.v1.DnsThreatDetectorServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectLocationSecurityProfileGroupPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationSecurityProfileGroupPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationSecurityProfileGroupPath', () => { + const result = client.projectLocationSecurityProfileGroupPath("projectValue", "locationValue", "securityProfileGroupValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.projectLocationSecurityProfileGroupPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromProjectLocationSecurityProfileGroupName', () => { + const result = client.matchProjectFromProjectLocationSecurityProfileGroupName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.projectLocationSecurityProfileGroupPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromProjectLocationSecurityProfileGroupName', () => { + const result = client.matchLocationFromProjectLocationSecurityProfileGroupName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.projectLocationSecurityProfileGroupPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchSecurityProfileGroupFromProjectLocationSecurityProfileGroupName', () => { + const result = client.matchSecurityProfileGroupFromProjectLocationSecurityProfileGroupName(fakePath); + assert.strictEqual(result, "securityProfileGroupValue"); + assert((client.pathTemplates.projectLocationSecurityProfileGroupPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('serverTlsPolicy', async () => { + const fakePath = "/rendered/path/serverTlsPolicy"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + server_tls_policy: "serverTlsPolicyValue", + }; + const client = new dnsthreatdetectorserviceModule.v1.DnsThreatDetectorServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.serverTlsPolicyPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.serverTlsPolicyPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('serverTlsPolicyPath', () => { + const result = client.serverTlsPolicyPath("projectValue", "locationValue", "serverTlsPolicyValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.serverTlsPolicyPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromServerTlsPolicyName', () => { + const result = client.matchProjectFromServerTlsPolicyName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.serverTlsPolicyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromServerTlsPolicyName', () => { + const result = client.matchLocationFromServerTlsPolicyName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.serverTlsPolicyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchServerTlsPolicyFromServerTlsPolicyName', () => { + const result = client.matchServerTlsPolicyFromServerTlsPolicyName(fakePath); + assert.strictEqual(result, "serverTlsPolicyValue"); + assert((client.pathTemplates.serverTlsPolicyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('tlsInspectionPolicy', async () => { + const fakePath = "/rendered/path/tlsInspectionPolicy"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + tls_inspection_policy: "tlsInspectionPolicyValue", + }; + const client = new dnsthreatdetectorserviceModule.v1.DnsThreatDetectorServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.tlsInspectionPolicyPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.tlsInspectionPolicyPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('tlsInspectionPolicyPath', () => { + const result = client.tlsInspectionPolicyPath("projectValue", "locationValue", "tlsInspectionPolicyValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.tlsInspectionPolicyPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromTlsInspectionPolicyName', () => { + const result = client.matchProjectFromTlsInspectionPolicyName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.tlsInspectionPolicyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromTlsInspectionPolicyName', () => { + const result = client.matchLocationFromTlsInspectionPolicyName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.tlsInspectionPolicyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchTlsInspectionPolicyFromTlsInspectionPolicyName', () => { + const result = client.matchTlsInspectionPolicyFromTlsInspectionPolicyName(fakePath); + assert.strictEqual(result, "tlsInspectionPolicyValue"); + assert((client.pathTemplates.tlsInspectionPolicyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('urlList', async () => { + const fakePath = "/rendered/path/urlList"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + url_list: "urlListValue", + }; + const client = new dnsthreatdetectorserviceModule.v1.DnsThreatDetectorServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.urlListPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.urlListPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('urlListPath', () => { + const result = client.urlListPath("projectValue", "locationValue", "urlListValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.urlListPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromUrlListName', () => { + const result = client.matchProjectFromUrlListName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.urlListPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromUrlListName', () => { + const result = client.matchLocationFromUrlListName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.urlListPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchUrlListFromUrlListName', () => { + const result = client.matchUrlListFromUrlListName(fakePath); + assert.strictEqual(result, "urlListValue"); + assert((client.pathTemplates.urlListPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + }); +}); diff --git a/packages/google-cloud-networksecurity/test/gapic_firewall_activation_v1.ts b/packages/google-cloud-networksecurity/test/gapic_firewall_activation_v1.ts new file mode 100644 index 00000000000..8b1790d3a66 --- /dev/null +++ b/packages/google-cloud-networksecurity/test/gapic_firewall_activation_v1.ts @@ -0,0 +1,4001 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import * as protos from '../protos/protos'; +import * as assert from 'assert'; +import * as sinon from 'sinon'; +import {SinonStub} from 'sinon'; +import {describe, it} from 'mocha'; +import * as firewallactivationModule from '../src'; + +import {PassThrough} from 'stream'; + +import {protobuf, LROperation, operationsProtos, IamProtos, LocationProtos} from 'google-gax'; + +// Dynamically loaded proto JSON is needed to get the type information +// to fill in default values for request objects +const root = protobuf.Root.fromJSON(require('../protos/protos.json')).resolveAll(); + +// eslint-disable-next-line @typescript-eslint/no-unused-vars +function getTypeDefaultValue(typeName: string, fields: string[]) { + let type = root.lookupType(typeName) as protobuf.Type; + for (const field of fields.slice(0, -1)) { + type = type.fields[field]?.resolvedType as protobuf.Type; + } + return type.fields[fields[fields.length - 1]]?.defaultValue; +} + +function generateSampleMessage(instance: T) { + const filledObject = (instance.constructor as typeof protobuf.Message) + .toObject(instance as protobuf.Message, {defaults: true}); + return (instance.constructor as typeof protobuf.Message).fromObject(filledObject) as T; +} + +function stubSimpleCall(response?: ResponseType, error?: Error) { + return error ? sinon.stub().rejects(error) : sinon.stub().resolves([response]); +} + +function stubSimpleCallWithCallback(response?: ResponseType, error?: Error) { + return error ? sinon.stub().callsArgWith(2, error) : sinon.stub().callsArgWith(2, null, response); +} + +function stubLongRunningCall(response?: ResponseType, callError?: Error, lroError?: Error) { + const innerStub = lroError ? sinon.stub().rejects(lroError) : sinon.stub().resolves([response]); + const mockOperation = { + promise: innerStub, + }; + return callError ? sinon.stub().rejects(callError) : sinon.stub().resolves([mockOperation]); +} + +function stubLongRunningCallWithCallback(response?: ResponseType, callError?: Error, lroError?: Error) { + const innerStub = lroError ? sinon.stub().rejects(lroError) : sinon.stub().resolves([response]); + const mockOperation = { + promise: innerStub, + }; + return callError ? sinon.stub().callsArgWith(2, callError) : sinon.stub().callsArgWith(2, null, mockOperation); +} + +function stubPageStreamingCall(responses?: ResponseType[], error?: Error) { + const pagingStub = sinon.stub(); + if (responses) { + for (let i = 0; i < responses.length; ++i) { + pagingStub.onCall(i).callsArgWith(2, null, responses[i]); + } + } + const transformStub = error ? sinon.stub().callsArgWith(2, error) : pagingStub; + const mockStream = new PassThrough({ + objectMode: true, + transform: transformStub, + }); + // trigger as many responses as needed + if (responses) { + for (let i = 0; i < responses.length; ++i) { + setImmediate(() => { mockStream.write({}); }); + } + setImmediate(() => { mockStream.end(); }); + } else { + setImmediate(() => { mockStream.write({}); }); + setImmediate(() => { mockStream.end(); }); + } + return sinon.stub().returns(mockStream); +} + +function stubAsyncIterationCall(responses?: ResponseType[], error?: Error) { + let counter = 0; + const asyncIterable = { + [Symbol.asyncIterator]() { + return { + async next() { + if (error) { + return Promise.reject(error); + } + if (counter >= responses!.length) { + return Promise.resolve({done: true, value: undefined}); + } + return Promise.resolve({done: false, value: responses![counter++]}); + } + }; + } + }; + return sinon.stub().returns(asyncIterable); +} + +describe('v1.FirewallActivationClient', () => { + describe('Common methods', () => { + it('has apiEndpoint', () => { + const client = new firewallactivationModule.v1.FirewallActivationClient(); + const apiEndpoint = client.apiEndpoint; + assert.strictEqual(apiEndpoint, 'networksecurity.googleapis.com'); + }); + + it('has universeDomain', () => { + const client = new firewallactivationModule.v1.FirewallActivationClient(); + const universeDomain = client.universeDomain; + assert.strictEqual(universeDomain, "googleapis.com"); + }); + + if (typeof process === 'object' && typeof process.emitWarning === 'function') { + it('throws DeprecationWarning if static servicePath is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const servicePath = firewallactivationModule.v1.FirewallActivationClient.servicePath; + assert.strictEqual(servicePath, 'networksecurity.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + + it('throws DeprecationWarning if static apiEndpoint is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const apiEndpoint = firewallactivationModule.v1.FirewallActivationClient.apiEndpoint; + assert.strictEqual(apiEndpoint, 'networksecurity.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + } + it('sets apiEndpoint according to universe domain camelCase', () => { + const client = new firewallactivationModule.v1.FirewallActivationClient({universeDomain: 'example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'networksecurity.example.com'); + }); + + it('sets apiEndpoint according to universe domain snakeCase', () => { + const client = new firewallactivationModule.v1.FirewallActivationClient({universe_domain: 'example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'networksecurity.example.com'); + }); + + if (typeof process === 'object' && 'env' in process) { + describe('GOOGLE_CLOUD_UNIVERSE_DOMAIN environment variable', () => { + it('sets apiEndpoint from environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = new firewallactivationModule.v1.FirewallActivationClient(); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'networksecurity.example.com'); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + + it('value configured in code has priority over environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = new firewallactivationModule.v1.FirewallActivationClient({universeDomain: 'configured.example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'networksecurity.configured.example.com'); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + }); + } + it('does not allow setting both universeDomain and universe_domain', () => { + assert.throws(() => { new firewallactivationModule.v1.FirewallActivationClient({universe_domain: 'example.com', universeDomain: 'example.net'}); }); + }); + + it('has port', () => { + const port = firewallactivationModule.v1.FirewallActivationClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new firewallactivationModule.v1.FirewallActivationClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new firewallactivationModule.v1.FirewallActivationClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new firewallactivationModule.v1.FirewallActivationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.firewallActivationStub, undefined); + await client.initialize(); + assert(client.firewallActivationStub); + }); + + it('has close method for the initialized client', done => { + const client = new firewallactivationModule.v1.FirewallActivationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize().catch(err => {throw err}); + assert(client.firewallActivationStub); + client.close().then(() => { + done(); + }).catch(err => {throw err}); + }); + + it('has close method for the non-initialized client', done => { + const client = new firewallactivationModule.v1.FirewallActivationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.firewallActivationStub, undefined); + client.close().then(() => { + done(); + }).catch(err => {throw err}); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new firewallactivationModule.v1.FirewallActivationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.auth.getProjectId = sinon.stub().resolves(fakeProjectId); + const result = await client.getProjectId(); + assert.strictEqual(result, fakeProjectId); + assert((client.auth.getProjectId as SinonStub).calledWithExactly()); + }); + + it('has getProjectId method with callback', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new firewallactivationModule.v1.FirewallActivationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.auth.getProjectId = sinon.stub().callsArgWith(0, null, fakeProjectId); + const promise = new Promise((resolve, reject) => { + client.getProjectId((err?: Error|null, projectId?: string|null) => { + if (err) { + reject(err); + } else { + resolve(projectId); + } + }); + }); + const result = await promise; + assert.strictEqual(result, fakeProjectId); + }); + }); + + describe('getFirewallEndpoint', () => { + it('invokes getFirewallEndpoint without error', async () => { + const client = new firewallactivationModule.v1.FirewallActivationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.GetFirewallEndpointRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.GetFirewallEndpointRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.FirewallEndpoint() + ); + client.innerApiCalls.getFirewallEndpoint = stubSimpleCall(expectedResponse); + const [response] = await client.getFirewallEndpoint(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getFirewallEndpoint as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getFirewallEndpoint as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getFirewallEndpoint without error using callback', async () => { + const client = new firewallactivationModule.v1.FirewallActivationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.GetFirewallEndpointRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.GetFirewallEndpointRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.FirewallEndpoint() + ); + client.innerApiCalls.getFirewallEndpoint = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getFirewallEndpoint( + request, + (err?: Error|null, result?: protos.google.cloud.networksecurity.v1.IFirewallEndpoint|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getFirewallEndpoint as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getFirewallEndpoint as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getFirewallEndpoint with error', async () => { + const client = new firewallactivationModule.v1.FirewallActivationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.GetFirewallEndpointRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.GetFirewallEndpointRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.getFirewallEndpoint = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getFirewallEndpoint(request), expectedError); + const actualRequest = (client.innerApiCalls.getFirewallEndpoint as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getFirewallEndpoint as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getFirewallEndpoint with closed client', async () => { + const client = new firewallactivationModule.v1.FirewallActivationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.GetFirewallEndpointRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.GetFirewallEndpointRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.getFirewallEndpoint(request), expectedError); + }); + }); + + describe('getFirewallEndpointAssociation', () => { + it('invokes getFirewallEndpointAssociation without error', async () => { + const client = new firewallactivationModule.v1.FirewallActivationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.GetFirewallEndpointAssociationRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.GetFirewallEndpointAssociationRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.FirewallEndpointAssociation() + ); + client.innerApiCalls.getFirewallEndpointAssociation = stubSimpleCall(expectedResponse); + const [response] = await client.getFirewallEndpointAssociation(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getFirewallEndpointAssociation as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getFirewallEndpointAssociation as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getFirewallEndpointAssociation without error using callback', async () => { + const client = new firewallactivationModule.v1.FirewallActivationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.GetFirewallEndpointAssociationRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.GetFirewallEndpointAssociationRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.FirewallEndpointAssociation() + ); + client.innerApiCalls.getFirewallEndpointAssociation = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getFirewallEndpointAssociation( + request, + (err?: Error|null, result?: protos.google.cloud.networksecurity.v1.IFirewallEndpointAssociation|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getFirewallEndpointAssociation as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getFirewallEndpointAssociation as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getFirewallEndpointAssociation with error', async () => { + const client = new firewallactivationModule.v1.FirewallActivationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.GetFirewallEndpointAssociationRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.GetFirewallEndpointAssociationRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.getFirewallEndpointAssociation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getFirewallEndpointAssociation(request), expectedError); + const actualRequest = (client.innerApiCalls.getFirewallEndpointAssociation as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getFirewallEndpointAssociation as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getFirewallEndpointAssociation with closed client', async () => { + const client = new firewallactivationModule.v1.FirewallActivationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.GetFirewallEndpointAssociationRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.GetFirewallEndpointAssociationRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.getFirewallEndpointAssociation(request), expectedError); + }); + }); + + describe('createFirewallEndpoint', () => { + it('invokes createFirewallEndpoint without error', async () => { + const client = new firewallactivationModule.v1.FirewallActivationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.CreateFirewallEndpointRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.CreateFirewallEndpointRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createFirewallEndpoint = stubLongRunningCall(expectedResponse); + const [operation] = await client.createFirewallEndpoint(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createFirewallEndpoint as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createFirewallEndpoint as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createFirewallEndpoint without error using callback', async () => { + const client = new firewallactivationModule.v1.FirewallActivationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.CreateFirewallEndpointRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.CreateFirewallEndpointRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createFirewallEndpoint = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createFirewallEndpoint( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createFirewallEndpoint as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createFirewallEndpoint as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createFirewallEndpoint with call error', async () => { + const client = new firewallactivationModule.v1.FirewallActivationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.CreateFirewallEndpointRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.CreateFirewallEndpointRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.createFirewallEndpoint = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.createFirewallEndpoint(request), expectedError); + const actualRequest = (client.innerApiCalls.createFirewallEndpoint as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createFirewallEndpoint as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createFirewallEndpoint with LRO error', async () => { + const client = new firewallactivationModule.v1.FirewallActivationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.CreateFirewallEndpointRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.CreateFirewallEndpointRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.createFirewallEndpoint = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.createFirewallEndpoint(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.createFirewallEndpoint as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createFirewallEndpoint as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkCreateFirewallEndpointProgress without error', async () => { + const client = new firewallactivationModule.v1.FirewallActivationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkCreateFirewallEndpointProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkCreateFirewallEndpointProgress with error', async () => { + const client = new firewallactivationModule.v1.FirewallActivationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkCreateFirewallEndpointProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('deleteFirewallEndpoint', () => { + it('invokes deleteFirewallEndpoint without error', async () => { + const client = new firewallactivationModule.v1.FirewallActivationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.DeleteFirewallEndpointRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.DeleteFirewallEndpointRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteFirewallEndpoint = stubLongRunningCall(expectedResponse); + const [operation] = await client.deleteFirewallEndpoint(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.deleteFirewallEndpoint as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteFirewallEndpoint as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteFirewallEndpoint without error using callback', async () => { + const client = new firewallactivationModule.v1.FirewallActivationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.DeleteFirewallEndpointRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.DeleteFirewallEndpointRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteFirewallEndpoint = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteFirewallEndpoint( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.deleteFirewallEndpoint as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteFirewallEndpoint as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteFirewallEndpoint with call error', async () => { + const client = new firewallactivationModule.v1.FirewallActivationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.DeleteFirewallEndpointRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.DeleteFirewallEndpointRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteFirewallEndpoint = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.deleteFirewallEndpoint(request), expectedError); + const actualRequest = (client.innerApiCalls.deleteFirewallEndpoint as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteFirewallEndpoint as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteFirewallEndpoint with LRO error', async () => { + const client = new firewallactivationModule.v1.FirewallActivationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.DeleteFirewallEndpointRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.DeleteFirewallEndpointRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteFirewallEndpoint = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.deleteFirewallEndpoint(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.deleteFirewallEndpoint as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteFirewallEndpoint as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkDeleteFirewallEndpointProgress without error', async () => { + const client = new firewallactivationModule.v1.FirewallActivationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkDeleteFirewallEndpointProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkDeleteFirewallEndpointProgress with error', async () => { + const client = new firewallactivationModule.v1.FirewallActivationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkDeleteFirewallEndpointProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('updateFirewallEndpoint', () => { + it('invokes updateFirewallEndpoint without error', async () => { + const client = new firewallactivationModule.v1.FirewallActivationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.UpdateFirewallEndpointRequest() + ); + request.firewallEndpoint ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.UpdateFirewallEndpointRequest', ['firewallEndpoint', 'name']); + request.firewallEndpoint.name = defaultValue1; + const expectedHeaderRequestParams = `firewall_endpoint.name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.updateFirewallEndpoint = stubLongRunningCall(expectedResponse); + const [operation] = await client.updateFirewallEndpoint(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateFirewallEndpoint as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateFirewallEndpoint as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateFirewallEndpoint without error using callback', async () => { + const client = new firewallactivationModule.v1.FirewallActivationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.UpdateFirewallEndpointRequest() + ); + request.firewallEndpoint ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.UpdateFirewallEndpointRequest', ['firewallEndpoint', 'name']); + request.firewallEndpoint.name = defaultValue1; + const expectedHeaderRequestParams = `firewall_endpoint.name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.updateFirewallEndpoint = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateFirewallEndpoint( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateFirewallEndpoint as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateFirewallEndpoint as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateFirewallEndpoint with call error', async () => { + const client = new firewallactivationModule.v1.FirewallActivationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.UpdateFirewallEndpointRequest() + ); + request.firewallEndpoint ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.UpdateFirewallEndpointRequest', ['firewallEndpoint', 'name']); + request.firewallEndpoint.name = defaultValue1; + const expectedHeaderRequestParams = `firewall_endpoint.name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateFirewallEndpoint = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.updateFirewallEndpoint(request), expectedError); + const actualRequest = (client.innerApiCalls.updateFirewallEndpoint as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateFirewallEndpoint as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateFirewallEndpoint with LRO error', async () => { + const client = new firewallactivationModule.v1.FirewallActivationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.UpdateFirewallEndpointRequest() + ); + request.firewallEndpoint ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.UpdateFirewallEndpointRequest', ['firewallEndpoint', 'name']); + request.firewallEndpoint.name = defaultValue1; + const expectedHeaderRequestParams = `firewall_endpoint.name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateFirewallEndpoint = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.updateFirewallEndpoint(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.updateFirewallEndpoint as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateFirewallEndpoint as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkUpdateFirewallEndpointProgress without error', async () => { + const client = new firewallactivationModule.v1.FirewallActivationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkUpdateFirewallEndpointProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkUpdateFirewallEndpointProgress with error', async () => { + const client = new firewallactivationModule.v1.FirewallActivationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkUpdateFirewallEndpointProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('createFirewallEndpointAssociation', () => { + it('invokes createFirewallEndpointAssociation without error', async () => { + const client = new firewallactivationModule.v1.FirewallActivationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.CreateFirewallEndpointAssociationRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.CreateFirewallEndpointAssociationRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createFirewallEndpointAssociation = stubLongRunningCall(expectedResponse); + const [operation] = await client.createFirewallEndpointAssociation(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createFirewallEndpointAssociation as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createFirewallEndpointAssociation as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createFirewallEndpointAssociation without error using callback', async () => { + const client = new firewallactivationModule.v1.FirewallActivationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.CreateFirewallEndpointAssociationRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.CreateFirewallEndpointAssociationRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createFirewallEndpointAssociation = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createFirewallEndpointAssociation( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createFirewallEndpointAssociation as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createFirewallEndpointAssociation as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createFirewallEndpointAssociation with call error', async () => { + const client = new firewallactivationModule.v1.FirewallActivationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.CreateFirewallEndpointAssociationRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.CreateFirewallEndpointAssociationRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.createFirewallEndpointAssociation = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.createFirewallEndpointAssociation(request), expectedError); + const actualRequest = (client.innerApiCalls.createFirewallEndpointAssociation as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createFirewallEndpointAssociation as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createFirewallEndpointAssociation with LRO error', async () => { + const client = new firewallactivationModule.v1.FirewallActivationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.CreateFirewallEndpointAssociationRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.CreateFirewallEndpointAssociationRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.createFirewallEndpointAssociation = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.createFirewallEndpointAssociation(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.createFirewallEndpointAssociation as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createFirewallEndpointAssociation as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkCreateFirewallEndpointAssociationProgress without error', async () => { + const client = new firewallactivationModule.v1.FirewallActivationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkCreateFirewallEndpointAssociationProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkCreateFirewallEndpointAssociationProgress with error', async () => { + const client = new firewallactivationModule.v1.FirewallActivationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkCreateFirewallEndpointAssociationProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('deleteFirewallEndpointAssociation', () => { + it('invokes deleteFirewallEndpointAssociation without error', async () => { + const client = new firewallactivationModule.v1.FirewallActivationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.DeleteFirewallEndpointAssociationRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.DeleteFirewallEndpointAssociationRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteFirewallEndpointAssociation = stubLongRunningCall(expectedResponse); + const [operation] = await client.deleteFirewallEndpointAssociation(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.deleteFirewallEndpointAssociation as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteFirewallEndpointAssociation as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteFirewallEndpointAssociation without error using callback', async () => { + const client = new firewallactivationModule.v1.FirewallActivationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.DeleteFirewallEndpointAssociationRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.DeleteFirewallEndpointAssociationRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteFirewallEndpointAssociation = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteFirewallEndpointAssociation( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.deleteFirewallEndpointAssociation as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteFirewallEndpointAssociation as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteFirewallEndpointAssociation with call error', async () => { + const client = new firewallactivationModule.v1.FirewallActivationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.DeleteFirewallEndpointAssociationRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.DeleteFirewallEndpointAssociationRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteFirewallEndpointAssociation = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.deleteFirewallEndpointAssociation(request), expectedError); + const actualRequest = (client.innerApiCalls.deleteFirewallEndpointAssociation as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteFirewallEndpointAssociation as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteFirewallEndpointAssociation with LRO error', async () => { + const client = new firewallactivationModule.v1.FirewallActivationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.DeleteFirewallEndpointAssociationRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.DeleteFirewallEndpointAssociationRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteFirewallEndpointAssociation = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.deleteFirewallEndpointAssociation(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.deleteFirewallEndpointAssociation as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteFirewallEndpointAssociation as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkDeleteFirewallEndpointAssociationProgress without error', async () => { + const client = new firewallactivationModule.v1.FirewallActivationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkDeleteFirewallEndpointAssociationProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkDeleteFirewallEndpointAssociationProgress with error', async () => { + const client = new firewallactivationModule.v1.FirewallActivationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkDeleteFirewallEndpointAssociationProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('updateFirewallEndpointAssociation', () => { + it('invokes updateFirewallEndpointAssociation without error', async () => { + const client = new firewallactivationModule.v1.FirewallActivationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.UpdateFirewallEndpointAssociationRequest() + ); + request.firewallEndpointAssociation ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.UpdateFirewallEndpointAssociationRequest', ['firewallEndpointAssociation', 'name']); + request.firewallEndpointAssociation.name = defaultValue1; + const expectedHeaderRequestParams = `firewall_endpoint_association.name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.updateFirewallEndpointAssociation = stubLongRunningCall(expectedResponse); + const [operation] = await client.updateFirewallEndpointAssociation(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateFirewallEndpointAssociation as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateFirewallEndpointAssociation as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateFirewallEndpointAssociation without error using callback', async () => { + const client = new firewallactivationModule.v1.FirewallActivationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.UpdateFirewallEndpointAssociationRequest() + ); + request.firewallEndpointAssociation ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.UpdateFirewallEndpointAssociationRequest', ['firewallEndpointAssociation', 'name']); + request.firewallEndpointAssociation.name = defaultValue1; + const expectedHeaderRequestParams = `firewall_endpoint_association.name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.updateFirewallEndpointAssociation = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateFirewallEndpointAssociation( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateFirewallEndpointAssociation as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateFirewallEndpointAssociation as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateFirewallEndpointAssociation with call error', async () => { + const client = new firewallactivationModule.v1.FirewallActivationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.UpdateFirewallEndpointAssociationRequest() + ); + request.firewallEndpointAssociation ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.UpdateFirewallEndpointAssociationRequest', ['firewallEndpointAssociation', 'name']); + request.firewallEndpointAssociation.name = defaultValue1; + const expectedHeaderRequestParams = `firewall_endpoint_association.name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateFirewallEndpointAssociation = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.updateFirewallEndpointAssociation(request), expectedError); + const actualRequest = (client.innerApiCalls.updateFirewallEndpointAssociation as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateFirewallEndpointAssociation as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateFirewallEndpointAssociation with LRO error', async () => { + const client = new firewallactivationModule.v1.FirewallActivationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.UpdateFirewallEndpointAssociationRequest() + ); + request.firewallEndpointAssociation ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.UpdateFirewallEndpointAssociationRequest', ['firewallEndpointAssociation', 'name']); + request.firewallEndpointAssociation.name = defaultValue1; + const expectedHeaderRequestParams = `firewall_endpoint_association.name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateFirewallEndpointAssociation = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.updateFirewallEndpointAssociation(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.updateFirewallEndpointAssociation as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateFirewallEndpointAssociation as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkUpdateFirewallEndpointAssociationProgress without error', async () => { + const client = new firewallactivationModule.v1.FirewallActivationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkUpdateFirewallEndpointAssociationProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkUpdateFirewallEndpointAssociationProgress with error', async () => { + const client = new firewallactivationModule.v1.FirewallActivationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkUpdateFirewallEndpointAssociationProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('listFirewallEndpoints', () => { + it('invokes listFirewallEndpoints without error', async () => { + const client = new firewallactivationModule.v1.FirewallActivationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.ListFirewallEndpointsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.ListFirewallEndpointsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.networksecurity.v1.FirewallEndpoint()), + generateSampleMessage(new protos.google.cloud.networksecurity.v1.FirewallEndpoint()), + generateSampleMessage(new protos.google.cloud.networksecurity.v1.FirewallEndpoint()), + ]; + client.innerApiCalls.listFirewallEndpoints = stubSimpleCall(expectedResponse); + const [response] = await client.listFirewallEndpoints(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listFirewallEndpoints as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listFirewallEndpoints as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listFirewallEndpoints without error using callback', async () => { + const client = new firewallactivationModule.v1.FirewallActivationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.ListFirewallEndpointsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.ListFirewallEndpointsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.networksecurity.v1.FirewallEndpoint()), + generateSampleMessage(new protos.google.cloud.networksecurity.v1.FirewallEndpoint()), + generateSampleMessage(new protos.google.cloud.networksecurity.v1.FirewallEndpoint()), + ]; + client.innerApiCalls.listFirewallEndpoints = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listFirewallEndpoints( + request, + (err?: Error|null, result?: protos.google.cloud.networksecurity.v1.IFirewallEndpoint[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listFirewallEndpoints as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listFirewallEndpoints as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listFirewallEndpoints with error', async () => { + const client = new firewallactivationModule.v1.FirewallActivationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.ListFirewallEndpointsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.ListFirewallEndpointsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.listFirewallEndpoints = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listFirewallEndpoints(request), expectedError); + const actualRequest = (client.innerApiCalls.listFirewallEndpoints as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listFirewallEndpoints as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listFirewallEndpointsStream without error', async () => { + const client = new firewallactivationModule.v1.FirewallActivationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.ListFirewallEndpointsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.ListFirewallEndpointsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.networksecurity.v1.FirewallEndpoint()), + generateSampleMessage(new protos.google.cloud.networksecurity.v1.FirewallEndpoint()), + generateSampleMessage(new protos.google.cloud.networksecurity.v1.FirewallEndpoint()), + ]; + client.descriptors.page.listFirewallEndpoints.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listFirewallEndpointsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.networksecurity.v1.FirewallEndpoint[] = []; + stream.on('data', (response: protos.google.cloud.networksecurity.v1.FirewallEndpoint) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert((client.descriptors.page.listFirewallEndpoints.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listFirewallEndpoints, request)); + assert( + (client.descriptors.page.listFirewallEndpoints.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listFirewallEndpointsStream with error', async () => { + const client = new firewallactivationModule.v1.FirewallActivationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.ListFirewallEndpointsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.ListFirewallEndpointsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.descriptors.page.listFirewallEndpoints.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listFirewallEndpointsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.networksecurity.v1.FirewallEndpoint[] = []; + stream.on('data', (response: protos.google.cloud.networksecurity.v1.FirewallEndpoint) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listFirewallEndpoints.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listFirewallEndpoints, request)); + assert( + (client.descriptors.page.listFirewallEndpoints.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listFirewallEndpoints without error', async () => { + const client = new firewallactivationModule.v1.FirewallActivationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.ListFirewallEndpointsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.ListFirewallEndpointsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.networksecurity.v1.FirewallEndpoint()), + generateSampleMessage(new protos.google.cloud.networksecurity.v1.FirewallEndpoint()), + generateSampleMessage(new protos.google.cloud.networksecurity.v1.FirewallEndpoint()), + ]; + client.descriptors.page.listFirewallEndpoints.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.networksecurity.v1.IFirewallEndpoint[] = []; + const iterable = client.listFirewallEndpointsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listFirewallEndpoints.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listFirewallEndpoints.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listFirewallEndpoints with error', async () => { + const client = new firewallactivationModule.v1.FirewallActivationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.ListFirewallEndpointsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.ListFirewallEndpointsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.descriptors.page.listFirewallEndpoints.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listFirewallEndpointsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.networksecurity.v1.IFirewallEndpoint[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listFirewallEndpoints.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listFirewallEndpoints.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('listFirewallEndpointAssociations', () => { + it('invokes listFirewallEndpointAssociations without error', async () => { + const client = new firewallactivationModule.v1.FirewallActivationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.ListFirewallEndpointAssociationsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.ListFirewallEndpointAssociationsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.networksecurity.v1.FirewallEndpointAssociation()), + generateSampleMessage(new protos.google.cloud.networksecurity.v1.FirewallEndpointAssociation()), + generateSampleMessage(new protos.google.cloud.networksecurity.v1.FirewallEndpointAssociation()), + ]; + client.innerApiCalls.listFirewallEndpointAssociations = stubSimpleCall(expectedResponse); + const [response] = await client.listFirewallEndpointAssociations(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listFirewallEndpointAssociations as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listFirewallEndpointAssociations as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listFirewallEndpointAssociations without error using callback', async () => { + const client = new firewallactivationModule.v1.FirewallActivationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.ListFirewallEndpointAssociationsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.ListFirewallEndpointAssociationsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.networksecurity.v1.FirewallEndpointAssociation()), + generateSampleMessage(new protos.google.cloud.networksecurity.v1.FirewallEndpointAssociation()), + generateSampleMessage(new protos.google.cloud.networksecurity.v1.FirewallEndpointAssociation()), + ]; + client.innerApiCalls.listFirewallEndpointAssociations = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listFirewallEndpointAssociations( + request, + (err?: Error|null, result?: protos.google.cloud.networksecurity.v1.IFirewallEndpointAssociation[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listFirewallEndpointAssociations as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listFirewallEndpointAssociations as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listFirewallEndpointAssociations with error', async () => { + const client = new firewallactivationModule.v1.FirewallActivationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.ListFirewallEndpointAssociationsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.ListFirewallEndpointAssociationsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.listFirewallEndpointAssociations = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listFirewallEndpointAssociations(request), expectedError); + const actualRequest = (client.innerApiCalls.listFirewallEndpointAssociations as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listFirewallEndpointAssociations as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listFirewallEndpointAssociationsStream without error', async () => { + const client = new firewallactivationModule.v1.FirewallActivationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.ListFirewallEndpointAssociationsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.ListFirewallEndpointAssociationsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.networksecurity.v1.FirewallEndpointAssociation()), + generateSampleMessage(new protos.google.cloud.networksecurity.v1.FirewallEndpointAssociation()), + generateSampleMessage(new protos.google.cloud.networksecurity.v1.FirewallEndpointAssociation()), + ]; + client.descriptors.page.listFirewallEndpointAssociations.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listFirewallEndpointAssociationsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.networksecurity.v1.FirewallEndpointAssociation[] = []; + stream.on('data', (response: protos.google.cloud.networksecurity.v1.FirewallEndpointAssociation) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert((client.descriptors.page.listFirewallEndpointAssociations.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listFirewallEndpointAssociations, request)); + assert( + (client.descriptors.page.listFirewallEndpointAssociations.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listFirewallEndpointAssociationsStream with error', async () => { + const client = new firewallactivationModule.v1.FirewallActivationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.ListFirewallEndpointAssociationsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.ListFirewallEndpointAssociationsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.descriptors.page.listFirewallEndpointAssociations.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listFirewallEndpointAssociationsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.networksecurity.v1.FirewallEndpointAssociation[] = []; + stream.on('data', (response: protos.google.cloud.networksecurity.v1.FirewallEndpointAssociation) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listFirewallEndpointAssociations.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listFirewallEndpointAssociations, request)); + assert( + (client.descriptors.page.listFirewallEndpointAssociations.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listFirewallEndpointAssociations without error', async () => { + const client = new firewallactivationModule.v1.FirewallActivationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.ListFirewallEndpointAssociationsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.ListFirewallEndpointAssociationsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.networksecurity.v1.FirewallEndpointAssociation()), + generateSampleMessage(new protos.google.cloud.networksecurity.v1.FirewallEndpointAssociation()), + generateSampleMessage(new protos.google.cloud.networksecurity.v1.FirewallEndpointAssociation()), + ]; + client.descriptors.page.listFirewallEndpointAssociations.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.networksecurity.v1.IFirewallEndpointAssociation[] = []; + const iterable = client.listFirewallEndpointAssociationsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listFirewallEndpointAssociations.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listFirewallEndpointAssociations.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listFirewallEndpointAssociations with error', async () => { + const client = new firewallactivationModule.v1.FirewallActivationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.ListFirewallEndpointAssociationsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.ListFirewallEndpointAssociationsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.descriptors.page.listFirewallEndpointAssociations.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listFirewallEndpointAssociationsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.networksecurity.v1.IFirewallEndpointAssociation[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listFirewallEndpointAssociations.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listFirewallEndpointAssociations.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + describe('getIamPolicy', () => { + it('invokes getIamPolicy without error', async () => { + const client = new firewallactivationModule.v1.FirewallActivationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.GetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy() + ); + client.iamClient.getIamPolicy = stubSimpleCall(expectedResponse); + const response = await client.getIamPolicy(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.iamClient.getIamPolicy as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + it('invokes getIamPolicy without error using callback', async () => { + const client = new firewallactivationModule.v1.FirewallActivationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.GetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy() + ); + client.iamClient.getIamPolicy = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getIamPolicy( + request, + expectedOptions, + (err?: Error|null, result?: IamProtos.google.iam.v1.Policy|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }).catch(err => {throw err}); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.iamClient.getIamPolicy as SinonStub) + .getCall(0)); + }); + it('invokes getIamPolicy with error', async () => { + const client = new firewallactivationModule.v1.FirewallActivationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.GetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.iamClient.getIamPolicy = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getIamPolicy(request, expectedOptions), expectedError); + assert((client.iamClient.getIamPolicy as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + }); + describe('setIamPolicy', () => { + it('invokes setIamPolicy without error', async () => { + const client = new firewallactivationModule.v1.FirewallActivationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.SetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy() + ); + client.iamClient.setIamPolicy = stubSimpleCall(expectedResponse); + const response = await client.setIamPolicy(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.iamClient.setIamPolicy as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + it('invokes setIamPolicy without error using callback', async () => { + const client = new firewallactivationModule.v1.FirewallActivationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.SetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy() + ); + client.iamClient.setIamPolicy = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.setIamPolicy( + request, + expectedOptions, + (err?: Error|null, result?: IamProtos.google.iam.v1.Policy|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }).catch(err => {throw err}); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.iamClient.setIamPolicy as SinonStub) + .getCall(0)); + }); + it('invokes setIamPolicy with error', async () => { + const client = new firewallactivationModule.v1.FirewallActivationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.SetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.iamClient.setIamPolicy = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.setIamPolicy(request, expectedOptions), expectedError); + assert((client.iamClient.setIamPolicy as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + }); + describe('testIamPermissions', () => { + it('invokes testIamPermissions without error', async () => { + const client = new firewallactivationModule.v1.FirewallActivationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsResponse() + ); + client.iamClient.testIamPermissions = stubSimpleCall(expectedResponse); + const response = await client.testIamPermissions(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.iamClient.testIamPermissions as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + it('invokes testIamPermissions without error using callback', async () => { + const client = new firewallactivationModule.v1.FirewallActivationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsResponse() + ); + client.iamClient.testIamPermissions = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.testIamPermissions( + request, + expectedOptions, + (err?: Error|null, result?: IamProtos.google.iam.v1.TestIamPermissionsResponse|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }).catch(err => {throw err}); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.iamClient.testIamPermissions as SinonStub) + .getCall(0)); + }); + it('invokes testIamPermissions with error', async () => { + const client = new firewallactivationModule.v1.FirewallActivationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.iamClient.testIamPermissions = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.testIamPermissions(request, expectedOptions), expectedError); + assert((client.iamClient.testIamPermissions as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + }); + describe('getLocation', () => { + it('invokes getLocation without error', async () => { + const client = new firewallactivationModule.v1.FirewallActivationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ); + client.locationsClient.getLocation = stubSimpleCall(expectedResponse); + const response = await client.getLocation(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.locationsClient.getLocation as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + it('invokes getLocation without error using callback', async () => { + const client = new firewallactivationModule.v1.FirewallActivationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ); + client.locationsClient.getLocation = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getLocation( + request, + expectedOptions, + ( + err?: Error | null, + result?: LocationProtos.google.cloud.location.ILocation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.locationsClient.getLocation as SinonStub) + .getCall(0)); + }); + it('invokes getLocation with error', async () => { + const client = new firewallactivationModule.v1.FirewallActivationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.locationsClient.getLocation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getLocation(request, expectedOptions), expectedError); + assert((client.locationsClient.getLocation as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + }); + describe('listLocationsAsync', () => { + it('uses async iteration with listLocations without error', async () => { + const client = new firewallactivationModule.v1.FirewallActivationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.ListLocationsRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedResponse = [ + generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ), + generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ), + generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ), + ]; + client.locationsClient.descriptors.page.listLocations.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: LocationProtos.google.cloud.location.ILocation[] = []; + const iterable = client.listLocationsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + it('uses async iteration with listLocations with error', async () => { + const client = new firewallactivationModule.v1.FirewallActivationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.ListLocationsRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedError = new Error('expected'); + client.locationsClient.descriptors.page.listLocations.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listLocationsAsync(request); + await assert.rejects(async () => { + const responses: LocationProtos.google.cloud.location.ILocation[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + describe('getOperation', () => { + it('invokes getOperation without error', async () => { + const client = new firewallactivationModule.v1.FirewallActivationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.GetOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const response = await client.getOperation(request); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0).calledWith(request) + ); + }); + it('invokes getOperation without error using callback', async () => { + const client = new firewallactivationModule.v1.FirewallActivationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.GetOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + client.operationsClient.getOperation = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.operationsClient.getOperation( + request, + undefined, + ( + err?: Error | null, + result?: operationsProtos.google.longrunning.Operation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }).catch(err => {throw err}); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + it('invokes getOperation with error', async () => { + const client = new firewallactivationModule.v1.FirewallActivationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.GetOperationRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(async () => {await client.getOperation(request)}, expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0).calledWith(request)); + }); + }); + describe('cancelOperation', () => { + it('invokes cancelOperation without error', async () => { + const client = new firewallactivationModule.v1.FirewallActivationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.CancelOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.cancelOperation = stubSimpleCall(expectedResponse); + const response = await client.cancelOperation(request); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.operationsClient.cancelOperation as SinonStub) + .getCall(0).calledWith(request) + ); + }); + it('invokes cancelOperation without error using callback', async () => { + const client = new firewallactivationModule.v1.FirewallActivationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.CancelOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.cancelOperation = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.operationsClient.cancelOperation( + request, + undefined, + ( + err?: Error | null, + result?: protos.google.protobuf.Empty | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }).catch(err => {throw err}); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.operationsClient.cancelOperation as SinonStub) + .getCall(0)); + }); + it('invokes cancelOperation with error', async () => { + const client = new firewallactivationModule.v1.FirewallActivationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.CancelOperationRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.cancelOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(async () => {await client.cancelOperation(request)}, expectedError); + assert((client.operationsClient.cancelOperation as SinonStub) + .getCall(0).calledWith(request)); + }); + }); + describe('deleteOperation', () => { + it('invokes deleteOperation without error', async () => { + const client = new firewallactivationModule.v1.FirewallActivationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.DeleteOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.deleteOperation = stubSimpleCall(expectedResponse); + const response = await client.deleteOperation(request); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.operationsClient.deleteOperation as SinonStub) + .getCall(0).calledWith(request) + ); + }); + it('invokes deleteOperation without error using callback', async () => { + const client = new firewallactivationModule.v1.FirewallActivationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.DeleteOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.deleteOperation = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.operationsClient.deleteOperation( + request, + undefined, + ( + err?: Error | null, + result?: protos.google.protobuf.Empty | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }).catch(err => {throw err}); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.operationsClient.deleteOperation as SinonStub) + .getCall(0)); + }); + it('invokes deleteOperation with error', async () => { + const client = new firewallactivationModule.v1.FirewallActivationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.DeleteOperationRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.deleteOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(async () => {await client.deleteOperation(request)}, expectedError); + assert((client.operationsClient.deleteOperation as SinonStub) + .getCall(0).calledWith(request)); + }); + }); + describe('listOperationsAsync', () => { + it('uses async iteration with listOperations without error', async () => { + const client = new firewallactivationModule.v1.FirewallActivationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsRequest() + ); + const expectedResponse = [ + generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsResponse() + ), + generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsResponse() + ), + generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsResponse() + ), + ]; + client.operationsClient.descriptor.listOperations.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: operationsProtos.google.longrunning.IOperation[] = []; + const iterable = client.operationsClient.listOperationsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.operationsClient.descriptor.listOperations.asyncIterate as SinonStub) + .getCall(0).args[1], request); + }); + it('uses async iteration with listOperations with error', async () => { + const client = new firewallactivationModule.v1.FirewallActivationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.descriptor.listOperations.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.operationsClient.listOperationsAsync(request); + await assert.rejects(async () => { + const responses: operationsProtos.google.longrunning.IOperation[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.operationsClient.descriptor.listOperations.asyncIterate as SinonStub) + .getCall(0).args[1], request); + }); + }); + + describe('Path templates', () => { + + describe('authorizationPolicy', async () => { + const fakePath = "/rendered/path/authorizationPolicy"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + authorization_policy: "authorizationPolicyValue", + }; + const client = new firewallactivationModule.v1.FirewallActivationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.authorizationPolicyPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.authorizationPolicyPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('authorizationPolicyPath', () => { + const result = client.authorizationPolicyPath("projectValue", "locationValue", "authorizationPolicyValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.authorizationPolicyPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromAuthorizationPolicyName', () => { + const result = client.matchProjectFromAuthorizationPolicyName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.authorizationPolicyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromAuthorizationPolicyName', () => { + const result = client.matchLocationFromAuthorizationPolicyName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.authorizationPolicyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchAuthorizationPolicyFromAuthorizationPolicyName', () => { + const result = client.matchAuthorizationPolicyFromAuthorizationPolicyName(fakePath); + assert.strictEqual(result, "authorizationPolicyValue"); + assert((client.pathTemplates.authorizationPolicyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('authzPolicy', async () => { + const fakePath = "/rendered/path/authzPolicy"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + authz_policy: "authzPolicyValue", + }; + const client = new firewallactivationModule.v1.FirewallActivationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.authzPolicyPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.authzPolicyPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('authzPolicyPath', () => { + const result = client.authzPolicyPath("projectValue", "locationValue", "authzPolicyValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.authzPolicyPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromAuthzPolicyName', () => { + const result = client.matchProjectFromAuthzPolicyName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.authzPolicyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromAuthzPolicyName', () => { + const result = client.matchLocationFromAuthzPolicyName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.authzPolicyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchAuthzPolicyFromAuthzPolicyName', () => { + const result = client.matchAuthzPolicyFromAuthzPolicyName(fakePath); + assert.strictEqual(result, "authzPolicyValue"); + assert((client.pathTemplates.authzPolicyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('backendAuthenticationConfig', async () => { + const fakePath = "/rendered/path/backendAuthenticationConfig"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + backend_authentication_config: "backendAuthenticationConfigValue", + }; + const client = new firewallactivationModule.v1.FirewallActivationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.backendAuthenticationConfigPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.backendAuthenticationConfigPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('backendAuthenticationConfigPath', () => { + const result = client.backendAuthenticationConfigPath("projectValue", "locationValue", "backendAuthenticationConfigValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.backendAuthenticationConfigPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromBackendAuthenticationConfigName', () => { + const result = client.matchProjectFromBackendAuthenticationConfigName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.backendAuthenticationConfigPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromBackendAuthenticationConfigName', () => { + const result = client.matchLocationFromBackendAuthenticationConfigName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.backendAuthenticationConfigPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchBackendAuthenticationConfigFromBackendAuthenticationConfigName', () => { + const result = client.matchBackendAuthenticationConfigFromBackendAuthenticationConfigName(fakePath); + assert.strictEqual(result, "backendAuthenticationConfigValue"); + assert((client.pathTemplates.backendAuthenticationConfigPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('clientTlsPolicy', async () => { + const fakePath = "/rendered/path/clientTlsPolicy"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + client_tls_policy: "clientTlsPolicyValue", + }; + const client = new firewallactivationModule.v1.FirewallActivationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.clientTlsPolicyPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.clientTlsPolicyPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('clientTlsPolicyPath', () => { + const result = client.clientTlsPolicyPath("projectValue", "locationValue", "clientTlsPolicyValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.clientTlsPolicyPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromClientTlsPolicyName', () => { + const result = client.matchProjectFromClientTlsPolicyName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.clientTlsPolicyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromClientTlsPolicyName', () => { + const result = client.matchLocationFromClientTlsPolicyName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.clientTlsPolicyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchClientTlsPolicyFromClientTlsPolicyName', () => { + const result = client.matchClientTlsPolicyFromClientTlsPolicyName(fakePath); + assert.strictEqual(result, "clientTlsPolicyValue"); + assert((client.pathTemplates.clientTlsPolicyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('dnsThreatDetector', async () => { + const fakePath = "/rendered/path/dnsThreatDetector"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + dns_threat_detector: "dnsThreatDetectorValue", + }; + const client = new firewallactivationModule.v1.FirewallActivationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.dnsThreatDetectorPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.dnsThreatDetectorPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('dnsThreatDetectorPath', () => { + const result = client.dnsThreatDetectorPath("projectValue", "locationValue", "dnsThreatDetectorValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.dnsThreatDetectorPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromDnsThreatDetectorName', () => { + const result = client.matchProjectFromDnsThreatDetectorName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.dnsThreatDetectorPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromDnsThreatDetectorName', () => { + const result = client.matchLocationFromDnsThreatDetectorName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.dnsThreatDetectorPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDnsThreatDetectorFromDnsThreatDetectorName', () => { + const result = client.matchDnsThreatDetectorFromDnsThreatDetectorName(fakePath); + assert.strictEqual(result, "dnsThreatDetectorValue"); + assert((client.pathTemplates.dnsThreatDetectorPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('firewallEndpointAssociation', async () => { + const fakePath = "/rendered/path/firewallEndpointAssociation"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + firewall_endpoint_association: "firewallEndpointAssociationValue", + }; + const client = new firewallactivationModule.v1.FirewallActivationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.firewallEndpointAssociationPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.firewallEndpointAssociationPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('firewallEndpointAssociationPath', () => { + const result = client.firewallEndpointAssociationPath("projectValue", "locationValue", "firewallEndpointAssociationValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.firewallEndpointAssociationPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromFirewallEndpointAssociationName', () => { + const result = client.matchProjectFromFirewallEndpointAssociationName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.firewallEndpointAssociationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromFirewallEndpointAssociationName', () => { + const result = client.matchLocationFromFirewallEndpointAssociationName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.firewallEndpointAssociationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchFirewallEndpointAssociationFromFirewallEndpointAssociationName', () => { + const result = client.matchFirewallEndpointAssociationFromFirewallEndpointAssociationName(fakePath); + assert.strictEqual(result, "firewallEndpointAssociationValue"); + assert((client.pathTemplates.firewallEndpointAssociationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('gatewaySecurityPolicy', async () => { + const fakePath = "/rendered/path/gatewaySecurityPolicy"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + gateway_security_policy: "gatewaySecurityPolicyValue", + }; + const client = new firewallactivationModule.v1.FirewallActivationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.gatewaySecurityPolicyPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.gatewaySecurityPolicyPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('gatewaySecurityPolicyPath', () => { + const result = client.gatewaySecurityPolicyPath("projectValue", "locationValue", "gatewaySecurityPolicyValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.gatewaySecurityPolicyPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromGatewaySecurityPolicyName', () => { + const result = client.matchProjectFromGatewaySecurityPolicyName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.gatewaySecurityPolicyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromGatewaySecurityPolicyName', () => { + const result = client.matchLocationFromGatewaySecurityPolicyName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.gatewaySecurityPolicyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchGatewaySecurityPolicyFromGatewaySecurityPolicyName', () => { + const result = client.matchGatewaySecurityPolicyFromGatewaySecurityPolicyName(fakePath); + assert.strictEqual(result, "gatewaySecurityPolicyValue"); + assert((client.pathTemplates.gatewaySecurityPolicyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('gatewaySecurityPolicyRule', async () => { + const fakePath = "/rendered/path/gatewaySecurityPolicyRule"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + gateway_security_policy: "gatewaySecurityPolicyValue", + rule: "ruleValue", + }; + const client = new firewallactivationModule.v1.FirewallActivationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.gatewaySecurityPolicyRulePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.gatewaySecurityPolicyRulePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('gatewaySecurityPolicyRulePath', () => { + const result = client.gatewaySecurityPolicyRulePath("projectValue", "locationValue", "gatewaySecurityPolicyValue", "ruleValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.gatewaySecurityPolicyRulePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromGatewaySecurityPolicyRuleName', () => { + const result = client.matchProjectFromGatewaySecurityPolicyRuleName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.gatewaySecurityPolicyRulePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromGatewaySecurityPolicyRuleName', () => { + const result = client.matchLocationFromGatewaySecurityPolicyRuleName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.gatewaySecurityPolicyRulePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchGatewaySecurityPolicyFromGatewaySecurityPolicyRuleName', () => { + const result = client.matchGatewaySecurityPolicyFromGatewaySecurityPolicyRuleName(fakePath); + assert.strictEqual(result, "gatewaySecurityPolicyValue"); + assert((client.pathTemplates.gatewaySecurityPolicyRulePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchRuleFromGatewaySecurityPolicyRuleName', () => { + const result = client.matchRuleFromGatewaySecurityPolicyRuleName(fakePath); + assert.strictEqual(result, "ruleValue"); + assert((client.pathTemplates.gatewaySecurityPolicyRulePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('interceptDeployment', async () => { + const fakePath = "/rendered/path/interceptDeployment"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + intercept_deployment: "interceptDeploymentValue", + }; + const client = new firewallactivationModule.v1.FirewallActivationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.interceptDeploymentPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.interceptDeploymentPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('interceptDeploymentPath', () => { + const result = client.interceptDeploymentPath("projectValue", "locationValue", "interceptDeploymentValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.interceptDeploymentPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromInterceptDeploymentName', () => { + const result = client.matchProjectFromInterceptDeploymentName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.interceptDeploymentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromInterceptDeploymentName', () => { + const result = client.matchLocationFromInterceptDeploymentName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.interceptDeploymentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchInterceptDeploymentFromInterceptDeploymentName', () => { + const result = client.matchInterceptDeploymentFromInterceptDeploymentName(fakePath); + assert.strictEqual(result, "interceptDeploymentValue"); + assert((client.pathTemplates.interceptDeploymentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('interceptDeploymentGroup', async () => { + const fakePath = "/rendered/path/interceptDeploymentGroup"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + intercept_deployment_group: "interceptDeploymentGroupValue", + }; + const client = new firewallactivationModule.v1.FirewallActivationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.interceptDeploymentGroupPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.interceptDeploymentGroupPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('interceptDeploymentGroupPath', () => { + const result = client.interceptDeploymentGroupPath("projectValue", "locationValue", "interceptDeploymentGroupValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.interceptDeploymentGroupPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromInterceptDeploymentGroupName', () => { + const result = client.matchProjectFromInterceptDeploymentGroupName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.interceptDeploymentGroupPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromInterceptDeploymentGroupName', () => { + const result = client.matchLocationFromInterceptDeploymentGroupName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.interceptDeploymentGroupPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchInterceptDeploymentGroupFromInterceptDeploymentGroupName', () => { + const result = client.matchInterceptDeploymentGroupFromInterceptDeploymentGroupName(fakePath); + assert.strictEqual(result, "interceptDeploymentGroupValue"); + assert((client.pathTemplates.interceptDeploymentGroupPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('interceptEndpointGroup', async () => { + const fakePath = "/rendered/path/interceptEndpointGroup"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + intercept_endpoint_group: "interceptEndpointGroupValue", + }; + const client = new firewallactivationModule.v1.FirewallActivationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.interceptEndpointGroupPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.interceptEndpointGroupPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('interceptEndpointGroupPath', () => { + const result = client.interceptEndpointGroupPath("projectValue", "locationValue", "interceptEndpointGroupValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.interceptEndpointGroupPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromInterceptEndpointGroupName', () => { + const result = client.matchProjectFromInterceptEndpointGroupName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.interceptEndpointGroupPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromInterceptEndpointGroupName', () => { + const result = client.matchLocationFromInterceptEndpointGroupName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.interceptEndpointGroupPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchInterceptEndpointGroupFromInterceptEndpointGroupName', () => { + const result = client.matchInterceptEndpointGroupFromInterceptEndpointGroupName(fakePath); + assert.strictEqual(result, "interceptEndpointGroupValue"); + assert((client.pathTemplates.interceptEndpointGroupPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('interceptEndpointGroupAssociation', async () => { + const fakePath = "/rendered/path/interceptEndpointGroupAssociation"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + intercept_endpoint_group_association: "interceptEndpointGroupAssociationValue", + }; + const client = new firewallactivationModule.v1.FirewallActivationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.interceptEndpointGroupAssociationPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.interceptEndpointGroupAssociationPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('interceptEndpointGroupAssociationPath', () => { + const result = client.interceptEndpointGroupAssociationPath("projectValue", "locationValue", "interceptEndpointGroupAssociationValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.interceptEndpointGroupAssociationPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromInterceptEndpointGroupAssociationName', () => { + const result = client.matchProjectFromInterceptEndpointGroupAssociationName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.interceptEndpointGroupAssociationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromInterceptEndpointGroupAssociationName', () => { + const result = client.matchLocationFromInterceptEndpointGroupAssociationName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.interceptEndpointGroupAssociationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchInterceptEndpointGroupAssociationFromInterceptEndpointGroupAssociationName', () => { + const result = client.matchInterceptEndpointGroupAssociationFromInterceptEndpointGroupAssociationName(fakePath); + assert.strictEqual(result, "interceptEndpointGroupAssociationValue"); + assert((client.pathTemplates.interceptEndpointGroupAssociationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('location', async () => { + const fakePath = "/rendered/path/location"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + }; + const client = new firewallactivationModule.v1.FirewallActivationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.locationPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.locationPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('locationPath', () => { + const result = client.locationPath("projectValue", "locationValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.locationPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromLocationName', () => { + const result = client.matchProjectFromLocationName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.locationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromLocationName', () => { + const result = client.matchLocationFromLocationName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.locationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('mirroringDeployment', async () => { + const fakePath = "/rendered/path/mirroringDeployment"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + mirroring_deployment: "mirroringDeploymentValue", + }; + const client = new firewallactivationModule.v1.FirewallActivationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.mirroringDeploymentPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.mirroringDeploymentPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('mirroringDeploymentPath', () => { + const result = client.mirroringDeploymentPath("projectValue", "locationValue", "mirroringDeploymentValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.mirroringDeploymentPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromMirroringDeploymentName', () => { + const result = client.matchProjectFromMirroringDeploymentName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.mirroringDeploymentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromMirroringDeploymentName', () => { + const result = client.matchLocationFromMirroringDeploymentName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.mirroringDeploymentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchMirroringDeploymentFromMirroringDeploymentName', () => { + const result = client.matchMirroringDeploymentFromMirroringDeploymentName(fakePath); + assert.strictEqual(result, "mirroringDeploymentValue"); + assert((client.pathTemplates.mirroringDeploymentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('mirroringDeploymentGroup', async () => { + const fakePath = "/rendered/path/mirroringDeploymentGroup"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + mirroring_deployment_group: "mirroringDeploymentGroupValue", + }; + const client = new firewallactivationModule.v1.FirewallActivationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.mirroringDeploymentGroupPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.mirroringDeploymentGroupPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('mirroringDeploymentGroupPath', () => { + const result = client.mirroringDeploymentGroupPath("projectValue", "locationValue", "mirroringDeploymentGroupValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.mirroringDeploymentGroupPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromMirroringDeploymentGroupName', () => { + const result = client.matchProjectFromMirroringDeploymentGroupName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.mirroringDeploymentGroupPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromMirroringDeploymentGroupName', () => { + const result = client.matchLocationFromMirroringDeploymentGroupName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.mirroringDeploymentGroupPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchMirroringDeploymentGroupFromMirroringDeploymentGroupName', () => { + const result = client.matchMirroringDeploymentGroupFromMirroringDeploymentGroupName(fakePath); + assert.strictEqual(result, "mirroringDeploymentGroupValue"); + assert((client.pathTemplates.mirroringDeploymentGroupPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('mirroringEndpointGroup', async () => { + const fakePath = "/rendered/path/mirroringEndpointGroup"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + mirroring_endpoint_group: "mirroringEndpointGroupValue", + }; + const client = new firewallactivationModule.v1.FirewallActivationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.mirroringEndpointGroupPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.mirroringEndpointGroupPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('mirroringEndpointGroupPath', () => { + const result = client.mirroringEndpointGroupPath("projectValue", "locationValue", "mirroringEndpointGroupValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.mirroringEndpointGroupPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromMirroringEndpointGroupName', () => { + const result = client.matchProjectFromMirroringEndpointGroupName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.mirroringEndpointGroupPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromMirroringEndpointGroupName', () => { + const result = client.matchLocationFromMirroringEndpointGroupName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.mirroringEndpointGroupPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchMirroringEndpointGroupFromMirroringEndpointGroupName', () => { + const result = client.matchMirroringEndpointGroupFromMirroringEndpointGroupName(fakePath); + assert.strictEqual(result, "mirroringEndpointGroupValue"); + assert((client.pathTemplates.mirroringEndpointGroupPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('mirroringEndpointGroupAssociation', async () => { + const fakePath = "/rendered/path/mirroringEndpointGroupAssociation"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + mirroring_endpoint_group_association: "mirroringEndpointGroupAssociationValue", + }; + const client = new firewallactivationModule.v1.FirewallActivationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.mirroringEndpointGroupAssociationPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.mirroringEndpointGroupAssociationPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('mirroringEndpointGroupAssociationPath', () => { + const result = client.mirroringEndpointGroupAssociationPath("projectValue", "locationValue", "mirroringEndpointGroupAssociationValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.mirroringEndpointGroupAssociationPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromMirroringEndpointGroupAssociationName', () => { + const result = client.matchProjectFromMirroringEndpointGroupAssociationName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.mirroringEndpointGroupAssociationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromMirroringEndpointGroupAssociationName', () => { + const result = client.matchLocationFromMirroringEndpointGroupAssociationName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.mirroringEndpointGroupAssociationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchMirroringEndpointGroupAssociationFromMirroringEndpointGroupAssociationName', () => { + const result = client.matchMirroringEndpointGroupAssociationFromMirroringEndpointGroupAssociationName(fakePath); + assert.strictEqual(result, "mirroringEndpointGroupAssociationValue"); + assert((client.pathTemplates.mirroringEndpointGroupAssociationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('organization', async () => { + const fakePath = "/rendered/path/organization"; + const expectedParameters = { + organization: "organizationValue", + }; + const client = new firewallactivationModule.v1.FirewallActivationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.organizationPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.organizationPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('organizationPath', () => { + const result = client.organizationPath("organizationValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.organizationPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchOrganizationFromOrganizationName', () => { + const result = client.matchOrganizationFromOrganizationName(fakePath); + assert.strictEqual(result, "organizationValue"); + assert((client.pathTemplates.organizationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('organizationLocation', async () => { + const fakePath = "/rendered/path/organizationLocation"; + const expectedParameters = { + organization: "organizationValue", + location: "locationValue", + }; + const client = new firewallactivationModule.v1.FirewallActivationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.organizationLocationPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.organizationLocationPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('organizationLocationPath', () => { + const result = client.organizationLocationPath("organizationValue", "locationValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.organizationLocationPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchOrganizationFromOrganizationLocationName', () => { + const result = client.matchOrganizationFromOrganizationLocationName(fakePath); + assert.strictEqual(result, "organizationValue"); + assert((client.pathTemplates.organizationLocationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromOrganizationLocationName', () => { + const result = client.matchLocationFromOrganizationLocationName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.organizationLocationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('organizationLocationAddressGroup', async () => { + const fakePath = "/rendered/path/organizationLocationAddressGroup"; + const expectedParameters = { + organization: "organizationValue", + location: "locationValue", + address_group: "addressGroupValue", + }; + const client = new firewallactivationModule.v1.FirewallActivationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.organizationLocationAddressGroupPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.organizationLocationAddressGroupPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('organizationLocationAddressGroupPath', () => { + const result = client.organizationLocationAddressGroupPath("organizationValue", "locationValue", "addressGroupValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.organizationLocationAddressGroupPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchOrganizationFromOrganizationLocationAddressGroupName', () => { + const result = client.matchOrganizationFromOrganizationLocationAddressGroupName(fakePath); + assert.strictEqual(result, "organizationValue"); + assert((client.pathTemplates.organizationLocationAddressGroupPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromOrganizationLocationAddressGroupName', () => { + const result = client.matchLocationFromOrganizationLocationAddressGroupName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.organizationLocationAddressGroupPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchAddressGroupFromOrganizationLocationAddressGroupName', () => { + const result = client.matchAddressGroupFromOrganizationLocationAddressGroupName(fakePath); + assert.strictEqual(result, "addressGroupValue"); + assert((client.pathTemplates.organizationLocationAddressGroupPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('organizationLocationFirewallEndpoints', async () => { + const fakePath = "/rendered/path/organizationLocationFirewallEndpoints"; + const expectedParameters = { + organization: "organizationValue", + location: "locationValue", + firewall_endpoint: "firewallEndpointValue", + }; + const client = new firewallactivationModule.v1.FirewallActivationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.organizationLocationFirewallEndpointsPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.organizationLocationFirewallEndpointsPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('organizationLocationFirewallEndpointsPath', () => { + const result = client.organizationLocationFirewallEndpointsPath("organizationValue", "locationValue", "firewallEndpointValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.organizationLocationFirewallEndpointsPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchOrganizationFromOrganizationLocationFirewallEndpointsName', () => { + const result = client.matchOrganizationFromOrganizationLocationFirewallEndpointsName(fakePath); + assert.strictEqual(result, "organizationValue"); + assert((client.pathTemplates.organizationLocationFirewallEndpointsPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromOrganizationLocationFirewallEndpointsName', () => { + const result = client.matchLocationFromOrganizationLocationFirewallEndpointsName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.organizationLocationFirewallEndpointsPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchFirewallEndpointFromOrganizationLocationFirewallEndpointsName', () => { + const result = client.matchFirewallEndpointFromOrganizationLocationFirewallEndpointsName(fakePath); + assert.strictEqual(result, "firewallEndpointValue"); + assert((client.pathTemplates.organizationLocationFirewallEndpointsPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('organizationLocationSecurityProfile', async () => { + const fakePath = "/rendered/path/organizationLocationSecurityProfile"; + const expectedParameters = { + organization: "organizationValue", + location: "locationValue", + security_profile: "securityProfileValue", + }; + const client = new firewallactivationModule.v1.FirewallActivationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.organizationLocationSecurityProfilePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.organizationLocationSecurityProfilePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('organizationLocationSecurityProfilePath', () => { + const result = client.organizationLocationSecurityProfilePath("organizationValue", "locationValue", "securityProfileValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.organizationLocationSecurityProfilePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchOrganizationFromOrganizationLocationSecurityProfileName', () => { + const result = client.matchOrganizationFromOrganizationLocationSecurityProfileName(fakePath); + assert.strictEqual(result, "organizationValue"); + assert((client.pathTemplates.organizationLocationSecurityProfilePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromOrganizationLocationSecurityProfileName', () => { + const result = client.matchLocationFromOrganizationLocationSecurityProfileName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.organizationLocationSecurityProfilePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchSecurityProfileFromOrganizationLocationSecurityProfileName', () => { + const result = client.matchSecurityProfileFromOrganizationLocationSecurityProfileName(fakePath); + assert.strictEqual(result, "securityProfileValue"); + assert((client.pathTemplates.organizationLocationSecurityProfilePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('organizationLocationSecurityProfileGroup', async () => { + const fakePath = "/rendered/path/organizationLocationSecurityProfileGroup"; + const expectedParameters = { + organization: "organizationValue", + location: "locationValue", + security_profile_group: "securityProfileGroupValue", + }; + const client = new firewallactivationModule.v1.FirewallActivationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.organizationLocationSecurityProfileGroupPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.organizationLocationSecurityProfileGroupPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('organizationLocationSecurityProfileGroupPath', () => { + const result = client.organizationLocationSecurityProfileGroupPath("organizationValue", "locationValue", "securityProfileGroupValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.organizationLocationSecurityProfileGroupPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchOrganizationFromOrganizationLocationSecurityProfileGroupName', () => { + const result = client.matchOrganizationFromOrganizationLocationSecurityProfileGroupName(fakePath); + assert.strictEqual(result, "organizationValue"); + assert((client.pathTemplates.organizationLocationSecurityProfileGroupPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromOrganizationLocationSecurityProfileGroupName', () => { + const result = client.matchLocationFromOrganizationLocationSecurityProfileGroupName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.organizationLocationSecurityProfileGroupPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchSecurityProfileGroupFromOrganizationLocationSecurityProfileGroupName', () => { + const result = client.matchSecurityProfileGroupFromOrganizationLocationSecurityProfileGroupName(fakePath); + assert.strictEqual(result, "securityProfileGroupValue"); + assert((client.pathTemplates.organizationLocationSecurityProfileGroupPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('project', async () => { + const fakePath = "/rendered/path/project"; + const expectedParameters = { + project: "projectValue", + }; + const client = new firewallactivationModule.v1.FirewallActivationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectPath', () => { + const result = client.projectPath("projectValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.projectPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromProjectName', () => { + const result = client.matchProjectFromProjectName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.projectPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('projectLocationAddressGroup', async () => { + const fakePath = "/rendered/path/projectLocationAddressGroup"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + address_group: "addressGroupValue", + }; + const client = new firewallactivationModule.v1.FirewallActivationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectLocationAddressGroupPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationAddressGroupPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationAddressGroupPath', () => { + const result = client.projectLocationAddressGroupPath("projectValue", "locationValue", "addressGroupValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.projectLocationAddressGroupPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromProjectLocationAddressGroupName', () => { + const result = client.matchProjectFromProjectLocationAddressGroupName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.projectLocationAddressGroupPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromProjectLocationAddressGroupName', () => { + const result = client.matchLocationFromProjectLocationAddressGroupName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.projectLocationAddressGroupPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchAddressGroupFromProjectLocationAddressGroupName', () => { + const result = client.matchAddressGroupFromProjectLocationAddressGroupName(fakePath); + assert.strictEqual(result, "addressGroupValue"); + assert((client.pathTemplates.projectLocationAddressGroupPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('projectLocationFirewallEndpoints', async () => { + const fakePath = "/rendered/path/projectLocationFirewallEndpoints"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + firewall_endpoint: "firewallEndpointValue", + }; + const client = new firewallactivationModule.v1.FirewallActivationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectLocationFirewallEndpointsPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationFirewallEndpointsPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationFirewallEndpointsPath', () => { + const result = client.projectLocationFirewallEndpointsPath("projectValue", "locationValue", "firewallEndpointValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.projectLocationFirewallEndpointsPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromProjectLocationFirewallEndpointsName', () => { + const result = client.matchProjectFromProjectLocationFirewallEndpointsName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.projectLocationFirewallEndpointsPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromProjectLocationFirewallEndpointsName', () => { + const result = client.matchLocationFromProjectLocationFirewallEndpointsName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.projectLocationFirewallEndpointsPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchFirewallEndpointFromProjectLocationFirewallEndpointsName', () => { + const result = client.matchFirewallEndpointFromProjectLocationFirewallEndpointsName(fakePath); + assert.strictEqual(result, "firewallEndpointValue"); + assert((client.pathTemplates.projectLocationFirewallEndpointsPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('projectLocationSecurityProfile', async () => { + const fakePath = "/rendered/path/projectLocationSecurityProfile"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + security_profile: "securityProfileValue", + }; + const client = new firewallactivationModule.v1.FirewallActivationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectLocationSecurityProfilePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationSecurityProfilePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationSecurityProfilePath', () => { + const result = client.projectLocationSecurityProfilePath("projectValue", "locationValue", "securityProfileValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.projectLocationSecurityProfilePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromProjectLocationSecurityProfileName', () => { + const result = client.matchProjectFromProjectLocationSecurityProfileName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.projectLocationSecurityProfilePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromProjectLocationSecurityProfileName', () => { + const result = client.matchLocationFromProjectLocationSecurityProfileName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.projectLocationSecurityProfilePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchSecurityProfileFromProjectLocationSecurityProfileName', () => { + const result = client.matchSecurityProfileFromProjectLocationSecurityProfileName(fakePath); + assert.strictEqual(result, "securityProfileValue"); + assert((client.pathTemplates.projectLocationSecurityProfilePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('projectLocationSecurityProfileGroup', async () => { + const fakePath = "/rendered/path/projectLocationSecurityProfileGroup"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + security_profile_group: "securityProfileGroupValue", + }; + const client = new firewallactivationModule.v1.FirewallActivationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectLocationSecurityProfileGroupPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationSecurityProfileGroupPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationSecurityProfileGroupPath', () => { + const result = client.projectLocationSecurityProfileGroupPath("projectValue", "locationValue", "securityProfileGroupValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.projectLocationSecurityProfileGroupPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromProjectLocationSecurityProfileGroupName', () => { + const result = client.matchProjectFromProjectLocationSecurityProfileGroupName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.projectLocationSecurityProfileGroupPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromProjectLocationSecurityProfileGroupName', () => { + const result = client.matchLocationFromProjectLocationSecurityProfileGroupName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.projectLocationSecurityProfileGroupPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchSecurityProfileGroupFromProjectLocationSecurityProfileGroupName', () => { + const result = client.matchSecurityProfileGroupFromProjectLocationSecurityProfileGroupName(fakePath); + assert.strictEqual(result, "securityProfileGroupValue"); + assert((client.pathTemplates.projectLocationSecurityProfileGroupPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('serverTlsPolicy', async () => { + const fakePath = "/rendered/path/serverTlsPolicy"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + server_tls_policy: "serverTlsPolicyValue", + }; + const client = new firewallactivationModule.v1.FirewallActivationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.serverTlsPolicyPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.serverTlsPolicyPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('serverTlsPolicyPath', () => { + const result = client.serverTlsPolicyPath("projectValue", "locationValue", "serverTlsPolicyValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.serverTlsPolicyPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromServerTlsPolicyName', () => { + const result = client.matchProjectFromServerTlsPolicyName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.serverTlsPolicyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromServerTlsPolicyName', () => { + const result = client.matchLocationFromServerTlsPolicyName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.serverTlsPolicyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchServerTlsPolicyFromServerTlsPolicyName', () => { + const result = client.matchServerTlsPolicyFromServerTlsPolicyName(fakePath); + assert.strictEqual(result, "serverTlsPolicyValue"); + assert((client.pathTemplates.serverTlsPolicyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('tlsInspectionPolicy', async () => { + const fakePath = "/rendered/path/tlsInspectionPolicy"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + tls_inspection_policy: "tlsInspectionPolicyValue", + }; + const client = new firewallactivationModule.v1.FirewallActivationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.tlsInspectionPolicyPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.tlsInspectionPolicyPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('tlsInspectionPolicyPath', () => { + const result = client.tlsInspectionPolicyPath("projectValue", "locationValue", "tlsInspectionPolicyValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.tlsInspectionPolicyPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromTlsInspectionPolicyName', () => { + const result = client.matchProjectFromTlsInspectionPolicyName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.tlsInspectionPolicyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromTlsInspectionPolicyName', () => { + const result = client.matchLocationFromTlsInspectionPolicyName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.tlsInspectionPolicyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchTlsInspectionPolicyFromTlsInspectionPolicyName', () => { + const result = client.matchTlsInspectionPolicyFromTlsInspectionPolicyName(fakePath); + assert.strictEqual(result, "tlsInspectionPolicyValue"); + assert((client.pathTemplates.tlsInspectionPolicyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('urlList', async () => { + const fakePath = "/rendered/path/urlList"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + url_list: "urlListValue", + }; + const client = new firewallactivationModule.v1.FirewallActivationClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.urlListPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.urlListPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('urlListPath', () => { + const result = client.urlListPath("projectValue", "locationValue", "urlListValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.urlListPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromUrlListName', () => { + const result = client.matchProjectFromUrlListName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.urlListPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromUrlListName', () => { + const result = client.matchLocationFromUrlListName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.urlListPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchUrlListFromUrlListName', () => { + const result = client.matchUrlListFromUrlListName(fakePath); + assert.strictEqual(result, "urlListValue"); + assert((client.pathTemplates.urlListPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + }); +}); diff --git a/packages/google-cloud-networksecurity/test/gapic_intercept_v1.ts b/packages/google-cloud-networksecurity/test/gapic_intercept_v1.ts new file mode 100644 index 00000000000..f8c84bca154 --- /dev/null +++ b/packages/google-cloud-networksecurity/test/gapic_intercept_v1.ts @@ -0,0 +1,5647 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import * as protos from '../protos/protos'; +import * as assert from 'assert'; +import * as sinon from 'sinon'; +import {SinonStub} from 'sinon'; +import {describe, it} from 'mocha'; +import * as interceptModule from '../src'; + +import {PassThrough} from 'stream'; + +import {protobuf, LROperation, operationsProtos, IamProtos, LocationProtos} from 'google-gax'; + +// Dynamically loaded proto JSON is needed to get the type information +// to fill in default values for request objects +const root = protobuf.Root.fromJSON(require('../protos/protos.json')).resolveAll(); + +// eslint-disable-next-line @typescript-eslint/no-unused-vars +function getTypeDefaultValue(typeName: string, fields: string[]) { + let type = root.lookupType(typeName) as protobuf.Type; + for (const field of fields.slice(0, -1)) { + type = type.fields[field]?.resolvedType as protobuf.Type; + } + return type.fields[fields[fields.length - 1]]?.defaultValue; +} + +function generateSampleMessage(instance: T) { + const filledObject = (instance.constructor as typeof protobuf.Message) + .toObject(instance as protobuf.Message, {defaults: true}); + return (instance.constructor as typeof protobuf.Message).fromObject(filledObject) as T; +} + +function stubSimpleCall(response?: ResponseType, error?: Error) { + return error ? sinon.stub().rejects(error) : sinon.stub().resolves([response]); +} + +function stubSimpleCallWithCallback(response?: ResponseType, error?: Error) { + return error ? sinon.stub().callsArgWith(2, error) : sinon.stub().callsArgWith(2, null, response); +} + +function stubLongRunningCall(response?: ResponseType, callError?: Error, lroError?: Error) { + const innerStub = lroError ? sinon.stub().rejects(lroError) : sinon.stub().resolves([response]); + const mockOperation = { + promise: innerStub, + }; + return callError ? sinon.stub().rejects(callError) : sinon.stub().resolves([mockOperation]); +} + +function stubLongRunningCallWithCallback(response?: ResponseType, callError?: Error, lroError?: Error) { + const innerStub = lroError ? sinon.stub().rejects(lroError) : sinon.stub().resolves([response]); + const mockOperation = { + promise: innerStub, + }; + return callError ? sinon.stub().callsArgWith(2, callError) : sinon.stub().callsArgWith(2, null, mockOperation); +} + +function stubPageStreamingCall(responses?: ResponseType[], error?: Error) { + const pagingStub = sinon.stub(); + if (responses) { + for (let i = 0; i < responses.length; ++i) { + pagingStub.onCall(i).callsArgWith(2, null, responses[i]); + } + } + const transformStub = error ? sinon.stub().callsArgWith(2, error) : pagingStub; + const mockStream = new PassThrough({ + objectMode: true, + transform: transformStub, + }); + // trigger as many responses as needed + if (responses) { + for (let i = 0; i < responses.length; ++i) { + setImmediate(() => { mockStream.write({}); }); + } + setImmediate(() => { mockStream.end(); }); + } else { + setImmediate(() => { mockStream.write({}); }); + setImmediate(() => { mockStream.end(); }); + } + return sinon.stub().returns(mockStream); +} + +function stubAsyncIterationCall(responses?: ResponseType[], error?: Error) { + let counter = 0; + const asyncIterable = { + [Symbol.asyncIterator]() { + return { + async next() { + if (error) { + return Promise.reject(error); + } + if (counter >= responses!.length) { + return Promise.resolve({done: true, value: undefined}); + } + return Promise.resolve({done: false, value: responses![counter++]}); + } + }; + } + }; + return sinon.stub().returns(asyncIterable); +} + +describe('v1.InterceptClient', () => { + describe('Common methods', () => { + it('has apiEndpoint', () => { + const client = new interceptModule.v1.InterceptClient(); + const apiEndpoint = client.apiEndpoint; + assert.strictEqual(apiEndpoint, 'networksecurity.googleapis.com'); + }); + + it('has universeDomain', () => { + const client = new interceptModule.v1.InterceptClient(); + const universeDomain = client.universeDomain; + assert.strictEqual(universeDomain, "googleapis.com"); + }); + + if (typeof process === 'object' && typeof process.emitWarning === 'function') { + it('throws DeprecationWarning if static servicePath is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const servicePath = interceptModule.v1.InterceptClient.servicePath; + assert.strictEqual(servicePath, 'networksecurity.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + + it('throws DeprecationWarning if static apiEndpoint is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const apiEndpoint = interceptModule.v1.InterceptClient.apiEndpoint; + assert.strictEqual(apiEndpoint, 'networksecurity.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + } + it('sets apiEndpoint according to universe domain camelCase', () => { + const client = new interceptModule.v1.InterceptClient({universeDomain: 'example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'networksecurity.example.com'); + }); + + it('sets apiEndpoint according to universe domain snakeCase', () => { + const client = new interceptModule.v1.InterceptClient({universe_domain: 'example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'networksecurity.example.com'); + }); + + if (typeof process === 'object' && 'env' in process) { + describe('GOOGLE_CLOUD_UNIVERSE_DOMAIN environment variable', () => { + it('sets apiEndpoint from environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = new interceptModule.v1.InterceptClient(); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'networksecurity.example.com'); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + + it('value configured in code has priority over environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = new interceptModule.v1.InterceptClient({universeDomain: 'configured.example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'networksecurity.configured.example.com'); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + }); + } + it('does not allow setting both universeDomain and universe_domain', () => { + assert.throws(() => { new interceptModule.v1.InterceptClient({universe_domain: 'example.com', universeDomain: 'example.net'}); }); + }); + + it('has port', () => { + const port = interceptModule.v1.InterceptClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new interceptModule.v1.InterceptClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new interceptModule.v1.InterceptClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new interceptModule.v1.InterceptClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.interceptStub, undefined); + await client.initialize(); + assert(client.interceptStub); + }); + + it('has close method for the initialized client', done => { + const client = new interceptModule.v1.InterceptClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize().catch(err => {throw err}); + assert(client.interceptStub); + client.close().then(() => { + done(); + }).catch(err => {throw err}); + }); + + it('has close method for the non-initialized client', done => { + const client = new interceptModule.v1.InterceptClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.interceptStub, undefined); + client.close().then(() => { + done(); + }).catch(err => {throw err}); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new interceptModule.v1.InterceptClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.auth.getProjectId = sinon.stub().resolves(fakeProjectId); + const result = await client.getProjectId(); + assert.strictEqual(result, fakeProjectId); + assert((client.auth.getProjectId as SinonStub).calledWithExactly()); + }); + + it('has getProjectId method with callback', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new interceptModule.v1.InterceptClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.auth.getProjectId = sinon.stub().callsArgWith(0, null, fakeProjectId); + const promise = new Promise((resolve, reject) => { + client.getProjectId((err?: Error|null, projectId?: string|null) => { + if (err) { + reject(err); + } else { + resolve(projectId); + } + }); + }); + const result = await promise; + assert.strictEqual(result, fakeProjectId); + }); + }); + + describe('getInterceptEndpointGroup', () => { + it('invokes getInterceptEndpointGroup without error', async () => { + const client = new interceptModule.v1.InterceptClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.GetInterceptEndpointGroupRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.GetInterceptEndpointGroupRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.InterceptEndpointGroup() + ); + client.innerApiCalls.getInterceptEndpointGroup = stubSimpleCall(expectedResponse); + const [response] = await client.getInterceptEndpointGroup(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getInterceptEndpointGroup as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getInterceptEndpointGroup as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getInterceptEndpointGroup without error using callback', async () => { + const client = new interceptModule.v1.InterceptClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.GetInterceptEndpointGroupRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.GetInterceptEndpointGroupRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.InterceptEndpointGroup() + ); + client.innerApiCalls.getInterceptEndpointGroup = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getInterceptEndpointGroup( + request, + (err?: Error|null, result?: protos.google.cloud.networksecurity.v1.IInterceptEndpointGroup|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getInterceptEndpointGroup as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getInterceptEndpointGroup as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getInterceptEndpointGroup with error', async () => { + const client = new interceptModule.v1.InterceptClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.GetInterceptEndpointGroupRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.GetInterceptEndpointGroupRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.getInterceptEndpointGroup = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getInterceptEndpointGroup(request), expectedError); + const actualRequest = (client.innerApiCalls.getInterceptEndpointGroup as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getInterceptEndpointGroup as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getInterceptEndpointGroup with closed client', async () => { + const client = new interceptModule.v1.InterceptClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.GetInterceptEndpointGroupRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.GetInterceptEndpointGroupRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.getInterceptEndpointGroup(request), expectedError); + }); + }); + + describe('getInterceptEndpointGroupAssociation', () => { + it('invokes getInterceptEndpointGroupAssociation without error', async () => { + const client = new interceptModule.v1.InterceptClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.GetInterceptEndpointGroupAssociationRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.GetInterceptEndpointGroupAssociationRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.InterceptEndpointGroupAssociation() + ); + client.innerApiCalls.getInterceptEndpointGroupAssociation = stubSimpleCall(expectedResponse); + const [response] = await client.getInterceptEndpointGroupAssociation(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getInterceptEndpointGroupAssociation as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getInterceptEndpointGroupAssociation as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getInterceptEndpointGroupAssociation without error using callback', async () => { + const client = new interceptModule.v1.InterceptClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.GetInterceptEndpointGroupAssociationRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.GetInterceptEndpointGroupAssociationRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.InterceptEndpointGroupAssociation() + ); + client.innerApiCalls.getInterceptEndpointGroupAssociation = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getInterceptEndpointGroupAssociation( + request, + (err?: Error|null, result?: protos.google.cloud.networksecurity.v1.IInterceptEndpointGroupAssociation|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getInterceptEndpointGroupAssociation as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getInterceptEndpointGroupAssociation as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getInterceptEndpointGroupAssociation with error', async () => { + const client = new interceptModule.v1.InterceptClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.GetInterceptEndpointGroupAssociationRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.GetInterceptEndpointGroupAssociationRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.getInterceptEndpointGroupAssociation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getInterceptEndpointGroupAssociation(request), expectedError); + const actualRequest = (client.innerApiCalls.getInterceptEndpointGroupAssociation as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getInterceptEndpointGroupAssociation as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getInterceptEndpointGroupAssociation with closed client', async () => { + const client = new interceptModule.v1.InterceptClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.GetInterceptEndpointGroupAssociationRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.GetInterceptEndpointGroupAssociationRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.getInterceptEndpointGroupAssociation(request), expectedError); + }); + }); + + describe('getInterceptDeploymentGroup', () => { + it('invokes getInterceptDeploymentGroup without error', async () => { + const client = new interceptModule.v1.InterceptClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.GetInterceptDeploymentGroupRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.GetInterceptDeploymentGroupRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.InterceptDeploymentGroup() + ); + client.innerApiCalls.getInterceptDeploymentGroup = stubSimpleCall(expectedResponse); + const [response] = await client.getInterceptDeploymentGroup(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getInterceptDeploymentGroup as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getInterceptDeploymentGroup as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getInterceptDeploymentGroup without error using callback', async () => { + const client = new interceptModule.v1.InterceptClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.GetInterceptDeploymentGroupRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.GetInterceptDeploymentGroupRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.InterceptDeploymentGroup() + ); + client.innerApiCalls.getInterceptDeploymentGroup = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getInterceptDeploymentGroup( + request, + (err?: Error|null, result?: protos.google.cloud.networksecurity.v1.IInterceptDeploymentGroup|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getInterceptDeploymentGroup as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getInterceptDeploymentGroup as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getInterceptDeploymentGroup with error', async () => { + const client = new interceptModule.v1.InterceptClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.GetInterceptDeploymentGroupRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.GetInterceptDeploymentGroupRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.getInterceptDeploymentGroup = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getInterceptDeploymentGroup(request), expectedError); + const actualRequest = (client.innerApiCalls.getInterceptDeploymentGroup as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getInterceptDeploymentGroup as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getInterceptDeploymentGroup with closed client', async () => { + const client = new interceptModule.v1.InterceptClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.GetInterceptDeploymentGroupRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.GetInterceptDeploymentGroupRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.getInterceptDeploymentGroup(request), expectedError); + }); + }); + + describe('getInterceptDeployment', () => { + it('invokes getInterceptDeployment without error', async () => { + const client = new interceptModule.v1.InterceptClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.GetInterceptDeploymentRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.GetInterceptDeploymentRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.InterceptDeployment() + ); + client.innerApiCalls.getInterceptDeployment = stubSimpleCall(expectedResponse); + const [response] = await client.getInterceptDeployment(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getInterceptDeployment as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getInterceptDeployment as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getInterceptDeployment without error using callback', async () => { + const client = new interceptModule.v1.InterceptClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.GetInterceptDeploymentRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.GetInterceptDeploymentRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.InterceptDeployment() + ); + client.innerApiCalls.getInterceptDeployment = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getInterceptDeployment( + request, + (err?: Error|null, result?: protos.google.cloud.networksecurity.v1.IInterceptDeployment|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getInterceptDeployment as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getInterceptDeployment as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getInterceptDeployment with error', async () => { + const client = new interceptModule.v1.InterceptClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.GetInterceptDeploymentRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.GetInterceptDeploymentRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.getInterceptDeployment = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getInterceptDeployment(request), expectedError); + const actualRequest = (client.innerApiCalls.getInterceptDeployment as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getInterceptDeployment as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getInterceptDeployment with closed client', async () => { + const client = new interceptModule.v1.InterceptClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.GetInterceptDeploymentRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.GetInterceptDeploymentRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.getInterceptDeployment(request), expectedError); + }); + }); + + describe('createInterceptEndpointGroup', () => { + it('invokes createInterceptEndpointGroup without error', async () => { + const client = new interceptModule.v1.InterceptClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.CreateInterceptEndpointGroupRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.CreateInterceptEndpointGroupRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createInterceptEndpointGroup = stubLongRunningCall(expectedResponse); + const [operation] = await client.createInterceptEndpointGroup(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createInterceptEndpointGroup as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createInterceptEndpointGroup as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createInterceptEndpointGroup without error using callback', async () => { + const client = new interceptModule.v1.InterceptClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.CreateInterceptEndpointGroupRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.CreateInterceptEndpointGroupRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createInterceptEndpointGroup = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createInterceptEndpointGroup( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createInterceptEndpointGroup as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createInterceptEndpointGroup as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createInterceptEndpointGroup with call error', async () => { + const client = new interceptModule.v1.InterceptClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.CreateInterceptEndpointGroupRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.CreateInterceptEndpointGroupRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.createInterceptEndpointGroup = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.createInterceptEndpointGroup(request), expectedError); + const actualRequest = (client.innerApiCalls.createInterceptEndpointGroup as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createInterceptEndpointGroup as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createInterceptEndpointGroup with LRO error', async () => { + const client = new interceptModule.v1.InterceptClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.CreateInterceptEndpointGroupRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.CreateInterceptEndpointGroupRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.createInterceptEndpointGroup = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.createInterceptEndpointGroup(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.createInterceptEndpointGroup as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createInterceptEndpointGroup as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkCreateInterceptEndpointGroupProgress without error', async () => { + const client = new interceptModule.v1.InterceptClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkCreateInterceptEndpointGroupProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkCreateInterceptEndpointGroupProgress with error', async () => { + const client = new interceptModule.v1.InterceptClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkCreateInterceptEndpointGroupProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('updateInterceptEndpointGroup', () => { + it('invokes updateInterceptEndpointGroup without error', async () => { + const client = new interceptModule.v1.InterceptClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.UpdateInterceptEndpointGroupRequest() + ); + request.interceptEndpointGroup ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.UpdateInterceptEndpointGroupRequest', ['interceptEndpointGroup', 'name']); + request.interceptEndpointGroup.name = defaultValue1; + const expectedHeaderRequestParams = `intercept_endpoint_group.name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.updateInterceptEndpointGroup = stubLongRunningCall(expectedResponse); + const [operation] = await client.updateInterceptEndpointGroup(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateInterceptEndpointGroup as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateInterceptEndpointGroup as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateInterceptEndpointGroup without error using callback', async () => { + const client = new interceptModule.v1.InterceptClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.UpdateInterceptEndpointGroupRequest() + ); + request.interceptEndpointGroup ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.UpdateInterceptEndpointGroupRequest', ['interceptEndpointGroup', 'name']); + request.interceptEndpointGroup.name = defaultValue1; + const expectedHeaderRequestParams = `intercept_endpoint_group.name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.updateInterceptEndpointGroup = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateInterceptEndpointGroup( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateInterceptEndpointGroup as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateInterceptEndpointGroup as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateInterceptEndpointGroup with call error', async () => { + const client = new interceptModule.v1.InterceptClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.UpdateInterceptEndpointGroupRequest() + ); + request.interceptEndpointGroup ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.UpdateInterceptEndpointGroupRequest', ['interceptEndpointGroup', 'name']); + request.interceptEndpointGroup.name = defaultValue1; + const expectedHeaderRequestParams = `intercept_endpoint_group.name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateInterceptEndpointGroup = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.updateInterceptEndpointGroup(request), expectedError); + const actualRequest = (client.innerApiCalls.updateInterceptEndpointGroup as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateInterceptEndpointGroup as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateInterceptEndpointGroup with LRO error', async () => { + const client = new interceptModule.v1.InterceptClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.UpdateInterceptEndpointGroupRequest() + ); + request.interceptEndpointGroup ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.UpdateInterceptEndpointGroupRequest', ['interceptEndpointGroup', 'name']); + request.interceptEndpointGroup.name = defaultValue1; + const expectedHeaderRequestParams = `intercept_endpoint_group.name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateInterceptEndpointGroup = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.updateInterceptEndpointGroup(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.updateInterceptEndpointGroup as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateInterceptEndpointGroup as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkUpdateInterceptEndpointGroupProgress without error', async () => { + const client = new interceptModule.v1.InterceptClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkUpdateInterceptEndpointGroupProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkUpdateInterceptEndpointGroupProgress with error', async () => { + const client = new interceptModule.v1.InterceptClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkUpdateInterceptEndpointGroupProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('deleteInterceptEndpointGroup', () => { + it('invokes deleteInterceptEndpointGroup without error', async () => { + const client = new interceptModule.v1.InterceptClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.DeleteInterceptEndpointGroupRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.DeleteInterceptEndpointGroupRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteInterceptEndpointGroup = stubLongRunningCall(expectedResponse); + const [operation] = await client.deleteInterceptEndpointGroup(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.deleteInterceptEndpointGroup as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteInterceptEndpointGroup as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteInterceptEndpointGroup without error using callback', async () => { + const client = new interceptModule.v1.InterceptClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.DeleteInterceptEndpointGroupRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.DeleteInterceptEndpointGroupRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteInterceptEndpointGroup = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteInterceptEndpointGroup( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.deleteInterceptEndpointGroup as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteInterceptEndpointGroup as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteInterceptEndpointGroup with call error', async () => { + const client = new interceptModule.v1.InterceptClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.DeleteInterceptEndpointGroupRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.DeleteInterceptEndpointGroupRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteInterceptEndpointGroup = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.deleteInterceptEndpointGroup(request), expectedError); + const actualRequest = (client.innerApiCalls.deleteInterceptEndpointGroup as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteInterceptEndpointGroup as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteInterceptEndpointGroup with LRO error', async () => { + const client = new interceptModule.v1.InterceptClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.DeleteInterceptEndpointGroupRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.DeleteInterceptEndpointGroupRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteInterceptEndpointGroup = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.deleteInterceptEndpointGroup(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.deleteInterceptEndpointGroup as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteInterceptEndpointGroup as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkDeleteInterceptEndpointGroupProgress without error', async () => { + const client = new interceptModule.v1.InterceptClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkDeleteInterceptEndpointGroupProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkDeleteInterceptEndpointGroupProgress with error', async () => { + const client = new interceptModule.v1.InterceptClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkDeleteInterceptEndpointGroupProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('createInterceptEndpointGroupAssociation', () => { + it('invokes createInterceptEndpointGroupAssociation without error', async () => { + const client = new interceptModule.v1.InterceptClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.CreateInterceptEndpointGroupAssociationRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.CreateInterceptEndpointGroupAssociationRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createInterceptEndpointGroupAssociation = stubLongRunningCall(expectedResponse); + const [operation] = await client.createInterceptEndpointGroupAssociation(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createInterceptEndpointGroupAssociation as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createInterceptEndpointGroupAssociation as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createInterceptEndpointGroupAssociation without error using callback', async () => { + const client = new interceptModule.v1.InterceptClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.CreateInterceptEndpointGroupAssociationRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.CreateInterceptEndpointGroupAssociationRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createInterceptEndpointGroupAssociation = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createInterceptEndpointGroupAssociation( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createInterceptEndpointGroupAssociation as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createInterceptEndpointGroupAssociation as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createInterceptEndpointGroupAssociation with call error', async () => { + const client = new interceptModule.v1.InterceptClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.CreateInterceptEndpointGroupAssociationRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.CreateInterceptEndpointGroupAssociationRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.createInterceptEndpointGroupAssociation = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.createInterceptEndpointGroupAssociation(request), expectedError); + const actualRequest = (client.innerApiCalls.createInterceptEndpointGroupAssociation as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createInterceptEndpointGroupAssociation as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createInterceptEndpointGroupAssociation with LRO error', async () => { + const client = new interceptModule.v1.InterceptClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.CreateInterceptEndpointGroupAssociationRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.CreateInterceptEndpointGroupAssociationRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.createInterceptEndpointGroupAssociation = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.createInterceptEndpointGroupAssociation(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.createInterceptEndpointGroupAssociation as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createInterceptEndpointGroupAssociation as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkCreateInterceptEndpointGroupAssociationProgress without error', async () => { + const client = new interceptModule.v1.InterceptClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkCreateInterceptEndpointGroupAssociationProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkCreateInterceptEndpointGroupAssociationProgress with error', async () => { + const client = new interceptModule.v1.InterceptClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkCreateInterceptEndpointGroupAssociationProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('updateInterceptEndpointGroupAssociation', () => { + it('invokes updateInterceptEndpointGroupAssociation without error', async () => { + const client = new interceptModule.v1.InterceptClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.UpdateInterceptEndpointGroupAssociationRequest() + ); + request.interceptEndpointGroupAssociation ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.UpdateInterceptEndpointGroupAssociationRequest', ['interceptEndpointGroupAssociation', 'name']); + request.interceptEndpointGroupAssociation.name = defaultValue1; + const expectedHeaderRequestParams = `intercept_endpoint_group_association.name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.updateInterceptEndpointGroupAssociation = stubLongRunningCall(expectedResponse); + const [operation] = await client.updateInterceptEndpointGroupAssociation(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateInterceptEndpointGroupAssociation as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateInterceptEndpointGroupAssociation as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateInterceptEndpointGroupAssociation without error using callback', async () => { + const client = new interceptModule.v1.InterceptClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.UpdateInterceptEndpointGroupAssociationRequest() + ); + request.interceptEndpointGroupAssociation ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.UpdateInterceptEndpointGroupAssociationRequest', ['interceptEndpointGroupAssociation', 'name']); + request.interceptEndpointGroupAssociation.name = defaultValue1; + const expectedHeaderRequestParams = `intercept_endpoint_group_association.name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.updateInterceptEndpointGroupAssociation = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateInterceptEndpointGroupAssociation( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateInterceptEndpointGroupAssociation as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateInterceptEndpointGroupAssociation as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateInterceptEndpointGroupAssociation with call error', async () => { + const client = new interceptModule.v1.InterceptClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.UpdateInterceptEndpointGroupAssociationRequest() + ); + request.interceptEndpointGroupAssociation ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.UpdateInterceptEndpointGroupAssociationRequest', ['interceptEndpointGroupAssociation', 'name']); + request.interceptEndpointGroupAssociation.name = defaultValue1; + const expectedHeaderRequestParams = `intercept_endpoint_group_association.name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateInterceptEndpointGroupAssociation = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.updateInterceptEndpointGroupAssociation(request), expectedError); + const actualRequest = (client.innerApiCalls.updateInterceptEndpointGroupAssociation as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateInterceptEndpointGroupAssociation as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateInterceptEndpointGroupAssociation with LRO error', async () => { + const client = new interceptModule.v1.InterceptClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.UpdateInterceptEndpointGroupAssociationRequest() + ); + request.interceptEndpointGroupAssociation ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.UpdateInterceptEndpointGroupAssociationRequest', ['interceptEndpointGroupAssociation', 'name']); + request.interceptEndpointGroupAssociation.name = defaultValue1; + const expectedHeaderRequestParams = `intercept_endpoint_group_association.name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateInterceptEndpointGroupAssociation = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.updateInterceptEndpointGroupAssociation(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.updateInterceptEndpointGroupAssociation as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateInterceptEndpointGroupAssociation as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkUpdateInterceptEndpointGroupAssociationProgress without error', async () => { + const client = new interceptModule.v1.InterceptClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkUpdateInterceptEndpointGroupAssociationProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkUpdateInterceptEndpointGroupAssociationProgress with error', async () => { + const client = new interceptModule.v1.InterceptClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkUpdateInterceptEndpointGroupAssociationProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('deleteInterceptEndpointGroupAssociation', () => { + it('invokes deleteInterceptEndpointGroupAssociation without error', async () => { + const client = new interceptModule.v1.InterceptClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.DeleteInterceptEndpointGroupAssociationRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.DeleteInterceptEndpointGroupAssociationRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteInterceptEndpointGroupAssociation = stubLongRunningCall(expectedResponse); + const [operation] = await client.deleteInterceptEndpointGroupAssociation(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.deleteInterceptEndpointGroupAssociation as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteInterceptEndpointGroupAssociation as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteInterceptEndpointGroupAssociation without error using callback', async () => { + const client = new interceptModule.v1.InterceptClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.DeleteInterceptEndpointGroupAssociationRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.DeleteInterceptEndpointGroupAssociationRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteInterceptEndpointGroupAssociation = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteInterceptEndpointGroupAssociation( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.deleteInterceptEndpointGroupAssociation as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteInterceptEndpointGroupAssociation as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteInterceptEndpointGroupAssociation with call error', async () => { + const client = new interceptModule.v1.InterceptClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.DeleteInterceptEndpointGroupAssociationRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.DeleteInterceptEndpointGroupAssociationRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteInterceptEndpointGroupAssociation = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.deleteInterceptEndpointGroupAssociation(request), expectedError); + const actualRequest = (client.innerApiCalls.deleteInterceptEndpointGroupAssociation as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteInterceptEndpointGroupAssociation as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteInterceptEndpointGroupAssociation with LRO error', async () => { + const client = new interceptModule.v1.InterceptClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.DeleteInterceptEndpointGroupAssociationRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.DeleteInterceptEndpointGroupAssociationRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteInterceptEndpointGroupAssociation = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.deleteInterceptEndpointGroupAssociation(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.deleteInterceptEndpointGroupAssociation as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteInterceptEndpointGroupAssociation as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkDeleteInterceptEndpointGroupAssociationProgress without error', async () => { + const client = new interceptModule.v1.InterceptClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkDeleteInterceptEndpointGroupAssociationProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkDeleteInterceptEndpointGroupAssociationProgress with error', async () => { + const client = new interceptModule.v1.InterceptClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkDeleteInterceptEndpointGroupAssociationProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('createInterceptDeploymentGroup', () => { + it('invokes createInterceptDeploymentGroup without error', async () => { + const client = new interceptModule.v1.InterceptClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.CreateInterceptDeploymentGroupRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.CreateInterceptDeploymentGroupRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createInterceptDeploymentGroup = stubLongRunningCall(expectedResponse); + const [operation] = await client.createInterceptDeploymentGroup(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createInterceptDeploymentGroup as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createInterceptDeploymentGroup as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createInterceptDeploymentGroup without error using callback', async () => { + const client = new interceptModule.v1.InterceptClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.CreateInterceptDeploymentGroupRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.CreateInterceptDeploymentGroupRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createInterceptDeploymentGroup = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createInterceptDeploymentGroup( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createInterceptDeploymentGroup as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createInterceptDeploymentGroup as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createInterceptDeploymentGroup with call error', async () => { + const client = new interceptModule.v1.InterceptClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.CreateInterceptDeploymentGroupRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.CreateInterceptDeploymentGroupRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.createInterceptDeploymentGroup = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.createInterceptDeploymentGroup(request), expectedError); + const actualRequest = (client.innerApiCalls.createInterceptDeploymentGroup as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createInterceptDeploymentGroup as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createInterceptDeploymentGroup with LRO error', async () => { + const client = new interceptModule.v1.InterceptClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.CreateInterceptDeploymentGroupRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.CreateInterceptDeploymentGroupRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.createInterceptDeploymentGroup = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.createInterceptDeploymentGroup(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.createInterceptDeploymentGroup as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createInterceptDeploymentGroup as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkCreateInterceptDeploymentGroupProgress without error', async () => { + const client = new interceptModule.v1.InterceptClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkCreateInterceptDeploymentGroupProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkCreateInterceptDeploymentGroupProgress with error', async () => { + const client = new interceptModule.v1.InterceptClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkCreateInterceptDeploymentGroupProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('updateInterceptDeploymentGroup', () => { + it('invokes updateInterceptDeploymentGroup without error', async () => { + const client = new interceptModule.v1.InterceptClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.UpdateInterceptDeploymentGroupRequest() + ); + request.interceptDeploymentGroup ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.UpdateInterceptDeploymentGroupRequest', ['interceptDeploymentGroup', 'name']); + request.interceptDeploymentGroup.name = defaultValue1; + const expectedHeaderRequestParams = `intercept_deployment_group.name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.updateInterceptDeploymentGroup = stubLongRunningCall(expectedResponse); + const [operation] = await client.updateInterceptDeploymentGroup(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateInterceptDeploymentGroup as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateInterceptDeploymentGroup as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateInterceptDeploymentGroup without error using callback', async () => { + const client = new interceptModule.v1.InterceptClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.UpdateInterceptDeploymentGroupRequest() + ); + request.interceptDeploymentGroup ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.UpdateInterceptDeploymentGroupRequest', ['interceptDeploymentGroup', 'name']); + request.interceptDeploymentGroup.name = defaultValue1; + const expectedHeaderRequestParams = `intercept_deployment_group.name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.updateInterceptDeploymentGroup = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateInterceptDeploymentGroup( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateInterceptDeploymentGroup as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateInterceptDeploymentGroup as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateInterceptDeploymentGroup with call error', async () => { + const client = new interceptModule.v1.InterceptClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.UpdateInterceptDeploymentGroupRequest() + ); + request.interceptDeploymentGroup ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.UpdateInterceptDeploymentGroupRequest', ['interceptDeploymentGroup', 'name']); + request.interceptDeploymentGroup.name = defaultValue1; + const expectedHeaderRequestParams = `intercept_deployment_group.name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateInterceptDeploymentGroup = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.updateInterceptDeploymentGroup(request), expectedError); + const actualRequest = (client.innerApiCalls.updateInterceptDeploymentGroup as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateInterceptDeploymentGroup as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateInterceptDeploymentGroup with LRO error', async () => { + const client = new interceptModule.v1.InterceptClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.UpdateInterceptDeploymentGroupRequest() + ); + request.interceptDeploymentGroup ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.UpdateInterceptDeploymentGroupRequest', ['interceptDeploymentGroup', 'name']); + request.interceptDeploymentGroup.name = defaultValue1; + const expectedHeaderRequestParams = `intercept_deployment_group.name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateInterceptDeploymentGroup = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.updateInterceptDeploymentGroup(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.updateInterceptDeploymentGroup as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateInterceptDeploymentGroup as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkUpdateInterceptDeploymentGroupProgress without error', async () => { + const client = new interceptModule.v1.InterceptClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkUpdateInterceptDeploymentGroupProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkUpdateInterceptDeploymentGroupProgress with error', async () => { + const client = new interceptModule.v1.InterceptClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkUpdateInterceptDeploymentGroupProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('deleteInterceptDeploymentGroup', () => { + it('invokes deleteInterceptDeploymentGroup without error', async () => { + const client = new interceptModule.v1.InterceptClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.DeleteInterceptDeploymentGroupRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.DeleteInterceptDeploymentGroupRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteInterceptDeploymentGroup = stubLongRunningCall(expectedResponse); + const [operation] = await client.deleteInterceptDeploymentGroup(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.deleteInterceptDeploymentGroup as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteInterceptDeploymentGroup as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteInterceptDeploymentGroup without error using callback', async () => { + const client = new interceptModule.v1.InterceptClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.DeleteInterceptDeploymentGroupRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.DeleteInterceptDeploymentGroupRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteInterceptDeploymentGroup = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteInterceptDeploymentGroup( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.deleteInterceptDeploymentGroup as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteInterceptDeploymentGroup as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteInterceptDeploymentGroup with call error', async () => { + const client = new interceptModule.v1.InterceptClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.DeleteInterceptDeploymentGroupRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.DeleteInterceptDeploymentGroupRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteInterceptDeploymentGroup = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.deleteInterceptDeploymentGroup(request), expectedError); + const actualRequest = (client.innerApiCalls.deleteInterceptDeploymentGroup as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteInterceptDeploymentGroup as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteInterceptDeploymentGroup with LRO error', async () => { + const client = new interceptModule.v1.InterceptClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.DeleteInterceptDeploymentGroupRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.DeleteInterceptDeploymentGroupRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteInterceptDeploymentGroup = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.deleteInterceptDeploymentGroup(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.deleteInterceptDeploymentGroup as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteInterceptDeploymentGroup as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkDeleteInterceptDeploymentGroupProgress without error', async () => { + const client = new interceptModule.v1.InterceptClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkDeleteInterceptDeploymentGroupProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkDeleteInterceptDeploymentGroupProgress with error', async () => { + const client = new interceptModule.v1.InterceptClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkDeleteInterceptDeploymentGroupProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('createInterceptDeployment', () => { + it('invokes createInterceptDeployment without error', async () => { + const client = new interceptModule.v1.InterceptClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.CreateInterceptDeploymentRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.CreateInterceptDeploymentRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createInterceptDeployment = stubLongRunningCall(expectedResponse); + const [operation] = await client.createInterceptDeployment(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createInterceptDeployment as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createInterceptDeployment as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createInterceptDeployment without error using callback', async () => { + const client = new interceptModule.v1.InterceptClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.CreateInterceptDeploymentRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.CreateInterceptDeploymentRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createInterceptDeployment = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createInterceptDeployment( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createInterceptDeployment as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createInterceptDeployment as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createInterceptDeployment with call error', async () => { + const client = new interceptModule.v1.InterceptClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.CreateInterceptDeploymentRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.CreateInterceptDeploymentRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.createInterceptDeployment = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.createInterceptDeployment(request), expectedError); + const actualRequest = (client.innerApiCalls.createInterceptDeployment as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createInterceptDeployment as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createInterceptDeployment with LRO error', async () => { + const client = new interceptModule.v1.InterceptClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.CreateInterceptDeploymentRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.CreateInterceptDeploymentRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.createInterceptDeployment = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.createInterceptDeployment(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.createInterceptDeployment as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createInterceptDeployment as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkCreateInterceptDeploymentProgress without error', async () => { + const client = new interceptModule.v1.InterceptClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkCreateInterceptDeploymentProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkCreateInterceptDeploymentProgress with error', async () => { + const client = new interceptModule.v1.InterceptClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkCreateInterceptDeploymentProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('updateInterceptDeployment', () => { + it('invokes updateInterceptDeployment without error', async () => { + const client = new interceptModule.v1.InterceptClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.UpdateInterceptDeploymentRequest() + ); + request.interceptDeployment ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.UpdateInterceptDeploymentRequest', ['interceptDeployment', 'name']); + request.interceptDeployment.name = defaultValue1; + const expectedHeaderRequestParams = `intercept_deployment.name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.updateInterceptDeployment = stubLongRunningCall(expectedResponse); + const [operation] = await client.updateInterceptDeployment(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateInterceptDeployment as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateInterceptDeployment as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateInterceptDeployment without error using callback', async () => { + const client = new interceptModule.v1.InterceptClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.UpdateInterceptDeploymentRequest() + ); + request.interceptDeployment ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.UpdateInterceptDeploymentRequest', ['interceptDeployment', 'name']); + request.interceptDeployment.name = defaultValue1; + const expectedHeaderRequestParams = `intercept_deployment.name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.updateInterceptDeployment = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateInterceptDeployment( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateInterceptDeployment as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateInterceptDeployment as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateInterceptDeployment with call error', async () => { + const client = new interceptModule.v1.InterceptClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.UpdateInterceptDeploymentRequest() + ); + request.interceptDeployment ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.UpdateInterceptDeploymentRequest', ['interceptDeployment', 'name']); + request.interceptDeployment.name = defaultValue1; + const expectedHeaderRequestParams = `intercept_deployment.name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateInterceptDeployment = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.updateInterceptDeployment(request), expectedError); + const actualRequest = (client.innerApiCalls.updateInterceptDeployment as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateInterceptDeployment as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateInterceptDeployment with LRO error', async () => { + const client = new interceptModule.v1.InterceptClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.UpdateInterceptDeploymentRequest() + ); + request.interceptDeployment ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.UpdateInterceptDeploymentRequest', ['interceptDeployment', 'name']); + request.interceptDeployment.name = defaultValue1; + const expectedHeaderRequestParams = `intercept_deployment.name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateInterceptDeployment = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.updateInterceptDeployment(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.updateInterceptDeployment as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateInterceptDeployment as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkUpdateInterceptDeploymentProgress without error', async () => { + const client = new interceptModule.v1.InterceptClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkUpdateInterceptDeploymentProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkUpdateInterceptDeploymentProgress with error', async () => { + const client = new interceptModule.v1.InterceptClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkUpdateInterceptDeploymentProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('deleteInterceptDeployment', () => { + it('invokes deleteInterceptDeployment without error', async () => { + const client = new interceptModule.v1.InterceptClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.DeleteInterceptDeploymentRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.DeleteInterceptDeploymentRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteInterceptDeployment = stubLongRunningCall(expectedResponse); + const [operation] = await client.deleteInterceptDeployment(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.deleteInterceptDeployment as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteInterceptDeployment as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteInterceptDeployment without error using callback', async () => { + const client = new interceptModule.v1.InterceptClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.DeleteInterceptDeploymentRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.DeleteInterceptDeploymentRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteInterceptDeployment = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteInterceptDeployment( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.deleteInterceptDeployment as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteInterceptDeployment as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteInterceptDeployment with call error', async () => { + const client = new interceptModule.v1.InterceptClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.DeleteInterceptDeploymentRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.DeleteInterceptDeploymentRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteInterceptDeployment = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.deleteInterceptDeployment(request), expectedError); + const actualRequest = (client.innerApiCalls.deleteInterceptDeployment as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteInterceptDeployment as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteInterceptDeployment with LRO error', async () => { + const client = new interceptModule.v1.InterceptClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.DeleteInterceptDeploymentRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.DeleteInterceptDeploymentRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteInterceptDeployment = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.deleteInterceptDeployment(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.deleteInterceptDeployment as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteInterceptDeployment as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkDeleteInterceptDeploymentProgress without error', async () => { + const client = new interceptModule.v1.InterceptClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkDeleteInterceptDeploymentProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkDeleteInterceptDeploymentProgress with error', async () => { + const client = new interceptModule.v1.InterceptClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkDeleteInterceptDeploymentProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('listInterceptEndpointGroups', () => { + it('invokes listInterceptEndpointGroups without error', async () => { + const client = new interceptModule.v1.InterceptClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.ListInterceptEndpointGroupsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.ListInterceptEndpointGroupsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.networksecurity.v1.InterceptEndpointGroup()), + generateSampleMessage(new protos.google.cloud.networksecurity.v1.InterceptEndpointGroup()), + generateSampleMessage(new protos.google.cloud.networksecurity.v1.InterceptEndpointGroup()), + ]; + client.innerApiCalls.listInterceptEndpointGroups = stubSimpleCall(expectedResponse); + const [response] = await client.listInterceptEndpointGroups(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listInterceptEndpointGroups as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listInterceptEndpointGroups as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listInterceptEndpointGroups without error using callback', async () => { + const client = new interceptModule.v1.InterceptClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.ListInterceptEndpointGroupsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.ListInterceptEndpointGroupsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.networksecurity.v1.InterceptEndpointGroup()), + generateSampleMessage(new protos.google.cloud.networksecurity.v1.InterceptEndpointGroup()), + generateSampleMessage(new protos.google.cloud.networksecurity.v1.InterceptEndpointGroup()), + ]; + client.innerApiCalls.listInterceptEndpointGroups = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listInterceptEndpointGroups( + request, + (err?: Error|null, result?: protos.google.cloud.networksecurity.v1.IInterceptEndpointGroup[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listInterceptEndpointGroups as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listInterceptEndpointGroups as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listInterceptEndpointGroups with error', async () => { + const client = new interceptModule.v1.InterceptClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.ListInterceptEndpointGroupsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.ListInterceptEndpointGroupsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.listInterceptEndpointGroups = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listInterceptEndpointGroups(request), expectedError); + const actualRequest = (client.innerApiCalls.listInterceptEndpointGroups as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listInterceptEndpointGroups as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listInterceptEndpointGroupsStream without error', async () => { + const client = new interceptModule.v1.InterceptClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.ListInterceptEndpointGroupsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.ListInterceptEndpointGroupsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.networksecurity.v1.InterceptEndpointGroup()), + generateSampleMessage(new protos.google.cloud.networksecurity.v1.InterceptEndpointGroup()), + generateSampleMessage(new protos.google.cloud.networksecurity.v1.InterceptEndpointGroup()), + ]; + client.descriptors.page.listInterceptEndpointGroups.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listInterceptEndpointGroupsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.networksecurity.v1.InterceptEndpointGroup[] = []; + stream.on('data', (response: protos.google.cloud.networksecurity.v1.InterceptEndpointGroup) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert((client.descriptors.page.listInterceptEndpointGroups.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listInterceptEndpointGroups, request)); + assert( + (client.descriptors.page.listInterceptEndpointGroups.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listInterceptEndpointGroupsStream with error', async () => { + const client = new interceptModule.v1.InterceptClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.ListInterceptEndpointGroupsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.ListInterceptEndpointGroupsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.descriptors.page.listInterceptEndpointGroups.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listInterceptEndpointGroupsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.networksecurity.v1.InterceptEndpointGroup[] = []; + stream.on('data', (response: protos.google.cloud.networksecurity.v1.InterceptEndpointGroup) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listInterceptEndpointGroups.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listInterceptEndpointGroups, request)); + assert( + (client.descriptors.page.listInterceptEndpointGroups.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listInterceptEndpointGroups without error', async () => { + const client = new interceptModule.v1.InterceptClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.ListInterceptEndpointGroupsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.ListInterceptEndpointGroupsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.networksecurity.v1.InterceptEndpointGroup()), + generateSampleMessage(new protos.google.cloud.networksecurity.v1.InterceptEndpointGroup()), + generateSampleMessage(new protos.google.cloud.networksecurity.v1.InterceptEndpointGroup()), + ]; + client.descriptors.page.listInterceptEndpointGroups.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.networksecurity.v1.IInterceptEndpointGroup[] = []; + const iterable = client.listInterceptEndpointGroupsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listInterceptEndpointGroups.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listInterceptEndpointGroups.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listInterceptEndpointGroups with error', async () => { + const client = new interceptModule.v1.InterceptClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.ListInterceptEndpointGroupsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.ListInterceptEndpointGroupsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.descriptors.page.listInterceptEndpointGroups.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listInterceptEndpointGroupsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.networksecurity.v1.IInterceptEndpointGroup[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listInterceptEndpointGroups.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listInterceptEndpointGroups.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('listInterceptEndpointGroupAssociations', () => { + it('invokes listInterceptEndpointGroupAssociations without error', async () => { + const client = new interceptModule.v1.InterceptClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.ListInterceptEndpointGroupAssociationsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.ListInterceptEndpointGroupAssociationsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.networksecurity.v1.InterceptEndpointGroupAssociation()), + generateSampleMessage(new protos.google.cloud.networksecurity.v1.InterceptEndpointGroupAssociation()), + generateSampleMessage(new protos.google.cloud.networksecurity.v1.InterceptEndpointGroupAssociation()), + ]; + client.innerApiCalls.listInterceptEndpointGroupAssociations = stubSimpleCall(expectedResponse); + const [response] = await client.listInterceptEndpointGroupAssociations(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listInterceptEndpointGroupAssociations as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listInterceptEndpointGroupAssociations as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listInterceptEndpointGroupAssociations without error using callback', async () => { + const client = new interceptModule.v1.InterceptClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.ListInterceptEndpointGroupAssociationsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.ListInterceptEndpointGroupAssociationsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.networksecurity.v1.InterceptEndpointGroupAssociation()), + generateSampleMessage(new protos.google.cloud.networksecurity.v1.InterceptEndpointGroupAssociation()), + generateSampleMessage(new protos.google.cloud.networksecurity.v1.InterceptEndpointGroupAssociation()), + ]; + client.innerApiCalls.listInterceptEndpointGroupAssociations = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listInterceptEndpointGroupAssociations( + request, + (err?: Error|null, result?: protos.google.cloud.networksecurity.v1.IInterceptEndpointGroupAssociation[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listInterceptEndpointGroupAssociations as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listInterceptEndpointGroupAssociations as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listInterceptEndpointGroupAssociations with error', async () => { + const client = new interceptModule.v1.InterceptClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.ListInterceptEndpointGroupAssociationsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.ListInterceptEndpointGroupAssociationsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.listInterceptEndpointGroupAssociations = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listInterceptEndpointGroupAssociations(request), expectedError); + const actualRequest = (client.innerApiCalls.listInterceptEndpointGroupAssociations as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listInterceptEndpointGroupAssociations as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listInterceptEndpointGroupAssociationsStream without error', async () => { + const client = new interceptModule.v1.InterceptClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.ListInterceptEndpointGroupAssociationsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.ListInterceptEndpointGroupAssociationsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.networksecurity.v1.InterceptEndpointGroupAssociation()), + generateSampleMessage(new protos.google.cloud.networksecurity.v1.InterceptEndpointGroupAssociation()), + generateSampleMessage(new protos.google.cloud.networksecurity.v1.InterceptEndpointGroupAssociation()), + ]; + client.descriptors.page.listInterceptEndpointGroupAssociations.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listInterceptEndpointGroupAssociationsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.networksecurity.v1.InterceptEndpointGroupAssociation[] = []; + stream.on('data', (response: protos.google.cloud.networksecurity.v1.InterceptEndpointGroupAssociation) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert((client.descriptors.page.listInterceptEndpointGroupAssociations.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listInterceptEndpointGroupAssociations, request)); + assert( + (client.descriptors.page.listInterceptEndpointGroupAssociations.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listInterceptEndpointGroupAssociationsStream with error', async () => { + const client = new interceptModule.v1.InterceptClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.ListInterceptEndpointGroupAssociationsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.ListInterceptEndpointGroupAssociationsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.descriptors.page.listInterceptEndpointGroupAssociations.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listInterceptEndpointGroupAssociationsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.networksecurity.v1.InterceptEndpointGroupAssociation[] = []; + stream.on('data', (response: protos.google.cloud.networksecurity.v1.InterceptEndpointGroupAssociation) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listInterceptEndpointGroupAssociations.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listInterceptEndpointGroupAssociations, request)); + assert( + (client.descriptors.page.listInterceptEndpointGroupAssociations.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listInterceptEndpointGroupAssociations without error', async () => { + const client = new interceptModule.v1.InterceptClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.ListInterceptEndpointGroupAssociationsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.ListInterceptEndpointGroupAssociationsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.networksecurity.v1.InterceptEndpointGroupAssociation()), + generateSampleMessage(new protos.google.cloud.networksecurity.v1.InterceptEndpointGroupAssociation()), + generateSampleMessage(new protos.google.cloud.networksecurity.v1.InterceptEndpointGroupAssociation()), + ]; + client.descriptors.page.listInterceptEndpointGroupAssociations.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.networksecurity.v1.IInterceptEndpointGroupAssociation[] = []; + const iterable = client.listInterceptEndpointGroupAssociationsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listInterceptEndpointGroupAssociations.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listInterceptEndpointGroupAssociations.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listInterceptEndpointGroupAssociations with error', async () => { + const client = new interceptModule.v1.InterceptClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.ListInterceptEndpointGroupAssociationsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.ListInterceptEndpointGroupAssociationsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.descriptors.page.listInterceptEndpointGroupAssociations.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listInterceptEndpointGroupAssociationsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.networksecurity.v1.IInterceptEndpointGroupAssociation[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listInterceptEndpointGroupAssociations.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listInterceptEndpointGroupAssociations.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('listInterceptDeploymentGroups', () => { + it('invokes listInterceptDeploymentGroups without error', async () => { + const client = new interceptModule.v1.InterceptClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.ListInterceptDeploymentGroupsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.ListInterceptDeploymentGroupsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.networksecurity.v1.InterceptDeploymentGroup()), + generateSampleMessage(new protos.google.cloud.networksecurity.v1.InterceptDeploymentGroup()), + generateSampleMessage(new protos.google.cloud.networksecurity.v1.InterceptDeploymentGroup()), + ]; + client.innerApiCalls.listInterceptDeploymentGroups = stubSimpleCall(expectedResponse); + const [response] = await client.listInterceptDeploymentGroups(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listInterceptDeploymentGroups as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listInterceptDeploymentGroups as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listInterceptDeploymentGroups without error using callback', async () => { + const client = new interceptModule.v1.InterceptClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.ListInterceptDeploymentGroupsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.ListInterceptDeploymentGroupsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.networksecurity.v1.InterceptDeploymentGroup()), + generateSampleMessage(new protos.google.cloud.networksecurity.v1.InterceptDeploymentGroup()), + generateSampleMessage(new protos.google.cloud.networksecurity.v1.InterceptDeploymentGroup()), + ]; + client.innerApiCalls.listInterceptDeploymentGroups = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listInterceptDeploymentGroups( + request, + (err?: Error|null, result?: protos.google.cloud.networksecurity.v1.IInterceptDeploymentGroup[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listInterceptDeploymentGroups as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listInterceptDeploymentGroups as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listInterceptDeploymentGroups with error', async () => { + const client = new interceptModule.v1.InterceptClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.ListInterceptDeploymentGroupsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.ListInterceptDeploymentGroupsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.listInterceptDeploymentGroups = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listInterceptDeploymentGroups(request), expectedError); + const actualRequest = (client.innerApiCalls.listInterceptDeploymentGroups as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listInterceptDeploymentGroups as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listInterceptDeploymentGroupsStream without error', async () => { + const client = new interceptModule.v1.InterceptClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.ListInterceptDeploymentGroupsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.ListInterceptDeploymentGroupsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.networksecurity.v1.InterceptDeploymentGroup()), + generateSampleMessage(new protos.google.cloud.networksecurity.v1.InterceptDeploymentGroup()), + generateSampleMessage(new protos.google.cloud.networksecurity.v1.InterceptDeploymentGroup()), + ]; + client.descriptors.page.listInterceptDeploymentGroups.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listInterceptDeploymentGroupsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.networksecurity.v1.InterceptDeploymentGroup[] = []; + stream.on('data', (response: protos.google.cloud.networksecurity.v1.InterceptDeploymentGroup) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert((client.descriptors.page.listInterceptDeploymentGroups.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listInterceptDeploymentGroups, request)); + assert( + (client.descriptors.page.listInterceptDeploymentGroups.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listInterceptDeploymentGroupsStream with error', async () => { + const client = new interceptModule.v1.InterceptClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.ListInterceptDeploymentGroupsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.ListInterceptDeploymentGroupsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.descriptors.page.listInterceptDeploymentGroups.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listInterceptDeploymentGroupsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.networksecurity.v1.InterceptDeploymentGroup[] = []; + stream.on('data', (response: protos.google.cloud.networksecurity.v1.InterceptDeploymentGroup) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listInterceptDeploymentGroups.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listInterceptDeploymentGroups, request)); + assert( + (client.descriptors.page.listInterceptDeploymentGroups.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listInterceptDeploymentGroups without error', async () => { + const client = new interceptModule.v1.InterceptClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.ListInterceptDeploymentGroupsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.ListInterceptDeploymentGroupsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.networksecurity.v1.InterceptDeploymentGroup()), + generateSampleMessage(new protos.google.cloud.networksecurity.v1.InterceptDeploymentGroup()), + generateSampleMessage(new protos.google.cloud.networksecurity.v1.InterceptDeploymentGroup()), + ]; + client.descriptors.page.listInterceptDeploymentGroups.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.networksecurity.v1.IInterceptDeploymentGroup[] = []; + const iterable = client.listInterceptDeploymentGroupsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listInterceptDeploymentGroups.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listInterceptDeploymentGroups.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listInterceptDeploymentGroups with error', async () => { + const client = new interceptModule.v1.InterceptClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.ListInterceptDeploymentGroupsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.ListInterceptDeploymentGroupsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.descriptors.page.listInterceptDeploymentGroups.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listInterceptDeploymentGroupsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.networksecurity.v1.IInterceptDeploymentGroup[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listInterceptDeploymentGroups.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listInterceptDeploymentGroups.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('listInterceptDeployments', () => { + it('invokes listInterceptDeployments without error', async () => { + const client = new interceptModule.v1.InterceptClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.ListInterceptDeploymentsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.ListInterceptDeploymentsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.networksecurity.v1.InterceptDeployment()), + generateSampleMessage(new protos.google.cloud.networksecurity.v1.InterceptDeployment()), + generateSampleMessage(new protos.google.cloud.networksecurity.v1.InterceptDeployment()), + ]; + client.innerApiCalls.listInterceptDeployments = stubSimpleCall(expectedResponse); + const [response] = await client.listInterceptDeployments(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listInterceptDeployments as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listInterceptDeployments as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listInterceptDeployments without error using callback', async () => { + const client = new interceptModule.v1.InterceptClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.ListInterceptDeploymentsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.ListInterceptDeploymentsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.networksecurity.v1.InterceptDeployment()), + generateSampleMessage(new protos.google.cloud.networksecurity.v1.InterceptDeployment()), + generateSampleMessage(new protos.google.cloud.networksecurity.v1.InterceptDeployment()), + ]; + client.innerApiCalls.listInterceptDeployments = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listInterceptDeployments( + request, + (err?: Error|null, result?: protos.google.cloud.networksecurity.v1.IInterceptDeployment[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listInterceptDeployments as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listInterceptDeployments as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listInterceptDeployments with error', async () => { + const client = new interceptModule.v1.InterceptClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.ListInterceptDeploymentsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.ListInterceptDeploymentsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.listInterceptDeployments = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listInterceptDeployments(request), expectedError); + const actualRequest = (client.innerApiCalls.listInterceptDeployments as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listInterceptDeployments as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listInterceptDeploymentsStream without error', async () => { + const client = new interceptModule.v1.InterceptClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.ListInterceptDeploymentsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.ListInterceptDeploymentsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.networksecurity.v1.InterceptDeployment()), + generateSampleMessage(new protos.google.cloud.networksecurity.v1.InterceptDeployment()), + generateSampleMessage(new protos.google.cloud.networksecurity.v1.InterceptDeployment()), + ]; + client.descriptors.page.listInterceptDeployments.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listInterceptDeploymentsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.networksecurity.v1.InterceptDeployment[] = []; + stream.on('data', (response: protos.google.cloud.networksecurity.v1.InterceptDeployment) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert((client.descriptors.page.listInterceptDeployments.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listInterceptDeployments, request)); + assert( + (client.descriptors.page.listInterceptDeployments.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listInterceptDeploymentsStream with error', async () => { + const client = new interceptModule.v1.InterceptClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.ListInterceptDeploymentsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.ListInterceptDeploymentsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.descriptors.page.listInterceptDeployments.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listInterceptDeploymentsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.networksecurity.v1.InterceptDeployment[] = []; + stream.on('data', (response: protos.google.cloud.networksecurity.v1.InterceptDeployment) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listInterceptDeployments.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listInterceptDeployments, request)); + assert( + (client.descriptors.page.listInterceptDeployments.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listInterceptDeployments without error', async () => { + const client = new interceptModule.v1.InterceptClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.ListInterceptDeploymentsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.ListInterceptDeploymentsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.networksecurity.v1.InterceptDeployment()), + generateSampleMessage(new protos.google.cloud.networksecurity.v1.InterceptDeployment()), + generateSampleMessage(new protos.google.cloud.networksecurity.v1.InterceptDeployment()), + ]; + client.descriptors.page.listInterceptDeployments.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.networksecurity.v1.IInterceptDeployment[] = []; + const iterable = client.listInterceptDeploymentsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listInterceptDeployments.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listInterceptDeployments.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listInterceptDeployments with error', async () => { + const client = new interceptModule.v1.InterceptClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.ListInterceptDeploymentsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.ListInterceptDeploymentsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.descriptors.page.listInterceptDeployments.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listInterceptDeploymentsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.networksecurity.v1.IInterceptDeployment[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listInterceptDeployments.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listInterceptDeployments.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + describe('getIamPolicy', () => { + it('invokes getIamPolicy without error', async () => { + const client = new interceptModule.v1.InterceptClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.GetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy() + ); + client.iamClient.getIamPolicy = stubSimpleCall(expectedResponse); + const response = await client.getIamPolicy(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.iamClient.getIamPolicy as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + it('invokes getIamPolicy without error using callback', async () => { + const client = new interceptModule.v1.InterceptClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.GetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy() + ); + client.iamClient.getIamPolicy = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getIamPolicy( + request, + expectedOptions, + (err?: Error|null, result?: IamProtos.google.iam.v1.Policy|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }).catch(err => {throw err}); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.iamClient.getIamPolicy as SinonStub) + .getCall(0)); + }); + it('invokes getIamPolicy with error', async () => { + const client = new interceptModule.v1.InterceptClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.GetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.iamClient.getIamPolicy = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getIamPolicy(request, expectedOptions), expectedError); + assert((client.iamClient.getIamPolicy as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + }); + describe('setIamPolicy', () => { + it('invokes setIamPolicy without error', async () => { + const client = new interceptModule.v1.InterceptClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.SetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy() + ); + client.iamClient.setIamPolicy = stubSimpleCall(expectedResponse); + const response = await client.setIamPolicy(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.iamClient.setIamPolicy as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + it('invokes setIamPolicy without error using callback', async () => { + const client = new interceptModule.v1.InterceptClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.SetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy() + ); + client.iamClient.setIamPolicy = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.setIamPolicy( + request, + expectedOptions, + (err?: Error|null, result?: IamProtos.google.iam.v1.Policy|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }).catch(err => {throw err}); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.iamClient.setIamPolicy as SinonStub) + .getCall(0)); + }); + it('invokes setIamPolicy with error', async () => { + const client = new interceptModule.v1.InterceptClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.SetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.iamClient.setIamPolicy = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.setIamPolicy(request, expectedOptions), expectedError); + assert((client.iamClient.setIamPolicy as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + }); + describe('testIamPermissions', () => { + it('invokes testIamPermissions without error', async () => { + const client = new interceptModule.v1.InterceptClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsResponse() + ); + client.iamClient.testIamPermissions = stubSimpleCall(expectedResponse); + const response = await client.testIamPermissions(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.iamClient.testIamPermissions as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + it('invokes testIamPermissions without error using callback', async () => { + const client = new interceptModule.v1.InterceptClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsResponse() + ); + client.iamClient.testIamPermissions = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.testIamPermissions( + request, + expectedOptions, + (err?: Error|null, result?: IamProtos.google.iam.v1.TestIamPermissionsResponse|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }).catch(err => {throw err}); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.iamClient.testIamPermissions as SinonStub) + .getCall(0)); + }); + it('invokes testIamPermissions with error', async () => { + const client = new interceptModule.v1.InterceptClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.iamClient.testIamPermissions = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.testIamPermissions(request, expectedOptions), expectedError); + assert((client.iamClient.testIamPermissions as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + }); + describe('getLocation', () => { + it('invokes getLocation without error', async () => { + const client = new interceptModule.v1.InterceptClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ); + client.locationsClient.getLocation = stubSimpleCall(expectedResponse); + const response = await client.getLocation(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.locationsClient.getLocation as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + it('invokes getLocation without error using callback', async () => { + const client = new interceptModule.v1.InterceptClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ); + client.locationsClient.getLocation = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getLocation( + request, + expectedOptions, + ( + err?: Error | null, + result?: LocationProtos.google.cloud.location.ILocation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.locationsClient.getLocation as SinonStub) + .getCall(0)); + }); + it('invokes getLocation with error', async () => { + const client = new interceptModule.v1.InterceptClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.locationsClient.getLocation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getLocation(request, expectedOptions), expectedError); + assert((client.locationsClient.getLocation as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + }); + describe('listLocationsAsync', () => { + it('uses async iteration with listLocations without error', async () => { + const client = new interceptModule.v1.InterceptClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.ListLocationsRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedResponse = [ + generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ), + generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ), + generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ), + ]; + client.locationsClient.descriptors.page.listLocations.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: LocationProtos.google.cloud.location.ILocation[] = []; + const iterable = client.listLocationsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + it('uses async iteration with listLocations with error', async () => { + const client = new interceptModule.v1.InterceptClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.ListLocationsRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedError = new Error('expected'); + client.locationsClient.descriptors.page.listLocations.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listLocationsAsync(request); + await assert.rejects(async () => { + const responses: LocationProtos.google.cloud.location.ILocation[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + describe('getOperation', () => { + it('invokes getOperation without error', async () => { + const client = new interceptModule.v1.InterceptClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.GetOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const response = await client.getOperation(request); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0).calledWith(request) + ); + }); + it('invokes getOperation without error using callback', async () => { + const client = new interceptModule.v1.InterceptClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.GetOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + client.operationsClient.getOperation = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.operationsClient.getOperation( + request, + undefined, + ( + err?: Error | null, + result?: operationsProtos.google.longrunning.Operation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }).catch(err => {throw err}); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + it('invokes getOperation with error', async () => { + const client = new interceptModule.v1.InterceptClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.GetOperationRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(async () => {await client.getOperation(request)}, expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0).calledWith(request)); + }); + }); + describe('cancelOperation', () => { + it('invokes cancelOperation without error', async () => { + const client = new interceptModule.v1.InterceptClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.CancelOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.cancelOperation = stubSimpleCall(expectedResponse); + const response = await client.cancelOperation(request); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.operationsClient.cancelOperation as SinonStub) + .getCall(0).calledWith(request) + ); + }); + it('invokes cancelOperation without error using callback', async () => { + const client = new interceptModule.v1.InterceptClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.CancelOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.cancelOperation = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.operationsClient.cancelOperation( + request, + undefined, + ( + err?: Error | null, + result?: protos.google.protobuf.Empty | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }).catch(err => {throw err}); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.operationsClient.cancelOperation as SinonStub) + .getCall(0)); + }); + it('invokes cancelOperation with error', async () => { + const client = new interceptModule.v1.InterceptClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.CancelOperationRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.cancelOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(async () => {await client.cancelOperation(request)}, expectedError); + assert((client.operationsClient.cancelOperation as SinonStub) + .getCall(0).calledWith(request)); + }); + }); + describe('deleteOperation', () => { + it('invokes deleteOperation without error', async () => { + const client = new interceptModule.v1.InterceptClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.DeleteOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.deleteOperation = stubSimpleCall(expectedResponse); + const response = await client.deleteOperation(request); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.operationsClient.deleteOperation as SinonStub) + .getCall(0).calledWith(request) + ); + }); + it('invokes deleteOperation without error using callback', async () => { + const client = new interceptModule.v1.InterceptClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.DeleteOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.deleteOperation = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.operationsClient.deleteOperation( + request, + undefined, + ( + err?: Error | null, + result?: protos.google.protobuf.Empty | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }).catch(err => {throw err}); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.operationsClient.deleteOperation as SinonStub) + .getCall(0)); + }); + it('invokes deleteOperation with error', async () => { + const client = new interceptModule.v1.InterceptClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.DeleteOperationRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.deleteOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(async () => {await client.deleteOperation(request)}, expectedError); + assert((client.operationsClient.deleteOperation as SinonStub) + .getCall(0).calledWith(request)); + }); + }); + describe('listOperationsAsync', () => { + it('uses async iteration with listOperations without error', async () => { + const client = new interceptModule.v1.InterceptClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsRequest() + ); + const expectedResponse = [ + generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsResponse() + ), + generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsResponse() + ), + generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsResponse() + ), + ]; + client.operationsClient.descriptor.listOperations.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: operationsProtos.google.longrunning.IOperation[] = []; + const iterable = client.operationsClient.listOperationsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.operationsClient.descriptor.listOperations.asyncIterate as SinonStub) + .getCall(0).args[1], request); + }); + it('uses async iteration with listOperations with error', async () => { + const client = new interceptModule.v1.InterceptClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.descriptor.listOperations.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.operationsClient.listOperationsAsync(request); + await assert.rejects(async () => { + const responses: operationsProtos.google.longrunning.IOperation[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.operationsClient.descriptor.listOperations.asyncIterate as SinonStub) + .getCall(0).args[1], request); + }); + }); + + describe('Path templates', () => { + + describe('authorizationPolicy', async () => { + const fakePath = "/rendered/path/authorizationPolicy"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + authorization_policy: "authorizationPolicyValue", + }; + const client = new interceptModule.v1.InterceptClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.authorizationPolicyPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.authorizationPolicyPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('authorizationPolicyPath', () => { + const result = client.authorizationPolicyPath("projectValue", "locationValue", "authorizationPolicyValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.authorizationPolicyPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromAuthorizationPolicyName', () => { + const result = client.matchProjectFromAuthorizationPolicyName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.authorizationPolicyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromAuthorizationPolicyName', () => { + const result = client.matchLocationFromAuthorizationPolicyName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.authorizationPolicyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchAuthorizationPolicyFromAuthorizationPolicyName', () => { + const result = client.matchAuthorizationPolicyFromAuthorizationPolicyName(fakePath); + assert.strictEqual(result, "authorizationPolicyValue"); + assert((client.pathTemplates.authorizationPolicyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('authzPolicy', async () => { + const fakePath = "/rendered/path/authzPolicy"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + authz_policy: "authzPolicyValue", + }; + const client = new interceptModule.v1.InterceptClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.authzPolicyPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.authzPolicyPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('authzPolicyPath', () => { + const result = client.authzPolicyPath("projectValue", "locationValue", "authzPolicyValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.authzPolicyPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromAuthzPolicyName', () => { + const result = client.matchProjectFromAuthzPolicyName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.authzPolicyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromAuthzPolicyName', () => { + const result = client.matchLocationFromAuthzPolicyName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.authzPolicyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchAuthzPolicyFromAuthzPolicyName', () => { + const result = client.matchAuthzPolicyFromAuthzPolicyName(fakePath); + assert.strictEqual(result, "authzPolicyValue"); + assert((client.pathTemplates.authzPolicyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('backendAuthenticationConfig', async () => { + const fakePath = "/rendered/path/backendAuthenticationConfig"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + backend_authentication_config: "backendAuthenticationConfigValue", + }; + const client = new interceptModule.v1.InterceptClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.backendAuthenticationConfigPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.backendAuthenticationConfigPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('backendAuthenticationConfigPath', () => { + const result = client.backendAuthenticationConfigPath("projectValue", "locationValue", "backendAuthenticationConfigValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.backendAuthenticationConfigPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromBackendAuthenticationConfigName', () => { + const result = client.matchProjectFromBackendAuthenticationConfigName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.backendAuthenticationConfigPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromBackendAuthenticationConfigName', () => { + const result = client.matchLocationFromBackendAuthenticationConfigName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.backendAuthenticationConfigPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchBackendAuthenticationConfigFromBackendAuthenticationConfigName', () => { + const result = client.matchBackendAuthenticationConfigFromBackendAuthenticationConfigName(fakePath); + assert.strictEqual(result, "backendAuthenticationConfigValue"); + assert((client.pathTemplates.backendAuthenticationConfigPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('clientTlsPolicy', async () => { + const fakePath = "/rendered/path/clientTlsPolicy"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + client_tls_policy: "clientTlsPolicyValue", + }; + const client = new interceptModule.v1.InterceptClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.clientTlsPolicyPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.clientTlsPolicyPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('clientTlsPolicyPath', () => { + const result = client.clientTlsPolicyPath("projectValue", "locationValue", "clientTlsPolicyValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.clientTlsPolicyPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromClientTlsPolicyName', () => { + const result = client.matchProjectFromClientTlsPolicyName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.clientTlsPolicyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromClientTlsPolicyName', () => { + const result = client.matchLocationFromClientTlsPolicyName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.clientTlsPolicyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchClientTlsPolicyFromClientTlsPolicyName', () => { + const result = client.matchClientTlsPolicyFromClientTlsPolicyName(fakePath); + assert.strictEqual(result, "clientTlsPolicyValue"); + assert((client.pathTemplates.clientTlsPolicyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('dnsThreatDetector', async () => { + const fakePath = "/rendered/path/dnsThreatDetector"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + dns_threat_detector: "dnsThreatDetectorValue", + }; + const client = new interceptModule.v1.InterceptClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.dnsThreatDetectorPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.dnsThreatDetectorPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('dnsThreatDetectorPath', () => { + const result = client.dnsThreatDetectorPath("projectValue", "locationValue", "dnsThreatDetectorValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.dnsThreatDetectorPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromDnsThreatDetectorName', () => { + const result = client.matchProjectFromDnsThreatDetectorName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.dnsThreatDetectorPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromDnsThreatDetectorName', () => { + const result = client.matchLocationFromDnsThreatDetectorName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.dnsThreatDetectorPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDnsThreatDetectorFromDnsThreatDetectorName', () => { + const result = client.matchDnsThreatDetectorFromDnsThreatDetectorName(fakePath); + assert.strictEqual(result, "dnsThreatDetectorValue"); + assert((client.pathTemplates.dnsThreatDetectorPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('firewallEndpointAssociation', async () => { + const fakePath = "/rendered/path/firewallEndpointAssociation"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + firewall_endpoint_association: "firewallEndpointAssociationValue", + }; + const client = new interceptModule.v1.InterceptClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.firewallEndpointAssociationPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.firewallEndpointAssociationPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('firewallEndpointAssociationPath', () => { + const result = client.firewallEndpointAssociationPath("projectValue", "locationValue", "firewallEndpointAssociationValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.firewallEndpointAssociationPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromFirewallEndpointAssociationName', () => { + const result = client.matchProjectFromFirewallEndpointAssociationName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.firewallEndpointAssociationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromFirewallEndpointAssociationName', () => { + const result = client.matchLocationFromFirewallEndpointAssociationName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.firewallEndpointAssociationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchFirewallEndpointAssociationFromFirewallEndpointAssociationName', () => { + const result = client.matchFirewallEndpointAssociationFromFirewallEndpointAssociationName(fakePath); + assert.strictEqual(result, "firewallEndpointAssociationValue"); + assert((client.pathTemplates.firewallEndpointAssociationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('forwardingRule', async () => { + const fakePath = "/rendered/path/forwardingRule"; + const expectedParameters = { + project: "projectValue", + forwarding_rule: "forwardingRuleValue", + }; + const client = new interceptModule.v1.InterceptClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.forwardingRulePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.forwardingRulePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('forwardingRulePath', () => { + const result = client.forwardingRulePath("projectValue", "forwardingRuleValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.forwardingRulePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromForwardingRuleName', () => { + const result = client.matchProjectFromForwardingRuleName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.forwardingRulePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchForwardingRuleFromForwardingRuleName', () => { + const result = client.matchForwardingRuleFromForwardingRuleName(fakePath); + assert.strictEqual(result, "forwardingRuleValue"); + assert((client.pathTemplates.forwardingRulePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('gatewaySecurityPolicy', async () => { + const fakePath = "/rendered/path/gatewaySecurityPolicy"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + gateway_security_policy: "gatewaySecurityPolicyValue", + }; + const client = new interceptModule.v1.InterceptClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.gatewaySecurityPolicyPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.gatewaySecurityPolicyPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('gatewaySecurityPolicyPath', () => { + const result = client.gatewaySecurityPolicyPath("projectValue", "locationValue", "gatewaySecurityPolicyValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.gatewaySecurityPolicyPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromGatewaySecurityPolicyName', () => { + const result = client.matchProjectFromGatewaySecurityPolicyName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.gatewaySecurityPolicyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromGatewaySecurityPolicyName', () => { + const result = client.matchLocationFromGatewaySecurityPolicyName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.gatewaySecurityPolicyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchGatewaySecurityPolicyFromGatewaySecurityPolicyName', () => { + const result = client.matchGatewaySecurityPolicyFromGatewaySecurityPolicyName(fakePath); + assert.strictEqual(result, "gatewaySecurityPolicyValue"); + assert((client.pathTemplates.gatewaySecurityPolicyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('gatewaySecurityPolicyRule', async () => { + const fakePath = "/rendered/path/gatewaySecurityPolicyRule"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + gateway_security_policy: "gatewaySecurityPolicyValue", + rule: "ruleValue", + }; + const client = new interceptModule.v1.InterceptClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.gatewaySecurityPolicyRulePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.gatewaySecurityPolicyRulePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('gatewaySecurityPolicyRulePath', () => { + const result = client.gatewaySecurityPolicyRulePath("projectValue", "locationValue", "gatewaySecurityPolicyValue", "ruleValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.gatewaySecurityPolicyRulePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromGatewaySecurityPolicyRuleName', () => { + const result = client.matchProjectFromGatewaySecurityPolicyRuleName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.gatewaySecurityPolicyRulePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromGatewaySecurityPolicyRuleName', () => { + const result = client.matchLocationFromGatewaySecurityPolicyRuleName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.gatewaySecurityPolicyRulePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchGatewaySecurityPolicyFromGatewaySecurityPolicyRuleName', () => { + const result = client.matchGatewaySecurityPolicyFromGatewaySecurityPolicyRuleName(fakePath); + assert.strictEqual(result, "gatewaySecurityPolicyValue"); + assert((client.pathTemplates.gatewaySecurityPolicyRulePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchRuleFromGatewaySecurityPolicyRuleName', () => { + const result = client.matchRuleFromGatewaySecurityPolicyRuleName(fakePath); + assert.strictEqual(result, "ruleValue"); + assert((client.pathTemplates.gatewaySecurityPolicyRulePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('interceptDeployment', async () => { + const fakePath = "/rendered/path/interceptDeployment"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + intercept_deployment: "interceptDeploymentValue", + }; + const client = new interceptModule.v1.InterceptClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.interceptDeploymentPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.interceptDeploymentPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('interceptDeploymentPath', () => { + const result = client.interceptDeploymentPath("projectValue", "locationValue", "interceptDeploymentValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.interceptDeploymentPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromInterceptDeploymentName', () => { + const result = client.matchProjectFromInterceptDeploymentName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.interceptDeploymentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromInterceptDeploymentName', () => { + const result = client.matchLocationFromInterceptDeploymentName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.interceptDeploymentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchInterceptDeploymentFromInterceptDeploymentName', () => { + const result = client.matchInterceptDeploymentFromInterceptDeploymentName(fakePath); + assert.strictEqual(result, "interceptDeploymentValue"); + assert((client.pathTemplates.interceptDeploymentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('interceptDeploymentGroup', async () => { + const fakePath = "/rendered/path/interceptDeploymentGroup"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + intercept_deployment_group: "interceptDeploymentGroupValue", + }; + const client = new interceptModule.v1.InterceptClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.interceptDeploymentGroupPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.interceptDeploymentGroupPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('interceptDeploymentGroupPath', () => { + const result = client.interceptDeploymentGroupPath("projectValue", "locationValue", "interceptDeploymentGroupValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.interceptDeploymentGroupPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromInterceptDeploymentGroupName', () => { + const result = client.matchProjectFromInterceptDeploymentGroupName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.interceptDeploymentGroupPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromInterceptDeploymentGroupName', () => { + const result = client.matchLocationFromInterceptDeploymentGroupName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.interceptDeploymentGroupPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchInterceptDeploymentGroupFromInterceptDeploymentGroupName', () => { + const result = client.matchInterceptDeploymentGroupFromInterceptDeploymentGroupName(fakePath); + assert.strictEqual(result, "interceptDeploymentGroupValue"); + assert((client.pathTemplates.interceptDeploymentGroupPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('interceptEndpointGroup', async () => { + const fakePath = "/rendered/path/interceptEndpointGroup"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + intercept_endpoint_group: "interceptEndpointGroupValue", + }; + const client = new interceptModule.v1.InterceptClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.interceptEndpointGroupPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.interceptEndpointGroupPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('interceptEndpointGroupPath', () => { + const result = client.interceptEndpointGroupPath("projectValue", "locationValue", "interceptEndpointGroupValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.interceptEndpointGroupPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromInterceptEndpointGroupName', () => { + const result = client.matchProjectFromInterceptEndpointGroupName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.interceptEndpointGroupPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromInterceptEndpointGroupName', () => { + const result = client.matchLocationFromInterceptEndpointGroupName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.interceptEndpointGroupPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchInterceptEndpointGroupFromInterceptEndpointGroupName', () => { + const result = client.matchInterceptEndpointGroupFromInterceptEndpointGroupName(fakePath); + assert.strictEqual(result, "interceptEndpointGroupValue"); + assert((client.pathTemplates.interceptEndpointGroupPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('interceptEndpointGroupAssociation', async () => { + const fakePath = "/rendered/path/interceptEndpointGroupAssociation"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + intercept_endpoint_group_association: "interceptEndpointGroupAssociationValue", + }; + const client = new interceptModule.v1.InterceptClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.interceptEndpointGroupAssociationPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.interceptEndpointGroupAssociationPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('interceptEndpointGroupAssociationPath', () => { + const result = client.interceptEndpointGroupAssociationPath("projectValue", "locationValue", "interceptEndpointGroupAssociationValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.interceptEndpointGroupAssociationPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromInterceptEndpointGroupAssociationName', () => { + const result = client.matchProjectFromInterceptEndpointGroupAssociationName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.interceptEndpointGroupAssociationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromInterceptEndpointGroupAssociationName', () => { + const result = client.matchLocationFromInterceptEndpointGroupAssociationName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.interceptEndpointGroupAssociationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchInterceptEndpointGroupAssociationFromInterceptEndpointGroupAssociationName', () => { + const result = client.matchInterceptEndpointGroupAssociationFromInterceptEndpointGroupAssociationName(fakePath); + assert.strictEqual(result, "interceptEndpointGroupAssociationValue"); + assert((client.pathTemplates.interceptEndpointGroupAssociationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('location', async () => { + const fakePath = "/rendered/path/location"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + }; + const client = new interceptModule.v1.InterceptClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.locationPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.locationPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('locationPath', () => { + const result = client.locationPath("projectValue", "locationValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.locationPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromLocationName', () => { + const result = client.matchProjectFromLocationName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.locationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromLocationName', () => { + const result = client.matchLocationFromLocationName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.locationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('mirroringDeployment', async () => { + const fakePath = "/rendered/path/mirroringDeployment"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + mirroring_deployment: "mirroringDeploymentValue", + }; + const client = new interceptModule.v1.InterceptClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.mirroringDeploymentPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.mirroringDeploymentPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('mirroringDeploymentPath', () => { + const result = client.mirroringDeploymentPath("projectValue", "locationValue", "mirroringDeploymentValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.mirroringDeploymentPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromMirroringDeploymentName', () => { + const result = client.matchProjectFromMirroringDeploymentName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.mirroringDeploymentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromMirroringDeploymentName', () => { + const result = client.matchLocationFromMirroringDeploymentName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.mirroringDeploymentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchMirroringDeploymentFromMirroringDeploymentName', () => { + const result = client.matchMirroringDeploymentFromMirroringDeploymentName(fakePath); + assert.strictEqual(result, "mirroringDeploymentValue"); + assert((client.pathTemplates.mirroringDeploymentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('mirroringDeploymentGroup', async () => { + const fakePath = "/rendered/path/mirroringDeploymentGroup"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + mirroring_deployment_group: "mirroringDeploymentGroupValue", + }; + const client = new interceptModule.v1.InterceptClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.mirroringDeploymentGroupPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.mirroringDeploymentGroupPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('mirroringDeploymentGroupPath', () => { + const result = client.mirroringDeploymentGroupPath("projectValue", "locationValue", "mirroringDeploymentGroupValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.mirroringDeploymentGroupPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromMirroringDeploymentGroupName', () => { + const result = client.matchProjectFromMirroringDeploymentGroupName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.mirroringDeploymentGroupPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromMirroringDeploymentGroupName', () => { + const result = client.matchLocationFromMirroringDeploymentGroupName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.mirroringDeploymentGroupPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchMirroringDeploymentGroupFromMirroringDeploymentGroupName', () => { + const result = client.matchMirroringDeploymentGroupFromMirroringDeploymentGroupName(fakePath); + assert.strictEqual(result, "mirroringDeploymentGroupValue"); + assert((client.pathTemplates.mirroringDeploymentGroupPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('mirroringEndpointGroup', async () => { + const fakePath = "/rendered/path/mirroringEndpointGroup"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + mirroring_endpoint_group: "mirroringEndpointGroupValue", + }; + const client = new interceptModule.v1.InterceptClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.mirroringEndpointGroupPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.mirroringEndpointGroupPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('mirroringEndpointGroupPath', () => { + const result = client.mirroringEndpointGroupPath("projectValue", "locationValue", "mirroringEndpointGroupValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.mirroringEndpointGroupPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromMirroringEndpointGroupName', () => { + const result = client.matchProjectFromMirroringEndpointGroupName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.mirroringEndpointGroupPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromMirroringEndpointGroupName', () => { + const result = client.matchLocationFromMirroringEndpointGroupName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.mirroringEndpointGroupPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchMirroringEndpointGroupFromMirroringEndpointGroupName', () => { + const result = client.matchMirroringEndpointGroupFromMirroringEndpointGroupName(fakePath); + assert.strictEqual(result, "mirroringEndpointGroupValue"); + assert((client.pathTemplates.mirroringEndpointGroupPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('mirroringEndpointGroupAssociation', async () => { + const fakePath = "/rendered/path/mirroringEndpointGroupAssociation"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + mirroring_endpoint_group_association: "mirroringEndpointGroupAssociationValue", + }; + const client = new interceptModule.v1.InterceptClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.mirroringEndpointGroupAssociationPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.mirroringEndpointGroupAssociationPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('mirroringEndpointGroupAssociationPath', () => { + const result = client.mirroringEndpointGroupAssociationPath("projectValue", "locationValue", "mirroringEndpointGroupAssociationValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.mirroringEndpointGroupAssociationPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromMirroringEndpointGroupAssociationName', () => { + const result = client.matchProjectFromMirroringEndpointGroupAssociationName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.mirroringEndpointGroupAssociationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromMirroringEndpointGroupAssociationName', () => { + const result = client.matchLocationFromMirroringEndpointGroupAssociationName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.mirroringEndpointGroupAssociationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchMirroringEndpointGroupAssociationFromMirroringEndpointGroupAssociationName', () => { + const result = client.matchMirroringEndpointGroupAssociationFromMirroringEndpointGroupAssociationName(fakePath); + assert.strictEqual(result, "mirroringEndpointGroupAssociationValue"); + assert((client.pathTemplates.mirroringEndpointGroupAssociationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('network', async () => { + const fakePath = "/rendered/path/network"; + const expectedParameters = { + project: "projectValue", + network: "networkValue", + }; + const client = new interceptModule.v1.InterceptClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.networkPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.networkPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('networkPath', () => { + const result = client.networkPath("projectValue", "networkValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.networkPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromNetworkName', () => { + const result = client.matchProjectFromNetworkName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.networkPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchNetworkFromNetworkName', () => { + const result = client.matchNetworkFromNetworkName(fakePath); + assert.strictEqual(result, "networkValue"); + assert((client.pathTemplates.networkPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('organizationLocationAddressGroup', async () => { + const fakePath = "/rendered/path/organizationLocationAddressGroup"; + const expectedParameters = { + organization: "organizationValue", + location: "locationValue", + address_group: "addressGroupValue", + }; + const client = new interceptModule.v1.InterceptClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.organizationLocationAddressGroupPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.organizationLocationAddressGroupPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('organizationLocationAddressGroupPath', () => { + const result = client.organizationLocationAddressGroupPath("organizationValue", "locationValue", "addressGroupValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.organizationLocationAddressGroupPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchOrganizationFromOrganizationLocationAddressGroupName', () => { + const result = client.matchOrganizationFromOrganizationLocationAddressGroupName(fakePath); + assert.strictEqual(result, "organizationValue"); + assert((client.pathTemplates.organizationLocationAddressGroupPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromOrganizationLocationAddressGroupName', () => { + const result = client.matchLocationFromOrganizationLocationAddressGroupName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.organizationLocationAddressGroupPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchAddressGroupFromOrganizationLocationAddressGroupName', () => { + const result = client.matchAddressGroupFromOrganizationLocationAddressGroupName(fakePath); + assert.strictEqual(result, "addressGroupValue"); + assert((client.pathTemplates.organizationLocationAddressGroupPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('organizationLocationFirewallEndpoints', async () => { + const fakePath = "/rendered/path/organizationLocationFirewallEndpoints"; + const expectedParameters = { + organization: "organizationValue", + location: "locationValue", + firewall_endpoint: "firewallEndpointValue", + }; + const client = new interceptModule.v1.InterceptClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.organizationLocationFirewallEndpointsPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.organizationLocationFirewallEndpointsPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('organizationLocationFirewallEndpointsPath', () => { + const result = client.organizationLocationFirewallEndpointsPath("organizationValue", "locationValue", "firewallEndpointValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.organizationLocationFirewallEndpointsPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchOrganizationFromOrganizationLocationFirewallEndpointsName', () => { + const result = client.matchOrganizationFromOrganizationLocationFirewallEndpointsName(fakePath); + assert.strictEqual(result, "organizationValue"); + assert((client.pathTemplates.organizationLocationFirewallEndpointsPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromOrganizationLocationFirewallEndpointsName', () => { + const result = client.matchLocationFromOrganizationLocationFirewallEndpointsName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.organizationLocationFirewallEndpointsPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchFirewallEndpointFromOrganizationLocationFirewallEndpointsName', () => { + const result = client.matchFirewallEndpointFromOrganizationLocationFirewallEndpointsName(fakePath); + assert.strictEqual(result, "firewallEndpointValue"); + assert((client.pathTemplates.organizationLocationFirewallEndpointsPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('organizationLocationSecurityProfile', async () => { + const fakePath = "/rendered/path/organizationLocationSecurityProfile"; + const expectedParameters = { + organization: "organizationValue", + location: "locationValue", + security_profile: "securityProfileValue", + }; + const client = new interceptModule.v1.InterceptClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.organizationLocationSecurityProfilePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.organizationLocationSecurityProfilePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('organizationLocationSecurityProfilePath', () => { + const result = client.organizationLocationSecurityProfilePath("organizationValue", "locationValue", "securityProfileValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.organizationLocationSecurityProfilePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchOrganizationFromOrganizationLocationSecurityProfileName', () => { + const result = client.matchOrganizationFromOrganizationLocationSecurityProfileName(fakePath); + assert.strictEqual(result, "organizationValue"); + assert((client.pathTemplates.organizationLocationSecurityProfilePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromOrganizationLocationSecurityProfileName', () => { + const result = client.matchLocationFromOrganizationLocationSecurityProfileName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.organizationLocationSecurityProfilePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchSecurityProfileFromOrganizationLocationSecurityProfileName', () => { + const result = client.matchSecurityProfileFromOrganizationLocationSecurityProfileName(fakePath); + assert.strictEqual(result, "securityProfileValue"); + assert((client.pathTemplates.organizationLocationSecurityProfilePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('organizationLocationSecurityProfileGroup', async () => { + const fakePath = "/rendered/path/organizationLocationSecurityProfileGroup"; + const expectedParameters = { + organization: "organizationValue", + location: "locationValue", + security_profile_group: "securityProfileGroupValue", + }; + const client = new interceptModule.v1.InterceptClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.organizationLocationSecurityProfileGroupPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.organizationLocationSecurityProfileGroupPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('organizationLocationSecurityProfileGroupPath', () => { + const result = client.organizationLocationSecurityProfileGroupPath("organizationValue", "locationValue", "securityProfileGroupValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.organizationLocationSecurityProfileGroupPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchOrganizationFromOrganizationLocationSecurityProfileGroupName', () => { + const result = client.matchOrganizationFromOrganizationLocationSecurityProfileGroupName(fakePath); + assert.strictEqual(result, "organizationValue"); + assert((client.pathTemplates.organizationLocationSecurityProfileGroupPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromOrganizationLocationSecurityProfileGroupName', () => { + const result = client.matchLocationFromOrganizationLocationSecurityProfileGroupName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.organizationLocationSecurityProfileGroupPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchSecurityProfileGroupFromOrganizationLocationSecurityProfileGroupName', () => { + const result = client.matchSecurityProfileGroupFromOrganizationLocationSecurityProfileGroupName(fakePath); + assert.strictEqual(result, "securityProfileGroupValue"); + assert((client.pathTemplates.organizationLocationSecurityProfileGroupPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('project', async () => { + const fakePath = "/rendered/path/project"; + const expectedParameters = { + project: "projectValue", + }; + const client = new interceptModule.v1.InterceptClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectPath', () => { + const result = client.projectPath("projectValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.projectPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromProjectName', () => { + const result = client.matchProjectFromProjectName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.projectPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('projectLocationAddressGroup', async () => { + const fakePath = "/rendered/path/projectLocationAddressGroup"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + address_group: "addressGroupValue", + }; + const client = new interceptModule.v1.InterceptClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectLocationAddressGroupPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationAddressGroupPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationAddressGroupPath', () => { + const result = client.projectLocationAddressGroupPath("projectValue", "locationValue", "addressGroupValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.projectLocationAddressGroupPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromProjectLocationAddressGroupName', () => { + const result = client.matchProjectFromProjectLocationAddressGroupName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.projectLocationAddressGroupPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromProjectLocationAddressGroupName', () => { + const result = client.matchLocationFromProjectLocationAddressGroupName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.projectLocationAddressGroupPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchAddressGroupFromProjectLocationAddressGroupName', () => { + const result = client.matchAddressGroupFromProjectLocationAddressGroupName(fakePath); + assert.strictEqual(result, "addressGroupValue"); + assert((client.pathTemplates.projectLocationAddressGroupPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('projectLocationFirewallEndpoints', async () => { + const fakePath = "/rendered/path/projectLocationFirewallEndpoints"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + firewall_endpoint: "firewallEndpointValue", + }; + const client = new interceptModule.v1.InterceptClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectLocationFirewallEndpointsPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationFirewallEndpointsPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationFirewallEndpointsPath', () => { + const result = client.projectLocationFirewallEndpointsPath("projectValue", "locationValue", "firewallEndpointValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.projectLocationFirewallEndpointsPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromProjectLocationFirewallEndpointsName', () => { + const result = client.matchProjectFromProjectLocationFirewallEndpointsName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.projectLocationFirewallEndpointsPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromProjectLocationFirewallEndpointsName', () => { + const result = client.matchLocationFromProjectLocationFirewallEndpointsName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.projectLocationFirewallEndpointsPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchFirewallEndpointFromProjectLocationFirewallEndpointsName', () => { + const result = client.matchFirewallEndpointFromProjectLocationFirewallEndpointsName(fakePath); + assert.strictEqual(result, "firewallEndpointValue"); + assert((client.pathTemplates.projectLocationFirewallEndpointsPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('projectLocationSecurityProfile', async () => { + const fakePath = "/rendered/path/projectLocationSecurityProfile"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + security_profile: "securityProfileValue", + }; + const client = new interceptModule.v1.InterceptClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectLocationSecurityProfilePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationSecurityProfilePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationSecurityProfilePath', () => { + const result = client.projectLocationSecurityProfilePath("projectValue", "locationValue", "securityProfileValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.projectLocationSecurityProfilePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromProjectLocationSecurityProfileName', () => { + const result = client.matchProjectFromProjectLocationSecurityProfileName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.projectLocationSecurityProfilePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromProjectLocationSecurityProfileName', () => { + const result = client.matchLocationFromProjectLocationSecurityProfileName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.projectLocationSecurityProfilePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchSecurityProfileFromProjectLocationSecurityProfileName', () => { + const result = client.matchSecurityProfileFromProjectLocationSecurityProfileName(fakePath); + assert.strictEqual(result, "securityProfileValue"); + assert((client.pathTemplates.projectLocationSecurityProfilePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('projectLocationSecurityProfileGroup', async () => { + const fakePath = "/rendered/path/projectLocationSecurityProfileGroup"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + security_profile_group: "securityProfileGroupValue", + }; + const client = new interceptModule.v1.InterceptClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectLocationSecurityProfileGroupPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationSecurityProfileGroupPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationSecurityProfileGroupPath', () => { + const result = client.projectLocationSecurityProfileGroupPath("projectValue", "locationValue", "securityProfileGroupValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.projectLocationSecurityProfileGroupPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromProjectLocationSecurityProfileGroupName', () => { + const result = client.matchProjectFromProjectLocationSecurityProfileGroupName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.projectLocationSecurityProfileGroupPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromProjectLocationSecurityProfileGroupName', () => { + const result = client.matchLocationFromProjectLocationSecurityProfileGroupName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.projectLocationSecurityProfileGroupPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchSecurityProfileGroupFromProjectLocationSecurityProfileGroupName', () => { + const result = client.matchSecurityProfileGroupFromProjectLocationSecurityProfileGroupName(fakePath); + assert.strictEqual(result, "securityProfileGroupValue"); + assert((client.pathTemplates.projectLocationSecurityProfileGroupPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('serverTlsPolicy', async () => { + const fakePath = "/rendered/path/serverTlsPolicy"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + server_tls_policy: "serverTlsPolicyValue", + }; + const client = new interceptModule.v1.InterceptClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.serverTlsPolicyPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.serverTlsPolicyPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('serverTlsPolicyPath', () => { + const result = client.serverTlsPolicyPath("projectValue", "locationValue", "serverTlsPolicyValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.serverTlsPolicyPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromServerTlsPolicyName', () => { + const result = client.matchProjectFromServerTlsPolicyName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.serverTlsPolicyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromServerTlsPolicyName', () => { + const result = client.matchLocationFromServerTlsPolicyName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.serverTlsPolicyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchServerTlsPolicyFromServerTlsPolicyName', () => { + const result = client.matchServerTlsPolicyFromServerTlsPolicyName(fakePath); + assert.strictEqual(result, "serverTlsPolicyValue"); + assert((client.pathTemplates.serverTlsPolicyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('tlsInspectionPolicy', async () => { + const fakePath = "/rendered/path/tlsInspectionPolicy"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + tls_inspection_policy: "tlsInspectionPolicyValue", + }; + const client = new interceptModule.v1.InterceptClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.tlsInspectionPolicyPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.tlsInspectionPolicyPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('tlsInspectionPolicyPath', () => { + const result = client.tlsInspectionPolicyPath("projectValue", "locationValue", "tlsInspectionPolicyValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.tlsInspectionPolicyPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromTlsInspectionPolicyName', () => { + const result = client.matchProjectFromTlsInspectionPolicyName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.tlsInspectionPolicyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromTlsInspectionPolicyName', () => { + const result = client.matchLocationFromTlsInspectionPolicyName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.tlsInspectionPolicyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchTlsInspectionPolicyFromTlsInspectionPolicyName', () => { + const result = client.matchTlsInspectionPolicyFromTlsInspectionPolicyName(fakePath); + assert.strictEqual(result, "tlsInspectionPolicyValue"); + assert((client.pathTemplates.tlsInspectionPolicyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('urlList', async () => { + const fakePath = "/rendered/path/urlList"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + url_list: "urlListValue", + }; + const client = new interceptModule.v1.InterceptClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.urlListPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.urlListPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('urlListPath', () => { + const result = client.urlListPath("projectValue", "locationValue", "urlListValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.urlListPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromUrlListName', () => { + const result = client.matchProjectFromUrlListName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.urlListPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromUrlListName', () => { + const result = client.matchLocationFromUrlListName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.urlListPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchUrlListFromUrlListName', () => { + const result = client.matchUrlListFromUrlListName(fakePath); + assert.strictEqual(result, "urlListValue"); + assert((client.pathTemplates.urlListPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + }); +}); diff --git a/packages/google-cloud-networksecurity/test/gapic_mirroring_v1.ts b/packages/google-cloud-networksecurity/test/gapic_mirroring_v1.ts new file mode 100644 index 00000000000..a6a7c910303 --- /dev/null +++ b/packages/google-cloud-networksecurity/test/gapic_mirroring_v1.ts @@ -0,0 +1,5647 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import * as protos from '../protos/protos'; +import * as assert from 'assert'; +import * as sinon from 'sinon'; +import {SinonStub} from 'sinon'; +import {describe, it} from 'mocha'; +import * as mirroringModule from '../src'; + +import {PassThrough} from 'stream'; + +import {protobuf, LROperation, operationsProtos, IamProtos, LocationProtos} from 'google-gax'; + +// Dynamically loaded proto JSON is needed to get the type information +// to fill in default values for request objects +const root = protobuf.Root.fromJSON(require('../protos/protos.json')).resolveAll(); + +// eslint-disable-next-line @typescript-eslint/no-unused-vars +function getTypeDefaultValue(typeName: string, fields: string[]) { + let type = root.lookupType(typeName) as protobuf.Type; + for (const field of fields.slice(0, -1)) { + type = type.fields[field]?.resolvedType as protobuf.Type; + } + return type.fields[fields[fields.length - 1]]?.defaultValue; +} + +function generateSampleMessage(instance: T) { + const filledObject = (instance.constructor as typeof protobuf.Message) + .toObject(instance as protobuf.Message, {defaults: true}); + return (instance.constructor as typeof protobuf.Message).fromObject(filledObject) as T; +} + +function stubSimpleCall(response?: ResponseType, error?: Error) { + return error ? sinon.stub().rejects(error) : sinon.stub().resolves([response]); +} + +function stubSimpleCallWithCallback(response?: ResponseType, error?: Error) { + return error ? sinon.stub().callsArgWith(2, error) : sinon.stub().callsArgWith(2, null, response); +} + +function stubLongRunningCall(response?: ResponseType, callError?: Error, lroError?: Error) { + const innerStub = lroError ? sinon.stub().rejects(lroError) : sinon.stub().resolves([response]); + const mockOperation = { + promise: innerStub, + }; + return callError ? sinon.stub().rejects(callError) : sinon.stub().resolves([mockOperation]); +} + +function stubLongRunningCallWithCallback(response?: ResponseType, callError?: Error, lroError?: Error) { + const innerStub = lroError ? sinon.stub().rejects(lroError) : sinon.stub().resolves([response]); + const mockOperation = { + promise: innerStub, + }; + return callError ? sinon.stub().callsArgWith(2, callError) : sinon.stub().callsArgWith(2, null, mockOperation); +} + +function stubPageStreamingCall(responses?: ResponseType[], error?: Error) { + const pagingStub = sinon.stub(); + if (responses) { + for (let i = 0; i < responses.length; ++i) { + pagingStub.onCall(i).callsArgWith(2, null, responses[i]); + } + } + const transformStub = error ? sinon.stub().callsArgWith(2, error) : pagingStub; + const mockStream = new PassThrough({ + objectMode: true, + transform: transformStub, + }); + // trigger as many responses as needed + if (responses) { + for (let i = 0; i < responses.length; ++i) { + setImmediate(() => { mockStream.write({}); }); + } + setImmediate(() => { mockStream.end(); }); + } else { + setImmediate(() => { mockStream.write({}); }); + setImmediate(() => { mockStream.end(); }); + } + return sinon.stub().returns(mockStream); +} + +function stubAsyncIterationCall(responses?: ResponseType[], error?: Error) { + let counter = 0; + const asyncIterable = { + [Symbol.asyncIterator]() { + return { + async next() { + if (error) { + return Promise.reject(error); + } + if (counter >= responses!.length) { + return Promise.resolve({done: true, value: undefined}); + } + return Promise.resolve({done: false, value: responses![counter++]}); + } + }; + } + }; + return sinon.stub().returns(asyncIterable); +} + +describe('v1.MirroringClient', () => { + describe('Common methods', () => { + it('has apiEndpoint', () => { + const client = new mirroringModule.v1.MirroringClient(); + const apiEndpoint = client.apiEndpoint; + assert.strictEqual(apiEndpoint, 'networksecurity.googleapis.com'); + }); + + it('has universeDomain', () => { + const client = new mirroringModule.v1.MirroringClient(); + const universeDomain = client.universeDomain; + assert.strictEqual(universeDomain, "googleapis.com"); + }); + + if (typeof process === 'object' && typeof process.emitWarning === 'function') { + it('throws DeprecationWarning if static servicePath is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const servicePath = mirroringModule.v1.MirroringClient.servicePath; + assert.strictEqual(servicePath, 'networksecurity.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + + it('throws DeprecationWarning if static apiEndpoint is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const apiEndpoint = mirroringModule.v1.MirroringClient.apiEndpoint; + assert.strictEqual(apiEndpoint, 'networksecurity.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + } + it('sets apiEndpoint according to universe domain camelCase', () => { + const client = new mirroringModule.v1.MirroringClient({universeDomain: 'example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'networksecurity.example.com'); + }); + + it('sets apiEndpoint according to universe domain snakeCase', () => { + const client = new mirroringModule.v1.MirroringClient({universe_domain: 'example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'networksecurity.example.com'); + }); + + if (typeof process === 'object' && 'env' in process) { + describe('GOOGLE_CLOUD_UNIVERSE_DOMAIN environment variable', () => { + it('sets apiEndpoint from environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = new mirroringModule.v1.MirroringClient(); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'networksecurity.example.com'); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + + it('value configured in code has priority over environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = new mirroringModule.v1.MirroringClient({universeDomain: 'configured.example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'networksecurity.configured.example.com'); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + }); + } + it('does not allow setting both universeDomain and universe_domain', () => { + assert.throws(() => { new mirroringModule.v1.MirroringClient({universe_domain: 'example.com', universeDomain: 'example.net'}); }); + }); + + it('has port', () => { + const port = mirroringModule.v1.MirroringClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new mirroringModule.v1.MirroringClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new mirroringModule.v1.MirroringClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new mirroringModule.v1.MirroringClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.mirroringStub, undefined); + await client.initialize(); + assert(client.mirroringStub); + }); + + it('has close method for the initialized client', done => { + const client = new mirroringModule.v1.MirroringClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize().catch(err => {throw err}); + assert(client.mirroringStub); + client.close().then(() => { + done(); + }).catch(err => {throw err}); + }); + + it('has close method for the non-initialized client', done => { + const client = new mirroringModule.v1.MirroringClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.mirroringStub, undefined); + client.close().then(() => { + done(); + }).catch(err => {throw err}); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new mirroringModule.v1.MirroringClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.auth.getProjectId = sinon.stub().resolves(fakeProjectId); + const result = await client.getProjectId(); + assert.strictEqual(result, fakeProjectId); + assert((client.auth.getProjectId as SinonStub).calledWithExactly()); + }); + + it('has getProjectId method with callback', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new mirroringModule.v1.MirroringClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.auth.getProjectId = sinon.stub().callsArgWith(0, null, fakeProjectId); + const promise = new Promise((resolve, reject) => { + client.getProjectId((err?: Error|null, projectId?: string|null) => { + if (err) { + reject(err); + } else { + resolve(projectId); + } + }); + }); + const result = await promise; + assert.strictEqual(result, fakeProjectId); + }); + }); + + describe('getMirroringEndpointGroup', () => { + it('invokes getMirroringEndpointGroup without error', async () => { + const client = new mirroringModule.v1.MirroringClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.GetMirroringEndpointGroupRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.GetMirroringEndpointGroupRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.MirroringEndpointGroup() + ); + client.innerApiCalls.getMirroringEndpointGroup = stubSimpleCall(expectedResponse); + const [response] = await client.getMirroringEndpointGroup(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getMirroringEndpointGroup as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getMirroringEndpointGroup as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getMirroringEndpointGroup without error using callback', async () => { + const client = new mirroringModule.v1.MirroringClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.GetMirroringEndpointGroupRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.GetMirroringEndpointGroupRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.MirroringEndpointGroup() + ); + client.innerApiCalls.getMirroringEndpointGroup = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getMirroringEndpointGroup( + request, + (err?: Error|null, result?: protos.google.cloud.networksecurity.v1.IMirroringEndpointGroup|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getMirroringEndpointGroup as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getMirroringEndpointGroup as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getMirroringEndpointGroup with error', async () => { + const client = new mirroringModule.v1.MirroringClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.GetMirroringEndpointGroupRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.GetMirroringEndpointGroupRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.getMirroringEndpointGroup = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getMirroringEndpointGroup(request), expectedError); + const actualRequest = (client.innerApiCalls.getMirroringEndpointGroup as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getMirroringEndpointGroup as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getMirroringEndpointGroup with closed client', async () => { + const client = new mirroringModule.v1.MirroringClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.GetMirroringEndpointGroupRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.GetMirroringEndpointGroupRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.getMirroringEndpointGroup(request), expectedError); + }); + }); + + describe('getMirroringEndpointGroupAssociation', () => { + it('invokes getMirroringEndpointGroupAssociation without error', async () => { + const client = new mirroringModule.v1.MirroringClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.GetMirroringEndpointGroupAssociationRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.GetMirroringEndpointGroupAssociationRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.MirroringEndpointGroupAssociation() + ); + client.innerApiCalls.getMirroringEndpointGroupAssociation = stubSimpleCall(expectedResponse); + const [response] = await client.getMirroringEndpointGroupAssociation(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getMirroringEndpointGroupAssociation as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getMirroringEndpointGroupAssociation as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getMirroringEndpointGroupAssociation without error using callback', async () => { + const client = new mirroringModule.v1.MirroringClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.GetMirroringEndpointGroupAssociationRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.GetMirroringEndpointGroupAssociationRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.MirroringEndpointGroupAssociation() + ); + client.innerApiCalls.getMirroringEndpointGroupAssociation = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getMirroringEndpointGroupAssociation( + request, + (err?: Error|null, result?: protos.google.cloud.networksecurity.v1.IMirroringEndpointGroupAssociation|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getMirroringEndpointGroupAssociation as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getMirroringEndpointGroupAssociation as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getMirroringEndpointGroupAssociation with error', async () => { + const client = new mirroringModule.v1.MirroringClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.GetMirroringEndpointGroupAssociationRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.GetMirroringEndpointGroupAssociationRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.getMirroringEndpointGroupAssociation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getMirroringEndpointGroupAssociation(request), expectedError); + const actualRequest = (client.innerApiCalls.getMirroringEndpointGroupAssociation as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getMirroringEndpointGroupAssociation as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getMirroringEndpointGroupAssociation with closed client', async () => { + const client = new mirroringModule.v1.MirroringClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.GetMirroringEndpointGroupAssociationRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.GetMirroringEndpointGroupAssociationRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.getMirroringEndpointGroupAssociation(request), expectedError); + }); + }); + + describe('getMirroringDeploymentGroup', () => { + it('invokes getMirroringDeploymentGroup without error', async () => { + const client = new mirroringModule.v1.MirroringClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.GetMirroringDeploymentGroupRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.GetMirroringDeploymentGroupRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.MirroringDeploymentGroup() + ); + client.innerApiCalls.getMirroringDeploymentGroup = stubSimpleCall(expectedResponse); + const [response] = await client.getMirroringDeploymentGroup(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getMirroringDeploymentGroup as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getMirroringDeploymentGroup as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getMirroringDeploymentGroup without error using callback', async () => { + const client = new mirroringModule.v1.MirroringClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.GetMirroringDeploymentGroupRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.GetMirroringDeploymentGroupRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.MirroringDeploymentGroup() + ); + client.innerApiCalls.getMirroringDeploymentGroup = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getMirroringDeploymentGroup( + request, + (err?: Error|null, result?: protos.google.cloud.networksecurity.v1.IMirroringDeploymentGroup|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getMirroringDeploymentGroup as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getMirroringDeploymentGroup as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getMirroringDeploymentGroup with error', async () => { + const client = new mirroringModule.v1.MirroringClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.GetMirroringDeploymentGroupRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.GetMirroringDeploymentGroupRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.getMirroringDeploymentGroup = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getMirroringDeploymentGroup(request), expectedError); + const actualRequest = (client.innerApiCalls.getMirroringDeploymentGroup as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getMirroringDeploymentGroup as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getMirroringDeploymentGroup with closed client', async () => { + const client = new mirroringModule.v1.MirroringClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.GetMirroringDeploymentGroupRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.GetMirroringDeploymentGroupRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.getMirroringDeploymentGroup(request), expectedError); + }); + }); + + describe('getMirroringDeployment', () => { + it('invokes getMirroringDeployment without error', async () => { + const client = new mirroringModule.v1.MirroringClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.GetMirroringDeploymentRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.GetMirroringDeploymentRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.MirroringDeployment() + ); + client.innerApiCalls.getMirroringDeployment = stubSimpleCall(expectedResponse); + const [response] = await client.getMirroringDeployment(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getMirroringDeployment as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getMirroringDeployment as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getMirroringDeployment without error using callback', async () => { + const client = new mirroringModule.v1.MirroringClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.GetMirroringDeploymentRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.GetMirroringDeploymentRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.MirroringDeployment() + ); + client.innerApiCalls.getMirroringDeployment = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getMirroringDeployment( + request, + (err?: Error|null, result?: protos.google.cloud.networksecurity.v1.IMirroringDeployment|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getMirroringDeployment as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getMirroringDeployment as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getMirroringDeployment with error', async () => { + const client = new mirroringModule.v1.MirroringClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.GetMirroringDeploymentRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.GetMirroringDeploymentRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.getMirroringDeployment = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getMirroringDeployment(request), expectedError); + const actualRequest = (client.innerApiCalls.getMirroringDeployment as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getMirroringDeployment as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getMirroringDeployment with closed client', async () => { + const client = new mirroringModule.v1.MirroringClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.GetMirroringDeploymentRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.GetMirroringDeploymentRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.getMirroringDeployment(request), expectedError); + }); + }); + + describe('createMirroringEndpointGroup', () => { + it('invokes createMirroringEndpointGroup without error', async () => { + const client = new mirroringModule.v1.MirroringClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.CreateMirroringEndpointGroupRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.CreateMirroringEndpointGroupRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createMirroringEndpointGroup = stubLongRunningCall(expectedResponse); + const [operation] = await client.createMirroringEndpointGroup(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createMirroringEndpointGroup as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createMirroringEndpointGroup as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createMirroringEndpointGroup without error using callback', async () => { + const client = new mirroringModule.v1.MirroringClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.CreateMirroringEndpointGroupRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.CreateMirroringEndpointGroupRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createMirroringEndpointGroup = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createMirroringEndpointGroup( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createMirroringEndpointGroup as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createMirroringEndpointGroup as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createMirroringEndpointGroup with call error', async () => { + const client = new mirroringModule.v1.MirroringClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.CreateMirroringEndpointGroupRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.CreateMirroringEndpointGroupRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.createMirroringEndpointGroup = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.createMirroringEndpointGroup(request), expectedError); + const actualRequest = (client.innerApiCalls.createMirroringEndpointGroup as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createMirroringEndpointGroup as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createMirroringEndpointGroup with LRO error', async () => { + const client = new mirroringModule.v1.MirroringClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.CreateMirroringEndpointGroupRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.CreateMirroringEndpointGroupRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.createMirroringEndpointGroup = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.createMirroringEndpointGroup(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.createMirroringEndpointGroup as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createMirroringEndpointGroup as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkCreateMirroringEndpointGroupProgress without error', async () => { + const client = new mirroringModule.v1.MirroringClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkCreateMirroringEndpointGroupProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkCreateMirroringEndpointGroupProgress with error', async () => { + const client = new mirroringModule.v1.MirroringClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkCreateMirroringEndpointGroupProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('updateMirroringEndpointGroup', () => { + it('invokes updateMirroringEndpointGroup without error', async () => { + const client = new mirroringModule.v1.MirroringClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.UpdateMirroringEndpointGroupRequest() + ); + request.mirroringEndpointGroup ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.UpdateMirroringEndpointGroupRequest', ['mirroringEndpointGroup', 'name']); + request.mirroringEndpointGroup.name = defaultValue1; + const expectedHeaderRequestParams = `mirroring_endpoint_group.name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.updateMirroringEndpointGroup = stubLongRunningCall(expectedResponse); + const [operation] = await client.updateMirroringEndpointGroup(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateMirroringEndpointGroup as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateMirroringEndpointGroup as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateMirroringEndpointGroup without error using callback', async () => { + const client = new mirroringModule.v1.MirroringClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.UpdateMirroringEndpointGroupRequest() + ); + request.mirroringEndpointGroup ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.UpdateMirroringEndpointGroupRequest', ['mirroringEndpointGroup', 'name']); + request.mirroringEndpointGroup.name = defaultValue1; + const expectedHeaderRequestParams = `mirroring_endpoint_group.name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.updateMirroringEndpointGroup = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateMirroringEndpointGroup( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateMirroringEndpointGroup as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateMirroringEndpointGroup as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateMirroringEndpointGroup with call error', async () => { + const client = new mirroringModule.v1.MirroringClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.UpdateMirroringEndpointGroupRequest() + ); + request.mirroringEndpointGroup ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.UpdateMirroringEndpointGroupRequest', ['mirroringEndpointGroup', 'name']); + request.mirroringEndpointGroup.name = defaultValue1; + const expectedHeaderRequestParams = `mirroring_endpoint_group.name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateMirroringEndpointGroup = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.updateMirroringEndpointGroup(request), expectedError); + const actualRequest = (client.innerApiCalls.updateMirroringEndpointGroup as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateMirroringEndpointGroup as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateMirroringEndpointGroup with LRO error', async () => { + const client = new mirroringModule.v1.MirroringClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.UpdateMirroringEndpointGroupRequest() + ); + request.mirroringEndpointGroup ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.UpdateMirroringEndpointGroupRequest', ['mirroringEndpointGroup', 'name']); + request.mirroringEndpointGroup.name = defaultValue1; + const expectedHeaderRequestParams = `mirroring_endpoint_group.name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateMirroringEndpointGroup = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.updateMirroringEndpointGroup(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.updateMirroringEndpointGroup as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateMirroringEndpointGroup as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkUpdateMirroringEndpointGroupProgress without error', async () => { + const client = new mirroringModule.v1.MirroringClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkUpdateMirroringEndpointGroupProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkUpdateMirroringEndpointGroupProgress with error', async () => { + const client = new mirroringModule.v1.MirroringClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkUpdateMirroringEndpointGroupProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('deleteMirroringEndpointGroup', () => { + it('invokes deleteMirroringEndpointGroup without error', async () => { + const client = new mirroringModule.v1.MirroringClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.DeleteMirroringEndpointGroupRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.DeleteMirroringEndpointGroupRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteMirroringEndpointGroup = stubLongRunningCall(expectedResponse); + const [operation] = await client.deleteMirroringEndpointGroup(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.deleteMirroringEndpointGroup as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteMirroringEndpointGroup as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteMirroringEndpointGroup without error using callback', async () => { + const client = new mirroringModule.v1.MirroringClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.DeleteMirroringEndpointGroupRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.DeleteMirroringEndpointGroupRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteMirroringEndpointGroup = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteMirroringEndpointGroup( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.deleteMirroringEndpointGroup as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteMirroringEndpointGroup as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteMirroringEndpointGroup with call error', async () => { + const client = new mirroringModule.v1.MirroringClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.DeleteMirroringEndpointGroupRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.DeleteMirroringEndpointGroupRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteMirroringEndpointGroup = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.deleteMirroringEndpointGroup(request), expectedError); + const actualRequest = (client.innerApiCalls.deleteMirroringEndpointGroup as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteMirroringEndpointGroup as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteMirroringEndpointGroup with LRO error', async () => { + const client = new mirroringModule.v1.MirroringClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.DeleteMirroringEndpointGroupRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.DeleteMirroringEndpointGroupRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteMirroringEndpointGroup = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.deleteMirroringEndpointGroup(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.deleteMirroringEndpointGroup as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteMirroringEndpointGroup as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkDeleteMirroringEndpointGroupProgress without error', async () => { + const client = new mirroringModule.v1.MirroringClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkDeleteMirroringEndpointGroupProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkDeleteMirroringEndpointGroupProgress with error', async () => { + const client = new mirroringModule.v1.MirroringClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkDeleteMirroringEndpointGroupProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('createMirroringEndpointGroupAssociation', () => { + it('invokes createMirroringEndpointGroupAssociation without error', async () => { + const client = new mirroringModule.v1.MirroringClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.CreateMirroringEndpointGroupAssociationRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.CreateMirroringEndpointGroupAssociationRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createMirroringEndpointGroupAssociation = stubLongRunningCall(expectedResponse); + const [operation] = await client.createMirroringEndpointGroupAssociation(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createMirroringEndpointGroupAssociation as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createMirroringEndpointGroupAssociation as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createMirroringEndpointGroupAssociation without error using callback', async () => { + const client = new mirroringModule.v1.MirroringClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.CreateMirroringEndpointGroupAssociationRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.CreateMirroringEndpointGroupAssociationRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createMirroringEndpointGroupAssociation = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createMirroringEndpointGroupAssociation( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createMirroringEndpointGroupAssociation as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createMirroringEndpointGroupAssociation as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createMirroringEndpointGroupAssociation with call error', async () => { + const client = new mirroringModule.v1.MirroringClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.CreateMirroringEndpointGroupAssociationRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.CreateMirroringEndpointGroupAssociationRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.createMirroringEndpointGroupAssociation = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.createMirroringEndpointGroupAssociation(request), expectedError); + const actualRequest = (client.innerApiCalls.createMirroringEndpointGroupAssociation as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createMirroringEndpointGroupAssociation as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createMirroringEndpointGroupAssociation with LRO error', async () => { + const client = new mirroringModule.v1.MirroringClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.CreateMirroringEndpointGroupAssociationRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.CreateMirroringEndpointGroupAssociationRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.createMirroringEndpointGroupAssociation = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.createMirroringEndpointGroupAssociation(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.createMirroringEndpointGroupAssociation as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createMirroringEndpointGroupAssociation as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkCreateMirroringEndpointGroupAssociationProgress without error', async () => { + const client = new mirroringModule.v1.MirroringClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkCreateMirroringEndpointGroupAssociationProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkCreateMirroringEndpointGroupAssociationProgress with error', async () => { + const client = new mirroringModule.v1.MirroringClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkCreateMirroringEndpointGroupAssociationProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('updateMirroringEndpointGroupAssociation', () => { + it('invokes updateMirroringEndpointGroupAssociation without error', async () => { + const client = new mirroringModule.v1.MirroringClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.UpdateMirroringEndpointGroupAssociationRequest() + ); + request.mirroringEndpointGroupAssociation ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.UpdateMirroringEndpointGroupAssociationRequest', ['mirroringEndpointGroupAssociation', 'name']); + request.mirroringEndpointGroupAssociation.name = defaultValue1; + const expectedHeaderRequestParams = `mirroring_endpoint_group_association.name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.updateMirroringEndpointGroupAssociation = stubLongRunningCall(expectedResponse); + const [operation] = await client.updateMirroringEndpointGroupAssociation(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateMirroringEndpointGroupAssociation as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateMirroringEndpointGroupAssociation as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateMirroringEndpointGroupAssociation without error using callback', async () => { + const client = new mirroringModule.v1.MirroringClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.UpdateMirroringEndpointGroupAssociationRequest() + ); + request.mirroringEndpointGroupAssociation ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.UpdateMirroringEndpointGroupAssociationRequest', ['mirroringEndpointGroupAssociation', 'name']); + request.mirroringEndpointGroupAssociation.name = defaultValue1; + const expectedHeaderRequestParams = `mirroring_endpoint_group_association.name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.updateMirroringEndpointGroupAssociation = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateMirroringEndpointGroupAssociation( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateMirroringEndpointGroupAssociation as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateMirroringEndpointGroupAssociation as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateMirroringEndpointGroupAssociation with call error', async () => { + const client = new mirroringModule.v1.MirroringClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.UpdateMirroringEndpointGroupAssociationRequest() + ); + request.mirroringEndpointGroupAssociation ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.UpdateMirroringEndpointGroupAssociationRequest', ['mirroringEndpointGroupAssociation', 'name']); + request.mirroringEndpointGroupAssociation.name = defaultValue1; + const expectedHeaderRequestParams = `mirroring_endpoint_group_association.name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateMirroringEndpointGroupAssociation = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.updateMirroringEndpointGroupAssociation(request), expectedError); + const actualRequest = (client.innerApiCalls.updateMirroringEndpointGroupAssociation as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateMirroringEndpointGroupAssociation as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateMirroringEndpointGroupAssociation with LRO error', async () => { + const client = new mirroringModule.v1.MirroringClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.UpdateMirroringEndpointGroupAssociationRequest() + ); + request.mirroringEndpointGroupAssociation ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.UpdateMirroringEndpointGroupAssociationRequest', ['mirroringEndpointGroupAssociation', 'name']); + request.mirroringEndpointGroupAssociation.name = defaultValue1; + const expectedHeaderRequestParams = `mirroring_endpoint_group_association.name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateMirroringEndpointGroupAssociation = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.updateMirroringEndpointGroupAssociation(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.updateMirroringEndpointGroupAssociation as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateMirroringEndpointGroupAssociation as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkUpdateMirroringEndpointGroupAssociationProgress without error', async () => { + const client = new mirroringModule.v1.MirroringClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkUpdateMirroringEndpointGroupAssociationProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkUpdateMirroringEndpointGroupAssociationProgress with error', async () => { + const client = new mirroringModule.v1.MirroringClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkUpdateMirroringEndpointGroupAssociationProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('deleteMirroringEndpointGroupAssociation', () => { + it('invokes deleteMirroringEndpointGroupAssociation without error', async () => { + const client = new mirroringModule.v1.MirroringClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.DeleteMirroringEndpointGroupAssociationRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.DeleteMirroringEndpointGroupAssociationRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteMirroringEndpointGroupAssociation = stubLongRunningCall(expectedResponse); + const [operation] = await client.deleteMirroringEndpointGroupAssociation(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.deleteMirroringEndpointGroupAssociation as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteMirroringEndpointGroupAssociation as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteMirroringEndpointGroupAssociation without error using callback', async () => { + const client = new mirroringModule.v1.MirroringClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.DeleteMirroringEndpointGroupAssociationRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.DeleteMirroringEndpointGroupAssociationRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteMirroringEndpointGroupAssociation = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteMirroringEndpointGroupAssociation( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.deleteMirroringEndpointGroupAssociation as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteMirroringEndpointGroupAssociation as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteMirroringEndpointGroupAssociation with call error', async () => { + const client = new mirroringModule.v1.MirroringClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.DeleteMirroringEndpointGroupAssociationRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.DeleteMirroringEndpointGroupAssociationRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteMirroringEndpointGroupAssociation = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.deleteMirroringEndpointGroupAssociation(request), expectedError); + const actualRequest = (client.innerApiCalls.deleteMirroringEndpointGroupAssociation as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteMirroringEndpointGroupAssociation as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteMirroringEndpointGroupAssociation with LRO error', async () => { + const client = new mirroringModule.v1.MirroringClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.DeleteMirroringEndpointGroupAssociationRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.DeleteMirroringEndpointGroupAssociationRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteMirroringEndpointGroupAssociation = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.deleteMirroringEndpointGroupAssociation(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.deleteMirroringEndpointGroupAssociation as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteMirroringEndpointGroupAssociation as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkDeleteMirroringEndpointGroupAssociationProgress without error', async () => { + const client = new mirroringModule.v1.MirroringClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkDeleteMirroringEndpointGroupAssociationProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkDeleteMirroringEndpointGroupAssociationProgress with error', async () => { + const client = new mirroringModule.v1.MirroringClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkDeleteMirroringEndpointGroupAssociationProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('createMirroringDeploymentGroup', () => { + it('invokes createMirroringDeploymentGroup without error', async () => { + const client = new mirroringModule.v1.MirroringClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.CreateMirroringDeploymentGroupRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.CreateMirroringDeploymentGroupRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createMirroringDeploymentGroup = stubLongRunningCall(expectedResponse); + const [operation] = await client.createMirroringDeploymentGroup(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createMirroringDeploymentGroup as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createMirroringDeploymentGroup as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createMirroringDeploymentGroup without error using callback', async () => { + const client = new mirroringModule.v1.MirroringClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.CreateMirroringDeploymentGroupRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.CreateMirroringDeploymentGroupRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createMirroringDeploymentGroup = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createMirroringDeploymentGroup( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createMirroringDeploymentGroup as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createMirroringDeploymentGroup as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createMirroringDeploymentGroup with call error', async () => { + const client = new mirroringModule.v1.MirroringClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.CreateMirroringDeploymentGroupRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.CreateMirroringDeploymentGroupRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.createMirroringDeploymentGroup = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.createMirroringDeploymentGroup(request), expectedError); + const actualRequest = (client.innerApiCalls.createMirroringDeploymentGroup as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createMirroringDeploymentGroup as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createMirroringDeploymentGroup with LRO error', async () => { + const client = new mirroringModule.v1.MirroringClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.CreateMirroringDeploymentGroupRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.CreateMirroringDeploymentGroupRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.createMirroringDeploymentGroup = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.createMirroringDeploymentGroup(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.createMirroringDeploymentGroup as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createMirroringDeploymentGroup as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkCreateMirroringDeploymentGroupProgress without error', async () => { + const client = new mirroringModule.v1.MirroringClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkCreateMirroringDeploymentGroupProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkCreateMirroringDeploymentGroupProgress with error', async () => { + const client = new mirroringModule.v1.MirroringClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkCreateMirroringDeploymentGroupProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('updateMirroringDeploymentGroup', () => { + it('invokes updateMirroringDeploymentGroup without error', async () => { + const client = new mirroringModule.v1.MirroringClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.UpdateMirroringDeploymentGroupRequest() + ); + request.mirroringDeploymentGroup ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.UpdateMirroringDeploymentGroupRequest', ['mirroringDeploymentGroup', 'name']); + request.mirroringDeploymentGroup.name = defaultValue1; + const expectedHeaderRequestParams = `mirroring_deployment_group.name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.updateMirroringDeploymentGroup = stubLongRunningCall(expectedResponse); + const [operation] = await client.updateMirroringDeploymentGroup(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateMirroringDeploymentGroup as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateMirroringDeploymentGroup as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateMirroringDeploymentGroup without error using callback', async () => { + const client = new mirroringModule.v1.MirroringClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.UpdateMirroringDeploymentGroupRequest() + ); + request.mirroringDeploymentGroup ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.UpdateMirroringDeploymentGroupRequest', ['mirroringDeploymentGroup', 'name']); + request.mirroringDeploymentGroup.name = defaultValue1; + const expectedHeaderRequestParams = `mirroring_deployment_group.name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.updateMirroringDeploymentGroup = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateMirroringDeploymentGroup( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateMirroringDeploymentGroup as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateMirroringDeploymentGroup as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateMirroringDeploymentGroup with call error', async () => { + const client = new mirroringModule.v1.MirroringClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.UpdateMirroringDeploymentGroupRequest() + ); + request.mirroringDeploymentGroup ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.UpdateMirroringDeploymentGroupRequest', ['mirroringDeploymentGroup', 'name']); + request.mirroringDeploymentGroup.name = defaultValue1; + const expectedHeaderRequestParams = `mirroring_deployment_group.name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateMirroringDeploymentGroup = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.updateMirroringDeploymentGroup(request), expectedError); + const actualRequest = (client.innerApiCalls.updateMirroringDeploymentGroup as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateMirroringDeploymentGroup as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateMirroringDeploymentGroup with LRO error', async () => { + const client = new mirroringModule.v1.MirroringClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.UpdateMirroringDeploymentGroupRequest() + ); + request.mirroringDeploymentGroup ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.UpdateMirroringDeploymentGroupRequest', ['mirroringDeploymentGroup', 'name']); + request.mirroringDeploymentGroup.name = defaultValue1; + const expectedHeaderRequestParams = `mirroring_deployment_group.name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateMirroringDeploymentGroup = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.updateMirroringDeploymentGroup(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.updateMirroringDeploymentGroup as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateMirroringDeploymentGroup as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkUpdateMirroringDeploymentGroupProgress without error', async () => { + const client = new mirroringModule.v1.MirroringClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkUpdateMirroringDeploymentGroupProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkUpdateMirroringDeploymentGroupProgress with error', async () => { + const client = new mirroringModule.v1.MirroringClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkUpdateMirroringDeploymentGroupProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('deleteMirroringDeploymentGroup', () => { + it('invokes deleteMirroringDeploymentGroup without error', async () => { + const client = new mirroringModule.v1.MirroringClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.DeleteMirroringDeploymentGroupRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.DeleteMirroringDeploymentGroupRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteMirroringDeploymentGroup = stubLongRunningCall(expectedResponse); + const [operation] = await client.deleteMirroringDeploymentGroup(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.deleteMirroringDeploymentGroup as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteMirroringDeploymentGroup as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteMirroringDeploymentGroup without error using callback', async () => { + const client = new mirroringModule.v1.MirroringClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.DeleteMirroringDeploymentGroupRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.DeleteMirroringDeploymentGroupRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteMirroringDeploymentGroup = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteMirroringDeploymentGroup( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.deleteMirroringDeploymentGroup as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteMirroringDeploymentGroup as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteMirroringDeploymentGroup with call error', async () => { + const client = new mirroringModule.v1.MirroringClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.DeleteMirroringDeploymentGroupRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.DeleteMirroringDeploymentGroupRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteMirroringDeploymentGroup = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.deleteMirroringDeploymentGroup(request), expectedError); + const actualRequest = (client.innerApiCalls.deleteMirroringDeploymentGroup as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteMirroringDeploymentGroup as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteMirroringDeploymentGroup with LRO error', async () => { + const client = new mirroringModule.v1.MirroringClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.DeleteMirroringDeploymentGroupRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.DeleteMirroringDeploymentGroupRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteMirroringDeploymentGroup = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.deleteMirroringDeploymentGroup(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.deleteMirroringDeploymentGroup as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteMirroringDeploymentGroup as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkDeleteMirroringDeploymentGroupProgress without error', async () => { + const client = new mirroringModule.v1.MirroringClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkDeleteMirroringDeploymentGroupProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkDeleteMirroringDeploymentGroupProgress with error', async () => { + const client = new mirroringModule.v1.MirroringClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkDeleteMirroringDeploymentGroupProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('createMirroringDeployment', () => { + it('invokes createMirroringDeployment without error', async () => { + const client = new mirroringModule.v1.MirroringClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.CreateMirroringDeploymentRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.CreateMirroringDeploymentRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createMirroringDeployment = stubLongRunningCall(expectedResponse); + const [operation] = await client.createMirroringDeployment(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createMirroringDeployment as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createMirroringDeployment as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createMirroringDeployment without error using callback', async () => { + const client = new mirroringModule.v1.MirroringClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.CreateMirroringDeploymentRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.CreateMirroringDeploymentRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createMirroringDeployment = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createMirroringDeployment( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createMirroringDeployment as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createMirroringDeployment as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createMirroringDeployment with call error', async () => { + const client = new mirroringModule.v1.MirroringClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.CreateMirroringDeploymentRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.CreateMirroringDeploymentRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.createMirroringDeployment = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.createMirroringDeployment(request), expectedError); + const actualRequest = (client.innerApiCalls.createMirroringDeployment as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createMirroringDeployment as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createMirroringDeployment with LRO error', async () => { + const client = new mirroringModule.v1.MirroringClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.CreateMirroringDeploymentRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.CreateMirroringDeploymentRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.createMirroringDeployment = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.createMirroringDeployment(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.createMirroringDeployment as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createMirroringDeployment as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkCreateMirroringDeploymentProgress without error', async () => { + const client = new mirroringModule.v1.MirroringClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkCreateMirroringDeploymentProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkCreateMirroringDeploymentProgress with error', async () => { + const client = new mirroringModule.v1.MirroringClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkCreateMirroringDeploymentProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('updateMirroringDeployment', () => { + it('invokes updateMirroringDeployment without error', async () => { + const client = new mirroringModule.v1.MirroringClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.UpdateMirroringDeploymentRequest() + ); + request.mirroringDeployment ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.UpdateMirroringDeploymentRequest', ['mirroringDeployment', 'name']); + request.mirroringDeployment.name = defaultValue1; + const expectedHeaderRequestParams = `mirroring_deployment.name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.updateMirroringDeployment = stubLongRunningCall(expectedResponse); + const [operation] = await client.updateMirroringDeployment(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateMirroringDeployment as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateMirroringDeployment as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateMirroringDeployment without error using callback', async () => { + const client = new mirroringModule.v1.MirroringClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.UpdateMirroringDeploymentRequest() + ); + request.mirroringDeployment ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.UpdateMirroringDeploymentRequest', ['mirroringDeployment', 'name']); + request.mirroringDeployment.name = defaultValue1; + const expectedHeaderRequestParams = `mirroring_deployment.name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.updateMirroringDeployment = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateMirroringDeployment( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateMirroringDeployment as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateMirroringDeployment as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateMirroringDeployment with call error', async () => { + const client = new mirroringModule.v1.MirroringClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.UpdateMirroringDeploymentRequest() + ); + request.mirroringDeployment ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.UpdateMirroringDeploymentRequest', ['mirroringDeployment', 'name']); + request.mirroringDeployment.name = defaultValue1; + const expectedHeaderRequestParams = `mirroring_deployment.name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateMirroringDeployment = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.updateMirroringDeployment(request), expectedError); + const actualRequest = (client.innerApiCalls.updateMirroringDeployment as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateMirroringDeployment as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateMirroringDeployment with LRO error', async () => { + const client = new mirroringModule.v1.MirroringClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.UpdateMirroringDeploymentRequest() + ); + request.mirroringDeployment ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.UpdateMirroringDeploymentRequest', ['mirroringDeployment', 'name']); + request.mirroringDeployment.name = defaultValue1; + const expectedHeaderRequestParams = `mirroring_deployment.name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateMirroringDeployment = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.updateMirroringDeployment(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.updateMirroringDeployment as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateMirroringDeployment as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkUpdateMirroringDeploymentProgress without error', async () => { + const client = new mirroringModule.v1.MirroringClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkUpdateMirroringDeploymentProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkUpdateMirroringDeploymentProgress with error', async () => { + const client = new mirroringModule.v1.MirroringClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkUpdateMirroringDeploymentProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('deleteMirroringDeployment', () => { + it('invokes deleteMirroringDeployment without error', async () => { + const client = new mirroringModule.v1.MirroringClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.DeleteMirroringDeploymentRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.DeleteMirroringDeploymentRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteMirroringDeployment = stubLongRunningCall(expectedResponse); + const [operation] = await client.deleteMirroringDeployment(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.deleteMirroringDeployment as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteMirroringDeployment as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteMirroringDeployment without error using callback', async () => { + const client = new mirroringModule.v1.MirroringClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.DeleteMirroringDeploymentRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.DeleteMirroringDeploymentRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteMirroringDeployment = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteMirroringDeployment( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.deleteMirroringDeployment as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteMirroringDeployment as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteMirroringDeployment with call error', async () => { + const client = new mirroringModule.v1.MirroringClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.DeleteMirroringDeploymentRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.DeleteMirroringDeploymentRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteMirroringDeployment = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.deleteMirroringDeployment(request), expectedError); + const actualRequest = (client.innerApiCalls.deleteMirroringDeployment as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteMirroringDeployment as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteMirroringDeployment with LRO error', async () => { + const client = new mirroringModule.v1.MirroringClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.DeleteMirroringDeploymentRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.DeleteMirroringDeploymentRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteMirroringDeployment = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.deleteMirroringDeployment(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.deleteMirroringDeployment as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteMirroringDeployment as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkDeleteMirroringDeploymentProgress without error', async () => { + const client = new mirroringModule.v1.MirroringClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkDeleteMirroringDeploymentProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkDeleteMirroringDeploymentProgress with error', async () => { + const client = new mirroringModule.v1.MirroringClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkDeleteMirroringDeploymentProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('listMirroringEndpointGroups', () => { + it('invokes listMirroringEndpointGroups without error', async () => { + const client = new mirroringModule.v1.MirroringClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.ListMirroringEndpointGroupsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.ListMirroringEndpointGroupsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.networksecurity.v1.MirroringEndpointGroup()), + generateSampleMessage(new protos.google.cloud.networksecurity.v1.MirroringEndpointGroup()), + generateSampleMessage(new protos.google.cloud.networksecurity.v1.MirroringEndpointGroup()), + ]; + client.innerApiCalls.listMirroringEndpointGroups = stubSimpleCall(expectedResponse); + const [response] = await client.listMirroringEndpointGroups(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listMirroringEndpointGroups as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listMirroringEndpointGroups as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listMirroringEndpointGroups without error using callback', async () => { + const client = new mirroringModule.v1.MirroringClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.ListMirroringEndpointGroupsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.ListMirroringEndpointGroupsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.networksecurity.v1.MirroringEndpointGroup()), + generateSampleMessage(new protos.google.cloud.networksecurity.v1.MirroringEndpointGroup()), + generateSampleMessage(new protos.google.cloud.networksecurity.v1.MirroringEndpointGroup()), + ]; + client.innerApiCalls.listMirroringEndpointGroups = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listMirroringEndpointGroups( + request, + (err?: Error|null, result?: protos.google.cloud.networksecurity.v1.IMirroringEndpointGroup[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listMirroringEndpointGroups as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listMirroringEndpointGroups as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listMirroringEndpointGroups with error', async () => { + const client = new mirroringModule.v1.MirroringClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.ListMirroringEndpointGroupsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.ListMirroringEndpointGroupsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.listMirroringEndpointGroups = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listMirroringEndpointGroups(request), expectedError); + const actualRequest = (client.innerApiCalls.listMirroringEndpointGroups as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listMirroringEndpointGroups as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listMirroringEndpointGroupsStream without error', async () => { + const client = new mirroringModule.v1.MirroringClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.ListMirroringEndpointGroupsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.ListMirroringEndpointGroupsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.networksecurity.v1.MirroringEndpointGroup()), + generateSampleMessage(new protos.google.cloud.networksecurity.v1.MirroringEndpointGroup()), + generateSampleMessage(new protos.google.cloud.networksecurity.v1.MirroringEndpointGroup()), + ]; + client.descriptors.page.listMirroringEndpointGroups.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listMirroringEndpointGroupsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.networksecurity.v1.MirroringEndpointGroup[] = []; + stream.on('data', (response: protos.google.cloud.networksecurity.v1.MirroringEndpointGroup) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert((client.descriptors.page.listMirroringEndpointGroups.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listMirroringEndpointGroups, request)); + assert( + (client.descriptors.page.listMirroringEndpointGroups.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listMirroringEndpointGroupsStream with error', async () => { + const client = new mirroringModule.v1.MirroringClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.ListMirroringEndpointGroupsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.ListMirroringEndpointGroupsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.descriptors.page.listMirroringEndpointGroups.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listMirroringEndpointGroupsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.networksecurity.v1.MirroringEndpointGroup[] = []; + stream.on('data', (response: protos.google.cloud.networksecurity.v1.MirroringEndpointGroup) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listMirroringEndpointGroups.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listMirroringEndpointGroups, request)); + assert( + (client.descriptors.page.listMirroringEndpointGroups.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listMirroringEndpointGroups without error', async () => { + const client = new mirroringModule.v1.MirroringClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.ListMirroringEndpointGroupsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.ListMirroringEndpointGroupsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.networksecurity.v1.MirroringEndpointGroup()), + generateSampleMessage(new protos.google.cloud.networksecurity.v1.MirroringEndpointGroup()), + generateSampleMessage(new protos.google.cloud.networksecurity.v1.MirroringEndpointGroup()), + ]; + client.descriptors.page.listMirroringEndpointGroups.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.networksecurity.v1.IMirroringEndpointGroup[] = []; + const iterable = client.listMirroringEndpointGroupsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listMirroringEndpointGroups.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listMirroringEndpointGroups.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listMirroringEndpointGroups with error', async () => { + const client = new mirroringModule.v1.MirroringClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.ListMirroringEndpointGroupsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.ListMirroringEndpointGroupsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.descriptors.page.listMirroringEndpointGroups.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listMirroringEndpointGroupsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.networksecurity.v1.IMirroringEndpointGroup[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listMirroringEndpointGroups.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listMirroringEndpointGroups.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('listMirroringEndpointGroupAssociations', () => { + it('invokes listMirroringEndpointGroupAssociations without error', async () => { + const client = new mirroringModule.v1.MirroringClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.ListMirroringEndpointGroupAssociationsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.ListMirroringEndpointGroupAssociationsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.networksecurity.v1.MirroringEndpointGroupAssociation()), + generateSampleMessage(new protos.google.cloud.networksecurity.v1.MirroringEndpointGroupAssociation()), + generateSampleMessage(new protos.google.cloud.networksecurity.v1.MirroringEndpointGroupAssociation()), + ]; + client.innerApiCalls.listMirroringEndpointGroupAssociations = stubSimpleCall(expectedResponse); + const [response] = await client.listMirroringEndpointGroupAssociations(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listMirroringEndpointGroupAssociations as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listMirroringEndpointGroupAssociations as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listMirroringEndpointGroupAssociations without error using callback', async () => { + const client = new mirroringModule.v1.MirroringClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.ListMirroringEndpointGroupAssociationsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.ListMirroringEndpointGroupAssociationsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.networksecurity.v1.MirroringEndpointGroupAssociation()), + generateSampleMessage(new protos.google.cloud.networksecurity.v1.MirroringEndpointGroupAssociation()), + generateSampleMessage(new protos.google.cloud.networksecurity.v1.MirroringEndpointGroupAssociation()), + ]; + client.innerApiCalls.listMirroringEndpointGroupAssociations = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listMirroringEndpointGroupAssociations( + request, + (err?: Error|null, result?: protos.google.cloud.networksecurity.v1.IMirroringEndpointGroupAssociation[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listMirroringEndpointGroupAssociations as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listMirroringEndpointGroupAssociations as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listMirroringEndpointGroupAssociations with error', async () => { + const client = new mirroringModule.v1.MirroringClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.ListMirroringEndpointGroupAssociationsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.ListMirroringEndpointGroupAssociationsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.listMirroringEndpointGroupAssociations = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listMirroringEndpointGroupAssociations(request), expectedError); + const actualRequest = (client.innerApiCalls.listMirroringEndpointGroupAssociations as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listMirroringEndpointGroupAssociations as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listMirroringEndpointGroupAssociationsStream without error', async () => { + const client = new mirroringModule.v1.MirroringClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.ListMirroringEndpointGroupAssociationsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.ListMirroringEndpointGroupAssociationsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.networksecurity.v1.MirroringEndpointGroupAssociation()), + generateSampleMessage(new protos.google.cloud.networksecurity.v1.MirroringEndpointGroupAssociation()), + generateSampleMessage(new protos.google.cloud.networksecurity.v1.MirroringEndpointGroupAssociation()), + ]; + client.descriptors.page.listMirroringEndpointGroupAssociations.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listMirroringEndpointGroupAssociationsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.networksecurity.v1.MirroringEndpointGroupAssociation[] = []; + stream.on('data', (response: protos.google.cloud.networksecurity.v1.MirroringEndpointGroupAssociation) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert((client.descriptors.page.listMirroringEndpointGroupAssociations.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listMirroringEndpointGroupAssociations, request)); + assert( + (client.descriptors.page.listMirroringEndpointGroupAssociations.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listMirroringEndpointGroupAssociationsStream with error', async () => { + const client = new mirroringModule.v1.MirroringClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.ListMirroringEndpointGroupAssociationsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.ListMirroringEndpointGroupAssociationsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.descriptors.page.listMirroringEndpointGroupAssociations.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listMirroringEndpointGroupAssociationsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.networksecurity.v1.MirroringEndpointGroupAssociation[] = []; + stream.on('data', (response: protos.google.cloud.networksecurity.v1.MirroringEndpointGroupAssociation) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listMirroringEndpointGroupAssociations.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listMirroringEndpointGroupAssociations, request)); + assert( + (client.descriptors.page.listMirroringEndpointGroupAssociations.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listMirroringEndpointGroupAssociations without error', async () => { + const client = new mirroringModule.v1.MirroringClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.ListMirroringEndpointGroupAssociationsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.ListMirroringEndpointGroupAssociationsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.networksecurity.v1.MirroringEndpointGroupAssociation()), + generateSampleMessage(new protos.google.cloud.networksecurity.v1.MirroringEndpointGroupAssociation()), + generateSampleMessage(new protos.google.cloud.networksecurity.v1.MirroringEndpointGroupAssociation()), + ]; + client.descriptors.page.listMirroringEndpointGroupAssociations.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.networksecurity.v1.IMirroringEndpointGroupAssociation[] = []; + const iterable = client.listMirroringEndpointGroupAssociationsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listMirroringEndpointGroupAssociations.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listMirroringEndpointGroupAssociations.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listMirroringEndpointGroupAssociations with error', async () => { + const client = new mirroringModule.v1.MirroringClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.ListMirroringEndpointGroupAssociationsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.ListMirroringEndpointGroupAssociationsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.descriptors.page.listMirroringEndpointGroupAssociations.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listMirroringEndpointGroupAssociationsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.networksecurity.v1.IMirroringEndpointGroupAssociation[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listMirroringEndpointGroupAssociations.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listMirroringEndpointGroupAssociations.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('listMirroringDeploymentGroups', () => { + it('invokes listMirroringDeploymentGroups without error', async () => { + const client = new mirroringModule.v1.MirroringClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.ListMirroringDeploymentGroupsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.ListMirroringDeploymentGroupsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.networksecurity.v1.MirroringDeploymentGroup()), + generateSampleMessage(new protos.google.cloud.networksecurity.v1.MirroringDeploymentGroup()), + generateSampleMessage(new protos.google.cloud.networksecurity.v1.MirroringDeploymentGroup()), + ]; + client.innerApiCalls.listMirroringDeploymentGroups = stubSimpleCall(expectedResponse); + const [response] = await client.listMirroringDeploymentGroups(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listMirroringDeploymentGroups as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listMirroringDeploymentGroups as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listMirroringDeploymentGroups without error using callback', async () => { + const client = new mirroringModule.v1.MirroringClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.ListMirroringDeploymentGroupsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.ListMirroringDeploymentGroupsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.networksecurity.v1.MirroringDeploymentGroup()), + generateSampleMessage(new protos.google.cloud.networksecurity.v1.MirroringDeploymentGroup()), + generateSampleMessage(new protos.google.cloud.networksecurity.v1.MirroringDeploymentGroup()), + ]; + client.innerApiCalls.listMirroringDeploymentGroups = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listMirroringDeploymentGroups( + request, + (err?: Error|null, result?: protos.google.cloud.networksecurity.v1.IMirroringDeploymentGroup[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listMirroringDeploymentGroups as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listMirroringDeploymentGroups as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listMirroringDeploymentGroups with error', async () => { + const client = new mirroringModule.v1.MirroringClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.ListMirroringDeploymentGroupsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.ListMirroringDeploymentGroupsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.listMirroringDeploymentGroups = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listMirroringDeploymentGroups(request), expectedError); + const actualRequest = (client.innerApiCalls.listMirroringDeploymentGroups as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listMirroringDeploymentGroups as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listMirroringDeploymentGroupsStream without error', async () => { + const client = new mirroringModule.v1.MirroringClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.ListMirroringDeploymentGroupsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.ListMirroringDeploymentGroupsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.networksecurity.v1.MirroringDeploymentGroup()), + generateSampleMessage(new protos.google.cloud.networksecurity.v1.MirroringDeploymentGroup()), + generateSampleMessage(new protos.google.cloud.networksecurity.v1.MirroringDeploymentGroup()), + ]; + client.descriptors.page.listMirroringDeploymentGroups.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listMirroringDeploymentGroupsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.networksecurity.v1.MirroringDeploymentGroup[] = []; + stream.on('data', (response: protos.google.cloud.networksecurity.v1.MirroringDeploymentGroup) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert((client.descriptors.page.listMirroringDeploymentGroups.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listMirroringDeploymentGroups, request)); + assert( + (client.descriptors.page.listMirroringDeploymentGroups.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listMirroringDeploymentGroupsStream with error', async () => { + const client = new mirroringModule.v1.MirroringClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.ListMirroringDeploymentGroupsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.ListMirroringDeploymentGroupsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.descriptors.page.listMirroringDeploymentGroups.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listMirroringDeploymentGroupsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.networksecurity.v1.MirroringDeploymentGroup[] = []; + stream.on('data', (response: protos.google.cloud.networksecurity.v1.MirroringDeploymentGroup) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listMirroringDeploymentGroups.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listMirroringDeploymentGroups, request)); + assert( + (client.descriptors.page.listMirroringDeploymentGroups.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listMirroringDeploymentGroups without error', async () => { + const client = new mirroringModule.v1.MirroringClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.ListMirroringDeploymentGroupsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.ListMirroringDeploymentGroupsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.networksecurity.v1.MirroringDeploymentGroup()), + generateSampleMessage(new protos.google.cloud.networksecurity.v1.MirroringDeploymentGroup()), + generateSampleMessage(new protos.google.cloud.networksecurity.v1.MirroringDeploymentGroup()), + ]; + client.descriptors.page.listMirroringDeploymentGroups.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.networksecurity.v1.IMirroringDeploymentGroup[] = []; + const iterable = client.listMirroringDeploymentGroupsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listMirroringDeploymentGroups.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listMirroringDeploymentGroups.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listMirroringDeploymentGroups with error', async () => { + const client = new mirroringModule.v1.MirroringClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.ListMirroringDeploymentGroupsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.ListMirroringDeploymentGroupsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.descriptors.page.listMirroringDeploymentGroups.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listMirroringDeploymentGroupsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.networksecurity.v1.IMirroringDeploymentGroup[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listMirroringDeploymentGroups.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listMirroringDeploymentGroups.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('listMirroringDeployments', () => { + it('invokes listMirroringDeployments without error', async () => { + const client = new mirroringModule.v1.MirroringClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.ListMirroringDeploymentsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.ListMirroringDeploymentsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.networksecurity.v1.MirroringDeployment()), + generateSampleMessage(new protos.google.cloud.networksecurity.v1.MirroringDeployment()), + generateSampleMessage(new protos.google.cloud.networksecurity.v1.MirroringDeployment()), + ]; + client.innerApiCalls.listMirroringDeployments = stubSimpleCall(expectedResponse); + const [response] = await client.listMirroringDeployments(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listMirroringDeployments as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listMirroringDeployments as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listMirroringDeployments without error using callback', async () => { + const client = new mirroringModule.v1.MirroringClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.ListMirroringDeploymentsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.ListMirroringDeploymentsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.networksecurity.v1.MirroringDeployment()), + generateSampleMessage(new protos.google.cloud.networksecurity.v1.MirroringDeployment()), + generateSampleMessage(new protos.google.cloud.networksecurity.v1.MirroringDeployment()), + ]; + client.innerApiCalls.listMirroringDeployments = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listMirroringDeployments( + request, + (err?: Error|null, result?: protos.google.cloud.networksecurity.v1.IMirroringDeployment[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listMirroringDeployments as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listMirroringDeployments as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listMirroringDeployments with error', async () => { + const client = new mirroringModule.v1.MirroringClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.ListMirroringDeploymentsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.ListMirroringDeploymentsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.listMirroringDeployments = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listMirroringDeployments(request), expectedError); + const actualRequest = (client.innerApiCalls.listMirroringDeployments as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listMirroringDeployments as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listMirroringDeploymentsStream without error', async () => { + const client = new mirroringModule.v1.MirroringClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.ListMirroringDeploymentsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.ListMirroringDeploymentsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.networksecurity.v1.MirroringDeployment()), + generateSampleMessage(new protos.google.cloud.networksecurity.v1.MirroringDeployment()), + generateSampleMessage(new protos.google.cloud.networksecurity.v1.MirroringDeployment()), + ]; + client.descriptors.page.listMirroringDeployments.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listMirroringDeploymentsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.networksecurity.v1.MirroringDeployment[] = []; + stream.on('data', (response: protos.google.cloud.networksecurity.v1.MirroringDeployment) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert((client.descriptors.page.listMirroringDeployments.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listMirroringDeployments, request)); + assert( + (client.descriptors.page.listMirroringDeployments.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listMirroringDeploymentsStream with error', async () => { + const client = new mirroringModule.v1.MirroringClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.ListMirroringDeploymentsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.ListMirroringDeploymentsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.descriptors.page.listMirroringDeployments.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listMirroringDeploymentsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.networksecurity.v1.MirroringDeployment[] = []; + stream.on('data', (response: protos.google.cloud.networksecurity.v1.MirroringDeployment) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listMirroringDeployments.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listMirroringDeployments, request)); + assert( + (client.descriptors.page.listMirroringDeployments.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listMirroringDeployments without error', async () => { + const client = new mirroringModule.v1.MirroringClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.ListMirroringDeploymentsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.ListMirroringDeploymentsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.networksecurity.v1.MirroringDeployment()), + generateSampleMessage(new protos.google.cloud.networksecurity.v1.MirroringDeployment()), + generateSampleMessage(new protos.google.cloud.networksecurity.v1.MirroringDeployment()), + ]; + client.descriptors.page.listMirroringDeployments.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.networksecurity.v1.IMirroringDeployment[] = []; + const iterable = client.listMirroringDeploymentsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listMirroringDeployments.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listMirroringDeployments.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listMirroringDeployments with error', async () => { + const client = new mirroringModule.v1.MirroringClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.ListMirroringDeploymentsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.ListMirroringDeploymentsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.descriptors.page.listMirroringDeployments.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listMirroringDeploymentsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.networksecurity.v1.IMirroringDeployment[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listMirroringDeployments.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listMirroringDeployments.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + describe('getIamPolicy', () => { + it('invokes getIamPolicy without error', async () => { + const client = new mirroringModule.v1.MirroringClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.GetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy() + ); + client.iamClient.getIamPolicy = stubSimpleCall(expectedResponse); + const response = await client.getIamPolicy(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.iamClient.getIamPolicy as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + it('invokes getIamPolicy without error using callback', async () => { + const client = new mirroringModule.v1.MirroringClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.GetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy() + ); + client.iamClient.getIamPolicy = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getIamPolicy( + request, + expectedOptions, + (err?: Error|null, result?: IamProtos.google.iam.v1.Policy|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }).catch(err => {throw err}); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.iamClient.getIamPolicy as SinonStub) + .getCall(0)); + }); + it('invokes getIamPolicy with error', async () => { + const client = new mirroringModule.v1.MirroringClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.GetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.iamClient.getIamPolicy = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getIamPolicy(request, expectedOptions), expectedError); + assert((client.iamClient.getIamPolicy as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + }); + describe('setIamPolicy', () => { + it('invokes setIamPolicy without error', async () => { + const client = new mirroringModule.v1.MirroringClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.SetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy() + ); + client.iamClient.setIamPolicy = stubSimpleCall(expectedResponse); + const response = await client.setIamPolicy(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.iamClient.setIamPolicy as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + it('invokes setIamPolicy without error using callback', async () => { + const client = new mirroringModule.v1.MirroringClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.SetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy() + ); + client.iamClient.setIamPolicy = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.setIamPolicy( + request, + expectedOptions, + (err?: Error|null, result?: IamProtos.google.iam.v1.Policy|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }).catch(err => {throw err}); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.iamClient.setIamPolicy as SinonStub) + .getCall(0)); + }); + it('invokes setIamPolicy with error', async () => { + const client = new mirroringModule.v1.MirroringClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.SetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.iamClient.setIamPolicy = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.setIamPolicy(request, expectedOptions), expectedError); + assert((client.iamClient.setIamPolicy as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + }); + describe('testIamPermissions', () => { + it('invokes testIamPermissions without error', async () => { + const client = new mirroringModule.v1.MirroringClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsResponse() + ); + client.iamClient.testIamPermissions = stubSimpleCall(expectedResponse); + const response = await client.testIamPermissions(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.iamClient.testIamPermissions as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + it('invokes testIamPermissions without error using callback', async () => { + const client = new mirroringModule.v1.MirroringClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsResponse() + ); + client.iamClient.testIamPermissions = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.testIamPermissions( + request, + expectedOptions, + (err?: Error|null, result?: IamProtos.google.iam.v1.TestIamPermissionsResponse|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }).catch(err => {throw err}); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.iamClient.testIamPermissions as SinonStub) + .getCall(0)); + }); + it('invokes testIamPermissions with error', async () => { + const client = new mirroringModule.v1.MirroringClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.iamClient.testIamPermissions = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.testIamPermissions(request, expectedOptions), expectedError); + assert((client.iamClient.testIamPermissions as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + }); + describe('getLocation', () => { + it('invokes getLocation without error', async () => { + const client = new mirroringModule.v1.MirroringClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ); + client.locationsClient.getLocation = stubSimpleCall(expectedResponse); + const response = await client.getLocation(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.locationsClient.getLocation as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + it('invokes getLocation without error using callback', async () => { + const client = new mirroringModule.v1.MirroringClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ); + client.locationsClient.getLocation = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getLocation( + request, + expectedOptions, + ( + err?: Error | null, + result?: LocationProtos.google.cloud.location.ILocation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.locationsClient.getLocation as SinonStub) + .getCall(0)); + }); + it('invokes getLocation with error', async () => { + const client = new mirroringModule.v1.MirroringClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.locationsClient.getLocation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getLocation(request, expectedOptions), expectedError); + assert((client.locationsClient.getLocation as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + }); + describe('listLocationsAsync', () => { + it('uses async iteration with listLocations without error', async () => { + const client = new mirroringModule.v1.MirroringClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.ListLocationsRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedResponse = [ + generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ), + generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ), + generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ), + ]; + client.locationsClient.descriptors.page.listLocations.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: LocationProtos.google.cloud.location.ILocation[] = []; + const iterable = client.listLocationsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + it('uses async iteration with listLocations with error', async () => { + const client = new mirroringModule.v1.MirroringClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.ListLocationsRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedError = new Error('expected'); + client.locationsClient.descriptors.page.listLocations.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listLocationsAsync(request); + await assert.rejects(async () => { + const responses: LocationProtos.google.cloud.location.ILocation[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + describe('getOperation', () => { + it('invokes getOperation without error', async () => { + const client = new mirroringModule.v1.MirroringClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.GetOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const response = await client.getOperation(request); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0).calledWith(request) + ); + }); + it('invokes getOperation without error using callback', async () => { + const client = new mirroringModule.v1.MirroringClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.GetOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + client.operationsClient.getOperation = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.operationsClient.getOperation( + request, + undefined, + ( + err?: Error | null, + result?: operationsProtos.google.longrunning.Operation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }).catch(err => {throw err}); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + it('invokes getOperation with error', async () => { + const client = new mirroringModule.v1.MirroringClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.GetOperationRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(async () => {await client.getOperation(request)}, expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0).calledWith(request)); + }); + }); + describe('cancelOperation', () => { + it('invokes cancelOperation without error', async () => { + const client = new mirroringModule.v1.MirroringClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.CancelOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.cancelOperation = stubSimpleCall(expectedResponse); + const response = await client.cancelOperation(request); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.operationsClient.cancelOperation as SinonStub) + .getCall(0).calledWith(request) + ); + }); + it('invokes cancelOperation without error using callback', async () => { + const client = new mirroringModule.v1.MirroringClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.CancelOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.cancelOperation = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.operationsClient.cancelOperation( + request, + undefined, + ( + err?: Error | null, + result?: protos.google.protobuf.Empty | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }).catch(err => {throw err}); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.operationsClient.cancelOperation as SinonStub) + .getCall(0)); + }); + it('invokes cancelOperation with error', async () => { + const client = new mirroringModule.v1.MirroringClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.CancelOperationRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.cancelOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(async () => {await client.cancelOperation(request)}, expectedError); + assert((client.operationsClient.cancelOperation as SinonStub) + .getCall(0).calledWith(request)); + }); + }); + describe('deleteOperation', () => { + it('invokes deleteOperation without error', async () => { + const client = new mirroringModule.v1.MirroringClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.DeleteOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.deleteOperation = stubSimpleCall(expectedResponse); + const response = await client.deleteOperation(request); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.operationsClient.deleteOperation as SinonStub) + .getCall(0).calledWith(request) + ); + }); + it('invokes deleteOperation without error using callback', async () => { + const client = new mirroringModule.v1.MirroringClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.DeleteOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.deleteOperation = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.operationsClient.deleteOperation( + request, + undefined, + ( + err?: Error | null, + result?: protos.google.protobuf.Empty | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }).catch(err => {throw err}); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.operationsClient.deleteOperation as SinonStub) + .getCall(0)); + }); + it('invokes deleteOperation with error', async () => { + const client = new mirroringModule.v1.MirroringClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.DeleteOperationRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.deleteOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(async () => {await client.deleteOperation(request)}, expectedError); + assert((client.operationsClient.deleteOperation as SinonStub) + .getCall(0).calledWith(request)); + }); + }); + describe('listOperationsAsync', () => { + it('uses async iteration with listOperations without error', async () => { + const client = new mirroringModule.v1.MirroringClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsRequest() + ); + const expectedResponse = [ + generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsResponse() + ), + generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsResponse() + ), + generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsResponse() + ), + ]; + client.operationsClient.descriptor.listOperations.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: operationsProtos.google.longrunning.IOperation[] = []; + const iterable = client.operationsClient.listOperationsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.operationsClient.descriptor.listOperations.asyncIterate as SinonStub) + .getCall(0).args[1], request); + }); + it('uses async iteration with listOperations with error', async () => { + const client = new mirroringModule.v1.MirroringClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.descriptor.listOperations.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.operationsClient.listOperationsAsync(request); + await assert.rejects(async () => { + const responses: operationsProtos.google.longrunning.IOperation[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.operationsClient.descriptor.listOperations.asyncIterate as SinonStub) + .getCall(0).args[1], request); + }); + }); + + describe('Path templates', () => { + + describe('authorizationPolicy', async () => { + const fakePath = "/rendered/path/authorizationPolicy"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + authorization_policy: "authorizationPolicyValue", + }; + const client = new mirroringModule.v1.MirroringClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.authorizationPolicyPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.authorizationPolicyPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('authorizationPolicyPath', () => { + const result = client.authorizationPolicyPath("projectValue", "locationValue", "authorizationPolicyValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.authorizationPolicyPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromAuthorizationPolicyName', () => { + const result = client.matchProjectFromAuthorizationPolicyName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.authorizationPolicyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromAuthorizationPolicyName', () => { + const result = client.matchLocationFromAuthorizationPolicyName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.authorizationPolicyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchAuthorizationPolicyFromAuthorizationPolicyName', () => { + const result = client.matchAuthorizationPolicyFromAuthorizationPolicyName(fakePath); + assert.strictEqual(result, "authorizationPolicyValue"); + assert((client.pathTemplates.authorizationPolicyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('authzPolicy', async () => { + const fakePath = "/rendered/path/authzPolicy"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + authz_policy: "authzPolicyValue", + }; + const client = new mirroringModule.v1.MirroringClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.authzPolicyPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.authzPolicyPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('authzPolicyPath', () => { + const result = client.authzPolicyPath("projectValue", "locationValue", "authzPolicyValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.authzPolicyPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromAuthzPolicyName', () => { + const result = client.matchProjectFromAuthzPolicyName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.authzPolicyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromAuthzPolicyName', () => { + const result = client.matchLocationFromAuthzPolicyName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.authzPolicyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchAuthzPolicyFromAuthzPolicyName', () => { + const result = client.matchAuthzPolicyFromAuthzPolicyName(fakePath); + assert.strictEqual(result, "authzPolicyValue"); + assert((client.pathTemplates.authzPolicyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('backendAuthenticationConfig', async () => { + const fakePath = "/rendered/path/backendAuthenticationConfig"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + backend_authentication_config: "backendAuthenticationConfigValue", + }; + const client = new mirroringModule.v1.MirroringClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.backendAuthenticationConfigPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.backendAuthenticationConfigPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('backendAuthenticationConfigPath', () => { + const result = client.backendAuthenticationConfigPath("projectValue", "locationValue", "backendAuthenticationConfigValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.backendAuthenticationConfigPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromBackendAuthenticationConfigName', () => { + const result = client.matchProjectFromBackendAuthenticationConfigName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.backendAuthenticationConfigPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromBackendAuthenticationConfigName', () => { + const result = client.matchLocationFromBackendAuthenticationConfigName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.backendAuthenticationConfigPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchBackendAuthenticationConfigFromBackendAuthenticationConfigName', () => { + const result = client.matchBackendAuthenticationConfigFromBackendAuthenticationConfigName(fakePath); + assert.strictEqual(result, "backendAuthenticationConfigValue"); + assert((client.pathTemplates.backendAuthenticationConfigPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('clientTlsPolicy', async () => { + const fakePath = "/rendered/path/clientTlsPolicy"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + client_tls_policy: "clientTlsPolicyValue", + }; + const client = new mirroringModule.v1.MirroringClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.clientTlsPolicyPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.clientTlsPolicyPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('clientTlsPolicyPath', () => { + const result = client.clientTlsPolicyPath("projectValue", "locationValue", "clientTlsPolicyValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.clientTlsPolicyPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromClientTlsPolicyName', () => { + const result = client.matchProjectFromClientTlsPolicyName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.clientTlsPolicyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromClientTlsPolicyName', () => { + const result = client.matchLocationFromClientTlsPolicyName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.clientTlsPolicyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchClientTlsPolicyFromClientTlsPolicyName', () => { + const result = client.matchClientTlsPolicyFromClientTlsPolicyName(fakePath); + assert.strictEqual(result, "clientTlsPolicyValue"); + assert((client.pathTemplates.clientTlsPolicyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('dnsThreatDetector', async () => { + const fakePath = "/rendered/path/dnsThreatDetector"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + dns_threat_detector: "dnsThreatDetectorValue", + }; + const client = new mirroringModule.v1.MirroringClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.dnsThreatDetectorPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.dnsThreatDetectorPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('dnsThreatDetectorPath', () => { + const result = client.dnsThreatDetectorPath("projectValue", "locationValue", "dnsThreatDetectorValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.dnsThreatDetectorPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromDnsThreatDetectorName', () => { + const result = client.matchProjectFromDnsThreatDetectorName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.dnsThreatDetectorPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromDnsThreatDetectorName', () => { + const result = client.matchLocationFromDnsThreatDetectorName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.dnsThreatDetectorPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDnsThreatDetectorFromDnsThreatDetectorName', () => { + const result = client.matchDnsThreatDetectorFromDnsThreatDetectorName(fakePath); + assert.strictEqual(result, "dnsThreatDetectorValue"); + assert((client.pathTemplates.dnsThreatDetectorPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('firewallEndpointAssociation', async () => { + const fakePath = "/rendered/path/firewallEndpointAssociation"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + firewall_endpoint_association: "firewallEndpointAssociationValue", + }; + const client = new mirroringModule.v1.MirroringClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.firewallEndpointAssociationPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.firewallEndpointAssociationPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('firewallEndpointAssociationPath', () => { + const result = client.firewallEndpointAssociationPath("projectValue", "locationValue", "firewallEndpointAssociationValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.firewallEndpointAssociationPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromFirewallEndpointAssociationName', () => { + const result = client.matchProjectFromFirewallEndpointAssociationName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.firewallEndpointAssociationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromFirewallEndpointAssociationName', () => { + const result = client.matchLocationFromFirewallEndpointAssociationName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.firewallEndpointAssociationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchFirewallEndpointAssociationFromFirewallEndpointAssociationName', () => { + const result = client.matchFirewallEndpointAssociationFromFirewallEndpointAssociationName(fakePath); + assert.strictEqual(result, "firewallEndpointAssociationValue"); + assert((client.pathTemplates.firewallEndpointAssociationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('forwardingRule', async () => { + const fakePath = "/rendered/path/forwardingRule"; + const expectedParameters = { + project: "projectValue", + forwarding_rule: "forwardingRuleValue", + }; + const client = new mirroringModule.v1.MirroringClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.forwardingRulePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.forwardingRulePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('forwardingRulePath', () => { + const result = client.forwardingRulePath("projectValue", "forwardingRuleValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.forwardingRulePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromForwardingRuleName', () => { + const result = client.matchProjectFromForwardingRuleName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.forwardingRulePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchForwardingRuleFromForwardingRuleName', () => { + const result = client.matchForwardingRuleFromForwardingRuleName(fakePath); + assert.strictEqual(result, "forwardingRuleValue"); + assert((client.pathTemplates.forwardingRulePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('gatewaySecurityPolicy', async () => { + const fakePath = "/rendered/path/gatewaySecurityPolicy"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + gateway_security_policy: "gatewaySecurityPolicyValue", + }; + const client = new mirroringModule.v1.MirroringClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.gatewaySecurityPolicyPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.gatewaySecurityPolicyPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('gatewaySecurityPolicyPath', () => { + const result = client.gatewaySecurityPolicyPath("projectValue", "locationValue", "gatewaySecurityPolicyValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.gatewaySecurityPolicyPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromGatewaySecurityPolicyName', () => { + const result = client.matchProjectFromGatewaySecurityPolicyName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.gatewaySecurityPolicyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromGatewaySecurityPolicyName', () => { + const result = client.matchLocationFromGatewaySecurityPolicyName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.gatewaySecurityPolicyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchGatewaySecurityPolicyFromGatewaySecurityPolicyName', () => { + const result = client.matchGatewaySecurityPolicyFromGatewaySecurityPolicyName(fakePath); + assert.strictEqual(result, "gatewaySecurityPolicyValue"); + assert((client.pathTemplates.gatewaySecurityPolicyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('gatewaySecurityPolicyRule', async () => { + const fakePath = "/rendered/path/gatewaySecurityPolicyRule"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + gateway_security_policy: "gatewaySecurityPolicyValue", + rule: "ruleValue", + }; + const client = new mirroringModule.v1.MirroringClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.gatewaySecurityPolicyRulePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.gatewaySecurityPolicyRulePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('gatewaySecurityPolicyRulePath', () => { + const result = client.gatewaySecurityPolicyRulePath("projectValue", "locationValue", "gatewaySecurityPolicyValue", "ruleValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.gatewaySecurityPolicyRulePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromGatewaySecurityPolicyRuleName', () => { + const result = client.matchProjectFromGatewaySecurityPolicyRuleName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.gatewaySecurityPolicyRulePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromGatewaySecurityPolicyRuleName', () => { + const result = client.matchLocationFromGatewaySecurityPolicyRuleName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.gatewaySecurityPolicyRulePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchGatewaySecurityPolicyFromGatewaySecurityPolicyRuleName', () => { + const result = client.matchGatewaySecurityPolicyFromGatewaySecurityPolicyRuleName(fakePath); + assert.strictEqual(result, "gatewaySecurityPolicyValue"); + assert((client.pathTemplates.gatewaySecurityPolicyRulePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchRuleFromGatewaySecurityPolicyRuleName', () => { + const result = client.matchRuleFromGatewaySecurityPolicyRuleName(fakePath); + assert.strictEqual(result, "ruleValue"); + assert((client.pathTemplates.gatewaySecurityPolicyRulePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('interceptDeployment', async () => { + const fakePath = "/rendered/path/interceptDeployment"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + intercept_deployment: "interceptDeploymentValue", + }; + const client = new mirroringModule.v1.MirroringClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.interceptDeploymentPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.interceptDeploymentPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('interceptDeploymentPath', () => { + const result = client.interceptDeploymentPath("projectValue", "locationValue", "interceptDeploymentValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.interceptDeploymentPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromInterceptDeploymentName', () => { + const result = client.matchProjectFromInterceptDeploymentName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.interceptDeploymentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromInterceptDeploymentName', () => { + const result = client.matchLocationFromInterceptDeploymentName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.interceptDeploymentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchInterceptDeploymentFromInterceptDeploymentName', () => { + const result = client.matchInterceptDeploymentFromInterceptDeploymentName(fakePath); + assert.strictEqual(result, "interceptDeploymentValue"); + assert((client.pathTemplates.interceptDeploymentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('interceptDeploymentGroup', async () => { + const fakePath = "/rendered/path/interceptDeploymentGroup"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + intercept_deployment_group: "interceptDeploymentGroupValue", + }; + const client = new mirroringModule.v1.MirroringClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.interceptDeploymentGroupPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.interceptDeploymentGroupPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('interceptDeploymentGroupPath', () => { + const result = client.interceptDeploymentGroupPath("projectValue", "locationValue", "interceptDeploymentGroupValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.interceptDeploymentGroupPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromInterceptDeploymentGroupName', () => { + const result = client.matchProjectFromInterceptDeploymentGroupName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.interceptDeploymentGroupPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromInterceptDeploymentGroupName', () => { + const result = client.matchLocationFromInterceptDeploymentGroupName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.interceptDeploymentGroupPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchInterceptDeploymentGroupFromInterceptDeploymentGroupName', () => { + const result = client.matchInterceptDeploymentGroupFromInterceptDeploymentGroupName(fakePath); + assert.strictEqual(result, "interceptDeploymentGroupValue"); + assert((client.pathTemplates.interceptDeploymentGroupPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('interceptEndpointGroup', async () => { + const fakePath = "/rendered/path/interceptEndpointGroup"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + intercept_endpoint_group: "interceptEndpointGroupValue", + }; + const client = new mirroringModule.v1.MirroringClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.interceptEndpointGroupPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.interceptEndpointGroupPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('interceptEndpointGroupPath', () => { + const result = client.interceptEndpointGroupPath("projectValue", "locationValue", "interceptEndpointGroupValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.interceptEndpointGroupPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromInterceptEndpointGroupName', () => { + const result = client.matchProjectFromInterceptEndpointGroupName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.interceptEndpointGroupPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromInterceptEndpointGroupName', () => { + const result = client.matchLocationFromInterceptEndpointGroupName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.interceptEndpointGroupPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchInterceptEndpointGroupFromInterceptEndpointGroupName', () => { + const result = client.matchInterceptEndpointGroupFromInterceptEndpointGroupName(fakePath); + assert.strictEqual(result, "interceptEndpointGroupValue"); + assert((client.pathTemplates.interceptEndpointGroupPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('interceptEndpointGroupAssociation', async () => { + const fakePath = "/rendered/path/interceptEndpointGroupAssociation"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + intercept_endpoint_group_association: "interceptEndpointGroupAssociationValue", + }; + const client = new mirroringModule.v1.MirroringClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.interceptEndpointGroupAssociationPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.interceptEndpointGroupAssociationPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('interceptEndpointGroupAssociationPath', () => { + const result = client.interceptEndpointGroupAssociationPath("projectValue", "locationValue", "interceptEndpointGroupAssociationValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.interceptEndpointGroupAssociationPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromInterceptEndpointGroupAssociationName', () => { + const result = client.matchProjectFromInterceptEndpointGroupAssociationName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.interceptEndpointGroupAssociationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromInterceptEndpointGroupAssociationName', () => { + const result = client.matchLocationFromInterceptEndpointGroupAssociationName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.interceptEndpointGroupAssociationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchInterceptEndpointGroupAssociationFromInterceptEndpointGroupAssociationName', () => { + const result = client.matchInterceptEndpointGroupAssociationFromInterceptEndpointGroupAssociationName(fakePath); + assert.strictEqual(result, "interceptEndpointGroupAssociationValue"); + assert((client.pathTemplates.interceptEndpointGroupAssociationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('location', async () => { + const fakePath = "/rendered/path/location"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + }; + const client = new mirroringModule.v1.MirroringClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.locationPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.locationPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('locationPath', () => { + const result = client.locationPath("projectValue", "locationValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.locationPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromLocationName', () => { + const result = client.matchProjectFromLocationName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.locationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromLocationName', () => { + const result = client.matchLocationFromLocationName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.locationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('mirroringDeployment', async () => { + const fakePath = "/rendered/path/mirroringDeployment"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + mirroring_deployment: "mirroringDeploymentValue", + }; + const client = new mirroringModule.v1.MirroringClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.mirroringDeploymentPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.mirroringDeploymentPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('mirroringDeploymentPath', () => { + const result = client.mirroringDeploymentPath("projectValue", "locationValue", "mirroringDeploymentValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.mirroringDeploymentPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromMirroringDeploymentName', () => { + const result = client.matchProjectFromMirroringDeploymentName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.mirroringDeploymentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromMirroringDeploymentName', () => { + const result = client.matchLocationFromMirroringDeploymentName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.mirroringDeploymentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchMirroringDeploymentFromMirroringDeploymentName', () => { + const result = client.matchMirroringDeploymentFromMirroringDeploymentName(fakePath); + assert.strictEqual(result, "mirroringDeploymentValue"); + assert((client.pathTemplates.mirroringDeploymentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('mirroringDeploymentGroup', async () => { + const fakePath = "/rendered/path/mirroringDeploymentGroup"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + mirroring_deployment_group: "mirroringDeploymentGroupValue", + }; + const client = new mirroringModule.v1.MirroringClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.mirroringDeploymentGroupPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.mirroringDeploymentGroupPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('mirroringDeploymentGroupPath', () => { + const result = client.mirroringDeploymentGroupPath("projectValue", "locationValue", "mirroringDeploymentGroupValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.mirroringDeploymentGroupPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromMirroringDeploymentGroupName', () => { + const result = client.matchProjectFromMirroringDeploymentGroupName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.mirroringDeploymentGroupPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromMirroringDeploymentGroupName', () => { + const result = client.matchLocationFromMirroringDeploymentGroupName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.mirroringDeploymentGroupPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchMirroringDeploymentGroupFromMirroringDeploymentGroupName', () => { + const result = client.matchMirroringDeploymentGroupFromMirroringDeploymentGroupName(fakePath); + assert.strictEqual(result, "mirroringDeploymentGroupValue"); + assert((client.pathTemplates.mirroringDeploymentGroupPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('mirroringEndpointGroup', async () => { + const fakePath = "/rendered/path/mirroringEndpointGroup"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + mirroring_endpoint_group: "mirroringEndpointGroupValue", + }; + const client = new mirroringModule.v1.MirroringClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.mirroringEndpointGroupPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.mirroringEndpointGroupPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('mirroringEndpointGroupPath', () => { + const result = client.mirroringEndpointGroupPath("projectValue", "locationValue", "mirroringEndpointGroupValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.mirroringEndpointGroupPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromMirroringEndpointGroupName', () => { + const result = client.matchProjectFromMirroringEndpointGroupName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.mirroringEndpointGroupPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromMirroringEndpointGroupName', () => { + const result = client.matchLocationFromMirroringEndpointGroupName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.mirroringEndpointGroupPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchMirroringEndpointGroupFromMirroringEndpointGroupName', () => { + const result = client.matchMirroringEndpointGroupFromMirroringEndpointGroupName(fakePath); + assert.strictEqual(result, "mirroringEndpointGroupValue"); + assert((client.pathTemplates.mirroringEndpointGroupPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('mirroringEndpointGroupAssociation', async () => { + const fakePath = "/rendered/path/mirroringEndpointGroupAssociation"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + mirroring_endpoint_group_association: "mirroringEndpointGroupAssociationValue", + }; + const client = new mirroringModule.v1.MirroringClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.mirroringEndpointGroupAssociationPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.mirroringEndpointGroupAssociationPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('mirroringEndpointGroupAssociationPath', () => { + const result = client.mirroringEndpointGroupAssociationPath("projectValue", "locationValue", "mirroringEndpointGroupAssociationValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.mirroringEndpointGroupAssociationPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromMirroringEndpointGroupAssociationName', () => { + const result = client.matchProjectFromMirroringEndpointGroupAssociationName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.mirroringEndpointGroupAssociationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromMirroringEndpointGroupAssociationName', () => { + const result = client.matchLocationFromMirroringEndpointGroupAssociationName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.mirroringEndpointGroupAssociationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchMirroringEndpointGroupAssociationFromMirroringEndpointGroupAssociationName', () => { + const result = client.matchMirroringEndpointGroupAssociationFromMirroringEndpointGroupAssociationName(fakePath); + assert.strictEqual(result, "mirroringEndpointGroupAssociationValue"); + assert((client.pathTemplates.mirroringEndpointGroupAssociationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('network', async () => { + const fakePath = "/rendered/path/network"; + const expectedParameters = { + project: "projectValue", + network: "networkValue", + }; + const client = new mirroringModule.v1.MirroringClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.networkPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.networkPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('networkPath', () => { + const result = client.networkPath("projectValue", "networkValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.networkPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromNetworkName', () => { + const result = client.matchProjectFromNetworkName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.networkPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchNetworkFromNetworkName', () => { + const result = client.matchNetworkFromNetworkName(fakePath); + assert.strictEqual(result, "networkValue"); + assert((client.pathTemplates.networkPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('organizationLocationAddressGroup', async () => { + const fakePath = "/rendered/path/organizationLocationAddressGroup"; + const expectedParameters = { + organization: "organizationValue", + location: "locationValue", + address_group: "addressGroupValue", + }; + const client = new mirroringModule.v1.MirroringClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.organizationLocationAddressGroupPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.organizationLocationAddressGroupPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('organizationLocationAddressGroupPath', () => { + const result = client.organizationLocationAddressGroupPath("organizationValue", "locationValue", "addressGroupValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.organizationLocationAddressGroupPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchOrganizationFromOrganizationLocationAddressGroupName', () => { + const result = client.matchOrganizationFromOrganizationLocationAddressGroupName(fakePath); + assert.strictEqual(result, "organizationValue"); + assert((client.pathTemplates.organizationLocationAddressGroupPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromOrganizationLocationAddressGroupName', () => { + const result = client.matchLocationFromOrganizationLocationAddressGroupName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.organizationLocationAddressGroupPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchAddressGroupFromOrganizationLocationAddressGroupName', () => { + const result = client.matchAddressGroupFromOrganizationLocationAddressGroupName(fakePath); + assert.strictEqual(result, "addressGroupValue"); + assert((client.pathTemplates.organizationLocationAddressGroupPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('organizationLocationFirewallEndpoints', async () => { + const fakePath = "/rendered/path/organizationLocationFirewallEndpoints"; + const expectedParameters = { + organization: "organizationValue", + location: "locationValue", + firewall_endpoint: "firewallEndpointValue", + }; + const client = new mirroringModule.v1.MirroringClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.organizationLocationFirewallEndpointsPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.organizationLocationFirewallEndpointsPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('organizationLocationFirewallEndpointsPath', () => { + const result = client.organizationLocationFirewallEndpointsPath("organizationValue", "locationValue", "firewallEndpointValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.organizationLocationFirewallEndpointsPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchOrganizationFromOrganizationLocationFirewallEndpointsName', () => { + const result = client.matchOrganizationFromOrganizationLocationFirewallEndpointsName(fakePath); + assert.strictEqual(result, "organizationValue"); + assert((client.pathTemplates.organizationLocationFirewallEndpointsPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromOrganizationLocationFirewallEndpointsName', () => { + const result = client.matchLocationFromOrganizationLocationFirewallEndpointsName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.organizationLocationFirewallEndpointsPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchFirewallEndpointFromOrganizationLocationFirewallEndpointsName', () => { + const result = client.matchFirewallEndpointFromOrganizationLocationFirewallEndpointsName(fakePath); + assert.strictEqual(result, "firewallEndpointValue"); + assert((client.pathTemplates.organizationLocationFirewallEndpointsPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('organizationLocationSecurityProfile', async () => { + const fakePath = "/rendered/path/organizationLocationSecurityProfile"; + const expectedParameters = { + organization: "organizationValue", + location: "locationValue", + security_profile: "securityProfileValue", + }; + const client = new mirroringModule.v1.MirroringClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.organizationLocationSecurityProfilePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.organizationLocationSecurityProfilePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('organizationLocationSecurityProfilePath', () => { + const result = client.organizationLocationSecurityProfilePath("organizationValue", "locationValue", "securityProfileValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.organizationLocationSecurityProfilePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchOrganizationFromOrganizationLocationSecurityProfileName', () => { + const result = client.matchOrganizationFromOrganizationLocationSecurityProfileName(fakePath); + assert.strictEqual(result, "organizationValue"); + assert((client.pathTemplates.organizationLocationSecurityProfilePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromOrganizationLocationSecurityProfileName', () => { + const result = client.matchLocationFromOrganizationLocationSecurityProfileName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.organizationLocationSecurityProfilePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchSecurityProfileFromOrganizationLocationSecurityProfileName', () => { + const result = client.matchSecurityProfileFromOrganizationLocationSecurityProfileName(fakePath); + assert.strictEqual(result, "securityProfileValue"); + assert((client.pathTemplates.organizationLocationSecurityProfilePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('organizationLocationSecurityProfileGroup', async () => { + const fakePath = "/rendered/path/organizationLocationSecurityProfileGroup"; + const expectedParameters = { + organization: "organizationValue", + location: "locationValue", + security_profile_group: "securityProfileGroupValue", + }; + const client = new mirroringModule.v1.MirroringClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.organizationLocationSecurityProfileGroupPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.organizationLocationSecurityProfileGroupPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('organizationLocationSecurityProfileGroupPath', () => { + const result = client.organizationLocationSecurityProfileGroupPath("organizationValue", "locationValue", "securityProfileGroupValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.organizationLocationSecurityProfileGroupPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchOrganizationFromOrganizationLocationSecurityProfileGroupName', () => { + const result = client.matchOrganizationFromOrganizationLocationSecurityProfileGroupName(fakePath); + assert.strictEqual(result, "organizationValue"); + assert((client.pathTemplates.organizationLocationSecurityProfileGroupPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromOrganizationLocationSecurityProfileGroupName', () => { + const result = client.matchLocationFromOrganizationLocationSecurityProfileGroupName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.organizationLocationSecurityProfileGroupPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchSecurityProfileGroupFromOrganizationLocationSecurityProfileGroupName', () => { + const result = client.matchSecurityProfileGroupFromOrganizationLocationSecurityProfileGroupName(fakePath); + assert.strictEqual(result, "securityProfileGroupValue"); + assert((client.pathTemplates.organizationLocationSecurityProfileGroupPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('project', async () => { + const fakePath = "/rendered/path/project"; + const expectedParameters = { + project: "projectValue", + }; + const client = new mirroringModule.v1.MirroringClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectPath', () => { + const result = client.projectPath("projectValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.projectPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromProjectName', () => { + const result = client.matchProjectFromProjectName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.projectPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('projectLocationAddressGroup', async () => { + const fakePath = "/rendered/path/projectLocationAddressGroup"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + address_group: "addressGroupValue", + }; + const client = new mirroringModule.v1.MirroringClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectLocationAddressGroupPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationAddressGroupPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationAddressGroupPath', () => { + const result = client.projectLocationAddressGroupPath("projectValue", "locationValue", "addressGroupValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.projectLocationAddressGroupPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromProjectLocationAddressGroupName', () => { + const result = client.matchProjectFromProjectLocationAddressGroupName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.projectLocationAddressGroupPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromProjectLocationAddressGroupName', () => { + const result = client.matchLocationFromProjectLocationAddressGroupName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.projectLocationAddressGroupPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchAddressGroupFromProjectLocationAddressGroupName', () => { + const result = client.matchAddressGroupFromProjectLocationAddressGroupName(fakePath); + assert.strictEqual(result, "addressGroupValue"); + assert((client.pathTemplates.projectLocationAddressGroupPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('projectLocationFirewallEndpoints', async () => { + const fakePath = "/rendered/path/projectLocationFirewallEndpoints"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + firewall_endpoint: "firewallEndpointValue", + }; + const client = new mirroringModule.v1.MirroringClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectLocationFirewallEndpointsPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationFirewallEndpointsPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationFirewallEndpointsPath', () => { + const result = client.projectLocationFirewallEndpointsPath("projectValue", "locationValue", "firewallEndpointValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.projectLocationFirewallEndpointsPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromProjectLocationFirewallEndpointsName', () => { + const result = client.matchProjectFromProjectLocationFirewallEndpointsName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.projectLocationFirewallEndpointsPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromProjectLocationFirewallEndpointsName', () => { + const result = client.matchLocationFromProjectLocationFirewallEndpointsName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.projectLocationFirewallEndpointsPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchFirewallEndpointFromProjectLocationFirewallEndpointsName', () => { + const result = client.matchFirewallEndpointFromProjectLocationFirewallEndpointsName(fakePath); + assert.strictEqual(result, "firewallEndpointValue"); + assert((client.pathTemplates.projectLocationFirewallEndpointsPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('projectLocationSecurityProfile', async () => { + const fakePath = "/rendered/path/projectLocationSecurityProfile"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + security_profile: "securityProfileValue", + }; + const client = new mirroringModule.v1.MirroringClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectLocationSecurityProfilePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationSecurityProfilePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationSecurityProfilePath', () => { + const result = client.projectLocationSecurityProfilePath("projectValue", "locationValue", "securityProfileValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.projectLocationSecurityProfilePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromProjectLocationSecurityProfileName', () => { + const result = client.matchProjectFromProjectLocationSecurityProfileName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.projectLocationSecurityProfilePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromProjectLocationSecurityProfileName', () => { + const result = client.matchLocationFromProjectLocationSecurityProfileName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.projectLocationSecurityProfilePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchSecurityProfileFromProjectLocationSecurityProfileName', () => { + const result = client.matchSecurityProfileFromProjectLocationSecurityProfileName(fakePath); + assert.strictEqual(result, "securityProfileValue"); + assert((client.pathTemplates.projectLocationSecurityProfilePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('projectLocationSecurityProfileGroup', async () => { + const fakePath = "/rendered/path/projectLocationSecurityProfileGroup"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + security_profile_group: "securityProfileGroupValue", + }; + const client = new mirroringModule.v1.MirroringClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectLocationSecurityProfileGroupPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationSecurityProfileGroupPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationSecurityProfileGroupPath', () => { + const result = client.projectLocationSecurityProfileGroupPath("projectValue", "locationValue", "securityProfileGroupValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.projectLocationSecurityProfileGroupPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromProjectLocationSecurityProfileGroupName', () => { + const result = client.matchProjectFromProjectLocationSecurityProfileGroupName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.projectLocationSecurityProfileGroupPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromProjectLocationSecurityProfileGroupName', () => { + const result = client.matchLocationFromProjectLocationSecurityProfileGroupName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.projectLocationSecurityProfileGroupPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchSecurityProfileGroupFromProjectLocationSecurityProfileGroupName', () => { + const result = client.matchSecurityProfileGroupFromProjectLocationSecurityProfileGroupName(fakePath); + assert.strictEqual(result, "securityProfileGroupValue"); + assert((client.pathTemplates.projectLocationSecurityProfileGroupPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('serverTlsPolicy', async () => { + const fakePath = "/rendered/path/serverTlsPolicy"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + server_tls_policy: "serverTlsPolicyValue", + }; + const client = new mirroringModule.v1.MirroringClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.serverTlsPolicyPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.serverTlsPolicyPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('serverTlsPolicyPath', () => { + const result = client.serverTlsPolicyPath("projectValue", "locationValue", "serverTlsPolicyValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.serverTlsPolicyPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromServerTlsPolicyName', () => { + const result = client.matchProjectFromServerTlsPolicyName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.serverTlsPolicyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromServerTlsPolicyName', () => { + const result = client.matchLocationFromServerTlsPolicyName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.serverTlsPolicyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchServerTlsPolicyFromServerTlsPolicyName', () => { + const result = client.matchServerTlsPolicyFromServerTlsPolicyName(fakePath); + assert.strictEqual(result, "serverTlsPolicyValue"); + assert((client.pathTemplates.serverTlsPolicyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('tlsInspectionPolicy', async () => { + const fakePath = "/rendered/path/tlsInspectionPolicy"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + tls_inspection_policy: "tlsInspectionPolicyValue", + }; + const client = new mirroringModule.v1.MirroringClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.tlsInspectionPolicyPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.tlsInspectionPolicyPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('tlsInspectionPolicyPath', () => { + const result = client.tlsInspectionPolicyPath("projectValue", "locationValue", "tlsInspectionPolicyValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.tlsInspectionPolicyPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromTlsInspectionPolicyName', () => { + const result = client.matchProjectFromTlsInspectionPolicyName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.tlsInspectionPolicyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromTlsInspectionPolicyName', () => { + const result = client.matchLocationFromTlsInspectionPolicyName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.tlsInspectionPolicyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchTlsInspectionPolicyFromTlsInspectionPolicyName', () => { + const result = client.matchTlsInspectionPolicyFromTlsInspectionPolicyName(fakePath); + assert.strictEqual(result, "tlsInspectionPolicyValue"); + assert((client.pathTemplates.tlsInspectionPolicyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('urlList', async () => { + const fakePath = "/rendered/path/urlList"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + url_list: "urlListValue", + }; + const client = new mirroringModule.v1.MirroringClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.urlListPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.urlListPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('urlListPath', () => { + const result = client.urlListPath("projectValue", "locationValue", "urlListValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.urlListPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromUrlListName', () => { + const result = client.matchProjectFromUrlListName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.urlListPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromUrlListName', () => { + const result = client.matchLocationFromUrlListName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.urlListPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchUrlListFromUrlListName', () => { + const result = client.matchUrlListFromUrlListName(fakePath); + assert.strictEqual(result, "urlListValue"); + assert((client.pathTemplates.urlListPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + }); +}); diff --git a/packages/google-cloud-networksecurity/test/gapic_network_security_v1.ts b/packages/google-cloud-networksecurity/test/gapic_network_security_v1.ts index c00d512b42a..a5100689c40 100644 --- a/packages/google-cloud-networksecurity/test/gapic_network_security_v1.ts +++ b/packages/google-cloud-networksecurity/test/gapic_network_security_v1.ts @@ -383,6 +383,114 @@ describe('v1.NetworkSecurityClient', () => { }); }); + describe('getBackendAuthenticationConfig', () => { + it('invokes getBackendAuthenticationConfig without error', async () => { + const client = new networksecurityModule.v1.NetworkSecurityClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.GetBackendAuthenticationConfigRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.GetBackendAuthenticationConfigRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.BackendAuthenticationConfig() + ); + client.innerApiCalls.getBackendAuthenticationConfig = stubSimpleCall(expectedResponse); + const [response] = await client.getBackendAuthenticationConfig(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getBackendAuthenticationConfig as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getBackendAuthenticationConfig as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getBackendAuthenticationConfig without error using callback', async () => { + const client = new networksecurityModule.v1.NetworkSecurityClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.GetBackendAuthenticationConfigRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.GetBackendAuthenticationConfigRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.BackendAuthenticationConfig() + ); + client.innerApiCalls.getBackendAuthenticationConfig = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getBackendAuthenticationConfig( + request, + (err?: Error|null, result?: protos.google.cloud.networksecurity.v1.IBackendAuthenticationConfig|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getBackendAuthenticationConfig as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getBackendAuthenticationConfig as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getBackendAuthenticationConfig with error', async () => { + const client = new networksecurityModule.v1.NetworkSecurityClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.GetBackendAuthenticationConfigRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.GetBackendAuthenticationConfigRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.getBackendAuthenticationConfig = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getBackendAuthenticationConfig(request), expectedError); + const actualRequest = (client.innerApiCalls.getBackendAuthenticationConfig as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getBackendAuthenticationConfig as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getBackendAuthenticationConfig with closed client', async () => { + const client = new networksecurityModule.v1.NetworkSecurityClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.GetBackendAuthenticationConfigRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.GetBackendAuthenticationConfigRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.getBackendAuthenticationConfig(request), expectedError); + }); + }); + describe('getServerTlsPolicy', () => { it('invokes getServerTlsPolicy without error', async () => { const client = new networksecurityModule.v1.NetworkSecurityClient({ @@ -599,58 +707,55 @@ describe('v1.NetworkSecurityClient', () => { }); }); - describe('createAuthorizationPolicy', () => { - it('invokes createAuthorizationPolicy without error', async () => { + describe('getGatewaySecurityPolicy', () => { + it('invokes getGatewaySecurityPolicy without error', async () => { const client = new networksecurityModule.v1.NetworkSecurityClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); await client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.networksecurity.v1.CreateAuthorizationPolicyRequest() + new protos.google.cloud.networksecurity.v1.GetGatewaySecurityPolicyRequest() ); const defaultValue1 = - getTypeDefaultValue('.google.cloud.networksecurity.v1.CreateAuthorizationPolicyRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + getTypeDefaultValue('.google.cloud.networksecurity.v1.GetGatewaySecurityPolicyRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() + new protos.google.cloud.networksecurity.v1.GatewaySecurityPolicy() ); - client.innerApiCalls.createAuthorizationPolicy = stubLongRunningCall(expectedResponse); - const [operation] = await client.createAuthorizationPolicy(request); - const [response] = await operation.promise(); + client.innerApiCalls.getGatewaySecurityPolicy = stubSimpleCall(expectedResponse); + const [response] = await client.getGatewaySecurityPolicy(request); assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.createAuthorizationPolicy as SinonStub) + const actualRequest = (client.innerApiCalls.getGatewaySecurityPolicy as SinonStub) .getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createAuthorizationPolicy as SinonStub) + const actualHeaderRequestParams = (client.innerApiCalls.getGatewaySecurityPolicy as SinonStub) .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes createAuthorizationPolicy without error using callback', async () => { + it('invokes getGatewaySecurityPolicy without error using callback', async () => { const client = new networksecurityModule.v1.NetworkSecurityClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); await client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.networksecurity.v1.CreateAuthorizationPolicyRequest() + new protos.google.cloud.networksecurity.v1.GetGatewaySecurityPolicyRequest() ); const defaultValue1 = - getTypeDefaultValue('.google.cloud.networksecurity.v1.CreateAuthorizationPolicyRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + getTypeDefaultValue('.google.cloud.networksecurity.v1.GetGatewaySecurityPolicyRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() + new protos.google.cloud.networksecurity.v1.GatewaySecurityPolicy() ); - client.innerApiCalls.createAuthorizationPolicy = stubLongRunningCallWithCallback(expectedResponse); + client.innerApiCalls.getGatewaySecurityPolicy = stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { - client.createAuthorizationPolicy( + client.getGatewaySecurityPolicy( request, - (err?: Error|null, - result?: LROperation|null - ) => { + (err?: Error|null, result?: protos.google.cloud.networksecurity.v1.IGatewaySecurityPolicy|null) => { if (err) { reject(err); } else { @@ -658,155 +763,215 @@ describe('v1.NetworkSecurityClient', () => { } }); }); - const operation = await promise as LROperation; - const [response] = await operation.promise(); + const response = await promise; assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.createAuthorizationPolicy as SinonStub) + const actualRequest = (client.innerApiCalls.getGatewaySecurityPolicy as SinonStub) .getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createAuthorizationPolicy as SinonStub) + const actualHeaderRequestParams = (client.innerApiCalls.getGatewaySecurityPolicy as SinonStub) .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes createAuthorizationPolicy with call error', async () => { + it('invokes getGatewaySecurityPolicy with error', async () => { const client = new networksecurityModule.v1.NetworkSecurityClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); await client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.networksecurity.v1.CreateAuthorizationPolicyRequest() + new protos.google.cloud.networksecurity.v1.GetGatewaySecurityPolicyRequest() ); const defaultValue1 = - getTypeDefaultValue('.google.cloud.networksecurity.v1.CreateAuthorizationPolicyRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + getTypeDefaultValue('.google.cloud.networksecurity.v1.GetGatewaySecurityPolicyRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; const expectedError = new Error('expected'); - client.innerApiCalls.createAuthorizationPolicy = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.createAuthorizationPolicy(request), expectedError); - const actualRequest = (client.innerApiCalls.createAuthorizationPolicy as SinonStub) + client.innerApiCalls.getGatewaySecurityPolicy = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getGatewaySecurityPolicy(request), expectedError); + const actualRequest = (client.innerApiCalls.getGatewaySecurityPolicy as SinonStub) .getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createAuthorizationPolicy as SinonStub) + const actualHeaderRequestParams = (client.innerApiCalls.getGatewaySecurityPolicy as SinonStub) .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes createAuthorizationPolicy with LRO error', async () => { + it('invokes getGatewaySecurityPolicy with closed client', async () => { const client = new networksecurityModule.v1.NetworkSecurityClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); await client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.networksecurity.v1.CreateAuthorizationPolicyRequest() + new protos.google.cloud.networksecurity.v1.GetGatewaySecurityPolicyRequest() ); const defaultValue1 = - getTypeDefaultValue('.google.cloud.networksecurity.v1.CreateAuthorizationPolicyRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.createAuthorizationPolicy = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.createAuthorizationPolicy(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.createAuthorizationPolicy as SinonStub) + getTypeDefaultValue('.google.cloud.networksecurity.v1.GetGatewaySecurityPolicyRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.getGatewaySecurityPolicy(request), expectedError); + }); + }); + + describe('getGatewaySecurityPolicyRule', () => { + it('invokes getGatewaySecurityPolicyRule without error', async () => { + const client = new networksecurityModule.v1.NetworkSecurityClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.GetGatewaySecurityPolicyRuleRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.GetGatewaySecurityPolicyRuleRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.GatewaySecurityPolicyRule() + ); + client.innerApiCalls.getGatewaySecurityPolicyRule = stubSimpleCall(expectedResponse); + const [response] = await client.getGatewaySecurityPolicyRule(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getGatewaySecurityPolicyRule as SinonStub) .getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createAuthorizationPolicy as SinonStub) + const actualHeaderRequestParams = (client.innerApiCalls.getGatewaySecurityPolicyRule as SinonStub) .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes checkCreateAuthorizationPolicyProgress without error', async () => { + it('invokes getGatewaySecurityPolicyRule without error using callback', async () => { const client = new networksecurityModule.v1.NetworkSecurityClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.GetGatewaySecurityPolicyRuleRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.GetGatewaySecurityPolicyRuleRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; const expectedResponse = generateSampleMessage( - new operationsProtos.google.longrunning.Operation() + new protos.google.cloud.networksecurity.v1.GatewaySecurityPolicyRule() ); - expectedResponse.name = 'test'; - expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; - expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} - - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkCreateAuthorizationPolicyProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + client.innerApiCalls.getGatewaySecurityPolicyRule = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getGatewaySecurityPolicyRule( + request, + (err?: Error|null, result?: protos.google.cloud.networksecurity.v1.IGatewaySecurityPolicyRule|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getGatewaySecurityPolicyRule as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getGatewaySecurityPolicyRule as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes checkCreateAuthorizationPolicyProgress with error', async () => { + it('invokes getGatewaySecurityPolicyRule with error', async () => { const client = new networksecurityModule.v1.NetworkSecurityClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.GetGatewaySecurityPolicyRuleRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.GetGatewaySecurityPolicyRuleRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; const expectedError = new Error('expected'); + client.innerApiCalls.getGatewaySecurityPolicyRule = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getGatewaySecurityPolicyRule(request), expectedError); + const actualRequest = (client.innerApiCalls.getGatewaySecurityPolicyRule as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getGatewaySecurityPolicyRule as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); - client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.checkCreateAuthorizationPolicyProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); + it('invokes getGatewaySecurityPolicyRule with closed client', async () => { + const client = new networksecurityModule.v1.NetworkSecurityClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.GetGatewaySecurityPolicyRuleRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.GetGatewaySecurityPolicyRuleRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.getGatewaySecurityPolicyRule(request), expectedError); }); }); - describe('updateAuthorizationPolicy', () => { - it('invokes updateAuthorizationPolicy without error', async () => { + describe('getUrlList', () => { + it('invokes getUrlList without error', async () => { const client = new networksecurityModule.v1.NetworkSecurityClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); await client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.networksecurity.v1.UpdateAuthorizationPolicyRequest() + new protos.google.cloud.networksecurity.v1.GetUrlListRequest() ); - request.authorizationPolicy ??= {}; const defaultValue1 = - getTypeDefaultValue('.google.cloud.networksecurity.v1.UpdateAuthorizationPolicyRequest', ['authorizationPolicy', 'name']); - request.authorizationPolicy.name = defaultValue1; - const expectedHeaderRequestParams = `authorization_policy.name=${defaultValue1 ?? '' }`; + getTypeDefaultValue('.google.cloud.networksecurity.v1.GetUrlListRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() + new protos.google.cloud.networksecurity.v1.UrlList() ); - client.innerApiCalls.updateAuthorizationPolicy = stubLongRunningCall(expectedResponse); - const [operation] = await client.updateAuthorizationPolicy(request); - const [response] = await operation.promise(); + client.innerApiCalls.getUrlList = stubSimpleCall(expectedResponse); + const [response] = await client.getUrlList(request); assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.updateAuthorizationPolicy as SinonStub) + const actualRequest = (client.innerApiCalls.getUrlList as SinonStub) .getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateAuthorizationPolicy as SinonStub) + const actualHeaderRequestParams = (client.innerApiCalls.getUrlList as SinonStub) .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes updateAuthorizationPolicy without error using callback', async () => { + it('invokes getUrlList without error using callback', async () => { const client = new networksecurityModule.v1.NetworkSecurityClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); await client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.networksecurity.v1.UpdateAuthorizationPolicyRequest() + new protos.google.cloud.networksecurity.v1.GetUrlListRequest() ); - request.authorizationPolicy ??= {}; const defaultValue1 = - getTypeDefaultValue('.google.cloud.networksecurity.v1.UpdateAuthorizationPolicyRequest', ['authorizationPolicy', 'name']); - request.authorizationPolicy.name = defaultValue1; - const expectedHeaderRequestParams = `authorization_policy.name=${defaultValue1 ?? '' }`; + getTypeDefaultValue('.google.cloud.networksecurity.v1.GetUrlListRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() + new protos.google.cloud.networksecurity.v1.UrlList() ); - client.innerApiCalls.updateAuthorizationPolicy = stubLongRunningCallWithCallback(expectedResponse); + client.innerApiCalls.getUrlList = stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { - client.updateAuthorizationPolicy( + client.getUrlList( request, - (err?: Error|null, - result?: LROperation|null - ) => { + (err?: Error|null, result?: protos.google.cloud.networksecurity.v1.IUrlList|null) => { if (err) { reject(err); } else { @@ -814,155 +979,107 @@ describe('v1.NetworkSecurityClient', () => { } }); }); - const operation = await promise as LROperation; - const [response] = await operation.promise(); + const response = await promise; assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.updateAuthorizationPolicy as SinonStub) + const actualRequest = (client.innerApiCalls.getUrlList as SinonStub) .getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateAuthorizationPolicy as SinonStub) + const actualHeaderRequestParams = (client.innerApiCalls.getUrlList as SinonStub) .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes updateAuthorizationPolicy with call error', async () => { + it('invokes getUrlList with error', async () => { const client = new networksecurityModule.v1.NetworkSecurityClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); await client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.networksecurity.v1.UpdateAuthorizationPolicyRequest() + new protos.google.cloud.networksecurity.v1.GetUrlListRequest() ); - request.authorizationPolicy ??= {}; const defaultValue1 = - getTypeDefaultValue('.google.cloud.networksecurity.v1.UpdateAuthorizationPolicyRequest', ['authorizationPolicy', 'name']); - request.authorizationPolicy.name = defaultValue1; - const expectedHeaderRequestParams = `authorization_policy.name=${defaultValue1 ?? '' }`; + getTypeDefaultValue('.google.cloud.networksecurity.v1.GetUrlListRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; const expectedError = new Error('expected'); - client.innerApiCalls.updateAuthorizationPolicy = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.updateAuthorizationPolicy(request), expectedError); - const actualRequest = (client.innerApiCalls.updateAuthorizationPolicy as SinonStub) + client.innerApiCalls.getUrlList = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getUrlList(request), expectedError); + const actualRequest = (client.innerApiCalls.getUrlList as SinonStub) .getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateAuthorizationPolicy as SinonStub) + const actualHeaderRequestParams = (client.innerApiCalls.getUrlList as SinonStub) .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes updateAuthorizationPolicy with LRO error', async () => { + it('invokes getUrlList with closed client', async () => { const client = new networksecurityModule.v1.NetworkSecurityClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); await client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.networksecurity.v1.UpdateAuthorizationPolicyRequest() + new protos.google.cloud.networksecurity.v1.GetUrlListRequest() ); - request.authorizationPolicy ??= {}; const defaultValue1 = - getTypeDefaultValue('.google.cloud.networksecurity.v1.UpdateAuthorizationPolicyRequest', ['authorizationPolicy', 'name']); - request.authorizationPolicy.name = defaultValue1; - const expectedHeaderRequestParams = `authorization_policy.name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.updateAuthorizationPolicy = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.updateAuthorizationPolicy(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.updateAuthorizationPolicy as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateAuthorizationPolicy as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes checkUpdateAuthorizationPolicyProgress without error', async () => { - const client = new networksecurityModule.v1.NetworkSecurityClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const expectedResponse = generateSampleMessage( - new operationsProtos.google.longrunning.Operation() - ); - expectedResponse.name = 'test'; - expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; - expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} - - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkUpdateAuthorizationPolicyProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkUpdateAuthorizationPolicyProgress with error', async () => { - const client = new networksecurityModule.v1.NetworkSecurityClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const expectedError = new Error('expected'); - - client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.checkUpdateAuthorizationPolicyProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); + getTypeDefaultValue('.google.cloud.networksecurity.v1.GetUrlListRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.getUrlList(request), expectedError); }); }); - describe('deleteAuthorizationPolicy', () => { - it('invokes deleteAuthorizationPolicy without error', async () => { + describe('getTlsInspectionPolicy', () => { + it('invokes getTlsInspectionPolicy without error', async () => { const client = new networksecurityModule.v1.NetworkSecurityClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); await client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.networksecurity.v1.DeleteAuthorizationPolicyRequest() + new protos.google.cloud.networksecurity.v1.GetTlsInspectionPolicyRequest() ); const defaultValue1 = - getTypeDefaultValue('.google.cloud.networksecurity.v1.DeleteAuthorizationPolicyRequest', ['name']); + getTypeDefaultValue('.google.cloud.networksecurity.v1.GetTlsInspectionPolicyRequest', ['name']); request.name = defaultValue1; const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() + new protos.google.cloud.networksecurity.v1.TlsInspectionPolicy() ); - client.innerApiCalls.deleteAuthorizationPolicy = stubLongRunningCall(expectedResponse); - const [operation] = await client.deleteAuthorizationPolicy(request); - const [response] = await operation.promise(); + client.innerApiCalls.getTlsInspectionPolicy = stubSimpleCall(expectedResponse); + const [response] = await client.getTlsInspectionPolicy(request); assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.deleteAuthorizationPolicy as SinonStub) + const actualRequest = (client.innerApiCalls.getTlsInspectionPolicy as SinonStub) .getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteAuthorizationPolicy as SinonStub) + const actualHeaderRequestParams = (client.innerApiCalls.getTlsInspectionPolicy as SinonStub) .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes deleteAuthorizationPolicy without error using callback', async () => { + it('invokes getTlsInspectionPolicy without error using callback', async () => { const client = new networksecurityModule.v1.NetworkSecurityClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); await client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.networksecurity.v1.DeleteAuthorizationPolicyRequest() + new protos.google.cloud.networksecurity.v1.GetTlsInspectionPolicyRequest() ); const defaultValue1 = - getTypeDefaultValue('.google.cloud.networksecurity.v1.DeleteAuthorizationPolicyRequest', ['name']); + getTypeDefaultValue('.google.cloud.networksecurity.v1.GetTlsInspectionPolicyRequest', ['name']); request.name = defaultValue1; const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() + new protos.google.cloud.networksecurity.v1.TlsInspectionPolicy() ); - client.innerApiCalls.deleteAuthorizationPolicy = stubLongRunningCallWithCallback(expectedResponse); + client.innerApiCalls.getTlsInspectionPolicy = stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { - client.deleteAuthorizationPolicy( + client.getTlsInspectionPolicy( request, - (err?: Error|null, - result?: LROperation|null - ) => { + (err?: Error|null, result?: protos.google.cloud.networksecurity.v1.ITlsInspectionPolicy|null) => { if (err) { reject(err); } else { @@ -970,152 +1087,217 @@ describe('v1.NetworkSecurityClient', () => { } }); }); - const operation = await promise as LROperation; - const [response] = await operation.promise(); + const response = await promise; assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.deleteAuthorizationPolicy as SinonStub) + const actualRequest = (client.innerApiCalls.getTlsInspectionPolicy as SinonStub) .getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteAuthorizationPolicy as SinonStub) + const actualHeaderRequestParams = (client.innerApiCalls.getTlsInspectionPolicy as SinonStub) .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes deleteAuthorizationPolicy with call error', async () => { + it('invokes getTlsInspectionPolicy with error', async () => { const client = new networksecurityModule.v1.NetworkSecurityClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); await client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.networksecurity.v1.DeleteAuthorizationPolicyRequest() + new protos.google.cloud.networksecurity.v1.GetTlsInspectionPolicyRequest() ); const defaultValue1 = - getTypeDefaultValue('.google.cloud.networksecurity.v1.DeleteAuthorizationPolicyRequest', ['name']); + getTypeDefaultValue('.google.cloud.networksecurity.v1.GetTlsInspectionPolicyRequest', ['name']); request.name = defaultValue1; const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; const expectedError = new Error('expected'); - client.innerApiCalls.deleteAuthorizationPolicy = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.deleteAuthorizationPolicy(request), expectedError); - const actualRequest = (client.innerApiCalls.deleteAuthorizationPolicy as SinonStub) + client.innerApiCalls.getTlsInspectionPolicy = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getTlsInspectionPolicy(request), expectedError); + const actualRequest = (client.innerApiCalls.getTlsInspectionPolicy as SinonStub) .getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteAuthorizationPolicy as SinonStub) + const actualHeaderRequestParams = (client.innerApiCalls.getTlsInspectionPolicy as SinonStub) .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes deleteAuthorizationPolicy with LRO error', async () => { + it('invokes getTlsInspectionPolicy with closed client', async () => { const client = new networksecurityModule.v1.NetworkSecurityClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); await client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.networksecurity.v1.DeleteAuthorizationPolicyRequest() + new protos.google.cloud.networksecurity.v1.GetTlsInspectionPolicyRequest() ); const defaultValue1 = - getTypeDefaultValue('.google.cloud.networksecurity.v1.DeleteAuthorizationPolicyRequest', ['name']); + getTypeDefaultValue('.google.cloud.networksecurity.v1.GetTlsInspectionPolicyRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.getTlsInspectionPolicy(request), expectedError); + }); + }); + + describe('getAuthzPolicy', () => { + it('invokes getAuthzPolicy without error', async () => { + const client = new networksecurityModule.v1.NetworkSecurityClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.GetAuthzPolicyRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.GetAuthzPolicyRequest', ['name']); request.name = defaultValue1; const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteAuthorizationPolicy = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.deleteAuthorizationPolicy(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.deleteAuthorizationPolicy as SinonStub) + const expectedResponse = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.AuthzPolicy() + ); + client.innerApiCalls.getAuthzPolicy = stubSimpleCall(expectedResponse); + const [response] = await client.getAuthzPolicy(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getAuthzPolicy as SinonStub) .getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteAuthorizationPolicy as SinonStub) + const actualHeaderRequestParams = (client.innerApiCalls.getAuthzPolicy as SinonStub) .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes checkDeleteAuthorizationPolicyProgress without error', async () => { + it('invokes getAuthzPolicy without error using callback', async () => { const client = new networksecurityModule.v1.NetworkSecurityClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.GetAuthzPolicyRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.GetAuthzPolicyRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; const expectedResponse = generateSampleMessage( - new operationsProtos.google.longrunning.Operation() + new protos.google.cloud.networksecurity.v1.AuthzPolicy() ); - expectedResponse.name = 'test'; - expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; - expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} - - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkDeleteAuthorizationPolicyProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + client.innerApiCalls.getAuthzPolicy = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getAuthzPolicy( + request, + (err?: Error|null, result?: protos.google.cloud.networksecurity.v1.IAuthzPolicy|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getAuthzPolicy as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getAuthzPolicy as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes checkDeleteAuthorizationPolicyProgress with error', async () => { + it('invokes getAuthzPolicy with error', async () => { const client = new networksecurityModule.v1.NetworkSecurityClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.GetAuthzPolicyRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.GetAuthzPolicyRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; const expectedError = new Error('expected'); + client.innerApiCalls.getAuthzPolicy = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getAuthzPolicy(request), expectedError); + const actualRequest = (client.innerApiCalls.getAuthzPolicy as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getAuthzPolicy as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); - client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.checkDeleteAuthorizationPolicyProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); + it('invokes getAuthzPolicy with closed client', async () => { + const client = new networksecurityModule.v1.NetworkSecurityClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.GetAuthzPolicyRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.GetAuthzPolicyRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.getAuthzPolicy(request), expectedError); }); }); - describe('createServerTlsPolicy', () => { - it('invokes createServerTlsPolicy without error', async () => { + describe('createAuthorizationPolicy', () => { + it('invokes createAuthorizationPolicy without error', async () => { const client = new networksecurityModule.v1.NetworkSecurityClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); await client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.networksecurity.v1.CreateServerTlsPolicyRequest() + new protos.google.cloud.networksecurity.v1.CreateAuthorizationPolicyRequest() ); const defaultValue1 = - getTypeDefaultValue('.google.cloud.networksecurity.v1.CreateServerTlsPolicyRequest', ['parent']); + getTypeDefaultValue('.google.cloud.networksecurity.v1.CreateAuthorizationPolicyRequest', ['parent']); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); - client.innerApiCalls.createServerTlsPolicy = stubLongRunningCall(expectedResponse); - const [operation] = await client.createServerTlsPolicy(request); + client.innerApiCalls.createAuthorizationPolicy = stubLongRunningCall(expectedResponse); + const [operation] = await client.createAuthorizationPolicy(request); const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.createServerTlsPolicy as SinonStub) + const actualRequest = (client.innerApiCalls.createAuthorizationPolicy as SinonStub) .getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createServerTlsPolicy as SinonStub) + const actualHeaderRequestParams = (client.innerApiCalls.createAuthorizationPolicy as SinonStub) .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes createServerTlsPolicy without error using callback', async () => { + it('invokes createAuthorizationPolicy without error using callback', async () => { const client = new networksecurityModule.v1.NetworkSecurityClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); await client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.networksecurity.v1.CreateServerTlsPolicyRequest() + new protos.google.cloud.networksecurity.v1.CreateAuthorizationPolicyRequest() ); const defaultValue1 = - getTypeDefaultValue('.google.cloud.networksecurity.v1.CreateServerTlsPolicyRequest', ['parent']); + getTypeDefaultValue('.google.cloud.networksecurity.v1.CreateAuthorizationPolicyRequest', ['parent']); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); - client.innerApiCalls.createServerTlsPolicy = stubLongRunningCallWithCallback(expectedResponse); + client.innerApiCalls.createAuthorizationPolicy = stubLongRunningCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { - client.createServerTlsPolicy( + client.createAuthorizationPolicy( request, (err?: Error|null, - result?: LROperation|null + result?: LROperation|null ) => { if (err) { reject(err); @@ -1124,67 +1306,67 @@ describe('v1.NetworkSecurityClient', () => { } }); }); - const operation = await promise as LROperation; + const operation = await promise as LROperation; const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.createServerTlsPolicy as SinonStub) + const actualRequest = (client.innerApiCalls.createAuthorizationPolicy as SinonStub) .getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createServerTlsPolicy as SinonStub) + const actualHeaderRequestParams = (client.innerApiCalls.createAuthorizationPolicy as SinonStub) .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes createServerTlsPolicy with call error', async () => { + it('invokes createAuthorizationPolicy with call error', async () => { const client = new networksecurityModule.v1.NetworkSecurityClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); await client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.networksecurity.v1.CreateServerTlsPolicyRequest() + new protos.google.cloud.networksecurity.v1.CreateAuthorizationPolicyRequest() ); const defaultValue1 = - getTypeDefaultValue('.google.cloud.networksecurity.v1.CreateServerTlsPolicyRequest', ['parent']); + getTypeDefaultValue('.google.cloud.networksecurity.v1.CreateAuthorizationPolicyRequest', ['parent']); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; const expectedError = new Error('expected'); - client.innerApiCalls.createServerTlsPolicy = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.createServerTlsPolicy(request), expectedError); - const actualRequest = (client.innerApiCalls.createServerTlsPolicy as SinonStub) + client.innerApiCalls.createAuthorizationPolicy = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.createAuthorizationPolicy(request), expectedError); + const actualRequest = (client.innerApiCalls.createAuthorizationPolicy as SinonStub) .getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createServerTlsPolicy as SinonStub) + const actualHeaderRequestParams = (client.innerApiCalls.createAuthorizationPolicy as SinonStub) .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes createServerTlsPolicy with LRO error', async () => { + it('invokes createAuthorizationPolicy with LRO error', async () => { const client = new networksecurityModule.v1.NetworkSecurityClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); await client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.networksecurity.v1.CreateServerTlsPolicyRequest() + new protos.google.cloud.networksecurity.v1.CreateAuthorizationPolicyRequest() ); const defaultValue1 = - getTypeDefaultValue('.google.cloud.networksecurity.v1.CreateServerTlsPolicyRequest', ['parent']); + getTypeDefaultValue('.google.cloud.networksecurity.v1.CreateAuthorizationPolicyRequest', ['parent']); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; const expectedError = new Error('expected'); - client.innerApiCalls.createServerTlsPolicy = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.createServerTlsPolicy(request); + client.innerApiCalls.createAuthorizationPolicy = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.createAuthorizationPolicy(request); await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.createServerTlsPolicy as SinonStub) + const actualRequest = (client.innerApiCalls.createAuthorizationPolicy as SinonStub) .getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createServerTlsPolicy as SinonStub) + const actualHeaderRequestParams = (client.innerApiCalls.createAuthorizationPolicy as SinonStub) .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes checkCreateServerTlsPolicyProgress without error', async () => { + it('invokes checkCreateAuthorizationPolicyProgress without error', async () => { const client = new networksecurityModule.v1.NetworkSecurityClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', @@ -1198,13 +1380,13 @@ describe('v1.NetworkSecurityClient', () => { expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkCreateServerTlsPolicyProgress(expectedResponse.name); + const decodedOperation = await client.checkCreateAuthorizationPolicyProgress(expectedResponse.name); assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); assert(decodedOperation.metadata); assert((client.operationsClient.getOperation as SinonStub).getCall(0)); }); - it('invokes checkCreateServerTlsPolicyProgress with error', async () => { + it('invokes checkCreateAuthorizationPolicyProgress with error', async () => { const client = new networksecurityModule.v1.NetworkSecurityClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', @@ -1213,65 +1395,65 @@ describe('v1.NetworkSecurityClient', () => { const expectedError = new Error('expected'); client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.checkCreateServerTlsPolicyProgress(''), expectedError); + await assert.rejects(client.checkCreateAuthorizationPolicyProgress(''), expectedError); assert((client.operationsClient.getOperation as SinonStub) .getCall(0)); }); }); - describe('updateServerTlsPolicy', () => { - it('invokes updateServerTlsPolicy without error', async () => { + describe('updateAuthorizationPolicy', () => { + it('invokes updateAuthorizationPolicy without error', async () => { const client = new networksecurityModule.v1.NetworkSecurityClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); await client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.networksecurity.v1.UpdateServerTlsPolicyRequest() + new protos.google.cloud.networksecurity.v1.UpdateAuthorizationPolicyRequest() ); - request.serverTlsPolicy ??= {}; + request.authorizationPolicy ??= {}; const defaultValue1 = - getTypeDefaultValue('.google.cloud.networksecurity.v1.UpdateServerTlsPolicyRequest', ['serverTlsPolicy', 'name']); - request.serverTlsPolicy.name = defaultValue1; - const expectedHeaderRequestParams = `server_tls_policy.name=${defaultValue1 ?? '' }`; + getTypeDefaultValue('.google.cloud.networksecurity.v1.UpdateAuthorizationPolicyRequest', ['authorizationPolicy', 'name']); + request.authorizationPolicy.name = defaultValue1; + const expectedHeaderRequestParams = `authorization_policy.name=${defaultValue1 ?? '' }`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); - client.innerApiCalls.updateServerTlsPolicy = stubLongRunningCall(expectedResponse); - const [operation] = await client.updateServerTlsPolicy(request); + client.innerApiCalls.updateAuthorizationPolicy = stubLongRunningCall(expectedResponse); + const [operation] = await client.updateAuthorizationPolicy(request); const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.updateServerTlsPolicy as SinonStub) + const actualRequest = (client.innerApiCalls.updateAuthorizationPolicy as SinonStub) .getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateServerTlsPolicy as SinonStub) + const actualHeaderRequestParams = (client.innerApiCalls.updateAuthorizationPolicy as SinonStub) .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes updateServerTlsPolicy without error using callback', async () => { + it('invokes updateAuthorizationPolicy without error using callback', async () => { const client = new networksecurityModule.v1.NetworkSecurityClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); await client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.networksecurity.v1.UpdateServerTlsPolicyRequest() + new protos.google.cloud.networksecurity.v1.UpdateAuthorizationPolicyRequest() ); - request.serverTlsPolicy ??= {}; + request.authorizationPolicy ??= {}; const defaultValue1 = - getTypeDefaultValue('.google.cloud.networksecurity.v1.UpdateServerTlsPolicyRequest', ['serverTlsPolicy', 'name']); - request.serverTlsPolicy.name = defaultValue1; - const expectedHeaderRequestParams = `server_tls_policy.name=${defaultValue1 ?? '' }`; + getTypeDefaultValue('.google.cloud.networksecurity.v1.UpdateAuthorizationPolicyRequest', ['authorizationPolicy', 'name']); + request.authorizationPolicy.name = defaultValue1; + const expectedHeaderRequestParams = `authorization_policy.name=${defaultValue1 ?? '' }`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); - client.innerApiCalls.updateServerTlsPolicy = stubLongRunningCallWithCallback(expectedResponse); + client.innerApiCalls.updateAuthorizationPolicy = stubLongRunningCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { - client.updateServerTlsPolicy( + client.updateAuthorizationPolicy( request, (err?: Error|null, - result?: LROperation|null + result?: LROperation|null ) => { if (err) { reject(err); @@ -1280,69 +1462,69 @@ describe('v1.NetworkSecurityClient', () => { } }); }); - const operation = await promise as LROperation; + const operation = await promise as LROperation; const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.updateServerTlsPolicy as SinonStub) + const actualRequest = (client.innerApiCalls.updateAuthorizationPolicy as SinonStub) .getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateServerTlsPolicy as SinonStub) + const actualHeaderRequestParams = (client.innerApiCalls.updateAuthorizationPolicy as SinonStub) .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes updateServerTlsPolicy with call error', async () => { + it('invokes updateAuthorizationPolicy with call error', async () => { const client = new networksecurityModule.v1.NetworkSecurityClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); await client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.networksecurity.v1.UpdateServerTlsPolicyRequest() + new protos.google.cloud.networksecurity.v1.UpdateAuthorizationPolicyRequest() ); - request.serverTlsPolicy ??= {}; + request.authorizationPolicy ??= {}; const defaultValue1 = - getTypeDefaultValue('.google.cloud.networksecurity.v1.UpdateServerTlsPolicyRequest', ['serverTlsPolicy', 'name']); - request.serverTlsPolicy.name = defaultValue1; - const expectedHeaderRequestParams = `server_tls_policy.name=${defaultValue1 ?? '' }`; + getTypeDefaultValue('.google.cloud.networksecurity.v1.UpdateAuthorizationPolicyRequest', ['authorizationPolicy', 'name']); + request.authorizationPolicy.name = defaultValue1; + const expectedHeaderRequestParams = `authorization_policy.name=${defaultValue1 ?? '' }`; const expectedError = new Error('expected'); - client.innerApiCalls.updateServerTlsPolicy = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.updateServerTlsPolicy(request), expectedError); - const actualRequest = (client.innerApiCalls.updateServerTlsPolicy as SinonStub) + client.innerApiCalls.updateAuthorizationPolicy = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.updateAuthorizationPolicy(request), expectedError); + const actualRequest = (client.innerApiCalls.updateAuthorizationPolicy as SinonStub) .getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateServerTlsPolicy as SinonStub) + const actualHeaderRequestParams = (client.innerApiCalls.updateAuthorizationPolicy as SinonStub) .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes updateServerTlsPolicy with LRO error', async () => { + it('invokes updateAuthorizationPolicy with LRO error', async () => { const client = new networksecurityModule.v1.NetworkSecurityClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); await client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.networksecurity.v1.UpdateServerTlsPolicyRequest() + new protos.google.cloud.networksecurity.v1.UpdateAuthorizationPolicyRequest() ); - request.serverTlsPolicy ??= {}; + request.authorizationPolicy ??= {}; const defaultValue1 = - getTypeDefaultValue('.google.cloud.networksecurity.v1.UpdateServerTlsPolicyRequest', ['serverTlsPolicy', 'name']); - request.serverTlsPolicy.name = defaultValue1; - const expectedHeaderRequestParams = `server_tls_policy.name=${defaultValue1 ?? '' }`; + getTypeDefaultValue('.google.cloud.networksecurity.v1.UpdateAuthorizationPolicyRequest', ['authorizationPolicy', 'name']); + request.authorizationPolicy.name = defaultValue1; + const expectedHeaderRequestParams = `authorization_policy.name=${defaultValue1 ?? '' }`; const expectedError = new Error('expected'); - client.innerApiCalls.updateServerTlsPolicy = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.updateServerTlsPolicy(request); + client.innerApiCalls.updateAuthorizationPolicy = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.updateAuthorizationPolicy(request); await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.updateServerTlsPolicy as SinonStub) + const actualRequest = (client.innerApiCalls.updateAuthorizationPolicy as SinonStub) .getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateServerTlsPolicy as SinonStub) + const actualHeaderRequestParams = (client.innerApiCalls.updateAuthorizationPolicy as SinonStub) .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes checkUpdateServerTlsPolicyProgress without error', async () => { + it('invokes checkUpdateAuthorizationPolicyProgress without error', async () => { const client = new networksecurityModule.v1.NetworkSecurityClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', @@ -1356,13 +1538,13 @@ describe('v1.NetworkSecurityClient', () => { expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkUpdateServerTlsPolicyProgress(expectedResponse.name); + const decodedOperation = await client.checkUpdateAuthorizationPolicyProgress(expectedResponse.name); assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); assert(decodedOperation.metadata); assert((client.operationsClient.getOperation as SinonStub).getCall(0)); }); - it('invokes checkUpdateServerTlsPolicyProgress with error', async () => { + it('invokes checkUpdateAuthorizationPolicyProgress with error', async () => { const client = new networksecurityModule.v1.NetworkSecurityClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', @@ -1371,60 +1553,60 @@ describe('v1.NetworkSecurityClient', () => { const expectedError = new Error('expected'); client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.checkUpdateServerTlsPolicyProgress(''), expectedError); + await assert.rejects(client.checkUpdateAuthorizationPolicyProgress(''), expectedError); assert((client.operationsClient.getOperation as SinonStub) .getCall(0)); }); }); - describe('deleteServerTlsPolicy', () => { - it('invokes deleteServerTlsPolicy without error', async () => { + describe('deleteAuthorizationPolicy', () => { + it('invokes deleteAuthorizationPolicy without error', async () => { const client = new networksecurityModule.v1.NetworkSecurityClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); await client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.networksecurity.v1.DeleteServerTlsPolicyRequest() + new protos.google.cloud.networksecurity.v1.DeleteAuthorizationPolicyRequest() ); const defaultValue1 = - getTypeDefaultValue('.google.cloud.networksecurity.v1.DeleteServerTlsPolicyRequest', ['name']); + getTypeDefaultValue('.google.cloud.networksecurity.v1.DeleteAuthorizationPolicyRequest', ['name']); request.name = defaultValue1; const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); - client.innerApiCalls.deleteServerTlsPolicy = stubLongRunningCall(expectedResponse); - const [operation] = await client.deleteServerTlsPolicy(request); + client.innerApiCalls.deleteAuthorizationPolicy = stubLongRunningCall(expectedResponse); + const [operation] = await client.deleteAuthorizationPolicy(request); const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.deleteServerTlsPolicy as SinonStub) + const actualRequest = (client.innerApiCalls.deleteAuthorizationPolicy as SinonStub) .getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteServerTlsPolicy as SinonStub) + const actualHeaderRequestParams = (client.innerApiCalls.deleteAuthorizationPolicy as SinonStub) .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes deleteServerTlsPolicy without error using callback', async () => { + it('invokes deleteAuthorizationPolicy without error using callback', async () => { const client = new networksecurityModule.v1.NetworkSecurityClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); await client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.networksecurity.v1.DeleteServerTlsPolicyRequest() + new protos.google.cloud.networksecurity.v1.DeleteAuthorizationPolicyRequest() ); const defaultValue1 = - getTypeDefaultValue('.google.cloud.networksecurity.v1.DeleteServerTlsPolicyRequest', ['name']); + getTypeDefaultValue('.google.cloud.networksecurity.v1.DeleteAuthorizationPolicyRequest', ['name']); request.name = defaultValue1; const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); - client.innerApiCalls.deleteServerTlsPolicy = stubLongRunningCallWithCallback(expectedResponse); + client.innerApiCalls.deleteAuthorizationPolicy = stubLongRunningCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { - client.deleteServerTlsPolicy( + client.deleteAuthorizationPolicy( request, (err?: Error|null, result?: LROperation|null @@ -1439,64 +1621,64 @@ describe('v1.NetworkSecurityClient', () => { const operation = await promise as LROperation; const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.deleteServerTlsPolicy as SinonStub) + const actualRequest = (client.innerApiCalls.deleteAuthorizationPolicy as SinonStub) .getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteServerTlsPolicy as SinonStub) + const actualHeaderRequestParams = (client.innerApiCalls.deleteAuthorizationPolicy as SinonStub) .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes deleteServerTlsPolicy with call error', async () => { + it('invokes deleteAuthorizationPolicy with call error', async () => { const client = new networksecurityModule.v1.NetworkSecurityClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); await client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.networksecurity.v1.DeleteServerTlsPolicyRequest() + new protos.google.cloud.networksecurity.v1.DeleteAuthorizationPolicyRequest() ); const defaultValue1 = - getTypeDefaultValue('.google.cloud.networksecurity.v1.DeleteServerTlsPolicyRequest', ['name']); + getTypeDefaultValue('.google.cloud.networksecurity.v1.DeleteAuthorizationPolicyRequest', ['name']); request.name = defaultValue1; const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; const expectedError = new Error('expected'); - client.innerApiCalls.deleteServerTlsPolicy = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.deleteServerTlsPolicy(request), expectedError); - const actualRequest = (client.innerApiCalls.deleteServerTlsPolicy as SinonStub) + client.innerApiCalls.deleteAuthorizationPolicy = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.deleteAuthorizationPolicy(request), expectedError); + const actualRequest = (client.innerApiCalls.deleteAuthorizationPolicy as SinonStub) .getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteServerTlsPolicy as SinonStub) + const actualHeaderRequestParams = (client.innerApiCalls.deleteAuthorizationPolicy as SinonStub) .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes deleteServerTlsPolicy with LRO error', async () => { + it('invokes deleteAuthorizationPolicy with LRO error', async () => { const client = new networksecurityModule.v1.NetworkSecurityClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); await client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.networksecurity.v1.DeleteServerTlsPolicyRequest() + new protos.google.cloud.networksecurity.v1.DeleteAuthorizationPolicyRequest() ); const defaultValue1 = - getTypeDefaultValue('.google.cloud.networksecurity.v1.DeleteServerTlsPolicyRequest', ['name']); + getTypeDefaultValue('.google.cloud.networksecurity.v1.DeleteAuthorizationPolicyRequest', ['name']); request.name = defaultValue1; const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; const expectedError = new Error('expected'); - client.innerApiCalls.deleteServerTlsPolicy = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.deleteServerTlsPolicy(request); + client.innerApiCalls.deleteAuthorizationPolicy = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.deleteAuthorizationPolicy(request); await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.deleteServerTlsPolicy as SinonStub) + const actualRequest = (client.innerApiCalls.deleteAuthorizationPolicy as SinonStub) .getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteServerTlsPolicy as SinonStub) + const actualHeaderRequestParams = (client.innerApiCalls.deleteAuthorizationPolicy as SinonStub) .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes checkDeleteServerTlsPolicyProgress without error', async () => { + it('invokes checkDeleteAuthorizationPolicyProgress without error', async () => { const client = new networksecurityModule.v1.NetworkSecurityClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', @@ -1510,13 +1692,13 @@ describe('v1.NetworkSecurityClient', () => { expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkDeleteServerTlsPolicyProgress(expectedResponse.name); + const decodedOperation = await client.checkDeleteAuthorizationPolicyProgress(expectedResponse.name); assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); assert(decodedOperation.metadata); assert((client.operationsClient.getOperation as SinonStub).getCall(0)); }); - it('invokes checkDeleteServerTlsPolicyProgress with error', async () => { + it('invokes checkDeleteAuthorizationPolicyProgress with error', async () => { const client = new networksecurityModule.v1.NetworkSecurityClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', @@ -1525,63 +1707,63 @@ describe('v1.NetworkSecurityClient', () => { const expectedError = new Error('expected'); client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.checkDeleteServerTlsPolicyProgress(''), expectedError); + await assert.rejects(client.checkDeleteAuthorizationPolicyProgress(''), expectedError); assert((client.operationsClient.getOperation as SinonStub) .getCall(0)); }); }); - describe('createClientTlsPolicy', () => { - it('invokes createClientTlsPolicy without error', async () => { + describe('createBackendAuthenticationConfig', () => { + it('invokes createBackendAuthenticationConfig without error', async () => { const client = new networksecurityModule.v1.NetworkSecurityClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); await client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.networksecurity.v1.CreateClientTlsPolicyRequest() + new protos.google.cloud.networksecurity.v1.CreateBackendAuthenticationConfigRequest() ); const defaultValue1 = - getTypeDefaultValue('.google.cloud.networksecurity.v1.CreateClientTlsPolicyRequest', ['parent']); + getTypeDefaultValue('.google.cloud.networksecurity.v1.CreateBackendAuthenticationConfigRequest', ['parent']); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); - client.innerApiCalls.createClientTlsPolicy = stubLongRunningCall(expectedResponse); - const [operation] = await client.createClientTlsPolicy(request); + client.innerApiCalls.createBackendAuthenticationConfig = stubLongRunningCall(expectedResponse); + const [operation] = await client.createBackendAuthenticationConfig(request); const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.createClientTlsPolicy as SinonStub) + const actualRequest = (client.innerApiCalls.createBackendAuthenticationConfig as SinonStub) .getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createClientTlsPolicy as SinonStub) + const actualHeaderRequestParams = (client.innerApiCalls.createBackendAuthenticationConfig as SinonStub) .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes createClientTlsPolicy without error using callback', async () => { + it('invokes createBackendAuthenticationConfig without error using callback', async () => { const client = new networksecurityModule.v1.NetworkSecurityClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); await client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.networksecurity.v1.CreateClientTlsPolicyRequest() + new protos.google.cloud.networksecurity.v1.CreateBackendAuthenticationConfigRequest() ); const defaultValue1 = - getTypeDefaultValue('.google.cloud.networksecurity.v1.CreateClientTlsPolicyRequest', ['parent']); + getTypeDefaultValue('.google.cloud.networksecurity.v1.CreateBackendAuthenticationConfigRequest', ['parent']); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); - client.innerApiCalls.createClientTlsPolicy = stubLongRunningCallWithCallback(expectedResponse); + client.innerApiCalls.createBackendAuthenticationConfig = stubLongRunningCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { - client.createClientTlsPolicy( + client.createBackendAuthenticationConfig( request, (err?: Error|null, - result?: LROperation|null + result?: LROperation|null ) => { if (err) { reject(err); @@ -1590,67 +1772,67 @@ describe('v1.NetworkSecurityClient', () => { } }); }); - const operation = await promise as LROperation; + const operation = await promise as LROperation; const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.createClientTlsPolicy as SinonStub) + const actualRequest = (client.innerApiCalls.createBackendAuthenticationConfig as SinonStub) .getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createClientTlsPolicy as SinonStub) + const actualHeaderRequestParams = (client.innerApiCalls.createBackendAuthenticationConfig as SinonStub) .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes createClientTlsPolicy with call error', async () => { + it('invokes createBackendAuthenticationConfig with call error', async () => { const client = new networksecurityModule.v1.NetworkSecurityClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); await client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.networksecurity.v1.CreateClientTlsPolicyRequest() + new protos.google.cloud.networksecurity.v1.CreateBackendAuthenticationConfigRequest() ); const defaultValue1 = - getTypeDefaultValue('.google.cloud.networksecurity.v1.CreateClientTlsPolicyRequest', ['parent']); + getTypeDefaultValue('.google.cloud.networksecurity.v1.CreateBackendAuthenticationConfigRequest', ['parent']); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; const expectedError = new Error('expected'); - client.innerApiCalls.createClientTlsPolicy = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.createClientTlsPolicy(request), expectedError); - const actualRequest = (client.innerApiCalls.createClientTlsPolicy as SinonStub) + client.innerApiCalls.createBackendAuthenticationConfig = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.createBackendAuthenticationConfig(request), expectedError); + const actualRequest = (client.innerApiCalls.createBackendAuthenticationConfig as SinonStub) .getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createClientTlsPolicy as SinonStub) + const actualHeaderRequestParams = (client.innerApiCalls.createBackendAuthenticationConfig as SinonStub) .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes createClientTlsPolicy with LRO error', async () => { + it('invokes createBackendAuthenticationConfig with LRO error', async () => { const client = new networksecurityModule.v1.NetworkSecurityClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); await client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.networksecurity.v1.CreateClientTlsPolicyRequest() + new protos.google.cloud.networksecurity.v1.CreateBackendAuthenticationConfigRequest() ); const defaultValue1 = - getTypeDefaultValue('.google.cloud.networksecurity.v1.CreateClientTlsPolicyRequest', ['parent']); + getTypeDefaultValue('.google.cloud.networksecurity.v1.CreateBackendAuthenticationConfigRequest', ['parent']); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; const expectedError = new Error('expected'); - client.innerApiCalls.createClientTlsPolicy = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.createClientTlsPolicy(request); + client.innerApiCalls.createBackendAuthenticationConfig = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.createBackendAuthenticationConfig(request); await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.createClientTlsPolicy as SinonStub) + const actualRequest = (client.innerApiCalls.createBackendAuthenticationConfig as SinonStub) .getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createClientTlsPolicy as SinonStub) + const actualHeaderRequestParams = (client.innerApiCalls.createBackendAuthenticationConfig as SinonStub) .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes checkCreateClientTlsPolicyProgress without error', async () => { + it('invokes checkCreateBackendAuthenticationConfigProgress without error', async () => { const client = new networksecurityModule.v1.NetworkSecurityClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', @@ -1664,13 +1846,13 @@ describe('v1.NetworkSecurityClient', () => { expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkCreateClientTlsPolicyProgress(expectedResponse.name); + const decodedOperation = await client.checkCreateBackendAuthenticationConfigProgress(expectedResponse.name); assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); assert(decodedOperation.metadata); assert((client.operationsClient.getOperation as SinonStub).getCall(0)); }); - it('invokes checkCreateClientTlsPolicyProgress with error', async () => { + it('invokes checkCreateBackendAuthenticationConfigProgress with error', async () => { const client = new networksecurityModule.v1.NetworkSecurityClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', @@ -1679,65 +1861,65 @@ describe('v1.NetworkSecurityClient', () => { const expectedError = new Error('expected'); client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.checkCreateClientTlsPolicyProgress(''), expectedError); + await assert.rejects(client.checkCreateBackendAuthenticationConfigProgress(''), expectedError); assert((client.operationsClient.getOperation as SinonStub) .getCall(0)); }); }); - describe('updateClientTlsPolicy', () => { - it('invokes updateClientTlsPolicy without error', async () => { + describe('updateBackendAuthenticationConfig', () => { + it('invokes updateBackendAuthenticationConfig without error', async () => { const client = new networksecurityModule.v1.NetworkSecurityClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); await client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.networksecurity.v1.UpdateClientTlsPolicyRequest() + new protos.google.cloud.networksecurity.v1.UpdateBackendAuthenticationConfigRequest() ); - request.clientTlsPolicy ??= {}; + request.backendAuthenticationConfig ??= {}; const defaultValue1 = - getTypeDefaultValue('.google.cloud.networksecurity.v1.UpdateClientTlsPolicyRequest', ['clientTlsPolicy', 'name']); - request.clientTlsPolicy.name = defaultValue1; - const expectedHeaderRequestParams = `client_tls_policy.name=${defaultValue1 ?? '' }`; + getTypeDefaultValue('.google.cloud.networksecurity.v1.UpdateBackendAuthenticationConfigRequest', ['backendAuthenticationConfig', 'name']); + request.backendAuthenticationConfig.name = defaultValue1; + const expectedHeaderRequestParams = `backend_authentication_config.name=${defaultValue1 ?? '' }`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); - client.innerApiCalls.updateClientTlsPolicy = stubLongRunningCall(expectedResponse); - const [operation] = await client.updateClientTlsPolicy(request); + client.innerApiCalls.updateBackendAuthenticationConfig = stubLongRunningCall(expectedResponse); + const [operation] = await client.updateBackendAuthenticationConfig(request); const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.updateClientTlsPolicy as SinonStub) + const actualRequest = (client.innerApiCalls.updateBackendAuthenticationConfig as SinonStub) .getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateClientTlsPolicy as SinonStub) + const actualHeaderRequestParams = (client.innerApiCalls.updateBackendAuthenticationConfig as SinonStub) .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes updateClientTlsPolicy without error using callback', async () => { + it('invokes updateBackendAuthenticationConfig without error using callback', async () => { const client = new networksecurityModule.v1.NetworkSecurityClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); await client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.networksecurity.v1.UpdateClientTlsPolicyRequest() + new protos.google.cloud.networksecurity.v1.UpdateBackendAuthenticationConfigRequest() ); - request.clientTlsPolicy ??= {}; + request.backendAuthenticationConfig ??= {}; const defaultValue1 = - getTypeDefaultValue('.google.cloud.networksecurity.v1.UpdateClientTlsPolicyRequest', ['clientTlsPolicy', 'name']); - request.clientTlsPolicy.name = defaultValue1; - const expectedHeaderRequestParams = `client_tls_policy.name=${defaultValue1 ?? '' }`; + getTypeDefaultValue('.google.cloud.networksecurity.v1.UpdateBackendAuthenticationConfigRequest', ['backendAuthenticationConfig', 'name']); + request.backendAuthenticationConfig.name = defaultValue1; + const expectedHeaderRequestParams = `backend_authentication_config.name=${defaultValue1 ?? '' }`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); - client.innerApiCalls.updateClientTlsPolicy = stubLongRunningCallWithCallback(expectedResponse); + client.innerApiCalls.updateBackendAuthenticationConfig = stubLongRunningCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { - client.updateClientTlsPolicy( + client.updateBackendAuthenticationConfig( request, (err?: Error|null, - result?: LROperation|null + result?: LROperation|null ) => { if (err) { reject(err); @@ -1746,69 +1928,69 @@ describe('v1.NetworkSecurityClient', () => { } }); }); - const operation = await promise as LROperation; + const operation = await promise as LROperation; const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.updateClientTlsPolicy as SinonStub) + const actualRequest = (client.innerApiCalls.updateBackendAuthenticationConfig as SinonStub) .getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateClientTlsPolicy as SinonStub) + const actualHeaderRequestParams = (client.innerApiCalls.updateBackendAuthenticationConfig as SinonStub) .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes updateClientTlsPolicy with call error', async () => { + it('invokes updateBackendAuthenticationConfig with call error', async () => { const client = new networksecurityModule.v1.NetworkSecurityClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); await client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.networksecurity.v1.UpdateClientTlsPolicyRequest() + new protos.google.cloud.networksecurity.v1.UpdateBackendAuthenticationConfigRequest() ); - request.clientTlsPolicy ??= {}; + request.backendAuthenticationConfig ??= {}; const defaultValue1 = - getTypeDefaultValue('.google.cloud.networksecurity.v1.UpdateClientTlsPolicyRequest', ['clientTlsPolicy', 'name']); - request.clientTlsPolicy.name = defaultValue1; - const expectedHeaderRequestParams = `client_tls_policy.name=${defaultValue1 ?? '' }`; + getTypeDefaultValue('.google.cloud.networksecurity.v1.UpdateBackendAuthenticationConfigRequest', ['backendAuthenticationConfig', 'name']); + request.backendAuthenticationConfig.name = defaultValue1; + const expectedHeaderRequestParams = `backend_authentication_config.name=${defaultValue1 ?? '' }`; const expectedError = new Error('expected'); - client.innerApiCalls.updateClientTlsPolicy = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.updateClientTlsPolicy(request), expectedError); - const actualRequest = (client.innerApiCalls.updateClientTlsPolicy as SinonStub) + client.innerApiCalls.updateBackendAuthenticationConfig = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.updateBackendAuthenticationConfig(request), expectedError); + const actualRequest = (client.innerApiCalls.updateBackendAuthenticationConfig as SinonStub) .getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateClientTlsPolicy as SinonStub) + const actualHeaderRequestParams = (client.innerApiCalls.updateBackendAuthenticationConfig as SinonStub) .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes updateClientTlsPolicy with LRO error', async () => { + it('invokes updateBackendAuthenticationConfig with LRO error', async () => { const client = new networksecurityModule.v1.NetworkSecurityClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); await client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.networksecurity.v1.UpdateClientTlsPolicyRequest() + new protos.google.cloud.networksecurity.v1.UpdateBackendAuthenticationConfigRequest() ); - request.clientTlsPolicy ??= {}; + request.backendAuthenticationConfig ??= {}; const defaultValue1 = - getTypeDefaultValue('.google.cloud.networksecurity.v1.UpdateClientTlsPolicyRequest', ['clientTlsPolicy', 'name']); - request.clientTlsPolicy.name = defaultValue1; - const expectedHeaderRequestParams = `client_tls_policy.name=${defaultValue1 ?? '' }`; + getTypeDefaultValue('.google.cloud.networksecurity.v1.UpdateBackendAuthenticationConfigRequest', ['backendAuthenticationConfig', 'name']); + request.backendAuthenticationConfig.name = defaultValue1; + const expectedHeaderRequestParams = `backend_authentication_config.name=${defaultValue1 ?? '' }`; const expectedError = new Error('expected'); - client.innerApiCalls.updateClientTlsPolicy = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.updateClientTlsPolicy(request); + client.innerApiCalls.updateBackendAuthenticationConfig = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.updateBackendAuthenticationConfig(request); await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.updateClientTlsPolicy as SinonStub) + const actualRequest = (client.innerApiCalls.updateBackendAuthenticationConfig as SinonStub) .getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateClientTlsPolicy as SinonStub) + const actualHeaderRequestParams = (client.innerApiCalls.updateBackendAuthenticationConfig as SinonStub) .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes checkUpdateClientTlsPolicyProgress without error', async () => { + it('invokes checkUpdateBackendAuthenticationConfigProgress without error', async () => { const client = new networksecurityModule.v1.NetworkSecurityClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', @@ -1822,13 +2004,13 @@ describe('v1.NetworkSecurityClient', () => { expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkUpdateClientTlsPolicyProgress(expectedResponse.name); + const decodedOperation = await client.checkUpdateBackendAuthenticationConfigProgress(expectedResponse.name); assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); assert(decodedOperation.metadata); assert((client.operationsClient.getOperation as SinonStub).getCall(0)); }); - it('invokes checkUpdateClientTlsPolicyProgress with error', async () => { + it('invokes checkUpdateBackendAuthenticationConfigProgress with error', async () => { const client = new networksecurityModule.v1.NetworkSecurityClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', @@ -1837,60 +2019,60 @@ describe('v1.NetworkSecurityClient', () => { const expectedError = new Error('expected'); client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.checkUpdateClientTlsPolicyProgress(''), expectedError); + await assert.rejects(client.checkUpdateBackendAuthenticationConfigProgress(''), expectedError); assert((client.operationsClient.getOperation as SinonStub) .getCall(0)); }); }); - describe('deleteClientTlsPolicy', () => { - it('invokes deleteClientTlsPolicy without error', async () => { + describe('deleteBackendAuthenticationConfig', () => { + it('invokes deleteBackendAuthenticationConfig without error', async () => { const client = new networksecurityModule.v1.NetworkSecurityClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); await client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.networksecurity.v1.DeleteClientTlsPolicyRequest() + new protos.google.cloud.networksecurity.v1.DeleteBackendAuthenticationConfigRequest() ); const defaultValue1 = - getTypeDefaultValue('.google.cloud.networksecurity.v1.DeleteClientTlsPolicyRequest', ['name']); + getTypeDefaultValue('.google.cloud.networksecurity.v1.DeleteBackendAuthenticationConfigRequest', ['name']); request.name = defaultValue1; const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); - client.innerApiCalls.deleteClientTlsPolicy = stubLongRunningCall(expectedResponse); - const [operation] = await client.deleteClientTlsPolicy(request); + client.innerApiCalls.deleteBackendAuthenticationConfig = stubLongRunningCall(expectedResponse); + const [operation] = await client.deleteBackendAuthenticationConfig(request); const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.deleteClientTlsPolicy as SinonStub) + const actualRequest = (client.innerApiCalls.deleteBackendAuthenticationConfig as SinonStub) .getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteClientTlsPolicy as SinonStub) + const actualHeaderRequestParams = (client.innerApiCalls.deleteBackendAuthenticationConfig as SinonStub) .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes deleteClientTlsPolicy without error using callback', async () => { + it('invokes deleteBackendAuthenticationConfig without error using callback', async () => { const client = new networksecurityModule.v1.NetworkSecurityClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); await client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.networksecurity.v1.DeleteClientTlsPolicyRequest() + new protos.google.cloud.networksecurity.v1.DeleteBackendAuthenticationConfigRequest() ); const defaultValue1 = - getTypeDefaultValue('.google.cloud.networksecurity.v1.DeleteClientTlsPolicyRequest', ['name']); + getTypeDefaultValue('.google.cloud.networksecurity.v1.DeleteBackendAuthenticationConfigRequest', ['name']); request.name = defaultValue1; const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); - client.innerApiCalls.deleteClientTlsPolicy = stubLongRunningCallWithCallback(expectedResponse); + client.innerApiCalls.deleteBackendAuthenticationConfig = stubLongRunningCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { - client.deleteClientTlsPolicy( + client.deleteBackendAuthenticationConfig( request, (err?: Error|null, result?: LROperation|null @@ -1905,64 +2087,64 @@ describe('v1.NetworkSecurityClient', () => { const operation = await promise as LROperation; const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.deleteClientTlsPolicy as SinonStub) + const actualRequest = (client.innerApiCalls.deleteBackendAuthenticationConfig as SinonStub) .getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteClientTlsPolicy as SinonStub) + const actualHeaderRequestParams = (client.innerApiCalls.deleteBackendAuthenticationConfig as SinonStub) .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes deleteClientTlsPolicy with call error', async () => { + it('invokes deleteBackendAuthenticationConfig with call error', async () => { const client = new networksecurityModule.v1.NetworkSecurityClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); await client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.networksecurity.v1.DeleteClientTlsPolicyRequest() + new protos.google.cloud.networksecurity.v1.DeleteBackendAuthenticationConfigRequest() ); const defaultValue1 = - getTypeDefaultValue('.google.cloud.networksecurity.v1.DeleteClientTlsPolicyRequest', ['name']); + getTypeDefaultValue('.google.cloud.networksecurity.v1.DeleteBackendAuthenticationConfigRequest', ['name']); request.name = defaultValue1; const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; const expectedError = new Error('expected'); - client.innerApiCalls.deleteClientTlsPolicy = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.deleteClientTlsPolicy(request), expectedError); - const actualRequest = (client.innerApiCalls.deleteClientTlsPolicy as SinonStub) + client.innerApiCalls.deleteBackendAuthenticationConfig = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.deleteBackendAuthenticationConfig(request), expectedError); + const actualRequest = (client.innerApiCalls.deleteBackendAuthenticationConfig as SinonStub) .getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteClientTlsPolicy as SinonStub) + const actualHeaderRequestParams = (client.innerApiCalls.deleteBackendAuthenticationConfig as SinonStub) .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes deleteClientTlsPolicy with LRO error', async () => { + it('invokes deleteBackendAuthenticationConfig with LRO error', async () => { const client = new networksecurityModule.v1.NetworkSecurityClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); await client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.networksecurity.v1.DeleteClientTlsPolicyRequest() + new protos.google.cloud.networksecurity.v1.DeleteBackendAuthenticationConfigRequest() ); const defaultValue1 = - getTypeDefaultValue('.google.cloud.networksecurity.v1.DeleteClientTlsPolicyRequest', ['name']); + getTypeDefaultValue('.google.cloud.networksecurity.v1.DeleteBackendAuthenticationConfigRequest', ['name']); request.name = defaultValue1; const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; const expectedError = new Error('expected'); - client.innerApiCalls.deleteClientTlsPolicy = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.deleteClientTlsPolicy(request); + client.innerApiCalls.deleteBackendAuthenticationConfig = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.deleteBackendAuthenticationConfig(request); await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.deleteClientTlsPolicy as SinonStub) + const actualRequest = (client.innerApiCalls.deleteBackendAuthenticationConfig as SinonStub) .getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteClientTlsPolicy as SinonStub) + const actualHeaderRequestParams = (client.innerApiCalls.deleteBackendAuthenticationConfig as SinonStub) .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes checkDeleteClientTlsPolicyProgress without error', async () => { + it('invokes checkDeleteBackendAuthenticationConfigProgress without error', async () => { const client = new networksecurityModule.v1.NetworkSecurityClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', @@ -1976,13 +2158,13 @@ describe('v1.NetworkSecurityClient', () => { expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkDeleteClientTlsPolicyProgress(expectedResponse.name); + const decodedOperation = await client.checkDeleteBackendAuthenticationConfigProgress(expectedResponse.name); assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); assert(decodedOperation.metadata); assert((client.operationsClient.getOperation as SinonStub).getCall(0)); }); - it('invokes checkDeleteClientTlsPolicyProgress with error', async () => { + it('invokes checkDeleteBackendAuthenticationConfigProgress with error', async () => { const client = new networksecurityModule.v1.NetworkSecurityClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', @@ -1991,63 +2173,64 @@ describe('v1.NetworkSecurityClient', () => { const expectedError = new Error('expected'); client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.checkDeleteClientTlsPolicyProgress(''), expectedError); + await assert.rejects(client.checkDeleteBackendAuthenticationConfigProgress(''), expectedError); assert((client.operationsClient.getOperation as SinonStub) .getCall(0)); }); }); - describe('listAuthorizationPolicies', () => { - it('invokes listAuthorizationPolicies without error', async () => { + describe('createServerTlsPolicy', () => { + it('invokes createServerTlsPolicy without error', async () => { const client = new networksecurityModule.v1.NetworkSecurityClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', }); await client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.networksecurity.v1.ListAuthorizationPoliciesRequest() + new protos.google.cloud.networksecurity.v1.CreateServerTlsPolicyRequest() ); const defaultValue1 = - getTypeDefaultValue('.google.cloud.networksecurity.v1.ListAuthorizationPoliciesRequest', ['parent']); + getTypeDefaultValue('.google.cloud.networksecurity.v1.CreateServerTlsPolicyRequest', ['parent']); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.networksecurity.v1.AuthorizationPolicy()), - generateSampleMessage(new protos.google.cloud.networksecurity.v1.AuthorizationPolicy()), - generateSampleMessage(new protos.google.cloud.networksecurity.v1.AuthorizationPolicy()), - ]; - client.innerApiCalls.listAuthorizationPolicies = stubSimpleCall(expectedResponse); - const [response] = await client.listAuthorizationPolicies(request); + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createServerTlsPolicy = stubLongRunningCall(expectedResponse); + const [operation] = await client.createServerTlsPolicy(request); + const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listAuthorizationPolicies as SinonStub) + const actualRequest = (client.innerApiCalls.createServerTlsPolicy as SinonStub) .getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listAuthorizationPolicies as SinonStub) + const actualHeaderRequestParams = (client.innerApiCalls.createServerTlsPolicy as SinonStub) .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes listAuthorizationPolicies without error using callback', async () => { + it('invokes createServerTlsPolicy without error using callback', async () => { const client = new networksecurityModule.v1.NetworkSecurityClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', }); await client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.networksecurity.v1.ListAuthorizationPoliciesRequest() + new protos.google.cloud.networksecurity.v1.CreateServerTlsPolicyRequest() ); const defaultValue1 = - getTypeDefaultValue('.google.cloud.networksecurity.v1.ListAuthorizationPoliciesRequest', ['parent']); + getTypeDefaultValue('.google.cloud.networksecurity.v1.CreateServerTlsPolicyRequest', ['parent']); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.networksecurity.v1.AuthorizationPolicy()), - generateSampleMessage(new protos.google.cloud.networksecurity.v1.AuthorizationPolicy()), - generateSampleMessage(new protos.google.cloud.networksecurity.v1.AuthorizationPolicy()), - ]; - client.innerApiCalls.listAuthorizationPolicies = stubSimpleCallWithCallback(expectedResponse); + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createServerTlsPolicy = stubLongRunningCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { - client.listAuthorizationPolicies( + client.createServerTlsPolicy( request, - (err?: Error|null, result?: protos.google.cloud.networksecurity.v1.IAuthorizationPolicy[]|null) => { + (err?: Error|null, + result?: LROperation|null + ) => { if (err) { reject(err); } else { @@ -2055,244 +2238,311 @@ describe('v1.NetworkSecurityClient', () => { } }); }); - const response = await promise; + const operation = await promise as LROperation; + const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listAuthorizationPolicies as SinonStub) + const actualRequest = (client.innerApiCalls.createServerTlsPolicy as SinonStub) .getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listAuthorizationPolicies as SinonStub) + const actualHeaderRequestParams = (client.innerApiCalls.createServerTlsPolicy as SinonStub) .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes listAuthorizationPolicies with error', async () => { + it('invokes createServerTlsPolicy with call error', async () => { const client = new networksecurityModule.v1.NetworkSecurityClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', }); await client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.networksecurity.v1.ListAuthorizationPoliciesRequest() + new protos.google.cloud.networksecurity.v1.CreateServerTlsPolicyRequest() ); const defaultValue1 = - getTypeDefaultValue('.google.cloud.networksecurity.v1.ListAuthorizationPoliciesRequest', ['parent']); + getTypeDefaultValue('.google.cloud.networksecurity.v1.CreateServerTlsPolicyRequest', ['parent']); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; const expectedError = new Error('expected'); - client.innerApiCalls.listAuthorizationPolicies = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listAuthorizationPolicies(request), expectedError); - const actualRequest = (client.innerApiCalls.listAuthorizationPolicies as SinonStub) + client.innerApiCalls.createServerTlsPolicy = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.createServerTlsPolicy(request), expectedError); + const actualRequest = (client.innerApiCalls.createServerTlsPolicy as SinonStub) .getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listAuthorizationPolicies as SinonStub) + const actualHeaderRequestParams = (client.innerApiCalls.createServerTlsPolicy as SinonStub) .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes listAuthorizationPoliciesStream without error', async () => { + it('invokes createServerTlsPolicy with LRO error', async () => { const client = new networksecurityModule.v1.NetworkSecurityClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', }); await client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.networksecurity.v1.ListAuthorizationPoliciesRequest() + new protos.google.cloud.networksecurity.v1.CreateServerTlsPolicyRequest() ); const defaultValue1 = - getTypeDefaultValue('.google.cloud.networksecurity.v1.ListAuthorizationPoliciesRequest', ['parent']); + getTypeDefaultValue('.google.cloud.networksecurity.v1.CreateServerTlsPolicyRequest', ['parent']); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.networksecurity.v1.AuthorizationPolicy()), - generateSampleMessage(new protos.google.cloud.networksecurity.v1.AuthorizationPolicy()), - generateSampleMessage(new protos.google.cloud.networksecurity.v1.AuthorizationPolicy()), - ]; - client.descriptors.page.listAuthorizationPolicies.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listAuthorizationPoliciesStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.networksecurity.v1.AuthorizationPolicy[] = []; - stream.on('data', (response: protos.google.cloud.networksecurity.v1.AuthorizationPolicy) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); + const expectedError = new Error('expected'); + client.innerApiCalls.createServerTlsPolicy = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.createServerTlsPolicy(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.createServerTlsPolicy as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createServerTlsPolicy as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkCreateServerTlsPolicyProgress without error', async () => { + const client = new networksecurityModule.v1.NetworkSecurityClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', }); - const responses = await promise; - assert.deepStrictEqual(responses, expectedResponse); - assert((client.descriptors.page.listAuthorizationPolicies.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listAuthorizationPolicies, request)); - assert( - (client.descriptors.page.listAuthorizationPolicies.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) + await client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkCreateServerTlsPolicyProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); }); - it('invokes listAuthorizationPoliciesStream with error', async () => { + it('invokes checkCreateServerTlsPolicyProgress with error', async () => { const client = new networksecurityModule.v1.NetworkSecurityClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', }); await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.networksecurity.v1.ListAuthorizationPoliciesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.networksecurity.v1.ListAuthorizationPoliciesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; const expectedError = new Error('expected'); - client.descriptors.page.listAuthorizationPolicies.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.listAuthorizationPoliciesStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.networksecurity.v1.AuthorizationPolicy[] = []; - stream.on('data', (response: protos.google.cloud.networksecurity.v1.AuthorizationPolicy) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.listAuthorizationPolicies.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listAuthorizationPolicies, request)); - assert( - (client.descriptors.page.listAuthorizationPolicies.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkCreateServerTlsPolicyProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); }); + }); - it('uses async iteration with listAuthorizationPolicies without error', async () => { + describe('updateServerTlsPolicy', () => { + it('invokes updateServerTlsPolicy without error', async () => { const client = new networksecurityModule.v1.NetworkSecurityClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); await client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.networksecurity.v1.ListAuthorizationPoliciesRequest() + new protos.google.cloud.networksecurity.v1.UpdateServerTlsPolicyRequest() ); + request.serverTlsPolicy ??= {}; const defaultValue1 = - getTypeDefaultValue('.google.cloud.networksecurity.v1.ListAuthorizationPoliciesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.networksecurity.v1.AuthorizationPolicy()), - generateSampleMessage(new protos.google.cloud.networksecurity.v1.AuthorizationPolicy()), - generateSampleMessage(new protos.google.cloud.networksecurity.v1.AuthorizationPolicy()), - ]; - client.descriptors.page.listAuthorizationPolicies.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.networksecurity.v1.IAuthorizationPolicy[] = []; - const iterable = client.listAuthorizationPoliciesAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.listAuthorizationPolicies.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listAuthorizationPolicies.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) + getTypeDefaultValue('.google.cloud.networksecurity.v1.UpdateServerTlsPolicyRequest', ['serverTlsPolicy', 'name']); + request.serverTlsPolicy.name = defaultValue1; + const expectedHeaderRequestParams = `server_tls_policy.name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() ); + client.innerApiCalls.updateServerTlsPolicy = stubLongRunningCall(expectedResponse); + const [operation] = await client.updateServerTlsPolicy(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateServerTlsPolicy as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateServerTlsPolicy as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('uses async iteration with listAuthorizationPolicies with error', async () => { + it('invokes updateServerTlsPolicy without error using callback', async () => { const client = new networksecurityModule.v1.NetworkSecurityClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', }); await client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.networksecurity.v1.ListAuthorizationPoliciesRequest() + new protos.google.cloud.networksecurity.v1.UpdateServerTlsPolicyRequest() ); + request.serverTlsPolicy ??= {}; const defaultValue1 = - getTypeDefaultValue('.google.cloud.networksecurity.v1.ListAuthorizationPoliciesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.descriptors.page.listAuthorizationPolicies.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listAuthorizationPoliciesAsync(request); - await assert.rejects(async () => { - const responses: protos.google.cloud.networksecurity.v1.IAuthorizationPolicy[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.listAuthorizationPolicies.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listAuthorizationPolicies.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) + getTypeDefaultValue('.google.cloud.networksecurity.v1.UpdateServerTlsPolicyRequest', ['serverTlsPolicy', 'name']); + request.serverTlsPolicy.name = defaultValue1; + const expectedHeaderRequestParams = `server_tls_policy.name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.updateServerTlsPolicy = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateServerTlsPolicy( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateServerTlsPolicy as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateServerTlsPolicy as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateServerTlsPolicy with call error', async () => { + const client = new networksecurityModule.v1.NetworkSecurityClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.UpdateServerTlsPolicyRequest() + ); + request.serverTlsPolicy ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.UpdateServerTlsPolicyRequest', ['serverTlsPolicy', 'name']); + request.serverTlsPolicy.name = defaultValue1; + const expectedHeaderRequestParams = `server_tls_policy.name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateServerTlsPolicy = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.updateServerTlsPolicy(request), expectedError); + const actualRequest = (client.innerApiCalls.updateServerTlsPolicy as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateServerTlsPolicy as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateServerTlsPolicy with LRO error', async () => { + const client = new networksecurityModule.v1.NetworkSecurityClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.UpdateServerTlsPolicyRequest() + ); + request.serverTlsPolicy ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.UpdateServerTlsPolicyRequest', ['serverTlsPolicy', 'name']); + request.serverTlsPolicy.name = defaultValue1; + const expectedHeaderRequestParams = `server_tls_policy.name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateServerTlsPolicy = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.updateServerTlsPolicy(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.updateServerTlsPolicy as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateServerTlsPolicy as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkUpdateServerTlsPolicyProgress without error', async () => { + const client = new networksecurityModule.v1.NetworkSecurityClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkUpdateServerTlsPolicyProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkUpdateServerTlsPolicyProgress with error', async () => { + const client = new networksecurityModule.v1.NetworkSecurityClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkUpdateServerTlsPolicyProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); }); }); - describe('listServerTlsPolicies', () => { - it('invokes listServerTlsPolicies without error', async () => { + describe('deleteServerTlsPolicy', () => { + it('invokes deleteServerTlsPolicy without error', async () => { const client = new networksecurityModule.v1.NetworkSecurityClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', }); await client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.networksecurity.v1.ListServerTlsPoliciesRequest() + new protos.google.cloud.networksecurity.v1.DeleteServerTlsPolicyRequest() ); const defaultValue1 = - getTypeDefaultValue('.google.cloud.networksecurity.v1.ListServerTlsPoliciesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.networksecurity.v1.ServerTlsPolicy()), - generateSampleMessage(new protos.google.cloud.networksecurity.v1.ServerTlsPolicy()), - generateSampleMessage(new protos.google.cloud.networksecurity.v1.ServerTlsPolicy()), - ]; - client.innerApiCalls.listServerTlsPolicies = stubSimpleCall(expectedResponse); - const [response] = await client.listServerTlsPolicies(request); + getTypeDefaultValue('.google.cloud.networksecurity.v1.DeleteServerTlsPolicyRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteServerTlsPolicy = stubLongRunningCall(expectedResponse); + const [operation] = await client.deleteServerTlsPolicy(request); + const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listServerTlsPolicies as SinonStub) + const actualRequest = (client.innerApiCalls.deleteServerTlsPolicy as SinonStub) .getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listServerTlsPolicies as SinonStub) + const actualHeaderRequestParams = (client.innerApiCalls.deleteServerTlsPolicy as SinonStub) .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes listServerTlsPolicies without error using callback', async () => { + it('invokes deleteServerTlsPolicy without error using callback', async () => { const client = new networksecurityModule.v1.NetworkSecurityClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', }); await client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.networksecurity.v1.ListServerTlsPoliciesRequest() + new protos.google.cloud.networksecurity.v1.DeleteServerTlsPolicyRequest() ); const defaultValue1 = - getTypeDefaultValue('.google.cloud.networksecurity.v1.ListServerTlsPoliciesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.networksecurity.v1.ServerTlsPolicy()), - generateSampleMessage(new protos.google.cloud.networksecurity.v1.ServerTlsPolicy()), - generateSampleMessage(new protos.google.cloud.networksecurity.v1.ServerTlsPolicy()), - ]; - client.innerApiCalls.listServerTlsPolicies = stubSimpleCallWithCallback(expectedResponse); + getTypeDefaultValue('.google.cloud.networksecurity.v1.DeleteServerTlsPolicyRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteServerTlsPolicy = stubLongRunningCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { - client.listServerTlsPolicies( + client.deleteServerTlsPolicy( request, - (err?: Error|null, result?: protos.google.cloud.networksecurity.v1.IServerTlsPolicy[]|null) => { + (err?: Error|null, + result?: LROperation|null + ) => { if (err) { reject(err); } else { @@ -2300,244 +2550,153 @@ describe('v1.NetworkSecurityClient', () => { } }); }); - const response = await promise; + const operation = await promise as LROperation; + const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listServerTlsPolicies as SinonStub) + const actualRequest = (client.innerApiCalls.deleteServerTlsPolicy as SinonStub) .getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listServerTlsPolicies as SinonStub) + const actualHeaderRequestParams = (client.innerApiCalls.deleteServerTlsPolicy as SinonStub) .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes listServerTlsPolicies with error', async () => { + it('invokes deleteServerTlsPolicy with call error', async () => { const client = new networksecurityModule.v1.NetworkSecurityClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', }); await client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.networksecurity.v1.ListServerTlsPoliciesRequest() + new protos.google.cloud.networksecurity.v1.DeleteServerTlsPolicyRequest() ); const defaultValue1 = - getTypeDefaultValue('.google.cloud.networksecurity.v1.ListServerTlsPoliciesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + getTypeDefaultValue('.google.cloud.networksecurity.v1.DeleteServerTlsPolicyRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; const expectedError = new Error('expected'); - client.innerApiCalls.listServerTlsPolicies = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listServerTlsPolicies(request), expectedError); - const actualRequest = (client.innerApiCalls.listServerTlsPolicies as SinonStub) + client.innerApiCalls.deleteServerTlsPolicy = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.deleteServerTlsPolicy(request), expectedError); + const actualRequest = (client.innerApiCalls.deleteServerTlsPolicy as SinonStub) .getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listServerTlsPolicies as SinonStub) + const actualHeaderRequestParams = (client.innerApiCalls.deleteServerTlsPolicy as SinonStub) .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes listServerTlsPoliciesStream without error', async () => { + it('invokes deleteServerTlsPolicy with LRO error', async () => { const client = new networksecurityModule.v1.NetworkSecurityClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', }); await client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.networksecurity.v1.ListServerTlsPoliciesRequest() + new protos.google.cloud.networksecurity.v1.DeleteServerTlsPolicyRequest() ); const defaultValue1 = - getTypeDefaultValue('.google.cloud.networksecurity.v1.ListServerTlsPoliciesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.networksecurity.v1.ServerTlsPolicy()), - generateSampleMessage(new protos.google.cloud.networksecurity.v1.ServerTlsPolicy()), - generateSampleMessage(new protos.google.cloud.networksecurity.v1.ServerTlsPolicy()), - ]; - client.descriptors.page.listServerTlsPolicies.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listServerTlsPoliciesStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.networksecurity.v1.ServerTlsPolicy[] = []; - stream.on('data', (response: protos.google.cloud.networksecurity.v1.ServerTlsPolicy) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - const responses = await promise; - assert.deepStrictEqual(responses, expectedResponse); - assert((client.descriptors.page.listServerTlsPolicies.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listServerTlsPolicies, request)); - assert( - (client.descriptors.page.listServerTlsPolicies.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('invokes listServerTlsPoliciesStream with error', async () => { - const client = new networksecurityModule.v1.NetworkSecurityClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', + getTypeDefaultValue('.google.cloud.networksecurity.v1.DeleteServerTlsPolicyRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteServerTlsPolicy = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.deleteServerTlsPolicy(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.deleteServerTlsPolicy as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteServerTlsPolicy as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkDeleteServerTlsPolicyProgress without error', async () => { + const client = new networksecurityModule.v1.NetworkSecurityClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', }); await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.networksecurity.v1.ListServerTlsPoliciesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.networksecurity.v1.ListServerTlsPoliciesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.descriptors.page.listServerTlsPolicies.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.listServerTlsPoliciesStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.networksecurity.v1.ServerTlsPolicy[] = []; - stream.on('data', (response: protos.google.cloud.networksecurity.v1.ServerTlsPolicy) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.listServerTlsPolicies.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listServerTlsPolicies, request)); - assert( - (client.descriptors.page.listServerTlsPolicies.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkDeleteServerTlsPolicyProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); }); - it('uses async iteration with listServerTlsPolicies without error', async () => { + it('invokes checkDeleteServerTlsPolicyProgress with error', async () => { const client = new networksecurityModule.v1.NetworkSecurityClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.networksecurity.v1.ListServerTlsPoliciesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.networksecurity.v1.ListServerTlsPoliciesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.networksecurity.v1.ServerTlsPolicy()), - generateSampleMessage(new protos.google.cloud.networksecurity.v1.ServerTlsPolicy()), - generateSampleMessage(new protos.google.cloud.networksecurity.v1.ServerTlsPolicy()), - ]; - client.descriptors.page.listServerTlsPolicies.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.networksecurity.v1.IServerTlsPolicy[] = []; - const iterable = client.listServerTlsPoliciesAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.listServerTlsPolicies.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listServerTlsPolicies.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listServerTlsPolicies with error', async () => { - const client = new networksecurityModule.v1.NetworkSecurityClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.networksecurity.v1.ListServerTlsPoliciesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.networksecurity.v1.ListServerTlsPoliciesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; const expectedError = new Error('expected'); - client.descriptors.page.listServerTlsPolicies.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listServerTlsPoliciesAsync(request); - await assert.rejects(async () => { - const responses: protos.google.cloud.networksecurity.v1.IServerTlsPolicy[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.listServerTlsPolicies.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listServerTlsPolicies.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkDeleteServerTlsPolicyProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); }); }); - describe('listClientTlsPolicies', () => { - it('invokes listClientTlsPolicies without error', async () => { + describe('createClientTlsPolicy', () => { + it('invokes createClientTlsPolicy without error', async () => { const client = new networksecurityModule.v1.NetworkSecurityClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', }); await client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.networksecurity.v1.ListClientTlsPoliciesRequest() + new protos.google.cloud.networksecurity.v1.CreateClientTlsPolicyRequest() ); const defaultValue1 = - getTypeDefaultValue('.google.cloud.networksecurity.v1.ListClientTlsPoliciesRequest', ['parent']); + getTypeDefaultValue('.google.cloud.networksecurity.v1.CreateClientTlsPolicyRequest', ['parent']); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.networksecurity.v1.ClientTlsPolicy()), - generateSampleMessage(new protos.google.cloud.networksecurity.v1.ClientTlsPolicy()), - generateSampleMessage(new protos.google.cloud.networksecurity.v1.ClientTlsPolicy()), - ]; - client.innerApiCalls.listClientTlsPolicies = stubSimpleCall(expectedResponse); - const [response] = await client.listClientTlsPolicies(request); + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createClientTlsPolicy = stubLongRunningCall(expectedResponse); + const [operation] = await client.createClientTlsPolicy(request); + const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listClientTlsPolicies as SinonStub) + const actualRequest = (client.innerApiCalls.createClientTlsPolicy as SinonStub) .getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listClientTlsPolicies as SinonStub) + const actualHeaderRequestParams = (client.innerApiCalls.createClientTlsPolicy as SinonStub) .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes listClientTlsPolicies without error using callback', async () => { + it('invokes createClientTlsPolicy without error using callback', async () => { const client = new networksecurityModule.v1.NetworkSecurityClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', }); await client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.networksecurity.v1.ListClientTlsPoliciesRequest() + new protos.google.cloud.networksecurity.v1.CreateClientTlsPolicyRequest() ); const defaultValue1 = - getTypeDefaultValue('.google.cloud.networksecurity.v1.ListClientTlsPoliciesRequest', ['parent']); + getTypeDefaultValue('.google.cloud.networksecurity.v1.CreateClientTlsPolicyRequest', ['parent']); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.networksecurity.v1.ClientTlsPolicy()), - generateSampleMessage(new protos.google.cloud.networksecurity.v1.ClientTlsPolicy()), - generateSampleMessage(new protos.google.cloud.networksecurity.v1.ClientTlsPolicy()), - ]; - client.innerApiCalls.listClientTlsPolicies = stubSimpleCallWithCallback(expectedResponse); + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createClientTlsPolicy = stubLongRunningCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { - client.listClientTlsPolicies( + client.createClientTlsPolicy( request, - (err?: Error|null, result?: protos.google.cloud.networksecurity.v1.IClientTlsPolicy[]|null) => { + (err?: Error|null, + result?: LROperation|null + ) => { if (err) { reject(err); } else { @@ -2545,980 +2704,6387 @@ describe('v1.NetworkSecurityClient', () => { } }); }); - const response = await promise; + const operation = await promise as LROperation; + const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listClientTlsPolicies as SinonStub) + const actualRequest = (client.innerApiCalls.createClientTlsPolicy as SinonStub) .getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listClientTlsPolicies as SinonStub) + const actualHeaderRequestParams = (client.innerApiCalls.createClientTlsPolicy as SinonStub) .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes listClientTlsPolicies with error', async () => { + it('invokes createClientTlsPolicy with call error', async () => { const client = new networksecurityModule.v1.NetworkSecurityClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', }); await client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.networksecurity.v1.ListClientTlsPoliciesRequest() + new protos.google.cloud.networksecurity.v1.CreateClientTlsPolicyRequest() ); const defaultValue1 = - getTypeDefaultValue('.google.cloud.networksecurity.v1.ListClientTlsPoliciesRequest', ['parent']); + getTypeDefaultValue('.google.cloud.networksecurity.v1.CreateClientTlsPolicyRequest', ['parent']); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; const expectedError = new Error('expected'); - client.innerApiCalls.listClientTlsPolicies = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listClientTlsPolicies(request), expectedError); - const actualRequest = (client.innerApiCalls.listClientTlsPolicies as SinonStub) + client.innerApiCalls.createClientTlsPolicy = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.createClientTlsPolicy(request), expectedError); + const actualRequest = (client.innerApiCalls.createClientTlsPolicy as SinonStub) .getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listClientTlsPolicies as SinonStub) + const actualHeaderRequestParams = (client.innerApiCalls.createClientTlsPolicy as SinonStub) .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes listClientTlsPoliciesStream without error', async () => { + it('invokes createClientTlsPolicy with LRO error', async () => { const client = new networksecurityModule.v1.NetworkSecurityClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', }); await client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.networksecurity.v1.ListClientTlsPoliciesRequest() + new protos.google.cloud.networksecurity.v1.CreateClientTlsPolicyRequest() ); const defaultValue1 = - getTypeDefaultValue('.google.cloud.networksecurity.v1.ListClientTlsPoliciesRequest', ['parent']); + getTypeDefaultValue('.google.cloud.networksecurity.v1.CreateClientTlsPolicyRequest', ['parent']); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.networksecurity.v1.ClientTlsPolicy()), - generateSampleMessage(new protos.google.cloud.networksecurity.v1.ClientTlsPolicy()), - generateSampleMessage(new protos.google.cloud.networksecurity.v1.ClientTlsPolicy()), - ]; - client.descriptors.page.listClientTlsPolicies.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listClientTlsPoliciesStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.networksecurity.v1.ClientTlsPolicy[] = []; - stream.on('data', (response: protos.google.cloud.networksecurity.v1.ClientTlsPolicy) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - const responses = await promise; - assert.deepStrictEqual(responses, expectedResponse); - assert((client.descriptors.page.listClientTlsPolicies.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listClientTlsPolicies, request)); - assert( - (client.descriptors.page.listClientTlsPolicies.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); + const expectedError = new Error('expected'); + client.innerApiCalls.createClientTlsPolicy = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.createClientTlsPolicy(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.createClientTlsPolicy as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createClientTlsPolicy as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes listClientTlsPoliciesStream with error', async () => { - const client = new networksecurityModule.v1.NetworkSecurityClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.networksecurity.v1.ListClientTlsPoliciesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.networksecurity.v1.ListClientTlsPoliciesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.descriptors.page.listClientTlsPolicies.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.listClientTlsPoliciesStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.networksecurity.v1.ClientTlsPolicy[] = []; - stream.on('data', (response: protos.google.cloud.networksecurity.v1.ClientTlsPolicy) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.listClientTlsPolicies.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listClientTlsPolicies, request)); - assert( - (client.descriptors.page.listClientTlsPolicies.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listClientTlsPolicies without error', async () => { + it('invokes checkCreateClientTlsPolicyProgress without error', async () => { const client = new networksecurityModule.v1.NetworkSecurityClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.networksecurity.v1.ListClientTlsPoliciesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.networksecurity.v1.ListClientTlsPoliciesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.networksecurity.v1.ClientTlsPolicy()), - generateSampleMessage(new protos.google.cloud.networksecurity.v1.ClientTlsPolicy()), - generateSampleMessage(new protos.google.cloud.networksecurity.v1.ClientTlsPolicy()), - ]; - client.descriptors.page.listClientTlsPolicies.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.networksecurity.v1.IClientTlsPolicy[] = []; - const iterable = client.listClientTlsPoliciesAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.listClientTlsPolicies.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listClientTlsPolicies.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkCreateClientTlsPolicyProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); }); - it('uses async iteration with listClientTlsPolicies with error', async () => { + it('invokes checkCreateClientTlsPolicyProgress with error', async () => { const client = new networksecurityModule.v1.NetworkSecurityClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', }); await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.networksecurity.v1.ListClientTlsPoliciesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.networksecurity.v1.ListClientTlsPoliciesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; const expectedError = new Error('expected'); - client.descriptors.page.listClientTlsPolicies.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listClientTlsPoliciesAsync(request); - await assert.rejects(async () => { - const responses: protos.google.cloud.networksecurity.v1.IClientTlsPolicy[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.listClientTlsPolicies.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listClientTlsPolicies.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkCreateClientTlsPolicyProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); }); }); - describe('getIamPolicy', () => { - it('invokes getIamPolicy without error', async () => { + + describe('updateClientTlsPolicy', () => { + it('invokes updateClientTlsPolicy without error', async () => { const client = new networksecurityModule.v1.NetworkSecurityClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); await client.initialize(); const request = generateSampleMessage( - new IamProtos.google.iam.v1.GetIamPolicyRequest() + new protos.google.cloud.networksecurity.v1.UpdateClientTlsPolicyRequest() ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + request.clientTlsPolicy ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.UpdateClientTlsPolicyRequest', ['clientTlsPolicy', 'name']); + request.clientTlsPolicy.name = defaultValue1; + const expectedHeaderRequestParams = `client_tls_policy.name=${defaultValue1 ?? '' }`; const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.Policy() + new protos.google.longrunning.Operation() ); - client.iamClient.getIamPolicy = stubSimpleCall(expectedResponse); - const response = await client.getIamPolicy(request, expectedOptions); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.iamClient.getIamPolicy as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); + client.innerApiCalls.updateClientTlsPolicy = stubLongRunningCall(expectedResponse); + const [operation] = await client.updateClientTlsPolicy(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateClientTlsPolicy as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateClientTlsPolicy as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes getIamPolicy without error using callback', async () => { + + it('invokes updateClientTlsPolicy without error using callback', async () => { const client = new networksecurityModule.v1.NetworkSecurityClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); await client.initialize(); const request = generateSampleMessage( - new IamProtos.google.iam.v1.GetIamPolicyRequest() + new protos.google.cloud.networksecurity.v1.UpdateClientTlsPolicyRequest() ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + request.clientTlsPolicy ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.UpdateClientTlsPolicyRequest', ['clientTlsPolicy', 'name']); + request.clientTlsPolicy.name = defaultValue1; + const expectedHeaderRequestParams = `client_tls_policy.name=${defaultValue1 ?? '' }`; const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.Policy() + new protos.google.longrunning.Operation() ); - client.iamClient.getIamPolicy = sinon.stub().callsArgWith(2, null, expectedResponse); + client.innerApiCalls.updateClientTlsPolicy = stubLongRunningCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { - client.getIamPolicy( + client.updateClientTlsPolicy( request, - expectedOptions, - (err?: Error|null, result?: IamProtos.google.iam.v1.Policy|null) => { + (err?: Error|null, + result?: LROperation|null + ) => { if (err) { reject(err); } else { resolve(result); } - }).catch(err => {throw err}); + }); }); - const response = await promise; + const operation = await promise as LROperation; + const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); - assert((client.iamClient.getIamPolicy as SinonStub) - .getCall(0)); + const actualRequest = (client.innerApiCalls.updateClientTlsPolicy as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateClientTlsPolicy as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes getIamPolicy with error', async () => { + + it('invokes updateClientTlsPolicy with call error', async () => { const client = new networksecurityModule.v1.NetworkSecurityClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); await client.initialize(); const request = generateSampleMessage( - new IamProtos.google.iam.v1.GetIamPolicyRequest() + new protos.google.cloud.networksecurity.v1.UpdateClientTlsPolicyRequest() ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + request.clientTlsPolicy ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.UpdateClientTlsPolicyRequest', ['clientTlsPolicy', 'name']); + request.clientTlsPolicy.name = defaultValue1; + const expectedHeaderRequestParams = `client_tls_policy.name=${defaultValue1 ?? '' }`; const expectedError = new Error('expected'); - client.iamClient.getIamPolicy = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getIamPolicy(request, expectedOptions), expectedError); - assert((client.iamClient.getIamPolicy as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); + client.innerApiCalls.updateClientTlsPolicy = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.updateClientTlsPolicy(request), expectedError); + const actualRequest = (client.innerApiCalls.updateClientTlsPolicy as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateClientTlsPolicy as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - }); - describe('setIamPolicy', () => { - it('invokes setIamPolicy without error', async () => { + + it('invokes updateClientTlsPolicy with LRO error', async () => { const client = new networksecurityModule.v1.NetworkSecurityClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); await client.initialize(); const request = generateSampleMessage( - new IamProtos.google.iam.v1.SetIamPolicyRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.Policy() + new protos.google.cloud.networksecurity.v1.UpdateClientTlsPolicyRequest() ); - client.iamClient.setIamPolicy = stubSimpleCall(expectedResponse); - const response = await client.setIamPolicy(request, expectedOptions); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.iamClient.setIamPolicy as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - it('invokes setIamPolicy without error using callback', async () => { - const client = new networksecurityModule.v1.NetworkSecurityClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); + request.clientTlsPolicy ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.UpdateClientTlsPolicyRequest', ['clientTlsPolicy', 'name']); + request.clientTlsPolicy.name = defaultValue1; + const expectedHeaderRequestParams = `client_tls_policy.name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateClientTlsPolicy = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.updateClientTlsPolicy(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.updateClientTlsPolicy as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateClientTlsPolicy as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkUpdateClientTlsPolicyProgress without error', async () => { + const client = new networksecurityModule.v1.NetworkSecurityClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); await client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.SetIamPolicyRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.Policy() + new operationsProtos.google.longrunning.Operation() ); - client.iamClient.setIamPolicy = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.setIamPolicy( - request, - expectedOptions, - (err?: Error|null, result?: IamProtos.google.iam.v1.Policy|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }).catch(err => {throw err}); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.iamClient.setIamPolicy as SinonStub) - .getCall(0)); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkUpdateClientTlsPolicyProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); }); - it('invokes setIamPolicy with error', async () => { + + it('invokes checkUpdateClientTlsPolicyProgress with error', async () => { const client = new networksecurityModule.v1.NetworkSecurityClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); await client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.SetIamPolicyRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; const expectedError = new Error('expected'); - client.iamClient.setIamPolicy = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.setIamPolicy(request, expectedOptions), expectedError); - assert((client.iamClient.setIamPolicy as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkUpdateClientTlsPolicyProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); }); }); - describe('testIamPermissions', () => { - it('invokes testIamPermissions without error', async () => { + + describe('deleteClientTlsPolicy', () => { + it('invokes deleteClientTlsPolicy without error', async () => { const client = new networksecurityModule.v1.NetworkSecurityClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); await client.initialize(); const request = generateSampleMessage( - new IamProtos.google.iam.v1.TestIamPermissionsRequest() + new protos.google.cloud.networksecurity.v1.DeleteClientTlsPolicyRequest() ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.DeleteClientTlsPolicyRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.TestIamPermissionsResponse() + new protos.google.longrunning.Operation() ); - client.iamClient.testIamPermissions = stubSimpleCall(expectedResponse); - const response = await client.testIamPermissions(request, expectedOptions); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.iamClient.testIamPermissions as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); + client.innerApiCalls.deleteClientTlsPolicy = stubLongRunningCall(expectedResponse); + const [operation] = await client.deleteClientTlsPolicy(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.deleteClientTlsPolicy as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteClientTlsPolicy as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes testIamPermissions without error using callback', async () => { + + it('invokes deleteClientTlsPolicy without error using callback', async () => { const client = new networksecurityModule.v1.NetworkSecurityClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); await client.initialize(); const request = generateSampleMessage( - new IamProtos.google.iam.v1.TestIamPermissionsRequest() + new protos.google.cloud.networksecurity.v1.DeleteClientTlsPolicyRequest() ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.DeleteClientTlsPolicyRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.TestIamPermissionsResponse() + new protos.google.longrunning.Operation() ); - client.iamClient.testIamPermissions = sinon.stub().callsArgWith(2, null, expectedResponse); + client.innerApiCalls.deleteClientTlsPolicy = stubLongRunningCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { - client.testIamPermissions( + client.deleteClientTlsPolicy( request, - expectedOptions, - (err?: Error|null, result?: IamProtos.google.iam.v1.TestIamPermissionsResponse|null) => { + (err?: Error|null, + result?: LROperation|null + ) => { if (err) { reject(err); } else { resolve(result); } - }).catch(err => {throw err}); + }); }); - const response = await promise; + const operation = await promise as LROperation; + const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); - assert((client.iamClient.testIamPermissions as SinonStub) - .getCall(0)); + const actualRequest = (client.innerApiCalls.deleteClientTlsPolicy as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteClientTlsPolicy as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes testIamPermissions with error', async () => { + + it('invokes deleteClientTlsPolicy with call error', async () => { const client = new networksecurityModule.v1.NetworkSecurityClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); await client.initialize(); const request = generateSampleMessage( - new IamProtos.google.iam.v1.TestIamPermissionsRequest() + new protos.google.cloud.networksecurity.v1.DeleteClientTlsPolicyRequest() ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.DeleteClientTlsPolicyRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; const expectedError = new Error('expected'); - client.iamClient.testIamPermissions = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.testIamPermissions(request, expectedOptions), expectedError); - assert((client.iamClient.testIamPermissions as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); + client.innerApiCalls.deleteClientTlsPolicy = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.deleteClientTlsPolicy(request), expectedError); + const actualRequest = (client.innerApiCalls.deleteClientTlsPolicy as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteClientTlsPolicy as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - }); - describe('getLocation', () => { - it('invokes getLocation without error', async () => { + + it('invokes deleteClientTlsPolicy with LRO error', async () => { const client = new networksecurityModule.v1.NetworkSecurityClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); await client.initialize(); const request = generateSampleMessage( - new LocationProtos.google.cloud.location.GetLocationRequest() - ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new LocationProtos.google.cloud.location.Location() + new protos.google.cloud.networksecurity.v1.DeleteClientTlsPolicyRequest() ); - client.locationsClient.getLocation = stubSimpleCall(expectedResponse); - const response = await client.getLocation(request, expectedOptions); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.locationsClient.getLocation as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.DeleteClientTlsPolicyRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteClientTlsPolicy = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.deleteClientTlsPolicy(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.deleteClientTlsPolicy as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteClientTlsPolicy as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes getLocation without error using callback', async () => { + + it('invokes checkDeleteClientTlsPolicyProgress without error', async () => { const client = new networksecurityModule.v1.NetworkSecurityClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); await client.initialize(); - const request = generateSampleMessage( - new LocationProtos.google.cloud.location.GetLocationRequest() - ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; const expectedResponse = generateSampleMessage( - new LocationProtos.google.cloud.location.Location() + new operationsProtos.google.longrunning.Operation() ); - client.locationsClient.getLocation = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getLocation( - request, - expectedOptions, - ( - err?: Error | null, - result?: LocationProtos.google.cloud.location.ILocation | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.locationsClient.getLocation as SinonStub) - .getCall(0)); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkDeleteClientTlsPolicyProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); }); - it('invokes getLocation with error', async () => { + + it('invokes checkDeleteClientTlsPolicyProgress with error', async () => { const client = new networksecurityModule.v1.NetworkSecurityClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); await client.initialize(); - const request = generateSampleMessage( - new LocationProtos.google.cloud.location.GetLocationRequest() - ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; const expectedError = new Error('expected'); - client.locationsClient.getLocation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getLocation(request, expectedOptions), expectedError); - assert((client.locationsClient.getLocation as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkDeleteClientTlsPolicyProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); }); }); - describe('listLocationsAsync', () => { - it('uses async iteration with listLocations without error', async () => { + + describe('createGatewaySecurityPolicy', () => { + it('invokes createGatewaySecurityPolicy without error', async () => { const client = new networksecurityModule.v1.NetworkSecurityClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); await client.initialize(); const request = generateSampleMessage( - new LocationProtos.google.cloud.location.ListLocationsRequest() + new protos.google.cloud.networksecurity.v1.CreateGatewaySecurityPolicyRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedResponse = [ - generateSampleMessage( - new LocationProtos.google.cloud.location.Location() - ), - generateSampleMessage( - new LocationProtos.google.cloud.location.Location() - ), - generateSampleMessage( - new LocationProtos.google.cloud.location.Location() - ), - ]; - client.locationsClient.descriptors.page.listLocations.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: LocationProtos.google.cloud.location.ILocation[] = []; - const iterable = client.listLocationsAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.CreateGatewaySecurityPolicyRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() ); + client.innerApiCalls.createGatewaySecurityPolicy = stubLongRunningCall(expectedResponse); + const [operation] = await client.createGatewaySecurityPolicy(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createGatewaySecurityPolicy as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createGatewaySecurityPolicy as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('uses async iteration with listLocations with error', async () => { + + it('invokes createGatewaySecurityPolicy without error using callback', async () => { const client = new networksecurityModule.v1.NetworkSecurityClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', }); await client.initialize(); const request = generateSampleMessage( - new LocationProtos.google.cloud.location.ListLocationsRequest() + new protos.google.cloud.networksecurity.v1.CreateGatewaySecurityPolicyRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedError = new Error('expected'); - client.locationsClient.descriptors.page.listLocations.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listLocationsAsync(request); - await assert.rejects(async () => { - const responses: LocationProtos.google.cloud.location.ILocation[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.CreateGatewaySecurityPolicyRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() ); + client.innerApiCalls.createGatewaySecurityPolicy = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createGatewaySecurityPolicy( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createGatewaySecurityPolicy as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createGatewaySecurityPolicy as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - }); - describe('getOperation', () => { - it('invokes getOperation without error', async () => { + + it('invokes createGatewaySecurityPolicy with call error', async () => { const client = new networksecurityModule.v1.NetworkSecurityClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); await client.initialize(); const request = generateSampleMessage( - new operationsProtos.google.longrunning.GetOperationRequest() - ); - const expectedResponse = generateSampleMessage( - new operationsProtos.google.longrunning.Operation() - ); - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const response = await client.getOperation(request); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0).calledWith(request) + new protos.google.cloud.networksecurity.v1.CreateGatewaySecurityPolicyRequest() ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.CreateGatewaySecurityPolicyRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.createGatewaySecurityPolicy = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.createGatewaySecurityPolicy(request), expectedError); + const actualRequest = (client.innerApiCalls.createGatewaySecurityPolicy as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createGatewaySecurityPolicy as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes getOperation without error using callback', async () => { + + it('invokes createGatewaySecurityPolicy with LRO error', async () => { const client = new networksecurityModule.v1.NetworkSecurityClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); + await client.initialize(); const request = generateSampleMessage( - new operationsProtos.google.longrunning.GetOperationRequest() + new protos.google.cloud.networksecurity.v1.CreateGatewaySecurityPolicyRequest() ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.CreateGatewaySecurityPolicyRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.createGatewaySecurityPolicy = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.createGatewaySecurityPolicy(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.createGatewaySecurityPolicy as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createGatewaySecurityPolicy as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkCreateGatewaySecurityPolicyProgress without error', async () => { + const client = new networksecurityModule.v1.NetworkSecurityClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); const expectedResponse = generateSampleMessage( - new operationsProtos.google.longrunning.Operation() + new operationsProtos.google.longrunning.Operation() ); - client.operationsClient.getOperation = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.operationsClient.getOperation( - request, - undefined, - ( - err?: Error | null, - result?: operationsProtos.google.longrunning.Operation | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }).catch(err => {throw err}); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkCreateGatewaySecurityPolicyProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); }); - it('invokes getOperation with error', async () => { + + it('invokes checkCreateGatewaySecurityPolicyProgress with error', async () => { const client = new networksecurityModule.v1.NetworkSecurityClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.GetOperationRequest() - ); + await client.initialize(); const expectedError = new Error('expected'); + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(async () => {await client.getOperation(request)}, expectedError); + await assert.rejects(client.checkCreateGatewaySecurityPolicyProgress(''), expectedError); assert((client.operationsClient.getOperation as SinonStub) - .getCall(0).calledWith(request)); + .getCall(0)); }); }); - describe('cancelOperation', () => { - it('invokes cancelOperation without error', async () => { + + describe('updateGatewaySecurityPolicy', () => { + it('invokes updateGatewaySecurityPolicy without error', async () => { const client = new networksecurityModule.v1.NetworkSecurityClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); await client.initialize(); const request = generateSampleMessage( - new operationsProtos.google.longrunning.CancelOperationRequest() + new protos.google.cloud.networksecurity.v1.UpdateGatewaySecurityPolicyRequest() ); + request.gatewaySecurityPolicy ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.UpdateGatewaySecurityPolicyRequest', ['gatewaySecurityPolicy', 'name']); + request.gatewaySecurityPolicy.name = defaultValue1; + const expectedHeaderRequestParams = `gateway_security_policy.name=${defaultValue1 ?? '' }`; const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.operationsClient.cancelOperation = stubSimpleCall(expectedResponse); - const response = await client.cancelOperation(request); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.operationsClient.cancelOperation as SinonStub) - .getCall(0).calledWith(request) + new protos.google.longrunning.Operation() ); + client.innerApiCalls.updateGatewaySecurityPolicy = stubLongRunningCall(expectedResponse); + const [operation] = await client.updateGatewaySecurityPolicy(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateGatewaySecurityPolicy as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateGatewaySecurityPolicy as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes cancelOperation without error using callback', async () => { + + it('invokes updateGatewaySecurityPolicy without error using callback', async () => { const client = new networksecurityModule.v1.NetworkSecurityClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); + await client.initialize(); const request = generateSampleMessage( - new operationsProtos.google.longrunning.CancelOperationRequest() + new protos.google.cloud.networksecurity.v1.UpdateGatewaySecurityPolicyRequest() ); + request.gatewaySecurityPolicy ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.UpdateGatewaySecurityPolicyRequest', ['gatewaySecurityPolicy', 'name']); + request.gatewaySecurityPolicy.name = defaultValue1; + const expectedHeaderRequestParams = `gateway_security_policy.name=${defaultValue1 ?? '' }`; const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() + new protos.google.longrunning.Operation() ); - client.operationsClient.cancelOperation = sinon.stub().callsArgWith(2, null, expectedResponse); + client.innerApiCalls.updateGatewaySecurityPolicy = stubLongRunningCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { - client.operationsClient.cancelOperation( + client.updateGatewaySecurityPolicy( request, - undefined, - ( - err?: Error | null, - result?: protos.google.protobuf.Empty | null + (err?: Error|null, + result?: LROperation|null ) => { if (err) { reject(err); } else { resolve(result); } - }).catch(err => {throw err}); + }); }); - const response = await promise; + const operation = await promise as LROperation; + const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); - assert((client.operationsClient.cancelOperation as SinonStub) - .getCall(0)); + const actualRequest = (client.innerApiCalls.updateGatewaySecurityPolicy as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateGatewaySecurityPolicy as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes cancelOperation with error', async () => { + + it('invokes updateGatewaySecurityPolicy with call error', async () => { const client = new networksecurityModule.v1.NetworkSecurityClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); + await client.initialize(); const request = generateSampleMessage( - new operationsProtos.google.longrunning.CancelOperationRequest() + new protos.google.cloud.networksecurity.v1.UpdateGatewaySecurityPolicyRequest() ); + request.gatewaySecurityPolicy ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.UpdateGatewaySecurityPolicyRequest', ['gatewaySecurityPolicy', 'name']); + request.gatewaySecurityPolicy.name = defaultValue1; + const expectedHeaderRequestParams = `gateway_security_policy.name=${defaultValue1 ?? '' }`; const expectedError = new Error('expected'); - client.operationsClient.cancelOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(async () => {await client.cancelOperation(request)}, expectedError); - assert((client.operationsClient.cancelOperation as SinonStub) - .getCall(0).calledWith(request)); + client.innerApiCalls.updateGatewaySecurityPolicy = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.updateGatewaySecurityPolicy(request), expectedError); + const actualRequest = (client.innerApiCalls.updateGatewaySecurityPolicy as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateGatewaySecurityPolicy as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - }); - describe('deleteOperation', () => { - it('invokes deleteOperation without error', async () => { + + it('invokes updateGatewaySecurityPolicy with LRO error', async () => { const client = new networksecurityModule.v1.NetworkSecurityClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); await client.initialize(); const request = generateSampleMessage( - new operationsProtos.google.longrunning.DeleteOperationRequest() + new protos.google.cloud.networksecurity.v1.UpdateGatewaySecurityPolicyRequest() ); + request.gatewaySecurityPolicy ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.UpdateGatewaySecurityPolicyRequest', ['gatewaySecurityPolicy', 'name']); + request.gatewaySecurityPolicy.name = defaultValue1; + const expectedHeaderRequestParams = `gateway_security_policy.name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateGatewaySecurityPolicy = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.updateGatewaySecurityPolicy(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.updateGatewaySecurityPolicy as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateGatewaySecurityPolicy as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkUpdateGatewaySecurityPolicyProgress without error', async () => { + const client = new networksecurityModule.v1.NetworkSecurityClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() + new operationsProtos.google.longrunning.Operation() ); - client.operationsClient.deleteOperation = stubSimpleCall(expectedResponse); - const response = await client.deleteOperation(request); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.operationsClient.deleteOperation as SinonStub) - .getCall(0).calledWith(request) + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkUpdateGatewaySecurityPolicyProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkUpdateGatewaySecurityPolicyProgress with error', async () => { + const client = new networksecurityModule.v1.NetworkSecurityClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkUpdateGatewaySecurityPolicyProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('deleteGatewaySecurityPolicy', () => { + it('invokes deleteGatewaySecurityPolicy without error', async () => { + const client = new networksecurityModule.v1.NetworkSecurityClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.DeleteGatewaySecurityPolicyRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.DeleteGatewaySecurityPolicyRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() ); + client.innerApiCalls.deleteGatewaySecurityPolicy = stubLongRunningCall(expectedResponse); + const [operation] = await client.deleteGatewaySecurityPolicy(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.deleteGatewaySecurityPolicy as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteGatewaySecurityPolicy as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes deleteOperation without error using callback', async () => { + + it('invokes deleteGatewaySecurityPolicy without error using callback', async () => { const client = new networksecurityModule.v1.NetworkSecurityClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); + await client.initialize(); const request = generateSampleMessage( - new operationsProtos.google.longrunning.DeleteOperationRequest() + new protos.google.cloud.networksecurity.v1.DeleteGatewaySecurityPolicyRequest() ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.DeleteGatewaySecurityPolicyRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() + new protos.google.longrunning.Operation() ); - client.operationsClient.deleteOperation = sinon.stub().callsArgWith(2, null, expectedResponse); + client.innerApiCalls.deleteGatewaySecurityPolicy = stubLongRunningCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { - client.operationsClient.deleteOperation( + client.deleteGatewaySecurityPolicy( request, - undefined, - ( - err?: Error | null, - result?: protos.google.protobuf.Empty | null + (err?: Error|null, + result?: LROperation|null ) => { if (err) { reject(err); } else { resolve(result); } - }).catch(err => {throw err}); + }); }); - const response = await promise; + const operation = await promise as LROperation; + const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); - assert((client.operationsClient.deleteOperation as SinonStub) - .getCall(0)); + const actualRequest = (client.innerApiCalls.deleteGatewaySecurityPolicy as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteGatewaySecurityPolicy as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes deleteOperation with error', async () => { + + it('invokes deleteGatewaySecurityPolicy with call error', async () => { const client = new networksecurityModule.v1.NetworkSecurityClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); + await client.initialize(); const request = generateSampleMessage( - new operationsProtos.google.longrunning.DeleteOperationRequest() + new protos.google.cloud.networksecurity.v1.DeleteGatewaySecurityPolicyRequest() ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.DeleteGatewaySecurityPolicyRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; const expectedError = new Error('expected'); - client.operationsClient.deleteOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(async () => {await client.deleteOperation(request)}, expectedError); - assert((client.operationsClient.deleteOperation as SinonStub) - .getCall(0).calledWith(request)); + client.innerApiCalls.deleteGatewaySecurityPolicy = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.deleteGatewaySecurityPolicy(request), expectedError); + const actualRequest = (client.innerApiCalls.deleteGatewaySecurityPolicy as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteGatewaySecurityPolicy as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - }); - describe('listOperationsAsync', () => { - it('uses async iteration with listOperations without error', async () => { + + it('invokes deleteGatewaySecurityPolicy with LRO error', async () => { const client = new networksecurityModule.v1.NetworkSecurityClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); + await client.initialize(); const request = generateSampleMessage( - new operationsProtos.google.longrunning.ListOperationsRequest() + new protos.google.cloud.networksecurity.v1.DeleteGatewaySecurityPolicyRequest() ); - const expectedResponse = [ - generateSampleMessage( - new operationsProtos.google.longrunning.ListOperationsResponse() - ), - generateSampleMessage( - new operationsProtos.google.longrunning.ListOperationsResponse() - ), - generateSampleMessage( - new operationsProtos.google.longrunning.ListOperationsResponse() - ), - ]; - client.operationsClient.descriptor.listOperations.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: operationsProtos.google.longrunning.IOperation[] = []; - const iterable = client.operationsClient.listOperationsAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.operationsClient.descriptor.listOperations.asyncIterate as SinonStub) - .getCall(0).args[1], request); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.DeleteGatewaySecurityPolicyRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteGatewaySecurityPolicy = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.deleteGatewaySecurityPolicy(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.deleteGatewaySecurityPolicy as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteGatewaySecurityPolicy as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('uses async iteration with listOperations with error', async () => { + + it('invokes checkDeleteGatewaySecurityPolicyProgress without error', async () => { const client = new networksecurityModule.v1.NetworkSecurityClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', }); await client.initialize(); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.ListOperationsRequest() + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() ); - const expectedError = new Error('expected'); - client.operationsClient.descriptor.listOperations.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.operationsClient.listOperationsAsync(request); - await assert.rejects(async () => { - const responses: operationsProtos.google.longrunning.IOperation[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkDeleteGatewaySecurityPolicyProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkDeleteGatewaySecurityPolicyProgress with error', async () => { + const client = new networksecurityModule.v1.NetworkSecurityClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', }); - assert.deepStrictEqual( - (client.operationsClient.descriptor.listOperations.asyncIterate as SinonStub) - .getCall(0).args[1], request); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkDeleteGatewaySecurityPolicyProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); }); }); - describe('Path templates', () => { + describe('createGatewaySecurityPolicyRule', () => { + it('invokes createGatewaySecurityPolicyRule without error', async () => { + const client = new networksecurityModule.v1.NetworkSecurityClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.CreateGatewaySecurityPolicyRuleRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.CreateGatewaySecurityPolicyRuleRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createGatewaySecurityPolicyRule = stubLongRunningCall(expectedResponse); + const [operation] = await client.createGatewaySecurityPolicyRule(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createGatewaySecurityPolicyRule as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createGatewaySecurityPolicyRule as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); - describe('authorizationPolicy', async () => { - const fakePath = "/rendered/path/authorizationPolicy"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - authorization_policy: "authorizationPolicyValue", - }; + it('invokes createGatewaySecurityPolicyRule without error using callback', async () => { const client = new networksecurityModule.v1.NetworkSecurityClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', }); await client.initialize(); - client.pathTemplates.authorizationPolicyPathTemplate.render = + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.CreateGatewaySecurityPolicyRuleRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.CreateGatewaySecurityPolicyRuleRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createGatewaySecurityPolicyRule = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createGatewaySecurityPolicyRule( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createGatewaySecurityPolicyRule as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createGatewaySecurityPolicyRule as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createGatewaySecurityPolicyRule with call error', async () => { + const client = new networksecurityModule.v1.NetworkSecurityClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.CreateGatewaySecurityPolicyRuleRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.CreateGatewaySecurityPolicyRuleRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.createGatewaySecurityPolicyRule = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.createGatewaySecurityPolicyRule(request), expectedError); + const actualRequest = (client.innerApiCalls.createGatewaySecurityPolicyRule as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createGatewaySecurityPolicyRule as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createGatewaySecurityPolicyRule with LRO error', async () => { + const client = new networksecurityModule.v1.NetworkSecurityClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.CreateGatewaySecurityPolicyRuleRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.CreateGatewaySecurityPolicyRuleRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.createGatewaySecurityPolicyRule = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.createGatewaySecurityPolicyRule(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.createGatewaySecurityPolicyRule as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createGatewaySecurityPolicyRule as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkCreateGatewaySecurityPolicyRuleProgress without error', async () => { + const client = new networksecurityModule.v1.NetworkSecurityClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkCreateGatewaySecurityPolicyRuleProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkCreateGatewaySecurityPolicyRuleProgress with error', async () => { + const client = new networksecurityModule.v1.NetworkSecurityClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkCreateGatewaySecurityPolicyRuleProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('updateGatewaySecurityPolicyRule', () => { + it('invokes updateGatewaySecurityPolicyRule without error', async () => { + const client = new networksecurityModule.v1.NetworkSecurityClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.UpdateGatewaySecurityPolicyRuleRequest() + ); + request.gatewaySecurityPolicyRule ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.UpdateGatewaySecurityPolicyRuleRequest', ['gatewaySecurityPolicyRule', 'name']); + request.gatewaySecurityPolicyRule.name = defaultValue1; + const expectedHeaderRequestParams = `gateway_security_policy_rule.name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.updateGatewaySecurityPolicyRule = stubLongRunningCall(expectedResponse); + const [operation] = await client.updateGatewaySecurityPolicyRule(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateGatewaySecurityPolicyRule as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateGatewaySecurityPolicyRule as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateGatewaySecurityPolicyRule without error using callback', async () => { + const client = new networksecurityModule.v1.NetworkSecurityClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.UpdateGatewaySecurityPolicyRuleRequest() + ); + request.gatewaySecurityPolicyRule ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.UpdateGatewaySecurityPolicyRuleRequest', ['gatewaySecurityPolicyRule', 'name']); + request.gatewaySecurityPolicyRule.name = defaultValue1; + const expectedHeaderRequestParams = `gateway_security_policy_rule.name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.updateGatewaySecurityPolicyRule = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateGatewaySecurityPolicyRule( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateGatewaySecurityPolicyRule as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateGatewaySecurityPolicyRule as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateGatewaySecurityPolicyRule with call error', async () => { + const client = new networksecurityModule.v1.NetworkSecurityClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.UpdateGatewaySecurityPolicyRuleRequest() + ); + request.gatewaySecurityPolicyRule ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.UpdateGatewaySecurityPolicyRuleRequest', ['gatewaySecurityPolicyRule', 'name']); + request.gatewaySecurityPolicyRule.name = defaultValue1; + const expectedHeaderRequestParams = `gateway_security_policy_rule.name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateGatewaySecurityPolicyRule = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.updateGatewaySecurityPolicyRule(request), expectedError); + const actualRequest = (client.innerApiCalls.updateGatewaySecurityPolicyRule as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateGatewaySecurityPolicyRule as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateGatewaySecurityPolicyRule with LRO error', async () => { + const client = new networksecurityModule.v1.NetworkSecurityClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.UpdateGatewaySecurityPolicyRuleRequest() + ); + request.gatewaySecurityPolicyRule ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.UpdateGatewaySecurityPolicyRuleRequest', ['gatewaySecurityPolicyRule', 'name']); + request.gatewaySecurityPolicyRule.name = defaultValue1; + const expectedHeaderRequestParams = `gateway_security_policy_rule.name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateGatewaySecurityPolicyRule = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.updateGatewaySecurityPolicyRule(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.updateGatewaySecurityPolicyRule as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateGatewaySecurityPolicyRule as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkUpdateGatewaySecurityPolicyRuleProgress without error', async () => { + const client = new networksecurityModule.v1.NetworkSecurityClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkUpdateGatewaySecurityPolicyRuleProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkUpdateGatewaySecurityPolicyRuleProgress with error', async () => { + const client = new networksecurityModule.v1.NetworkSecurityClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkUpdateGatewaySecurityPolicyRuleProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('deleteGatewaySecurityPolicyRule', () => { + it('invokes deleteGatewaySecurityPolicyRule without error', async () => { + const client = new networksecurityModule.v1.NetworkSecurityClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.DeleteGatewaySecurityPolicyRuleRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.DeleteGatewaySecurityPolicyRuleRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteGatewaySecurityPolicyRule = stubLongRunningCall(expectedResponse); + const [operation] = await client.deleteGatewaySecurityPolicyRule(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.deleteGatewaySecurityPolicyRule as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteGatewaySecurityPolicyRule as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteGatewaySecurityPolicyRule without error using callback', async () => { + const client = new networksecurityModule.v1.NetworkSecurityClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.DeleteGatewaySecurityPolicyRuleRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.DeleteGatewaySecurityPolicyRuleRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteGatewaySecurityPolicyRule = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteGatewaySecurityPolicyRule( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.deleteGatewaySecurityPolicyRule as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteGatewaySecurityPolicyRule as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteGatewaySecurityPolicyRule with call error', async () => { + const client = new networksecurityModule.v1.NetworkSecurityClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.DeleteGatewaySecurityPolicyRuleRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.DeleteGatewaySecurityPolicyRuleRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteGatewaySecurityPolicyRule = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.deleteGatewaySecurityPolicyRule(request), expectedError); + const actualRequest = (client.innerApiCalls.deleteGatewaySecurityPolicyRule as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteGatewaySecurityPolicyRule as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteGatewaySecurityPolicyRule with LRO error', async () => { + const client = new networksecurityModule.v1.NetworkSecurityClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.DeleteGatewaySecurityPolicyRuleRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.DeleteGatewaySecurityPolicyRuleRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteGatewaySecurityPolicyRule = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.deleteGatewaySecurityPolicyRule(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.deleteGatewaySecurityPolicyRule as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteGatewaySecurityPolicyRule as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkDeleteGatewaySecurityPolicyRuleProgress without error', async () => { + const client = new networksecurityModule.v1.NetworkSecurityClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkDeleteGatewaySecurityPolicyRuleProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkDeleteGatewaySecurityPolicyRuleProgress with error', async () => { + const client = new networksecurityModule.v1.NetworkSecurityClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkDeleteGatewaySecurityPolicyRuleProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('createUrlList', () => { + it('invokes createUrlList without error', async () => { + const client = new networksecurityModule.v1.NetworkSecurityClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.CreateUrlListRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.CreateUrlListRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createUrlList = stubLongRunningCall(expectedResponse); + const [operation] = await client.createUrlList(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createUrlList as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createUrlList as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createUrlList without error using callback', async () => { + const client = new networksecurityModule.v1.NetworkSecurityClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.CreateUrlListRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.CreateUrlListRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createUrlList = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createUrlList( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createUrlList as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createUrlList as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createUrlList with call error', async () => { + const client = new networksecurityModule.v1.NetworkSecurityClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.CreateUrlListRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.CreateUrlListRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.createUrlList = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.createUrlList(request), expectedError); + const actualRequest = (client.innerApiCalls.createUrlList as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createUrlList as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createUrlList with LRO error', async () => { + const client = new networksecurityModule.v1.NetworkSecurityClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.CreateUrlListRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.CreateUrlListRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.createUrlList = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.createUrlList(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.createUrlList as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createUrlList as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkCreateUrlListProgress without error', async () => { + const client = new networksecurityModule.v1.NetworkSecurityClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkCreateUrlListProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkCreateUrlListProgress with error', async () => { + const client = new networksecurityModule.v1.NetworkSecurityClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkCreateUrlListProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('updateUrlList', () => { + it('invokes updateUrlList without error', async () => { + const client = new networksecurityModule.v1.NetworkSecurityClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.UpdateUrlListRequest() + ); + request.urlList ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.UpdateUrlListRequest', ['urlList', 'name']); + request.urlList.name = defaultValue1; + const expectedHeaderRequestParams = `url_list.name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.updateUrlList = stubLongRunningCall(expectedResponse); + const [operation] = await client.updateUrlList(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateUrlList as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateUrlList as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateUrlList without error using callback', async () => { + const client = new networksecurityModule.v1.NetworkSecurityClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.UpdateUrlListRequest() + ); + request.urlList ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.UpdateUrlListRequest', ['urlList', 'name']); + request.urlList.name = defaultValue1; + const expectedHeaderRequestParams = `url_list.name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.updateUrlList = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateUrlList( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateUrlList as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateUrlList as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateUrlList with call error', async () => { + const client = new networksecurityModule.v1.NetworkSecurityClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.UpdateUrlListRequest() + ); + request.urlList ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.UpdateUrlListRequest', ['urlList', 'name']); + request.urlList.name = defaultValue1; + const expectedHeaderRequestParams = `url_list.name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateUrlList = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.updateUrlList(request), expectedError); + const actualRequest = (client.innerApiCalls.updateUrlList as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateUrlList as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateUrlList with LRO error', async () => { + const client = new networksecurityModule.v1.NetworkSecurityClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.UpdateUrlListRequest() + ); + request.urlList ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.UpdateUrlListRequest', ['urlList', 'name']); + request.urlList.name = defaultValue1; + const expectedHeaderRequestParams = `url_list.name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateUrlList = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.updateUrlList(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.updateUrlList as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateUrlList as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkUpdateUrlListProgress without error', async () => { + const client = new networksecurityModule.v1.NetworkSecurityClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkUpdateUrlListProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkUpdateUrlListProgress with error', async () => { + const client = new networksecurityModule.v1.NetworkSecurityClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkUpdateUrlListProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('deleteUrlList', () => { + it('invokes deleteUrlList without error', async () => { + const client = new networksecurityModule.v1.NetworkSecurityClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.DeleteUrlListRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.DeleteUrlListRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteUrlList = stubLongRunningCall(expectedResponse); + const [operation] = await client.deleteUrlList(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.deleteUrlList as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteUrlList as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteUrlList without error using callback', async () => { + const client = new networksecurityModule.v1.NetworkSecurityClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.DeleteUrlListRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.DeleteUrlListRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteUrlList = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteUrlList( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.deleteUrlList as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteUrlList as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteUrlList with call error', async () => { + const client = new networksecurityModule.v1.NetworkSecurityClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.DeleteUrlListRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.DeleteUrlListRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteUrlList = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.deleteUrlList(request), expectedError); + const actualRequest = (client.innerApiCalls.deleteUrlList as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteUrlList as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteUrlList with LRO error', async () => { + const client = new networksecurityModule.v1.NetworkSecurityClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.DeleteUrlListRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.DeleteUrlListRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteUrlList = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.deleteUrlList(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.deleteUrlList as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteUrlList as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkDeleteUrlListProgress without error', async () => { + const client = new networksecurityModule.v1.NetworkSecurityClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkDeleteUrlListProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkDeleteUrlListProgress with error', async () => { + const client = new networksecurityModule.v1.NetworkSecurityClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkDeleteUrlListProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('createTlsInspectionPolicy', () => { + it('invokes createTlsInspectionPolicy without error', async () => { + const client = new networksecurityModule.v1.NetworkSecurityClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.CreateTlsInspectionPolicyRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.CreateTlsInspectionPolicyRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createTlsInspectionPolicy = stubLongRunningCall(expectedResponse); + const [operation] = await client.createTlsInspectionPolicy(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createTlsInspectionPolicy as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createTlsInspectionPolicy as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createTlsInspectionPolicy without error using callback', async () => { + const client = new networksecurityModule.v1.NetworkSecurityClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.CreateTlsInspectionPolicyRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.CreateTlsInspectionPolicyRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createTlsInspectionPolicy = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createTlsInspectionPolicy( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createTlsInspectionPolicy as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createTlsInspectionPolicy as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createTlsInspectionPolicy with call error', async () => { + const client = new networksecurityModule.v1.NetworkSecurityClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.CreateTlsInspectionPolicyRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.CreateTlsInspectionPolicyRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.createTlsInspectionPolicy = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.createTlsInspectionPolicy(request), expectedError); + const actualRequest = (client.innerApiCalls.createTlsInspectionPolicy as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createTlsInspectionPolicy as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createTlsInspectionPolicy with LRO error', async () => { + const client = new networksecurityModule.v1.NetworkSecurityClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.CreateTlsInspectionPolicyRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.CreateTlsInspectionPolicyRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.createTlsInspectionPolicy = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.createTlsInspectionPolicy(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.createTlsInspectionPolicy as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createTlsInspectionPolicy as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkCreateTlsInspectionPolicyProgress without error', async () => { + const client = new networksecurityModule.v1.NetworkSecurityClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkCreateTlsInspectionPolicyProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkCreateTlsInspectionPolicyProgress with error', async () => { + const client = new networksecurityModule.v1.NetworkSecurityClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkCreateTlsInspectionPolicyProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('updateTlsInspectionPolicy', () => { + it('invokes updateTlsInspectionPolicy without error', async () => { + const client = new networksecurityModule.v1.NetworkSecurityClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.UpdateTlsInspectionPolicyRequest() + ); + request.tlsInspectionPolicy ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.UpdateTlsInspectionPolicyRequest', ['tlsInspectionPolicy', 'name']); + request.tlsInspectionPolicy.name = defaultValue1; + const expectedHeaderRequestParams = `tls_inspection_policy.name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.updateTlsInspectionPolicy = stubLongRunningCall(expectedResponse); + const [operation] = await client.updateTlsInspectionPolicy(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateTlsInspectionPolicy as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateTlsInspectionPolicy as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateTlsInspectionPolicy without error using callback', async () => { + const client = new networksecurityModule.v1.NetworkSecurityClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.UpdateTlsInspectionPolicyRequest() + ); + request.tlsInspectionPolicy ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.UpdateTlsInspectionPolicyRequest', ['tlsInspectionPolicy', 'name']); + request.tlsInspectionPolicy.name = defaultValue1; + const expectedHeaderRequestParams = `tls_inspection_policy.name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.updateTlsInspectionPolicy = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateTlsInspectionPolicy( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateTlsInspectionPolicy as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateTlsInspectionPolicy as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateTlsInspectionPolicy with call error', async () => { + const client = new networksecurityModule.v1.NetworkSecurityClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.UpdateTlsInspectionPolicyRequest() + ); + request.tlsInspectionPolicy ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.UpdateTlsInspectionPolicyRequest', ['tlsInspectionPolicy', 'name']); + request.tlsInspectionPolicy.name = defaultValue1; + const expectedHeaderRequestParams = `tls_inspection_policy.name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateTlsInspectionPolicy = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.updateTlsInspectionPolicy(request), expectedError); + const actualRequest = (client.innerApiCalls.updateTlsInspectionPolicy as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateTlsInspectionPolicy as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateTlsInspectionPolicy with LRO error', async () => { + const client = new networksecurityModule.v1.NetworkSecurityClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.UpdateTlsInspectionPolicyRequest() + ); + request.tlsInspectionPolicy ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.UpdateTlsInspectionPolicyRequest', ['tlsInspectionPolicy', 'name']); + request.tlsInspectionPolicy.name = defaultValue1; + const expectedHeaderRequestParams = `tls_inspection_policy.name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateTlsInspectionPolicy = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.updateTlsInspectionPolicy(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.updateTlsInspectionPolicy as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateTlsInspectionPolicy as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkUpdateTlsInspectionPolicyProgress without error', async () => { + const client = new networksecurityModule.v1.NetworkSecurityClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkUpdateTlsInspectionPolicyProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkUpdateTlsInspectionPolicyProgress with error', async () => { + const client = new networksecurityModule.v1.NetworkSecurityClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkUpdateTlsInspectionPolicyProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('deleteTlsInspectionPolicy', () => { + it('invokes deleteTlsInspectionPolicy without error', async () => { + const client = new networksecurityModule.v1.NetworkSecurityClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.DeleteTlsInspectionPolicyRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.DeleteTlsInspectionPolicyRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteTlsInspectionPolicy = stubLongRunningCall(expectedResponse); + const [operation] = await client.deleteTlsInspectionPolicy(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.deleteTlsInspectionPolicy as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteTlsInspectionPolicy as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteTlsInspectionPolicy without error using callback', async () => { + const client = new networksecurityModule.v1.NetworkSecurityClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.DeleteTlsInspectionPolicyRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.DeleteTlsInspectionPolicyRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteTlsInspectionPolicy = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteTlsInspectionPolicy( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.deleteTlsInspectionPolicy as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteTlsInspectionPolicy as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteTlsInspectionPolicy with call error', async () => { + const client = new networksecurityModule.v1.NetworkSecurityClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.DeleteTlsInspectionPolicyRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.DeleteTlsInspectionPolicyRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteTlsInspectionPolicy = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.deleteTlsInspectionPolicy(request), expectedError); + const actualRequest = (client.innerApiCalls.deleteTlsInspectionPolicy as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteTlsInspectionPolicy as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteTlsInspectionPolicy with LRO error', async () => { + const client = new networksecurityModule.v1.NetworkSecurityClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.DeleteTlsInspectionPolicyRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.DeleteTlsInspectionPolicyRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteTlsInspectionPolicy = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.deleteTlsInspectionPolicy(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.deleteTlsInspectionPolicy as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteTlsInspectionPolicy as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkDeleteTlsInspectionPolicyProgress without error', async () => { + const client = new networksecurityModule.v1.NetworkSecurityClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkDeleteTlsInspectionPolicyProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkDeleteTlsInspectionPolicyProgress with error', async () => { + const client = new networksecurityModule.v1.NetworkSecurityClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkDeleteTlsInspectionPolicyProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('createAuthzPolicy', () => { + it('invokes createAuthzPolicy without error', async () => { + const client = new networksecurityModule.v1.NetworkSecurityClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.CreateAuthzPolicyRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.CreateAuthzPolicyRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createAuthzPolicy = stubLongRunningCall(expectedResponse); + const [operation] = await client.createAuthzPolicy(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createAuthzPolicy as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createAuthzPolicy as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createAuthzPolicy without error using callback', async () => { + const client = new networksecurityModule.v1.NetworkSecurityClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.CreateAuthzPolicyRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.CreateAuthzPolicyRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createAuthzPolicy = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createAuthzPolicy( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createAuthzPolicy as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createAuthzPolicy as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createAuthzPolicy with call error', async () => { + const client = new networksecurityModule.v1.NetworkSecurityClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.CreateAuthzPolicyRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.CreateAuthzPolicyRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.createAuthzPolicy = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.createAuthzPolicy(request), expectedError); + const actualRequest = (client.innerApiCalls.createAuthzPolicy as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createAuthzPolicy as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createAuthzPolicy with LRO error', async () => { + const client = new networksecurityModule.v1.NetworkSecurityClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.CreateAuthzPolicyRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.CreateAuthzPolicyRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.createAuthzPolicy = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.createAuthzPolicy(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.createAuthzPolicy as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createAuthzPolicy as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkCreateAuthzPolicyProgress without error', async () => { + const client = new networksecurityModule.v1.NetworkSecurityClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkCreateAuthzPolicyProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkCreateAuthzPolicyProgress with error', async () => { + const client = new networksecurityModule.v1.NetworkSecurityClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkCreateAuthzPolicyProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('updateAuthzPolicy', () => { + it('invokes updateAuthzPolicy without error', async () => { + const client = new networksecurityModule.v1.NetworkSecurityClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.UpdateAuthzPolicyRequest() + ); + request.authzPolicy ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.UpdateAuthzPolicyRequest', ['authzPolicy', 'name']); + request.authzPolicy.name = defaultValue1; + const expectedHeaderRequestParams = `authz_policy.name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.updateAuthzPolicy = stubLongRunningCall(expectedResponse); + const [operation] = await client.updateAuthzPolicy(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateAuthzPolicy as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateAuthzPolicy as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateAuthzPolicy without error using callback', async () => { + const client = new networksecurityModule.v1.NetworkSecurityClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.UpdateAuthzPolicyRequest() + ); + request.authzPolicy ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.UpdateAuthzPolicyRequest', ['authzPolicy', 'name']); + request.authzPolicy.name = defaultValue1; + const expectedHeaderRequestParams = `authz_policy.name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.updateAuthzPolicy = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateAuthzPolicy( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateAuthzPolicy as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateAuthzPolicy as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateAuthzPolicy with call error', async () => { + const client = new networksecurityModule.v1.NetworkSecurityClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.UpdateAuthzPolicyRequest() + ); + request.authzPolicy ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.UpdateAuthzPolicyRequest', ['authzPolicy', 'name']); + request.authzPolicy.name = defaultValue1; + const expectedHeaderRequestParams = `authz_policy.name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateAuthzPolicy = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.updateAuthzPolicy(request), expectedError); + const actualRequest = (client.innerApiCalls.updateAuthzPolicy as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateAuthzPolicy as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateAuthzPolicy with LRO error', async () => { + const client = new networksecurityModule.v1.NetworkSecurityClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.UpdateAuthzPolicyRequest() + ); + request.authzPolicy ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.UpdateAuthzPolicyRequest', ['authzPolicy', 'name']); + request.authzPolicy.name = defaultValue1; + const expectedHeaderRequestParams = `authz_policy.name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateAuthzPolicy = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.updateAuthzPolicy(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.updateAuthzPolicy as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateAuthzPolicy as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkUpdateAuthzPolicyProgress without error', async () => { + const client = new networksecurityModule.v1.NetworkSecurityClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkUpdateAuthzPolicyProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkUpdateAuthzPolicyProgress with error', async () => { + const client = new networksecurityModule.v1.NetworkSecurityClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkUpdateAuthzPolicyProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('deleteAuthzPolicy', () => { + it('invokes deleteAuthzPolicy without error', async () => { + const client = new networksecurityModule.v1.NetworkSecurityClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.DeleteAuthzPolicyRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.DeleteAuthzPolicyRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteAuthzPolicy = stubLongRunningCall(expectedResponse); + const [operation] = await client.deleteAuthzPolicy(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.deleteAuthzPolicy as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteAuthzPolicy as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteAuthzPolicy without error using callback', async () => { + const client = new networksecurityModule.v1.NetworkSecurityClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.DeleteAuthzPolicyRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.DeleteAuthzPolicyRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteAuthzPolicy = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteAuthzPolicy( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.deleteAuthzPolicy as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteAuthzPolicy as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteAuthzPolicy with call error', async () => { + const client = new networksecurityModule.v1.NetworkSecurityClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.DeleteAuthzPolicyRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.DeleteAuthzPolicyRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteAuthzPolicy = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.deleteAuthzPolicy(request), expectedError); + const actualRequest = (client.innerApiCalls.deleteAuthzPolicy as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteAuthzPolicy as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteAuthzPolicy with LRO error', async () => { + const client = new networksecurityModule.v1.NetworkSecurityClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.DeleteAuthzPolicyRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.DeleteAuthzPolicyRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteAuthzPolicy = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.deleteAuthzPolicy(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.deleteAuthzPolicy as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteAuthzPolicy as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkDeleteAuthzPolicyProgress without error', async () => { + const client = new networksecurityModule.v1.NetworkSecurityClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkDeleteAuthzPolicyProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkDeleteAuthzPolicyProgress with error', async () => { + const client = new networksecurityModule.v1.NetworkSecurityClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkDeleteAuthzPolicyProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('listAuthorizationPolicies', () => { + it('invokes listAuthorizationPolicies without error', async () => { + const client = new networksecurityModule.v1.NetworkSecurityClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.ListAuthorizationPoliciesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.ListAuthorizationPoliciesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.networksecurity.v1.AuthorizationPolicy()), + generateSampleMessage(new protos.google.cloud.networksecurity.v1.AuthorizationPolicy()), + generateSampleMessage(new protos.google.cloud.networksecurity.v1.AuthorizationPolicy()), + ]; + client.innerApiCalls.listAuthorizationPolicies = stubSimpleCall(expectedResponse); + const [response] = await client.listAuthorizationPolicies(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listAuthorizationPolicies as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listAuthorizationPolicies as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listAuthorizationPolicies without error using callback', async () => { + const client = new networksecurityModule.v1.NetworkSecurityClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.ListAuthorizationPoliciesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.ListAuthorizationPoliciesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.networksecurity.v1.AuthorizationPolicy()), + generateSampleMessage(new protos.google.cloud.networksecurity.v1.AuthorizationPolicy()), + generateSampleMessage(new protos.google.cloud.networksecurity.v1.AuthorizationPolicy()), + ]; + client.innerApiCalls.listAuthorizationPolicies = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listAuthorizationPolicies( + request, + (err?: Error|null, result?: protos.google.cloud.networksecurity.v1.IAuthorizationPolicy[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listAuthorizationPolicies as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listAuthorizationPolicies as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listAuthorizationPolicies with error', async () => { + const client = new networksecurityModule.v1.NetworkSecurityClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.ListAuthorizationPoliciesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.ListAuthorizationPoliciesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.listAuthorizationPolicies = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listAuthorizationPolicies(request), expectedError); + const actualRequest = (client.innerApiCalls.listAuthorizationPolicies as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listAuthorizationPolicies as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listAuthorizationPoliciesStream without error', async () => { + const client = new networksecurityModule.v1.NetworkSecurityClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.ListAuthorizationPoliciesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.ListAuthorizationPoliciesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.networksecurity.v1.AuthorizationPolicy()), + generateSampleMessage(new protos.google.cloud.networksecurity.v1.AuthorizationPolicy()), + generateSampleMessage(new protos.google.cloud.networksecurity.v1.AuthorizationPolicy()), + ]; + client.descriptors.page.listAuthorizationPolicies.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listAuthorizationPoliciesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.networksecurity.v1.AuthorizationPolicy[] = []; + stream.on('data', (response: protos.google.cloud.networksecurity.v1.AuthorizationPolicy) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert((client.descriptors.page.listAuthorizationPolicies.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listAuthorizationPolicies, request)); + assert( + (client.descriptors.page.listAuthorizationPolicies.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listAuthorizationPoliciesStream with error', async () => { + const client = new networksecurityModule.v1.NetworkSecurityClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.ListAuthorizationPoliciesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.ListAuthorizationPoliciesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.descriptors.page.listAuthorizationPolicies.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listAuthorizationPoliciesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.networksecurity.v1.AuthorizationPolicy[] = []; + stream.on('data', (response: protos.google.cloud.networksecurity.v1.AuthorizationPolicy) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listAuthorizationPolicies.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listAuthorizationPolicies, request)); + assert( + (client.descriptors.page.listAuthorizationPolicies.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listAuthorizationPolicies without error', async () => { + const client = new networksecurityModule.v1.NetworkSecurityClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.ListAuthorizationPoliciesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.ListAuthorizationPoliciesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.networksecurity.v1.AuthorizationPolicy()), + generateSampleMessage(new protos.google.cloud.networksecurity.v1.AuthorizationPolicy()), + generateSampleMessage(new protos.google.cloud.networksecurity.v1.AuthorizationPolicy()), + ]; + client.descriptors.page.listAuthorizationPolicies.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.networksecurity.v1.IAuthorizationPolicy[] = []; + const iterable = client.listAuthorizationPoliciesAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listAuthorizationPolicies.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listAuthorizationPolicies.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listAuthorizationPolicies with error', async () => { + const client = new networksecurityModule.v1.NetworkSecurityClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.ListAuthorizationPoliciesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.ListAuthorizationPoliciesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.descriptors.page.listAuthorizationPolicies.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listAuthorizationPoliciesAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.networksecurity.v1.IAuthorizationPolicy[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listAuthorizationPolicies.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listAuthorizationPolicies.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('listBackendAuthenticationConfigs', () => { + it('invokes listBackendAuthenticationConfigs without error', async () => { + const client = new networksecurityModule.v1.NetworkSecurityClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.ListBackendAuthenticationConfigsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.ListBackendAuthenticationConfigsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.networksecurity.v1.BackendAuthenticationConfig()), + generateSampleMessage(new protos.google.cloud.networksecurity.v1.BackendAuthenticationConfig()), + generateSampleMessage(new protos.google.cloud.networksecurity.v1.BackendAuthenticationConfig()), + ]; + client.innerApiCalls.listBackendAuthenticationConfigs = stubSimpleCall(expectedResponse); + const [response] = await client.listBackendAuthenticationConfigs(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listBackendAuthenticationConfigs as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listBackendAuthenticationConfigs as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listBackendAuthenticationConfigs without error using callback', async () => { + const client = new networksecurityModule.v1.NetworkSecurityClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.ListBackendAuthenticationConfigsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.ListBackendAuthenticationConfigsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.networksecurity.v1.BackendAuthenticationConfig()), + generateSampleMessage(new protos.google.cloud.networksecurity.v1.BackendAuthenticationConfig()), + generateSampleMessage(new protos.google.cloud.networksecurity.v1.BackendAuthenticationConfig()), + ]; + client.innerApiCalls.listBackendAuthenticationConfigs = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listBackendAuthenticationConfigs( + request, + (err?: Error|null, result?: protos.google.cloud.networksecurity.v1.IBackendAuthenticationConfig[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listBackendAuthenticationConfigs as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listBackendAuthenticationConfigs as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listBackendAuthenticationConfigs with error', async () => { + const client = new networksecurityModule.v1.NetworkSecurityClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.ListBackendAuthenticationConfigsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.ListBackendAuthenticationConfigsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.listBackendAuthenticationConfigs = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listBackendAuthenticationConfigs(request), expectedError); + const actualRequest = (client.innerApiCalls.listBackendAuthenticationConfigs as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listBackendAuthenticationConfigs as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listBackendAuthenticationConfigsStream without error', async () => { + const client = new networksecurityModule.v1.NetworkSecurityClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.ListBackendAuthenticationConfigsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.ListBackendAuthenticationConfigsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.networksecurity.v1.BackendAuthenticationConfig()), + generateSampleMessage(new protos.google.cloud.networksecurity.v1.BackendAuthenticationConfig()), + generateSampleMessage(new protos.google.cloud.networksecurity.v1.BackendAuthenticationConfig()), + ]; + client.descriptors.page.listBackendAuthenticationConfigs.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listBackendAuthenticationConfigsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.networksecurity.v1.BackendAuthenticationConfig[] = []; + stream.on('data', (response: protos.google.cloud.networksecurity.v1.BackendAuthenticationConfig) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert((client.descriptors.page.listBackendAuthenticationConfigs.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listBackendAuthenticationConfigs, request)); + assert( + (client.descriptors.page.listBackendAuthenticationConfigs.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listBackendAuthenticationConfigsStream with error', async () => { + const client = new networksecurityModule.v1.NetworkSecurityClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.ListBackendAuthenticationConfigsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.ListBackendAuthenticationConfigsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.descriptors.page.listBackendAuthenticationConfigs.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listBackendAuthenticationConfigsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.networksecurity.v1.BackendAuthenticationConfig[] = []; + stream.on('data', (response: protos.google.cloud.networksecurity.v1.BackendAuthenticationConfig) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listBackendAuthenticationConfigs.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listBackendAuthenticationConfigs, request)); + assert( + (client.descriptors.page.listBackendAuthenticationConfigs.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listBackendAuthenticationConfigs without error', async () => { + const client = new networksecurityModule.v1.NetworkSecurityClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.ListBackendAuthenticationConfigsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.ListBackendAuthenticationConfigsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.networksecurity.v1.BackendAuthenticationConfig()), + generateSampleMessage(new protos.google.cloud.networksecurity.v1.BackendAuthenticationConfig()), + generateSampleMessage(new protos.google.cloud.networksecurity.v1.BackendAuthenticationConfig()), + ]; + client.descriptors.page.listBackendAuthenticationConfigs.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.networksecurity.v1.IBackendAuthenticationConfig[] = []; + const iterable = client.listBackendAuthenticationConfigsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listBackendAuthenticationConfigs.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listBackendAuthenticationConfigs.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listBackendAuthenticationConfigs with error', async () => { + const client = new networksecurityModule.v1.NetworkSecurityClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.ListBackendAuthenticationConfigsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.ListBackendAuthenticationConfigsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.descriptors.page.listBackendAuthenticationConfigs.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listBackendAuthenticationConfigsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.networksecurity.v1.IBackendAuthenticationConfig[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listBackendAuthenticationConfigs.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listBackendAuthenticationConfigs.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('listServerTlsPolicies', () => { + it('invokes listServerTlsPolicies without error', async () => { + const client = new networksecurityModule.v1.NetworkSecurityClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.ListServerTlsPoliciesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.ListServerTlsPoliciesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.networksecurity.v1.ServerTlsPolicy()), + generateSampleMessage(new protos.google.cloud.networksecurity.v1.ServerTlsPolicy()), + generateSampleMessage(new protos.google.cloud.networksecurity.v1.ServerTlsPolicy()), + ]; + client.innerApiCalls.listServerTlsPolicies = stubSimpleCall(expectedResponse); + const [response] = await client.listServerTlsPolicies(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listServerTlsPolicies as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listServerTlsPolicies as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listServerTlsPolicies without error using callback', async () => { + const client = new networksecurityModule.v1.NetworkSecurityClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.ListServerTlsPoliciesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.ListServerTlsPoliciesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.networksecurity.v1.ServerTlsPolicy()), + generateSampleMessage(new protos.google.cloud.networksecurity.v1.ServerTlsPolicy()), + generateSampleMessage(new protos.google.cloud.networksecurity.v1.ServerTlsPolicy()), + ]; + client.innerApiCalls.listServerTlsPolicies = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listServerTlsPolicies( + request, + (err?: Error|null, result?: protos.google.cloud.networksecurity.v1.IServerTlsPolicy[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listServerTlsPolicies as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listServerTlsPolicies as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listServerTlsPolicies with error', async () => { + const client = new networksecurityModule.v1.NetworkSecurityClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.ListServerTlsPoliciesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.ListServerTlsPoliciesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.listServerTlsPolicies = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listServerTlsPolicies(request), expectedError); + const actualRequest = (client.innerApiCalls.listServerTlsPolicies as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listServerTlsPolicies as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listServerTlsPoliciesStream without error', async () => { + const client = new networksecurityModule.v1.NetworkSecurityClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.ListServerTlsPoliciesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.ListServerTlsPoliciesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.networksecurity.v1.ServerTlsPolicy()), + generateSampleMessage(new protos.google.cloud.networksecurity.v1.ServerTlsPolicy()), + generateSampleMessage(new protos.google.cloud.networksecurity.v1.ServerTlsPolicy()), + ]; + client.descriptors.page.listServerTlsPolicies.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listServerTlsPoliciesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.networksecurity.v1.ServerTlsPolicy[] = []; + stream.on('data', (response: protos.google.cloud.networksecurity.v1.ServerTlsPolicy) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert((client.descriptors.page.listServerTlsPolicies.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listServerTlsPolicies, request)); + assert( + (client.descriptors.page.listServerTlsPolicies.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listServerTlsPoliciesStream with error', async () => { + const client = new networksecurityModule.v1.NetworkSecurityClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.ListServerTlsPoliciesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.ListServerTlsPoliciesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.descriptors.page.listServerTlsPolicies.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listServerTlsPoliciesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.networksecurity.v1.ServerTlsPolicy[] = []; + stream.on('data', (response: protos.google.cloud.networksecurity.v1.ServerTlsPolicy) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listServerTlsPolicies.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listServerTlsPolicies, request)); + assert( + (client.descriptors.page.listServerTlsPolicies.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listServerTlsPolicies without error', async () => { + const client = new networksecurityModule.v1.NetworkSecurityClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.ListServerTlsPoliciesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.ListServerTlsPoliciesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.networksecurity.v1.ServerTlsPolicy()), + generateSampleMessage(new protos.google.cloud.networksecurity.v1.ServerTlsPolicy()), + generateSampleMessage(new protos.google.cloud.networksecurity.v1.ServerTlsPolicy()), + ]; + client.descriptors.page.listServerTlsPolicies.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.networksecurity.v1.IServerTlsPolicy[] = []; + const iterable = client.listServerTlsPoliciesAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listServerTlsPolicies.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listServerTlsPolicies.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listServerTlsPolicies with error', async () => { + const client = new networksecurityModule.v1.NetworkSecurityClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.ListServerTlsPoliciesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.ListServerTlsPoliciesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.descriptors.page.listServerTlsPolicies.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listServerTlsPoliciesAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.networksecurity.v1.IServerTlsPolicy[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listServerTlsPolicies.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listServerTlsPolicies.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('listClientTlsPolicies', () => { + it('invokes listClientTlsPolicies without error', async () => { + const client = new networksecurityModule.v1.NetworkSecurityClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.ListClientTlsPoliciesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.ListClientTlsPoliciesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.networksecurity.v1.ClientTlsPolicy()), + generateSampleMessage(new protos.google.cloud.networksecurity.v1.ClientTlsPolicy()), + generateSampleMessage(new protos.google.cloud.networksecurity.v1.ClientTlsPolicy()), + ]; + client.innerApiCalls.listClientTlsPolicies = stubSimpleCall(expectedResponse); + const [response] = await client.listClientTlsPolicies(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listClientTlsPolicies as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listClientTlsPolicies as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listClientTlsPolicies without error using callback', async () => { + const client = new networksecurityModule.v1.NetworkSecurityClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.ListClientTlsPoliciesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.ListClientTlsPoliciesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.networksecurity.v1.ClientTlsPolicy()), + generateSampleMessage(new protos.google.cloud.networksecurity.v1.ClientTlsPolicy()), + generateSampleMessage(new protos.google.cloud.networksecurity.v1.ClientTlsPolicy()), + ]; + client.innerApiCalls.listClientTlsPolicies = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listClientTlsPolicies( + request, + (err?: Error|null, result?: protos.google.cloud.networksecurity.v1.IClientTlsPolicy[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listClientTlsPolicies as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listClientTlsPolicies as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listClientTlsPolicies with error', async () => { + const client = new networksecurityModule.v1.NetworkSecurityClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.ListClientTlsPoliciesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.ListClientTlsPoliciesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.listClientTlsPolicies = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listClientTlsPolicies(request), expectedError); + const actualRequest = (client.innerApiCalls.listClientTlsPolicies as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listClientTlsPolicies as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listClientTlsPoliciesStream without error', async () => { + const client = new networksecurityModule.v1.NetworkSecurityClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.ListClientTlsPoliciesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.ListClientTlsPoliciesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.networksecurity.v1.ClientTlsPolicy()), + generateSampleMessage(new protos.google.cloud.networksecurity.v1.ClientTlsPolicy()), + generateSampleMessage(new protos.google.cloud.networksecurity.v1.ClientTlsPolicy()), + ]; + client.descriptors.page.listClientTlsPolicies.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listClientTlsPoliciesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.networksecurity.v1.ClientTlsPolicy[] = []; + stream.on('data', (response: protos.google.cloud.networksecurity.v1.ClientTlsPolicy) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert((client.descriptors.page.listClientTlsPolicies.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listClientTlsPolicies, request)); + assert( + (client.descriptors.page.listClientTlsPolicies.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listClientTlsPoliciesStream with error', async () => { + const client = new networksecurityModule.v1.NetworkSecurityClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.ListClientTlsPoliciesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.ListClientTlsPoliciesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.descriptors.page.listClientTlsPolicies.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listClientTlsPoliciesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.networksecurity.v1.ClientTlsPolicy[] = []; + stream.on('data', (response: protos.google.cloud.networksecurity.v1.ClientTlsPolicy) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listClientTlsPolicies.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listClientTlsPolicies, request)); + assert( + (client.descriptors.page.listClientTlsPolicies.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listClientTlsPolicies without error', async () => { + const client = new networksecurityModule.v1.NetworkSecurityClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.ListClientTlsPoliciesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.ListClientTlsPoliciesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.networksecurity.v1.ClientTlsPolicy()), + generateSampleMessage(new protos.google.cloud.networksecurity.v1.ClientTlsPolicy()), + generateSampleMessage(new protos.google.cloud.networksecurity.v1.ClientTlsPolicy()), + ]; + client.descriptors.page.listClientTlsPolicies.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.networksecurity.v1.IClientTlsPolicy[] = []; + const iterable = client.listClientTlsPoliciesAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listClientTlsPolicies.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listClientTlsPolicies.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listClientTlsPolicies with error', async () => { + const client = new networksecurityModule.v1.NetworkSecurityClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.ListClientTlsPoliciesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.ListClientTlsPoliciesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.descriptors.page.listClientTlsPolicies.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listClientTlsPoliciesAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.networksecurity.v1.IClientTlsPolicy[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listClientTlsPolicies.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listClientTlsPolicies.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('listGatewaySecurityPolicies', () => { + it('invokes listGatewaySecurityPolicies without error', async () => { + const client = new networksecurityModule.v1.NetworkSecurityClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.ListGatewaySecurityPoliciesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.ListGatewaySecurityPoliciesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.networksecurity.v1.GatewaySecurityPolicy()), + generateSampleMessage(new protos.google.cloud.networksecurity.v1.GatewaySecurityPolicy()), + generateSampleMessage(new protos.google.cloud.networksecurity.v1.GatewaySecurityPolicy()), + ]; + client.innerApiCalls.listGatewaySecurityPolicies = stubSimpleCall(expectedResponse); + const [response] = await client.listGatewaySecurityPolicies(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listGatewaySecurityPolicies as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listGatewaySecurityPolicies as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listGatewaySecurityPolicies without error using callback', async () => { + const client = new networksecurityModule.v1.NetworkSecurityClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.ListGatewaySecurityPoliciesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.ListGatewaySecurityPoliciesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.networksecurity.v1.GatewaySecurityPolicy()), + generateSampleMessage(new protos.google.cloud.networksecurity.v1.GatewaySecurityPolicy()), + generateSampleMessage(new protos.google.cloud.networksecurity.v1.GatewaySecurityPolicy()), + ]; + client.innerApiCalls.listGatewaySecurityPolicies = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listGatewaySecurityPolicies( + request, + (err?: Error|null, result?: protos.google.cloud.networksecurity.v1.IGatewaySecurityPolicy[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listGatewaySecurityPolicies as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listGatewaySecurityPolicies as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listGatewaySecurityPolicies with error', async () => { + const client = new networksecurityModule.v1.NetworkSecurityClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.ListGatewaySecurityPoliciesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.ListGatewaySecurityPoliciesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.listGatewaySecurityPolicies = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listGatewaySecurityPolicies(request), expectedError); + const actualRequest = (client.innerApiCalls.listGatewaySecurityPolicies as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listGatewaySecurityPolicies as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listGatewaySecurityPoliciesStream without error', async () => { + const client = new networksecurityModule.v1.NetworkSecurityClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.ListGatewaySecurityPoliciesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.ListGatewaySecurityPoliciesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.networksecurity.v1.GatewaySecurityPolicy()), + generateSampleMessage(new protos.google.cloud.networksecurity.v1.GatewaySecurityPolicy()), + generateSampleMessage(new protos.google.cloud.networksecurity.v1.GatewaySecurityPolicy()), + ]; + client.descriptors.page.listGatewaySecurityPolicies.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listGatewaySecurityPoliciesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.networksecurity.v1.GatewaySecurityPolicy[] = []; + stream.on('data', (response: protos.google.cloud.networksecurity.v1.GatewaySecurityPolicy) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert((client.descriptors.page.listGatewaySecurityPolicies.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listGatewaySecurityPolicies, request)); + assert( + (client.descriptors.page.listGatewaySecurityPolicies.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listGatewaySecurityPoliciesStream with error', async () => { + const client = new networksecurityModule.v1.NetworkSecurityClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.ListGatewaySecurityPoliciesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.ListGatewaySecurityPoliciesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.descriptors.page.listGatewaySecurityPolicies.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listGatewaySecurityPoliciesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.networksecurity.v1.GatewaySecurityPolicy[] = []; + stream.on('data', (response: protos.google.cloud.networksecurity.v1.GatewaySecurityPolicy) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listGatewaySecurityPolicies.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listGatewaySecurityPolicies, request)); + assert( + (client.descriptors.page.listGatewaySecurityPolicies.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listGatewaySecurityPolicies without error', async () => { + const client = new networksecurityModule.v1.NetworkSecurityClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.ListGatewaySecurityPoliciesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.ListGatewaySecurityPoliciesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.networksecurity.v1.GatewaySecurityPolicy()), + generateSampleMessage(new protos.google.cloud.networksecurity.v1.GatewaySecurityPolicy()), + generateSampleMessage(new protos.google.cloud.networksecurity.v1.GatewaySecurityPolicy()), + ]; + client.descriptors.page.listGatewaySecurityPolicies.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.networksecurity.v1.IGatewaySecurityPolicy[] = []; + const iterable = client.listGatewaySecurityPoliciesAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listGatewaySecurityPolicies.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listGatewaySecurityPolicies.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listGatewaySecurityPolicies with error', async () => { + const client = new networksecurityModule.v1.NetworkSecurityClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.ListGatewaySecurityPoliciesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.ListGatewaySecurityPoliciesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.descriptors.page.listGatewaySecurityPolicies.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listGatewaySecurityPoliciesAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.networksecurity.v1.IGatewaySecurityPolicy[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listGatewaySecurityPolicies.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listGatewaySecurityPolicies.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('listGatewaySecurityPolicyRules', () => { + it('invokes listGatewaySecurityPolicyRules without error', async () => { + const client = new networksecurityModule.v1.NetworkSecurityClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.ListGatewaySecurityPolicyRulesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.ListGatewaySecurityPolicyRulesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.networksecurity.v1.GatewaySecurityPolicyRule()), + generateSampleMessage(new protos.google.cloud.networksecurity.v1.GatewaySecurityPolicyRule()), + generateSampleMessage(new protos.google.cloud.networksecurity.v1.GatewaySecurityPolicyRule()), + ]; + client.innerApiCalls.listGatewaySecurityPolicyRules = stubSimpleCall(expectedResponse); + const [response] = await client.listGatewaySecurityPolicyRules(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listGatewaySecurityPolicyRules as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listGatewaySecurityPolicyRules as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listGatewaySecurityPolicyRules without error using callback', async () => { + const client = new networksecurityModule.v1.NetworkSecurityClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.ListGatewaySecurityPolicyRulesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.ListGatewaySecurityPolicyRulesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.networksecurity.v1.GatewaySecurityPolicyRule()), + generateSampleMessage(new protos.google.cloud.networksecurity.v1.GatewaySecurityPolicyRule()), + generateSampleMessage(new protos.google.cloud.networksecurity.v1.GatewaySecurityPolicyRule()), + ]; + client.innerApiCalls.listGatewaySecurityPolicyRules = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listGatewaySecurityPolicyRules( + request, + (err?: Error|null, result?: protos.google.cloud.networksecurity.v1.IGatewaySecurityPolicyRule[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listGatewaySecurityPolicyRules as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listGatewaySecurityPolicyRules as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listGatewaySecurityPolicyRules with error', async () => { + const client = new networksecurityModule.v1.NetworkSecurityClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.ListGatewaySecurityPolicyRulesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.ListGatewaySecurityPolicyRulesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.listGatewaySecurityPolicyRules = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listGatewaySecurityPolicyRules(request), expectedError); + const actualRequest = (client.innerApiCalls.listGatewaySecurityPolicyRules as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listGatewaySecurityPolicyRules as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listGatewaySecurityPolicyRulesStream without error', async () => { + const client = new networksecurityModule.v1.NetworkSecurityClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.ListGatewaySecurityPolicyRulesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.ListGatewaySecurityPolicyRulesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.networksecurity.v1.GatewaySecurityPolicyRule()), + generateSampleMessage(new protos.google.cloud.networksecurity.v1.GatewaySecurityPolicyRule()), + generateSampleMessage(new protos.google.cloud.networksecurity.v1.GatewaySecurityPolicyRule()), + ]; + client.descriptors.page.listGatewaySecurityPolicyRules.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listGatewaySecurityPolicyRulesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.networksecurity.v1.GatewaySecurityPolicyRule[] = []; + stream.on('data', (response: protos.google.cloud.networksecurity.v1.GatewaySecurityPolicyRule) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert((client.descriptors.page.listGatewaySecurityPolicyRules.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listGatewaySecurityPolicyRules, request)); + assert( + (client.descriptors.page.listGatewaySecurityPolicyRules.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listGatewaySecurityPolicyRulesStream with error', async () => { + const client = new networksecurityModule.v1.NetworkSecurityClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.ListGatewaySecurityPolicyRulesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.ListGatewaySecurityPolicyRulesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.descriptors.page.listGatewaySecurityPolicyRules.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listGatewaySecurityPolicyRulesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.networksecurity.v1.GatewaySecurityPolicyRule[] = []; + stream.on('data', (response: protos.google.cloud.networksecurity.v1.GatewaySecurityPolicyRule) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listGatewaySecurityPolicyRules.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listGatewaySecurityPolicyRules, request)); + assert( + (client.descriptors.page.listGatewaySecurityPolicyRules.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listGatewaySecurityPolicyRules without error', async () => { + const client = new networksecurityModule.v1.NetworkSecurityClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.ListGatewaySecurityPolicyRulesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.ListGatewaySecurityPolicyRulesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.networksecurity.v1.GatewaySecurityPolicyRule()), + generateSampleMessage(new protos.google.cloud.networksecurity.v1.GatewaySecurityPolicyRule()), + generateSampleMessage(new protos.google.cloud.networksecurity.v1.GatewaySecurityPolicyRule()), + ]; + client.descriptors.page.listGatewaySecurityPolicyRules.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.networksecurity.v1.IGatewaySecurityPolicyRule[] = []; + const iterable = client.listGatewaySecurityPolicyRulesAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listGatewaySecurityPolicyRules.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listGatewaySecurityPolicyRules.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listGatewaySecurityPolicyRules with error', async () => { + const client = new networksecurityModule.v1.NetworkSecurityClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.ListGatewaySecurityPolicyRulesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.ListGatewaySecurityPolicyRulesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.descriptors.page.listGatewaySecurityPolicyRules.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listGatewaySecurityPolicyRulesAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.networksecurity.v1.IGatewaySecurityPolicyRule[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listGatewaySecurityPolicyRules.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listGatewaySecurityPolicyRules.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('listUrlLists', () => { + it('invokes listUrlLists without error', async () => { + const client = new networksecurityModule.v1.NetworkSecurityClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.ListUrlListsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.ListUrlListsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.networksecurity.v1.UrlList()), + generateSampleMessage(new protos.google.cloud.networksecurity.v1.UrlList()), + generateSampleMessage(new protos.google.cloud.networksecurity.v1.UrlList()), + ]; + client.innerApiCalls.listUrlLists = stubSimpleCall(expectedResponse); + const [response] = await client.listUrlLists(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listUrlLists as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listUrlLists as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listUrlLists without error using callback', async () => { + const client = new networksecurityModule.v1.NetworkSecurityClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.ListUrlListsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.ListUrlListsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.networksecurity.v1.UrlList()), + generateSampleMessage(new protos.google.cloud.networksecurity.v1.UrlList()), + generateSampleMessage(new protos.google.cloud.networksecurity.v1.UrlList()), + ]; + client.innerApiCalls.listUrlLists = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listUrlLists( + request, + (err?: Error|null, result?: protos.google.cloud.networksecurity.v1.IUrlList[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listUrlLists as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listUrlLists as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listUrlLists with error', async () => { + const client = new networksecurityModule.v1.NetworkSecurityClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.ListUrlListsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.ListUrlListsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.listUrlLists = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listUrlLists(request), expectedError); + const actualRequest = (client.innerApiCalls.listUrlLists as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listUrlLists as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listUrlListsStream without error', async () => { + const client = new networksecurityModule.v1.NetworkSecurityClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.ListUrlListsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.ListUrlListsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.networksecurity.v1.UrlList()), + generateSampleMessage(new protos.google.cloud.networksecurity.v1.UrlList()), + generateSampleMessage(new protos.google.cloud.networksecurity.v1.UrlList()), + ]; + client.descriptors.page.listUrlLists.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listUrlListsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.networksecurity.v1.UrlList[] = []; + stream.on('data', (response: protos.google.cloud.networksecurity.v1.UrlList) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert((client.descriptors.page.listUrlLists.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listUrlLists, request)); + assert( + (client.descriptors.page.listUrlLists.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listUrlListsStream with error', async () => { + const client = new networksecurityModule.v1.NetworkSecurityClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.ListUrlListsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.ListUrlListsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.descriptors.page.listUrlLists.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listUrlListsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.networksecurity.v1.UrlList[] = []; + stream.on('data', (response: protos.google.cloud.networksecurity.v1.UrlList) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listUrlLists.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listUrlLists, request)); + assert( + (client.descriptors.page.listUrlLists.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listUrlLists without error', async () => { + const client = new networksecurityModule.v1.NetworkSecurityClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.ListUrlListsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.ListUrlListsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.networksecurity.v1.UrlList()), + generateSampleMessage(new protos.google.cloud.networksecurity.v1.UrlList()), + generateSampleMessage(new protos.google.cloud.networksecurity.v1.UrlList()), + ]; + client.descriptors.page.listUrlLists.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.networksecurity.v1.IUrlList[] = []; + const iterable = client.listUrlListsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listUrlLists.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listUrlLists.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listUrlLists with error', async () => { + const client = new networksecurityModule.v1.NetworkSecurityClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.ListUrlListsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.ListUrlListsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.descriptors.page.listUrlLists.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listUrlListsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.networksecurity.v1.IUrlList[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listUrlLists.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listUrlLists.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('listTlsInspectionPolicies', () => { + it('invokes listTlsInspectionPolicies without error', async () => { + const client = new networksecurityModule.v1.NetworkSecurityClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.ListTlsInspectionPoliciesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.ListTlsInspectionPoliciesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.networksecurity.v1.TlsInspectionPolicy()), + generateSampleMessage(new protos.google.cloud.networksecurity.v1.TlsInspectionPolicy()), + generateSampleMessage(new protos.google.cloud.networksecurity.v1.TlsInspectionPolicy()), + ]; + client.innerApiCalls.listTlsInspectionPolicies = stubSimpleCall(expectedResponse); + const [response] = await client.listTlsInspectionPolicies(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listTlsInspectionPolicies as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listTlsInspectionPolicies as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listTlsInspectionPolicies without error using callback', async () => { + const client = new networksecurityModule.v1.NetworkSecurityClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.ListTlsInspectionPoliciesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.ListTlsInspectionPoliciesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.networksecurity.v1.TlsInspectionPolicy()), + generateSampleMessage(new protos.google.cloud.networksecurity.v1.TlsInspectionPolicy()), + generateSampleMessage(new protos.google.cloud.networksecurity.v1.TlsInspectionPolicy()), + ]; + client.innerApiCalls.listTlsInspectionPolicies = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listTlsInspectionPolicies( + request, + (err?: Error|null, result?: protos.google.cloud.networksecurity.v1.ITlsInspectionPolicy[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listTlsInspectionPolicies as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listTlsInspectionPolicies as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listTlsInspectionPolicies with error', async () => { + const client = new networksecurityModule.v1.NetworkSecurityClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.ListTlsInspectionPoliciesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.ListTlsInspectionPoliciesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.listTlsInspectionPolicies = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listTlsInspectionPolicies(request), expectedError); + const actualRequest = (client.innerApiCalls.listTlsInspectionPolicies as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listTlsInspectionPolicies as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listTlsInspectionPoliciesStream without error', async () => { + const client = new networksecurityModule.v1.NetworkSecurityClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.ListTlsInspectionPoliciesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.ListTlsInspectionPoliciesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.networksecurity.v1.TlsInspectionPolicy()), + generateSampleMessage(new protos.google.cloud.networksecurity.v1.TlsInspectionPolicy()), + generateSampleMessage(new protos.google.cloud.networksecurity.v1.TlsInspectionPolicy()), + ]; + client.descriptors.page.listTlsInspectionPolicies.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listTlsInspectionPoliciesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.networksecurity.v1.TlsInspectionPolicy[] = []; + stream.on('data', (response: protos.google.cloud.networksecurity.v1.TlsInspectionPolicy) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert((client.descriptors.page.listTlsInspectionPolicies.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listTlsInspectionPolicies, request)); + assert( + (client.descriptors.page.listTlsInspectionPolicies.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listTlsInspectionPoliciesStream with error', async () => { + const client = new networksecurityModule.v1.NetworkSecurityClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.ListTlsInspectionPoliciesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.ListTlsInspectionPoliciesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.descriptors.page.listTlsInspectionPolicies.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listTlsInspectionPoliciesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.networksecurity.v1.TlsInspectionPolicy[] = []; + stream.on('data', (response: protos.google.cloud.networksecurity.v1.TlsInspectionPolicy) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listTlsInspectionPolicies.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listTlsInspectionPolicies, request)); + assert( + (client.descriptors.page.listTlsInspectionPolicies.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listTlsInspectionPolicies without error', async () => { + const client = new networksecurityModule.v1.NetworkSecurityClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.ListTlsInspectionPoliciesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.ListTlsInspectionPoliciesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.networksecurity.v1.TlsInspectionPolicy()), + generateSampleMessage(new protos.google.cloud.networksecurity.v1.TlsInspectionPolicy()), + generateSampleMessage(new protos.google.cloud.networksecurity.v1.TlsInspectionPolicy()), + ]; + client.descriptors.page.listTlsInspectionPolicies.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.networksecurity.v1.ITlsInspectionPolicy[] = []; + const iterable = client.listTlsInspectionPoliciesAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listTlsInspectionPolicies.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listTlsInspectionPolicies.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listTlsInspectionPolicies with error', async () => { + const client = new networksecurityModule.v1.NetworkSecurityClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.ListTlsInspectionPoliciesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.ListTlsInspectionPoliciesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.descriptors.page.listTlsInspectionPolicies.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listTlsInspectionPoliciesAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.networksecurity.v1.ITlsInspectionPolicy[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listTlsInspectionPolicies.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listTlsInspectionPolicies.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('listAuthzPolicies', () => { + it('invokes listAuthzPolicies without error', async () => { + const client = new networksecurityModule.v1.NetworkSecurityClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.ListAuthzPoliciesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.ListAuthzPoliciesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.networksecurity.v1.AuthzPolicy()), + generateSampleMessage(new protos.google.cloud.networksecurity.v1.AuthzPolicy()), + generateSampleMessage(new protos.google.cloud.networksecurity.v1.AuthzPolicy()), + ]; + client.innerApiCalls.listAuthzPolicies = stubSimpleCall(expectedResponse); + const [response] = await client.listAuthzPolicies(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listAuthzPolicies as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listAuthzPolicies as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listAuthzPolicies without error using callback', async () => { + const client = new networksecurityModule.v1.NetworkSecurityClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.ListAuthzPoliciesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.ListAuthzPoliciesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.networksecurity.v1.AuthzPolicy()), + generateSampleMessage(new protos.google.cloud.networksecurity.v1.AuthzPolicy()), + generateSampleMessage(new protos.google.cloud.networksecurity.v1.AuthzPolicy()), + ]; + client.innerApiCalls.listAuthzPolicies = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listAuthzPolicies( + request, + (err?: Error|null, result?: protos.google.cloud.networksecurity.v1.IAuthzPolicy[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listAuthzPolicies as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listAuthzPolicies as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listAuthzPolicies with error', async () => { + const client = new networksecurityModule.v1.NetworkSecurityClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.ListAuthzPoliciesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.ListAuthzPoliciesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.listAuthzPolicies = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listAuthzPolicies(request), expectedError); + const actualRequest = (client.innerApiCalls.listAuthzPolicies as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listAuthzPolicies as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listAuthzPoliciesStream without error', async () => { + const client = new networksecurityModule.v1.NetworkSecurityClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.ListAuthzPoliciesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.ListAuthzPoliciesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.networksecurity.v1.AuthzPolicy()), + generateSampleMessage(new protos.google.cloud.networksecurity.v1.AuthzPolicy()), + generateSampleMessage(new protos.google.cloud.networksecurity.v1.AuthzPolicy()), + ]; + client.descriptors.page.listAuthzPolicies.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listAuthzPoliciesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.networksecurity.v1.AuthzPolicy[] = []; + stream.on('data', (response: protos.google.cloud.networksecurity.v1.AuthzPolicy) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert((client.descriptors.page.listAuthzPolicies.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listAuthzPolicies, request)); + assert( + (client.descriptors.page.listAuthzPolicies.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listAuthzPoliciesStream with error', async () => { + const client = new networksecurityModule.v1.NetworkSecurityClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.ListAuthzPoliciesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.ListAuthzPoliciesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.descriptors.page.listAuthzPolicies.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listAuthzPoliciesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.networksecurity.v1.AuthzPolicy[] = []; + stream.on('data', (response: protos.google.cloud.networksecurity.v1.AuthzPolicy) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listAuthzPolicies.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listAuthzPolicies, request)); + assert( + (client.descriptors.page.listAuthzPolicies.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listAuthzPolicies without error', async () => { + const client = new networksecurityModule.v1.NetworkSecurityClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.ListAuthzPoliciesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.ListAuthzPoliciesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.networksecurity.v1.AuthzPolicy()), + generateSampleMessage(new protos.google.cloud.networksecurity.v1.AuthzPolicy()), + generateSampleMessage(new protos.google.cloud.networksecurity.v1.AuthzPolicy()), + ]; + client.descriptors.page.listAuthzPolicies.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.networksecurity.v1.IAuthzPolicy[] = []; + const iterable = client.listAuthzPoliciesAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listAuthzPolicies.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listAuthzPolicies.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listAuthzPolicies with error', async () => { + const client = new networksecurityModule.v1.NetworkSecurityClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.ListAuthzPoliciesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.ListAuthzPoliciesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.descriptors.page.listAuthzPolicies.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listAuthzPoliciesAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.networksecurity.v1.IAuthzPolicy[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listAuthzPolicies.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listAuthzPolicies.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + describe('getIamPolicy', () => { + it('invokes getIamPolicy without error', async () => { + const client = new networksecurityModule.v1.NetworkSecurityClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.GetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy() + ); + client.iamClient.getIamPolicy = stubSimpleCall(expectedResponse); + const response = await client.getIamPolicy(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.iamClient.getIamPolicy as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + it('invokes getIamPolicy without error using callback', async () => { + const client = new networksecurityModule.v1.NetworkSecurityClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.GetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy() + ); + client.iamClient.getIamPolicy = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getIamPolicy( + request, + expectedOptions, + (err?: Error|null, result?: IamProtos.google.iam.v1.Policy|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }).catch(err => {throw err}); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.iamClient.getIamPolicy as SinonStub) + .getCall(0)); + }); + it('invokes getIamPolicy with error', async () => { + const client = new networksecurityModule.v1.NetworkSecurityClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.GetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.iamClient.getIamPolicy = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getIamPolicy(request, expectedOptions), expectedError); + assert((client.iamClient.getIamPolicy as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + }); + describe('setIamPolicy', () => { + it('invokes setIamPolicy without error', async () => { + const client = new networksecurityModule.v1.NetworkSecurityClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.SetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy() + ); + client.iamClient.setIamPolicy = stubSimpleCall(expectedResponse); + const response = await client.setIamPolicy(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.iamClient.setIamPolicy as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + it('invokes setIamPolicy without error using callback', async () => { + const client = new networksecurityModule.v1.NetworkSecurityClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.SetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy() + ); + client.iamClient.setIamPolicy = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.setIamPolicy( + request, + expectedOptions, + (err?: Error|null, result?: IamProtos.google.iam.v1.Policy|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }).catch(err => {throw err}); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.iamClient.setIamPolicy as SinonStub) + .getCall(0)); + }); + it('invokes setIamPolicy with error', async () => { + const client = new networksecurityModule.v1.NetworkSecurityClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.SetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.iamClient.setIamPolicy = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.setIamPolicy(request, expectedOptions), expectedError); + assert((client.iamClient.setIamPolicy as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + }); + describe('testIamPermissions', () => { + it('invokes testIamPermissions without error', async () => { + const client = new networksecurityModule.v1.NetworkSecurityClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsResponse() + ); + client.iamClient.testIamPermissions = stubSimpleCall(expectedResponse); + const response = await client.testIamPermissions(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.iamClient.testIamPermissions as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + it('invokes testIamPermissions without error using callback', async () => { + const client = new networksecurityModule.v1.NetworkSecurityClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsResponse() + ); + client.iamClient.testIamPermissions = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.testIamPermissions( + request, + expectedOptions, + (err?: Error|null, result?: IamProtos.google.iam.v1.TestIamPermissionsResponse|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }).catch(err => {throw err}); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.iamClient.testIamPermissions as SinonStub) + .getCall(0)); + }); + it('invokes testIamPermissions with error', async () => { + const client = new networksecurityModule.v1.NetworkSecurityClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.iamClient.testIamPermissions = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.testIamPermissions(request, expectedOptions), expectedError); + assert((client.iamClient.testIamPermissions as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + }); + describe('getLocation', () => { + it('invokes getLocation without error', async () => { + const client = new networksecurityModule.v1.NetworkSecurityClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ); + client.locationsClient.getLocation = stubSimpleCall(expectedResponse); + const response = await client.getLocation(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.locationsClient.getLocation as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + it('invokes getLocation without error using callback', async () => { + const client = new networksecurityModule.v1.NetworkSecurityClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ); + client.locationsClient.getLocation = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getLocation( + request, + expectedOptions, + ( + err?: Error | null, + result?: LocationProtos.google.cloud.location.ILocation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.locationsClient.getLocation as SinonStub) + .getCall(0)); + }); + it('invokes getLocation with error', async () => { + const client = new networksecurityModule.v1.NetworkSecurityClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.locationsClient.getLocation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getLocation(request, expectedOptions), expectedError); + assert((client.locationsClient.getLocation as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + }); + describe('listLocationsAsync', () => { + it('uses async iteration with listLocations without error', async () => { + const client = new networksecurityModule.v1.NetworkSecurityClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.ListLocationsRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedResponse = [ + generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ), + generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ), + generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ), + ]; + client.locationsClient.descriptors.page.listLocations.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: LocationProtos.google.cloud.location.ILocation[] = []; + const iterable = client.listLocationsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + it('uses async iteration with listLocations with error', async () => { + const client = new networksecurityModule.v1.NetworkSecurityClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.ListLocationsRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedError = new Error('expected'); + client.locationsClient.descriptors.page.listLocations.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listLocationsAsync(request); + await assert.rejects(async () => { + const responses: LocationProtos.google.cloud.location.ILocation[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + describe('getOperation', () => { + it('invokes getOperation without error', async () => { + const client = new networksecurityModule.v1.NetworkSecurityClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.GetOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const response = await client.getOperation(request); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0).calledWith(request) + ); + }); + it('invokes getOperation without error using callback', async () => { + const client = new networksecurityModule.v1.NetworkSecurityClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.GetOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + client.operationsClient.getOperation = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.operationsClient.getOperation( + request, + undefined, + ( + err?: Error | null, + result?: operationsProtos.google.longrunning.Operation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }).catch(err => {throw err}); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + it('invokes getOperation with error', async () => { + const client = new networksecurityModule.v1.NetworkSecurityClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.GetOperationRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(async () => {await client.getOperation(request)}, expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0).calledWith(request)); + }); + }); + describe('cancelOperation', () => { + it('invokes cancelOperation without error', async () => { + const client = new networksecurityModule.v1.NetworkSecurityClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.CancelOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.cancelOperation = stubSimpleCall(expectedResponse); + const response = await client.cancelOperation(request); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.operationsClient.cancelOperation as SinonStub) + .getCall(0).calledWith(request) + ); + }); + it('invokes cancelOperation without error using callback', async () => { + const client = new networksecurityModule.v1.NetworkSecurityClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.CancelOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.cancelOperation = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.operationsClient.cancelOperation( + request, + undefined, + ( + err?: Error | null, + result?: protos.google.protobuf.Empty | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }).catch(err => {throw err}); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.operationsClient.cancelOperation as SinonStub) + .getCall(0)); + }); + it('invokes cancelOperation with error', async () => { + const client = new networksecurityModule.v1.NetworkSecurityClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.CancelOperationRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.cancelOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(async () => {await client.cancelOperation(request)}, expectedError); + assert((client.operationsClient.cancelOperation as SinonStub) + .getCall(0).calledWith(request)); + }); + }); + describe('deleteOperation', () => { + it('invokes deleteOperation without error', async () => { + const client = new networksecurityModule.v1.NetworkSecurityClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.DeleteOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.deleteOperation = stubSimpleCall(expectedResponse); + const response = await client.deleteOperation(request); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.operationsClient.deleteOperation as SinonStub) + .getCall(0).calledWith(request) + ); + }); + it('invokes deleteOperation without error using callback', async () => { + const client = new networksecurityModule.v1.NetworkSecurityClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.DeleteOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.deleteOperation = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.operationsClient.deleteOperation( + request, + undefined, + ( + err?: Error | null, + result?: protos.google.protobuf.Empty | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }).catch(err => {throw err}); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.operationsClient.deleteOperation as SinonStub) + .getCall(0)); + }); + it('invokes deleteOperation with error', async () => { + const client = new networksecurityModule.v1.NetworkSecurityClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.DeleteOperationRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.deleteOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(async () => {await client.deleteOperation(request)}, expectedError); + assert((client.operationsClient.deleteOperation as SinonStub) + .getCall(0).calledWith(request)); + }); + }); + describe('listOperationsAsync', () => { + it('uses async iteration with listOperations without error', async () => { + const client = new networksecurityModule.v1.NetworkSecurityClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsRequest() + ); + const expectedResponse = [ + generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsResponse() + ), + generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsResponse() + ), + generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsResponse() + ), + ]; + client.operationsClient.descriptor.listOperations.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: operationsProtos.google.longrunning.IOperation[] = []; + const iterable = client.operationsClient.listOperationsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.operationsClient.descriptor.listOperations.asyncIterate as SinonStub) + .getCall(0).args[1], request); + }); + it('uses async iteration with listOperations with error', async () => { + const client = new networksecurityModule.v1.NetworkSecurityClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.descriptor.listOperations.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.operationsClient.listOperationsAsync(request); + await assert.rejects(async () => { + const responses: operationsProtos.google.longrunning.IOperation[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.operationsClient.descriptor.listOperations.asyncIterate as SinonStub) + .getCall(0).args[1], request); + }); + }); + + describe('Path templates', () => { + + describe('authorizationPolicy', async () => { + const fakePath = "/rendered/path/authorizationPolicy"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + authorization_policy: "authorizationPolicyValue", + }; + const client = new networksecurityModule.v1.NetworkSecurityClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.authorizationPolicyPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.authorizationPolicyPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('authorizationPolicyPath', () => { + const result = client.authorizationPolicyPath("projectValue", "locationValue", "authorizationPolicyValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.authorizationPolicyPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromAuthorizationPolicyName', () => { + const result = client.matchProjectFromAuthorizationPolicyName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.authorizationPolicyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromAuthorizationPolicyName', () => { + const result = client.matchLocationFromAuthorizationPolicyName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.authorizationPolicyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchAuthorizationPolicyFromAuthorizationPolicyName', () => { + const result = client.matchAuthorizationPolicyFromAuthorizationPolicyName(fakePath); + assert.strictEqual(result, "authorizationPolicyValue"); + assert((client.pathTemplates.authorizationPolicyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('authzPolicy', async () => { + const fakePath = "/rendered/path/authzPolicy"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + authz_policy: "authzPolicyValue", + }; + const client = new networksecurityModule.v1.NetworkSecurityClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.authzPolicyPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.authzPolicyPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('authzPolicyPath', () => { + const result = client.authzPolicyPath("projectValue", "locationValue", "authzPolicyValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.authzPolicyPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromAuthzPolicyName', () => { + const result = client.matchProjectFromAuthzPolicyName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.authzPolicyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromAuthzPolicyName', () => { + const result = client.matchLocationFromAuthzPolicyName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.authzPolicyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchAuthzPolicyFromAuthzPolicyName', () => { + const result = client.matchAuthzPolicyFromAuthzPolicyName(fakePath); + assert.strictEqual(result, "authzPolicyValue"); + assert((client.pathTemplates.authzPolicyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('backendAuthenticationConfig', async () => { + const fakePath = "/rendered/path/backendAuthenticationConfig"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + backend_authentication_config: "backendAuthenticationConfigValue", + }; + const client = new networksecurityModule.v1.NetworkSecurityClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.backendAuthenticationConfigPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.backendAuthenticationConfigPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('backendAuthenticationConfigPath', () => { + const result = client.backendAuthenticationConfigPath("projectValue", "locationValue", "backendAuthenticationConfigValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.backendAuthenticationConfigPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromBackendAuthenticationConfigName', () => { + const result = client.matchProjectFromBackendAuthenticationConfigName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.backendAuthenticationConfigPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromBackendAuthenticationConfigName', () => { + const result = client.matchLocationFromBackendAuthenticationConfigName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.backendAuthenticationConfigPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchBackendAuthenticationConfigFromBackendAuthenticationConfigName', () => { + const result = client.matchBackendAuthenticationConfigFromBackendAuthenticationConfigName(fakePath); + assert.strictEqual(result, "backendAuthenticationConfigValue"); + assert((client.pathTemplates.backendAuthenticationConfigPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('clientTlsPolicy', async () => { + const fakePath = "/rendered/path/clientTlsPolicy"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + client_tls_policy: "clientTlsPolicyValue", + }; + const client = new networksecurityModule.v1.NetworkSecurityClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.clientTlsPolicyPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.clientTlsPolicyPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('clientTlsPolicyPath', () => { + const result = client.clientTlsPolicyPath("projectValue", "locationValue", "clientTlsPolicyValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.clientTlsPolicyPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromClientTlsPolicyName', () => { + const result = client.matchProjectFromClientTlsPolicyName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.clientTlsPolicyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromClientTlsPolicyName', () => { + const result = client.matchLocationFromClientTlsPolicyName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.clientTlsPolicyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchClientTlsPolicyFromClientTlsPolicyName', () => { + const result = client.matchClientTlsPolicyFromClientTlsPolicyName(fakePath); + assert.strictEqual(result, "clientTlsPolicyValue"); + assert((client.pathTemplates.clientTlsPolicyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('dnsThreatDetector', async () => { + const fakePath = "/rendered/path/dnsThreatDetector"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + dns_threat_detector: "dnsThreatDetectorValue", + }; + const client = new networksecurityModule.v1.NetworkSecurityClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.dnsThreatDetectorPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.dnsThreatDetectorPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('dnsThreatDetectorPath', () => { + const result = client.dnsThreatDetectorPath("projectValue", "locationValue", "dnsThreatDetectorValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.dnsThreatDetectorPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromDnsThreatDetectorName', () => { + const result = client.matchProjectFromDnsThreatDetectorName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.dnsThreatDetectorPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromDnsThreatDetectorName', () => { + const result = client.matchLocationFromDnsThreatDetectorName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.dnsThreatDetectorPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDnsThreatDetectorFromDnsThreatDetectorName', () => { + const result = client.matchDnsThreatDetectorFromDnsThreatDetectorName(fakePath); + assert.strictEqual(result, "dnsThreatDetectorValue"); + assert((client.pathTemplates.dnsThreatDetectorPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('firewallEndpointAssociation', async () => { + const fakePath = "/rendered/path/firewallEndpointAssociation"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + firewall_endpoint_association: "firewallEndpointAssociationValue", + }; + const client = new networksecurityModule.v1.NetworkSecurityClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.firewallEndpointAssociationPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.firewallEndpointAssociationPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('firewallEndpointAssociationPath', () => { + const result = client.firewallEndpointAssociationPath("projectValue", "locationValue", "firewallEndpointAssociationValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.firewallEndpointAssociationPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromFirewallEndpointAssociationName', () => { + const result = client.matchProjectFromFirewallEndpointAssociationName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.firewallEndpointAssociationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromFirewallEndpointAssociationName', () => { + const result = client.matchLocationFromFirewallEndpointAssociationName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.firewallEndpointAssociationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchFirewallEndpointAssociationFromFirewallEndpointAssociationName', () => { + const result = client.matchFirewallEndpointAssociationFromFirewallEndpointAssociationName(fakePath); + assert.strictEqual(result, "firewallEndpointAssociationValue"); + assert((client.pathTemplates.firewallEndpointAssociationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('gatewaySecurityPolicy', async () => { + const fakePath = "/rendered/path/gatewaySecurityPolicy"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + gateway_security_policy: "gatewaySecurityPolicyValue", + }; + const client = new networksecurityModule.v1.NetworkSecurityClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.gatewaySecurityPolicyPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.gatewaySecurityPolicyPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('gatewaySecurityPolicyPath', () => { + const result = client.gatewaySecurityPolicyPath("projectValue", "locationValue", "gatewaySecurityPolicyValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.gatewaySecurityPolicyPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromGatewaySecurityPolicyName', () => { + const result = client.matchProjectFromGatewaySecurityPolicyName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.gatewaySecurityPolicyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromGatewaySecurityPolicyName', () => { + const result = client.matchLocationFromGatewaySecurityPolicyName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.gatewaySecurityPolicyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchGatewaySecurityPolicyFromGatewaySecurityPolicyName', () => { + const result = client.matchGatewaySecurityPolicyFromGatewaySecurityPolicyName(fakePath); + assert.strictEqual(result, "gatewaySecurityPolicyValue"); + assert((client.pathTemplates.gatewaySecurityPolicyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('gatewaySecurityPolicyRule', async () => { + const fakePath = "/rendered/path/gatewaySecurityPolicyRule"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + gateway_security_policy: "gatewaySecurityPolicyValue", + rule: "ruleValue", + }; + const client = new networksecurityModule.v1.NetworkSecurityClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.gatewaySecurityPolicyRulePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.gatewaySecurityPolicyRulePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('gatewaySecurityPolicyRulePath', () => { + const result = client.gatewaySecurityPolicyRulePath("projectValue", "locationValue", "gatewaySecurityPolicyValue", "ruleValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.gatewaySecurityPolicyRulePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromGatewaySecurityPolicyRuleName', () => { + const result = client.matchProjectFromGatewaySecurityPolicyRuleName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.gatewaySecurityPolicyRulePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromGatewaySecurityPolicyRuleName', () => { + const result = client.matchLocationFromGatewaySecurityPolicyRuleName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.gatewaySecurityPolicyRulePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchGatewaySecurityPolicyFromGatewaySecurityPolicyRuleName', () => { + const result = client.matchGatewaySecurityPolicyFromGatewaySecurityPolicyRuleName(fakePath); + assert.strictEqual(result, "gatewaySecurityPolicyValue"); + assert((client.pathTemplates.gatewaySecurityPolicyRulePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchRuleFromGatewaySecurityPolicyRuleName', () => { + const result = client.matchRuleFromGatewaySecurityPolicyRuleName(fakePath); + assert.strictEqual(result, "ruleValue"); + assert((client.pathTemplates.gatewaySecurityPolicyRulePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('interceptDeployment', async () => { + const fakePath = "/rendered/path/interceptDeployment"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + intercept_deployment: "interceptDeploymentValue", + }; + const client = new networksecurityModule.v1.NetworkSecurityClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.interceptDeploymentPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.interceptDeploymentPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('interceptDeploymentPath', () => { + const result = client.interceptDeploymentPath("projectValue", "locationValue", "interceptDeploymentValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.interceptDeploymentPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromInterceptDeploymentName', () => { + const result = client.matchProjectFromInterceptDeploymentName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.interceptDeploymentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromInterceptDeploymentName', () => { + const result = client.matchLocationFromInterceptDeploymentName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.interceptDeploymentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchInterceptDeploymentFromInterceptDeploymentName', () => { + const result = client.matchInterceptDeploymentFromInterceptDeploymentName(fakePath); + assert.strictEqual(result, "interceptDeploymentValue"); + assert((client.pathTemplates.interceptDeploymentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('interceptDeploymentGroup', async () => { + const fakePath = "/rendered/path/interceptDeploymentGroup"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + intercept_deployment_group: "interceptDeploymentGroupValue", + }; + const client = new networksecurityModule.v1.NetworkSecurityClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.interceptDeploymentGroupPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.interceptDeploymentGroupPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('interceptDeploymentGroupPath', () => { + const result = client.interceptDeploymentGroupPath("projectValue", "locationValue", "interceptDeploymentGroupValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.interceptDeploymentGroupPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromInterceptDeploymentGroupName', () => { + const result = client.matchProjectFromInterceptDeploymentGroupName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.interceptDeploymentGroupPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromInterceptDeploymentGroupName', () => { + const result = client.matchLocationFromInterceptDeploymentGroupName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.interceptDeploymentGroupPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchInterceptDeploymentGroupFromInterceptDeploymentGroupName', () => { + const result = client.matchInterceptDeploymentGroupFromInterceptDeploymentGroupName(fakePath); + assert.strictEqual(result, "interceptDeploymentGroupValue"); + assert((client.pathTemplates.interceptDeploymentGroupPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('interceptEndpointGroup', async () => { + const fakePath = "/rendered/path/interceptEndpointGroup"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + intercept_endpoint_group: "interceptEndpointGroupValue", + }; + const client = new networksecurityModule.v1.NetworkSecurityClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.interceptEndpointGroupPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.interceptEndpointGroupPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('interceptEndpointGroupPath', () => { + const result = client.interceptEndpointGroupPath("projectValue", "locationValue", "interceptEndpointGroupValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.interceptEndpointGroupPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromInterceptEndpointGroupName', () => { + const result = client.matchProjectFromInterceptEndpointGroupName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.interceptEndpointGroupPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromInterceptEndpointGroupName', () => { + const result = client.matchLocationFromInterceptEndpointGroupName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.interceptEndpointGroupPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchInterceptEndpointGroupFromInterceptEndpointGroupName', () => { + const result = client.matchInterceptEndpointGroupFromInterceptEndpointGroupName(fakePath); + assert.strictEqual(result, "interceptEndpointGroupValue"); + assert((client.pathTemplates.interceptEndpointGroupPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('interceptEndpointGroupAssociation', async () => { + const fakePath = "/rendered/path/interceptEndpointGroupAssociation"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + intercept_endpoint_group_association: "interceptEndpointGroupAssociationValue", + }; + const client = new networksecurityModule.v1.NetworkSecurityClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.interceptEndpointGroupAssociationPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.interceptEndpointGroupAssociationPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('interceptEndpointGroupAssociationPath', () => { + const result = client.interceptEndpointGroupAssociationPath("projectValue", "locationValue", "interceptEndpointGroupAssociationValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.interceptEndpointGroupAssociationPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromInterceptEndpointGroupAssociationName', () => { + const result = client.matchProjectFromInterceptEndpointGroupAssociationName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.interceptEndpointGroupAssociationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromInterceptEndpointGroupAssociationName', () => { + const result = client.matchLocationFromInterceptEndpointGroupAssociationName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.interceptEndpointGroupAssociationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchInterceptEndpointGroupAssociationFromInterceptEndpointGroupAssociationName', () => { + const result = client.matchInterceptEndpointGroupAssociationFromInterceptEndpointGroupAssociationName(fakePath); + assert.strictEqual(result, "interceptEndpointGroupAssociationValue"); + assert((client.pathTemplates.interceptEndpointGroupAssociationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('mirroringDeployment', async () => { + const fakePath = "/rendered/path/mirroringDeployment"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + mirroring_deployment: "mirroringDeploymentValue", + }; + const client = new networksecurityModule.v1.NetworkSecurityClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.mirroringDeploymentPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.mirroringDeploymentPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('mirroringDeploymentPath', () => { + const result = client.mirroringDeploymentPath("projectValue", "locationValue", "mirroringDeploymentValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.mirroringDeploymentPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromMirroringDeploymentName', () => { + const result = client.matchProjectFromMirroringDeploymentName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.mirroringDeploymentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromMirroringDeploymentName', () => { + const result = client.matchLocationFromMirroringDeploymentName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.mirroringDeploymentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchMirroringDeploymentFromMirroringDeploymentName', () => { + const result = client.matchMirroringDeploymentFromMirroringDeploymentName(fakePath); + assert.strictEqual(result, "mirroringDeploymentValue"); + assert((client.pathTemplates.mirroringDeploymentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('mirroringDeploymentGroup', async () => { + const fakePath = "/rendered/path/mirroringDeploymentGroup"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + mirroring_deployment_group: "mirroringDeploymentGroupValue", + }; + const client = new networksecurityModule.v1.NetworkSecurityClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.mirroringDeploymentGroupPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.mirroringDeploymentGroupPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('mirroringDeploymentGroupPath', () => { + const result = client.mirroringDeploymentGroupPath("projectValue", "locationValue", "mirroringDeploymentGroupValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.mirroringDeploymentGroupPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromMirroringDeploymentGroupName', () => { + const result = client.matchProjectFromMirroringDeploymentGroupName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.mirroringDeploymentGroupPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromMirroringDeploymentGroupName', () => { + const result = client.matchLocationFromMirroringDeploymentGroupName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.mirroringDeploymentGroupPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchMirroringDeploymentGroupFromMirroringDeploymentGroupName', () => { + const result = client.matchMirroringDeploymentGroupFromMirroringDeploymentGroupName(fakePath); + assert.strictEqual(result, "mirroringDeploymentGroupValue"); + assert((client.pathTemplates.mirroringDeploymentGroupPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('mirroringEndpointGroup', async () => { + const fakePath = "/rendered/path/mirroringEndpointGroup"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + mirroring_endpoint_group: "mirroringEndpointGroupValue", + }; + const client = new networksecurityModule.v1.NetworkSecurityClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.mirroringEndpointGroupPathTemplate.render = sinon.stub().returns(fakePath); - client.pathTemplates.authorizationPolicyPathTemplate.match = + client.pathTemplates.mirroringEndpointGroupPathTemplate.match = sinon.stub().returns(expectedParameters); - it('authorizationPolicyPath', () => { - const result = client.authorizationPolicyPath("projectValue", "locationValue", "authorizationPolicyValue"); + it('mirroringEndpointGroupPath', () => { + const result = client.mirroringEndpointGroupPath("projectValue", "locationValue", "mirroringEndpointGroupValue"); assert.strictEqual(result, fakePath); - assert((client.pathTemplates.authorizationPolicyPathTemplate.render as SinonStub) + assert((client.pathTemplates.mirroringEndpointGroupPathTemplate.render as SinonStub) .getCall(-1).calledWith(expectedParameters)); }); - it('matchProjectFromAuthorizationPolicyName', () => { - const result = client.matchProjectFromAuthorizationPolicyName(fakePath); + it('matchProjectFromMirroringEndpointGroupName', () => { + const result = client.matchProjectFromMirroringEndpointGroupName(fakePath); assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.authorizationPolicyPathTemplate.match as SinonStub) + assert((client.pathTemplates.mirroringEndpointGroupPathTemplate.match as SinonStub) .getCall(-1).calledWith(fakePath)); }); - it('matchLocationFromAuthorizationPolicyName', () => { - const result = client.matchLocationFromAuthorizationPolicyName(fakePath); + it('matchLocationFromMirroringEndpointGroupName', () => { + const result = client.matchLocationFromMirroringEndpointGroupName(fakePath); assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.authorizationPolicyPathTemplate.match as SinonStub) + assert((client.pathTemplates.mirroringEndpointGroupPathTemplate.match as SinonStub) .getCall(-1).calledWith(fakePath)); }); - it('matchAuthorizationPolicyFromAuthorizationPolicyName', () => { - const result = client.matchAuthorizationPolicyFromAuthorizationPolicyName(fakePath); - assert.strictEqual(result, "authorizationPolicyValue"); - assert((client.pathTemplates.authorizationPolicyPathTemplate.match as SinonStub) + it('matchMirroringEndpointGroupFromMirroringEndpointGroupName', () => { + const result = client.matchMirroringEndpointGroupFromMirroringEndpointGroupName(fakePath); + assert.strictEqual(result, "mirroringEndpointGroupValue"); + assert((client.pathTemplates.mirroringEndpointGroupPathTemplate.match as SinonStub) .getCall(-1).calledWith(fakePath)); }); }); - describe('clientTlsPolicy', async () => { - const fakePath = "/rendered/path/clientTlsPolicy"; + describe('mirroringEndpointGroupAssociation', async () => { + const fakePath = "/rendered/path/mirroringEndpointGroupAssociation"; const expectedParameters = { project: "projectValue", location: "locationValue", - client_tls_policy: "clientTlsPolicyValue", + mirroring_endpoint_group_association: "mirroringEndpointGroupAssociationValue", }; const client = new networksecurityModule.v1.NetworkSecurityClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); await client.initialize(); - client.pathTemplates.clientTlsPolicyPathTemplate.render = + client.pathTemplates.mirroringEndpointGroupAssociationPathTemplate.render = sinon.stub().returns(fakePath); - client.pathTemplates.clientTlsPolicyPathTemplate.match = + client.pathTemplates.mirroringEndpointGroupAssociationPathTemplate.match = sinon.stub().returns(expectedParameters); - it('clientTlsPolicyPath', () => { - const result = client.clientTlsPolicyPath("projectValue", "locationValue", "clientTlsPolicyValue"); + it('mirroringEndpointGroupAssociationPath', () => { + const result = client.mirroringEndpointGroupAssociationPath("projectValue", "locationValue", "mirroringEndpointGroupAssociationValue"); assert.strictEqual(result, fakePath); - assert((client.pathTemplates.clientTlsPolicyPathTemplate.render as SinonStub) + assert((client.pathTemplates.mirroringEndpointGroupAssociationPathTemplate.render as SinonStub) .getCall(-1).calledWith(expectedParameters)); }); - it('matchProjectFromClientTlsPolicyName', () => { - const result = client.matchProjectFromClientTlsPolicyName(fakePath); + it('matchProjectFromMirroringEndpointGroupAssociationName', () => { + const result = client.matchProjectFromMirroringEndpointGroupAssociationName(fakePath); assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.clientTlsPolicyPathTemplate.match as SinonStub) + assert((client.pathTemplates.mirroringEndpointGroupAssociationPathTemplate.match as SinonStub) .getCall(-1).calledWith(fakePath)); }); - it('matchLocationFromClientTlsPolicyName', () => { - const result = client.matchLocationFromClientTlsPolicyName(fakePath); + it('matchLocationFromMirroringEndpointGroupAssociationName', () => { + const result = client.matchLocationFromMirroringEndpointGroupAssociationName(fakePath); assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.clientTlsPolicyPathTemplate.match as SinonStub) + assert((client.pathTemplates.mirroringEndpointGroupAssociationPathTemplate.match as SinonStub) .getCall(-1).calledWith(fakePath)); }); - it('matchClientTlsPolicyFromClientTlsPolicyName', () => { - const result = client.matchClientTlsPolicyFromClientTlsPolicyName(fakePath); - assert.strictEqual(result, "clientTlsPolicyValue"); - assert((client.pathTemplates.clientTlsPolicyPathTemplate.match as SinonStub) + it('matchMirroringEndpointGroupAssociationFromMirroringEndpointGroupAssociationName', () => { + const result = client.matchMirroringEndpointGroupAssociationFromMirroringEndpointGroupAssociationName(fakePath); + assert.strictEqual(result, "mirroringEndpointGroupAssociationValue"); + assert((client.pathTemplates.mirroringEndpointGroupAssociationPathTemplate.match as SinonStub) .getCall(-1).calledWith(fakePath)); }); }); @@ -3569,6 +9135,144 @@ describe('v1.NetworkSecurityClient', () => { }); }); + describe('organizationLocationFirewallEndpoints', async () => { + const fakePath = "/rendered/path/organizationLocationFirewallEndpoints"; + const expectedParameters = { + organization: "organizationValue", + location: "locationValue", + firewall_endpoint: "firewallEndpointValue", + }; + const client = new networksecurityModule.v1.NetworkSecurityClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.organizationLocationFirewallEndpointsPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.organizationLocationFirewallEndpointsPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('organizationLocationFirewallEndpointsPath', () => { + const result = client.organizationLocationFirewallEndpointsPath("organizationValue", "locationValue", "firewallEndpointValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.organizationLocationFirewallEndpointsPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchOrganizationFromOrganizationLocationFirewallEndpointsName', () => { + const result = client.matchOrganizationFromOrganizationLocationFirewallEndpointsName(fakePath); + assert.strictEqual(result, "organizationValue"); + assert((client.pathTemplates.organizationLocationFirewallEndpointsPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromOrganizationLocationFirewallEndpointsName', () => { + const result = client.matchLocationFromOrganizationLocationFirewallEndpointsName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.organizationLocationFirewallEndpointsPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchFirewallEndpointFromOrganizationLocationFirewallEndpointsName', () => { + const result = client.matchFirewallEndpointFromOrganizationLocationFirewallEndpointsName(fakePath); + assert.strictEqual(result, "firewallEndpointValue"); + assert((client.pathTemplates.organizationLocationFirewallEndpointsPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('organizationLocationSecurityProfile', async () => { + const fakePath = "/rendered/path/organizationLocationSecurityProfile"; + const expectedParameters = { + organization: "organizationValue", + location: "locationValue", + security_profile: "securityProfileValue", + }; + const client = new networksecurityModule.v1.NetworkSecurityClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.organizationLocationSecurityProfilePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.organizationLocationSecurityProfilePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('organizationLocationSecurityProfilePath', () => { + const result = client.organizationLocationSecurityProfilePath("organizationValue", "locationValue", "securityProfileValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.organizationLocationSecurityProfilePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchOrganizationFromOrganizationLocationSecurityProfileName', () => { + const result = client.matchOrganizationFromOrganizationLocationSecurityProfileName(fakePath); + assert.strictEqual(result, "organizationValue"); + assert((client.pathTemplates.organizationLocationSecurityProfilePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromOrganizationLocationSecurityProfileName', () => { + const result = client.matchLocationFromOrganizationLocationSecurityProfileName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.organizationLocationSecurityProfilePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchSecurityProfileFromOrganizationLocationSecurityProfileName', () => { + const result = client.matchSecurityProfileFromOrganizationLocationSecurityProfileName(fakePath); + assert.strictEqual(result, "securityProfileValue"); + assert((client.pathTemplates.organizationLocationSecurityProfilePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('organizationLocationSecurityProfileGroup', async () => { + const fakePath = "/rendered/path/organizationLocationSecurityProfileGroup"; + const expectedParameters = { + organization: "organizationValue", + location: "locationValue", + security_profile_group: "securityProfileGroupValue", + }; + const client = new networksecurityModule.v1.NetworkSecurityClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.organizationLocationSecurityProfileGroupPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.organizationLocationSecurityProfileGroupPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('organizationLocationSecurityProfileGroupPath', () => { + const result = client.organizationLocationSecurityProfileGroupPath("organizationValue", "locationValue", "securityProfileGroupValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.organizationLocationSecurityProfileGroupPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchOrganizationFromOrganizationLocationSecurityProfileGroupName', () => { + const result = client.matchOrganizationFromOrganizationLocationSecurityProfileGroupName(fakePath); + assert.strictEqual(result, "organizationValue"); + assert((client.pathTemplates.organizationLocationSecurityProfileGroupPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromOrganizationLocationSecurityProfileGroupName', () => { + const result = client.matchLocationFromOrganizationLocationSecurityProfileGroupName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.organizationLocationSecurityProfileGroupPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchSecurityProfileGroupFromOrganizationLocationSecurityProfileGroupName', () => { + const result = client.matchSecurityProfileGroupFromOrganizationLocationSecurityProfileGroupName(fakePath); + assert.strictEqual(result, "securityProfileGroupValue"); + assert((client.pathTemplates.organizationLocationSecurityProfileGroupPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + describe('projectLocationAddressGroup', async () => { const fakePath = "/rendered/path/projectLocationAddressGroup"; const expectedParameters = { @@ -3615,6 +9319,144 @@ describe('v1.NetworkSecurityClient', () => { }); }); + describe('projectLocationFirewallEndpoints', async () => { + const fakePath = "/rendered/path/projectLocationFirewallEndpoints"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + firewall_endpoint: "firewallEndpointValue", + }; + const client = new networksecurityModule.v1.NetworkSecurityClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectLocationFirewallEndpointsPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationFirewallEndpointsPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationFirewallEndpointsPath', () => { + const result = client.projectLocationFirewallEndpointsPath("projectValue", "locationValue", "firewallEndpointValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.projectLocationFirewallEndpointsPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromProjectLocationFirewallEndpointsName', () => { + const result = client.matchProjectFromProjectLocationFirewallEndpointsName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.projectLocationFirewallEndpointsPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromProjectLocationFirewallEndpointsName', () => { + const result = client.matchLocationFromProjectLocationFirewallEndpointsName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.projectLocationFirewallEndpointsPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchFirewallEndpointFromProjectLocationFirewallEndpointsName', () => { + const result = client.matchFirewallEndpointFromProjectLocationFirewallEndpointsName(fakePath); + assert.strictEqual(result, "firewallEndpointValue"); + assert((client.pathTemplates.projectLocationFirewallEndpointsPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('projectLocationSecurityProfile', async () => { + const fakePath = "/rendered/path/projectLocationSecurityProfile"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + security_profile: "securityProfileValue", + }; + const client = new networksecurityModule.v1.NetworkSecurityClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectLocationSecurityProfilePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationSecurityProfilePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationSecurityProfilePath', () => { + const result = client.projectLocationSecurityProfilePath("projectValue", "locationValue", "securityProfileValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.projectLocationSecurityProfilePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromProjectLocationSecurityProfileName', () => { + const result = client.matchProjectFromProjectLocationSecurityProfileName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.projectLocationSecurityProfilePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromProjectLocationSecurityProfileName', () => { + const result = client.matchLocationFromProjectLocationSecurityProfileName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.projectLocationSecurityProfilePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchSecurityProfileFromProjectLocationSecurityProfileName', () => { + const result = client.matchSecurityProfileFromProjectLocationSecurityProfileName(fakePath); + assert.strictEqual(result, "securityProfileValue"); + assert((client.pathTemplates.projectLocationSecurityProfilePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('projectLocationSecurityProfileGroup', async () => { + const fakePath = "/rendered/path/projectLocationSecurityProfileGroup"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + security_profile_group: "securityProfileGroupValue", + }; + const client = new networksecurityModule.v1.NetworkSecurityClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectLocationSecurityProfileGroupPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationSecurityProfileGroupPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationSecurityProfileGroupPath', () => { + const result = client.projectLocationSecurityProfileGroupPath("projectValue", "locationValue", "securityProfileGroupValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.projectLocationSecurityProfileGroupPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromProjectLocationSecurityProfileGroupName', () => { + const result = client.matchProjectFromProjectLocationSecurityProfileGroupName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.projectLocationSecurityProfileGroupPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromProjectLocationSecurityProfileGroupName', () => { + const result = client.matchLocationFromProjectLocationSecurityProfileGroupName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.projectLocationSecurityProfileGroupPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchSecurityProfileGroupFromProjectLocationSecurityProfileGroupName', () => { + const result = client.matchSecurityProfileGroupFromProjectLocationSecurityProfileGroupName(fakePath); + assert.strictEqual(result, "securityProfileGroupValue"); + assert((client.pathTemplates.projectLocationSecurityProfileGroupPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + describe('serverTlsPolicy', async () => { const fakePath = "/rendered/path/serverTlsPolicy"; const expectedParameters = { @@ -3660,5 +9502,97 @@ describe('v1.NetworkSecurityClient', () => { .getCall(-1).calledWith(fakePath)); }); }); + + describe('tlsInspectionPolicy', async () => { + const fakePath = "/rendered/path/tlsInspectionPolicy"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + tls_inspection_policy: "tlsInspectionPolicyValue", + }; + const client = new networksecurityModule.v1.NetworkSecurityClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.tlsInspectionPolicyPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.tlsInspectionPolicyPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('tlsInspectionPolicyPath', () => { + const result = client.tlsInspectionPolicyPath("projectValue", "locationValue", "tlsInspectionPolicyValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.tlsInspectionPolicyPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromTlsInspectionPolicyName', () => { + const result = client.matchProjectFromTlsInspectionPolicyName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.tlsInspectionPolicyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromTlsInspectionPolicyName', () => { + const result = client.matchLocationFromTlsInspectionPolicyName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.tlsInspectionPolicyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchTlsInspectionPolicyFromTlsInspectionPolicyName', () => { + const result = client.matchTlsInspectionPolicyFromTlsInspectionPolicyName(fakePath); + assert.strictEqual(result, "tlsInspectionPolicyValue"); + assert((client.pathTemplates.tlsInspectionPolicyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('urlList', async () => { + const fakePath = "/rendered/path/urlList"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + url_list: "urlListValue", + }; + const client = new networksecurityModule.v1.NetworkSecurityClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.urlListPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.urlListPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('urlListPath', () => { + const result = client.urlListPath("projectValue", "locationValue", "urlListValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.urlListPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromUrlListName', () => { + const result = client.matchProjectFromUrlListName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.urlListPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromUrlListName', () => { + const result = client.matchLocationFromUrlListName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.urlListPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchUrlListFromUrlListName', () => { + const result = client.matchUrlListFromUrlListName(fakePath); + assert.strictEqual(result, "urlListValue"); + assert((client.pathTemplates.urlListPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); }); }); diff --git a/packages/google-cloud-networksecurity/test/gapic_organization_address_group_service_v1.ts b/packages/google-cloud-networksecurity/test/gapic_organization_address_group_service_v1.ts index 1d10d2fe26f..dee0a6238c8 100644 --- a/packages/google-cloud-networksecurity/test/gapic_organization_address_group_service_v1.ts +++ b/packages/google-cloud-networksecurity/test/gapic_organization_address_group_service_v1.ts @@ -2546,86 +2546,738 @@ describe('v1.OrganizationAddressGroupServiceClient', () => { }); }); + describe('authzPolicy', async () => { + const fakePath = "/rendered/path/authzPolicy"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + authz_policy: "authzPolicyValue", + }; + const client = new organizationaddressgroupserviceModule.v1.OrganizationAddressGroupServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.authzPolicyPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.authzPolicyPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('authzPolicyPath', () => { + const result = client.authzPolicyPath("projectValue", "locationValue", "authzPolicyValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.authzPolicyPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromAuthzPolicyName', () => { + const result = client.matchProjectFromAuthzPolicyName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.authzPolicyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromAuthzPolicyName', () => { + const result = client.matchLocationFromAuthzPolicyName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.authzPolicyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchAuthzPolicyFromAuthzPolicyName', () => { + const result = client.matchAuthzPolicyFromAuthzPolicyName(fakePath); + assert.strictEqual(result, "authzPolicyValue"); + assert((client.pathTemplates.authzPolicyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('backendAuthenticationConfig', async () => { + const fakePath = "/rendered/path/backendAuthenticationConfig"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + backend_authentication_config: "backendAuthenticationConfigValue", + }; + const client = new organizationaddressgroupserviceModule.v1.OrganizationAddressGroupServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.backendAuthenticationConfigPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.backendAuthenticationConfigPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('backendAuthenticationConfigPath', () => { + const result = client.backendAuthenticationConfigPath("projectValue", "locationValue", "backendAuthenticationConfigValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.backendAuthenticationConfigPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromBackendAuthenticationConfigName', () => { + const result = client.matchProjectFromBackendAuthenticationConfigName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.backendAuthenticationConfigPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromBackendAuthenticationConfigName', () => { + const result = client.matchLocationFromBackendAuthenticationConfigName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.backendAuthenticationConfigPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchBackendAuthenticationConfigFromBackendAuthenticationConfigName', () => { + const result = client.matchBackendAuthenticationConfigFromBackendAuthenticationConfigName(fakePath); + assert.strictEqual(result, "backendAuthenticationConfigValue"); + assert((client.pathTemplates.backendAuthenticationConfigPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + describe('clientTlsPolicy', async () => { const fakePath = "/rendered/path/clientTlsPolicy"; const expectedParameters = { project: "projectValue", location: "locationValue", - client_tls_policy: "clientTlsPolicyValue", + client_tls_policy: "clientTlsPolicyValue", + }; + const client = new organizationaddressgroupserviceModule.v1.OrganizationAddressGroupServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.clientTlsPolicyPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.clientTlsPolicyPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('clientTlsPolicyPath', () => { + const result = client.clientTlsPolicyPath("projectValue", "locationValue", "clientTlsPolicyValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.clientTlsPolicyPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromClientTlsPolicyName', () => { + const result = client.matchProjectFromClientTlsPolicyName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.clientTlsPolicyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromClientTlsPolicyName', () => { + const result = client.matchLocationFromClientTlsPolicyName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.clientTlsPolicyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchClientTlsPolicyFromClientTlsPolicyName', () => { + const result = client.matchClientTlsPolicyFromClientTlsPolicyName(fakePath); + assert.strictEqual(result, "clientTlsPolicyValue"); + assert((client.pathTemplates.clientTlsPolicyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('dnsThreatDetector', async () => { + const fakePath = "/rendered/path/dnsThreatDetector"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + dns_threat_detector: "dnsThreatDetectorValue", + }; + const client = new organizationaddressgroupserviceModule.v1.OrganizationAddressGroupServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.dnsThreatDetectorPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.dnsThreatDetectorPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('dnsThreatDetectorPath', () => { + const result = client.dnsThreatDetectorPath("projectValue", "locationValue", "dnsThreatDetectorValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.dnsThreatDetectorPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromDnsThreatDetectorName', () => { + const result = client.matchProjectFromDnsThreatDetectorName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.dnsThreatDetectorPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromDnsThreatDetectorName', () => { + const result = client.matchLocationFromDnsThreatDetectorName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.dnsThreatDetectorPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDnsThreatDetectorFromDnsThreatDetectorName', () => { + const result = client.matchDnsThreatDetectorFromDnsThreatDetectorName(fakePath); + assert.strictEqual(result, "dnsThreatDetectorValue"); + assert((client.pathTemplates.dnsThreatDetectorPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('firewallEndpointAssociation', async () => { + const fakePath = "/rendered/path/firewallEndpointAssociation"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + firewall_endpoint_association: "firewallEndpointAssociationValue", + }; + const client = new organizationaddressgroupserviceModule.v1.OrganizationAddressGroupServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.firewallEndpointAssociationPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.firewallEndpointAssociationPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('firewallEndpointAssociationPath', () => { + const result = client.firewallEndpointAssociationPath("projectValue", "locationValue", "firewallEndpointAssociationValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.firewallEndpointAssociationPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromFirewallEndpointAssociationName', () => { + const result = client.matchProjectFromFirewallEndpointAssociationName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.firewallEndpointAssociationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromFirewallEndpointAssociationName', () => { + const result = client.matchLocationFromFirewallEndpointAssociationName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.firewallEndpointAssociationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchFirewallEndpointAssociationFromFirewallEndpointAssociationName', () => { + const result = client.matchFirewallEndpointAssociationFromFirewallEndpointAssociationName(fakePath); + assert.strictEqual(result, "firewallEndpointAssociationValue"); + assert((client.pathTemplates.firewallEndpointAssociationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('gatewaySecurityPolicy', async () => { + const fakePath = "/rendered/path/gatewaySecurityPolicy"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + gateway_security_policy: "gatewaySecurityPolicyValue", + }; + const client = new organizationaddressgroupserviceModule.v1.OrganizationAddressGroupServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.gatewaySecurityPolicyPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.gatewaySecurityPolicyPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('gatewaySecurityPolicyPath', () => { + const result = client.gatewaySecurityPolicyPath("projectValue", "locationValue", "gatewaySecurityPolicyValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.gatewaySecurityPolicyPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromGatewaySecurityPolicyName', () => { + const result = client.matchProjectFromGatewaySecurityPolicyName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.gatewaySecurityPolicyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromGatewaySecurityPolicyName', () => { + const result = client.matchLocationFromGatewaySecurityPolicyName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.gatewaySecurityPolicyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchGatewaySecurityPolicyFromGatewaySecurityPolicyName', () => { + const result = client.matchGatewaySecurityPolicyFromGatewaySecurityPolicyName(fakePath); + assert.strictEqual(result, "gatewaySecurityPolicyValue"); + assert((client.pathTemplates.gatewaySecurityPolicyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('gatewaySecurityPolicyRule', async () => { + const fakePath = "/rendered/path/gatewaySecurityPolicyRule"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + gateway_security_policy: "gatewaySecurityPolicyValue", + rule: "ruleValue", + }; + const client = new organizationaddressgroupserviceModule.v1.OrganizationAddressGroupServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.gatewaySecurityPolicyRulePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.gatewaySecurityPolicyRulePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('gatewaySecurityPolicyRulePath', () => { + const result = client.gatewaySecurityPolicyRulePath("projectValue", "locationValue", "gatewaySecurityPolicyValue", "ruleValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.gatewaySecurityPolicyRulePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromGatewaySecurityPolicyRuleName', () => { + const result = client.matchProjectFromGatewaySecurityPolicyRuleName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.gatewaySecurityPolicyRulePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromGatewaySecurityPolicyRuleName', () => { + const result = client.matchLocationFromGatewaySecurityPolicyRuleName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.gatewaySecurityPolicyRulePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchGatewaySecurityPolicyFromGatewaySecurityPolicyRuleName', () => { + const result = client.matchGatewaySecurityPolicyFromGatewaySecurityPolicyRuleName(fakePath); + assert.strictEqual(result, "gatewaySecurityPolicyValue"); + assert((client.pathTemplates.gatewaySecurityPolicyRulePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchRuleFromGatewaySecurityPolicyRuleName', () => { + const result = client.matchRuleFromGatewaySecurityPolicyRuleName(fakePath); + assert.strictEqual(result, "ruleValue"); + assert((client.pathTemplates.gatewaySecurityPolicyRulePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('interceptDeployment', async () => { + const fakePath = "/rendered/path/interceptDeployment"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + intercept_deployment: "interceptDeploymentValue", + }; + const client = new organizationaddressgroupserviceModule.v1.OrganizationAddressGroupServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.interceptDeploymentPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.interceptDeploymentPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('interceptDeploymentPath', () => { + const result = client.interceptDeploymentPath("projectValue", "locationValue", "interceptDeploymentValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.interceptDeploymentPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromInterceptDeploymentName', () => { + const result = client.matchProjectFromInterceptDeploymentName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.interceptDeploymentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromInterceptDeploymentName', () => { + const result = client.matchLocationFromInterceptDeploymentName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.interceptDeploymentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchInterceptDeploymentFromInterceptDeploymentName', () => { + const result = client.matchInterceptDeploymentFromInterceptDeploymentName(fakePath); + assert.strictEqual(result, "interceptDeploymentValue"); + assert((client.pathTemplates.interceptDeploymentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('interceptDeploymentGroup', async () => { + const fakePath = "/rendered/path/interceptDeploymentGroup"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + intercept_deployment_group: "interceptDeploymentGroupValue", + }; + const client = new organizationaddressgroupserviceModule.v1.OrganizationAddressGroupServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.interceptDeploymentGroupPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.interceptDeploymentGroupPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('interceptDeploymentGroupPath', () => { + const result = client.interceptDeploymentGroupPath("projectValue", "locationValue", "interceptDeploymentGroupValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.interceptDeploymentGroupPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromInterceptDeploymentGroupName', () => { + const result = client.matchProjectFromInterceptDeploymentGroupName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.interceptDeploymentGroupPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromInterceptDeploymentGroupName', () => { + const result = client.matchLocationFromInterceptDeploymentGroupName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.interceptDeploymentGroupPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchInterceptDeploymentGroupFromInterceptDeploymentGroupName', () => { + const result = client.matchInterceptDeploymentGroupFromInterceptDeploymentGroupName(fakePath); + assert.strictEqual(result, "interceptDeploymentGroupValue"); + assert((client.pathTemplates.interceptDeploymentGroupPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('interceptEndpointGroup', async () => { + const fakePath = "/rendered/path/interceptEndpointGroup"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + intercept_endpoint_group: "interceptEndpointGroupValue", + }; + const client = new organizationaddressgroupserviceModule.v1.OrganizationAddressGroupServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.interceptEndpointGroupPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.interceptEndpointGroupPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('interceptEndpointGroupPath', () => { + const result = client.interceptEndpointGroupPath("projectValue", "locationValue", "interceptEndpointGroupValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.interceptEndpointGroupPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromInterceptEndpointGroupName', () => { + const result = client.matchProjectFromInterceptEndpointGroupName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.interceptEndpointGroupPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromInterceptEndpointGroupName', () => { + const result = client.matchLocationFromInterceptEndpointGroupName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.interceptEndpointGroupPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchInterceptEndpointGroupFromInterceptEndpointGroupName', () => { + const result = client.matchInterceptEndpointGroupFromInterceptEndpointGroupName(fakePath); + assert.strictEqual(result, "interceptEndpointGroupValue"); + assert((client.pathTemplates.interceptEndpointGroupPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('interceptEndpointGroupAssociation', async () => { + const fakePath = "/rendered/path/interceptEndpointGroupAssociation"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + intercept_endpoint_group_association: "interceptEndpointGroupAssociationValue", + }; + const client = new organizationaddressgroupserviceModule.v1.OrganizationAddressGroupServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.interceptEndpointGroupAssociationPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.interceptEndpointGroupAssociationPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('interceptEndpointGroupAssociationPath', () => { + const result = client.interceptEndpointGroupAssociationPath("projectValue", "locationValue", "interceptEndpointGroupAssociationValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.interceptEndpointGroupAssociationPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromInterceptEndpointGroupAssociationName', () => { + const result = client.matchProjectFromInterceptEndpointGroupAssociationName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.interceptEndpointGroupAssociationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromInterceptEndpointGroupAssociationName', () => { + const result = client.matchLocationFromInterceptEndpointGroupAssociationName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.interceptEndpointGroupAssociationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchInterceptEndpointGroupAssociationFromInterceptEndpointGroupAssociationName', () => { + const result = client.matchInterceptEndpointGroupAssociationFromInterceptEndpointGroupAssociationName(fakePath); + assert.strictEqual(result, "interceptEndpointGroupAssociationValue"); + assert((client.pathTemplates.interceptEndpointGroupAssociationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('location', async () => { + const fakePath = "/rendered/path/location"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + }; + const client = new organizationaddressgroupserviceModule.v1.OrganizationAddressGroupServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.locationPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.locationPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('locationPath', () => { + const result = client.locationPath("projectValue", "locationValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.locationPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromLocationName', () => { + const result = client.matchProjectFromLocationName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.locationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromLocationName', () => { + const result = client.matchLocationFromLocationName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.locationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('mirroringDeployment', async () => { + const fakePath = "/rendered/path/mirroringDeployment"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + mirroring_deployment: "mirroringDeploymentValue", + }; + const client = new organizationaddressgroupserviceModule.v1.OrganizationAddressGroupServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.mirroringDeploymentPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.mirroringDeploymentPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('mirroringDeploymentPath', () => { + const result = client.mirroringDeploymentPath("projectValue", "locationValue", "mirroringDeploymentValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.mirroringDeploymentPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromMirroringDeploymentName', () => { + const result = client.matchProjectFromMirroringDeploymentName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.mirroringDeploymentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromMirroringDeploymentName', () => { + const result = client.matchLocationFromMirroringDeploymentName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.mirroringDeploymentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchMirroringDeploymentFromMirroringDeploymentName', () => { + const result = client.matchMirroringDeploymentFromMirroringDeploymentName(fakePath); + assert.strictEqual(result, "mirroringDeploymentValue"); + assert((client.pathTemplates.mirroringDeploymentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('mirroringDeploymentGroup', async () => { + const fakePath = "/rendered/path/mirroringDeploymentGroup"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + mirroring_deployment_group: "mirroringDeploymentGroupValue", + }; + const client = new organizationaddressgroupserviceModule.v1.OrganizationAddressGroupServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.mirroringDeploymentGroupPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.mirroringDeploymentGroupPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('mirroringDeploymentGroupPath', () => { + const result = client.mirroringDeploymentGroupPath("projectValue", "locationValue", "mirroringDeploymentGroupValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.mirroringDeploymentGroupPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromMirroringDeploymentGroupName', () => { + const result = client.matchProjectFromMirroringDeploymentGroupName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.mirroringDeploymentGroupPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromMirroringDeploymentGroupName', () => { + const result = client.matchLocationFromMirroringDeploymentGroupName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.mirroringDeploymentGroupPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchMirroringDeploymentGroupFromMirroringDeploymentGroupName', () => { + const result = client.matchMirroringDeploymentGroupFromMirroringDeploymentGroupName(fakePath); + assert.strictEqual(result, "mirroringDeploymentGroupValue"); + assert((client.pathTemplates.mirroringDeploymentGroupPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('mirroringEndpointGroup', async () => { + const fakePath = "/rendered/path/mirroringEndpointGroup"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + mirroring_endpoint_group: "mirroringEndpointGroupValue", }; const client = new organizationaddressgroupserviceModule.v1.OrganizationAddressGroupServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); await client.initialize(); - client.pathTemplates.clientTlsPolicyPathTemplate.render = + client.pathTemplates.mirroringEndpointGroupPathTemplate.render = sinon.stub().returns(fakePath); - client.pathTemplates.clientTlsPolicyPathTemplate.match = + client.pathTemplates.mirroringEndpointGroupPathTemplate.match = sinon.stub().returns(expectedParameters); - it('clientTlsPolicyPath', () => { - const result = client.clientTlsPolicyPath("projectValue", "locationValue", "clientTlsPolicyValue"); + it('mirroringEndpointGroupPath', () => { + const result = client.mirroringEndpointGroupPath("projectValue", "locationValue", "mirroringEndpointGroupValue"); assert.strictEqual(result, fakePath); - assert((client.pathTemplates.clientTlsPolicyPathTemplate.render as SinonStub) + assert((client.pathTemplates.mirroringEndpointGroupPathTemplate.render as SinonStub) .getCall(-1).calledWith(expectedParameters)); }); - it('matchProjectFromClientTlsPolicyName', () => { - const result = client.matchProjectFromClientTlsPolicyName(fakePath); + it('matchProjectFromMirroringEndpointGroupName', () => { + const result = client.matchProjectFromMirroringEndpointGroupName(fakePath); assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.clientTlsPolicyPathTemplate.match as SinonStub) + assert((client.pathTemplates.mirroringEndpointGroupPathTemplate.match as SinonStub) .getCall(-1).calledWith(fakePath)); }); - it('matchLocationFromClientTlsPolicyName', () => { - const result = client.matchLocationFromClientTlsPolicyName(fakePath); + it('matchLocationFromMirroringEndpointGroupName', () => { + const result = client.matchLocationFromMirroringEndpointGroupName(fakePath); assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.clientTlsPolicyPathTemplate.match as SinonStub) + assert((client.pathTemplates.mirroringEndpointGroupPathTemplate.match as SinonStub) .getCall(-1).calledWith(fakePath)); }); - it('matchClientTlsPolicyFromClientTlsPolicyName', () => { - const result = client.matchClientTlsPolicyFromClientTlsPolicyName(fakePath); - assert.strictEqual(result, "clientTlsPolicyValue"); - assert((client.pathTemplates.clientTlsPolicyPathTemplate.match as SinonStub) + it('matchMirroringEndpointGroupFromMirroringEndpointGroupName', () => { + const result = client.matchMirroringEndpointGroupFromMirroringEndpointGroupName(fakePath); + assert.strictEqual(result, "mirroringEndpointGroupValue"); + assert((client.pathTemplates.mirroringEndpointGroupPathTemplate.match as SinonStub) .getCall(-1).calledWith(fakePath)); }); }); - describe('location', async () => { - const fakePath = "/rendered/path/location"; + describe('mirroringEndpointGroupAssociation', async () => { + const fakePath = "/rendered/path/mirroringEndpointGroupAssociation"; const expectedParameters = { project: "projectValue", location: "locationValue", + mirroring_endpoint_group_association: "mirroringEndpointGroupAssociationValue", }; const client = new organizationaddressgroupserviceModule.v1.OrganizationAddressGroupServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); await client.initialize(); - client.pathTemplates.locationPathTemplate.render = + client.pathTemplates.mirroringEndpointGroupAssociationPathTemplate.render = sinon.stub().returns(fakePath); - client.pathTemplates.locationPathTemplate.match = + client.pathTemplates.mirroringEndpointGroupAssociationPathTemplate.match = sinon.stub().returns(expectedParameters); - it('locationPath', () => { - const result = client.locationPath("projectValue", "locationValue"); + it('mirroringEndpointGroupAssociationPath', () => { + const result = client.mirroringEndpointGroupAssociationPath("projectValue", "locationValue", "mirroringEndpointGroupAssociationValue"); assert.strictEqual(result, fakePath); - assert((client.pathTemplates.locationPathTemplate.render as SinonStub) + assert((client.pathTemplates.mirroringEndpointGroupAssociationPathTemplate.render as SinonStub) .getCall(-1).calledWith(expectedParameters)); }); - it('matchProjectFromLocationName', () => { - const result = client.matchProjectFromLocationName(fakePath); + it('matchProjectFromMirroringEndpointGroupAssociationName', () => { + const result = client.matchProjectFromMirroringEndpointGroupAssociationName(fakePath); assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.locationPathTemplate.match as SinonStub) + assert((client.pathTemplates.mirroringEndpointGroupAssociationPathTemplate.match as SinonStub) .getCall(-1).calledWith(fakePath)); }); - it('matchLocationFromLocationName', () => { - const result = client.matchLocationFromLocationName(fakePath); + it('matchLocationFromMirroringEndpointGroupAssociationName', () => { + const result = client.matchLocationFromMirroringEndpointGroupAssociationName(fakePath); assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.locationPathTemplate.match as SinonStub) + assert((client.pathTemplates.mirroringEndpointGroupAssociationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchMirroringEndpointGroupAssociationFromMirroringEndpointGroupAssociationName', () => { + const result = client.matchMirroringEndpointGroupAssociationFromMirroringEndpointGroupAssociationName(fakePath); + assert.strictEqual(result, "mirroringEndpointGroupAssociationValue"); + assert((client.pathTemplates.mirroringEndpointGroupAssociationPathTemplate.match as SinonStub) .getCall(-1).calledWith(fakePath)); }); }); @@ -2676,6 +3328,144 @@ describe('v1.OrganizationAddressGroupServiceClient', () => { }); }); + describe('organizationLocationFirewallEndpoints', async () => { + const fakePath = "/rendered/path/organizationLocationFirewallEndpoints"; + const expectedParameters = { + organization: "organizationValue", + location: "locationValue", + firewall_endpoint: "firewallEndpointValue", + }; + const client = new organizationaddressgroupserviceModule.v1.OrganizationAddressGroupServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.organizationLocationFirewallEndpointsPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.organizationLocationFirewallEndpointsPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('organizationLocationFirewallEndpointsPath', () => { + const result = client.organizationLocationFirewallEndpointsPath("organizationValue", "locationValue", "firewallEndpointValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.organizationLocationFirewallEndpointsPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchOrganizationFromOrganizationLocationFirewallEndpointsName', () => { + const result = client.matchOrganizationFromOrganizationLocationFirewallEndpointsName(fakePath); + assert.strictEqual(result, "organizationValue"); + assert((client.pathTemplates.organizationLocationFirewallEndpointsPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromOrganizationLocationFirewallEndpointsName', () => { + const result = client.matchLocationFromOrganizationLocationFirewallEndpointsName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.organizationLocationFirewallEndpointsPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchFirewallEndpointFromOrganizationLocationFirewallEndpointsName', () => { + const result = client.matchFirewallEndpointFromOrganizationLocationFirewallEndpointsName(fakePath); + assert.strictEqual(result, "firewallEndpointValue"); + assert((client.pathTemplates.organizationLocationFirewallEndpointsPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('organizationLocationSecurityProfile', async () => { + const fakePath = "/rendered/path/organizationLocationSecurityProfile"; + const expectedParameters = { + organization: "organizationValue", + location: "locationValue", + security_profile: "securityProfileValue", + }; + const client = new organizationaddressgroupserviceModule.v1.OrganizationAddressGroupServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.organizationLocationSecurityProfilePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.organizationLocationSecurityProfilePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('organizationLocationSecurityProfilePath', () => { + const result = client.organizationLocationSecurityProfilePath("organizationValue", "locationValue", "securityProfileValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.organizationLocationSecurityProfilePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchOrganizationFromOrganizationLocationSecurityProfileName', () => { + const result = client.matchOrganizationFromOrganizationLocationSecurityProfileName(fakePath); + assert.strictEqual(result, "organizationValue"); + assert((client.pathTemplates.organizationLocationSecurityProfilePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromOrganizationLocationSecurityProfileName', () => { + const result = client.matchLocationFromOrganizationLocationSecurityProfileName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.organizationLocationSecurityProfilePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchSecurityProfileFromOrganizationLocationSecurityProfileName', () => { + const result = client.matchSecurityProfileFromOrganizationLocationSecurityProfileName(fakePath); + assert.strictEqual(result, "securityProfileValue"); + assert((client.pathTemplates.organizationLocationSecurityProfilePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('organizationLocationSecurityProfileGroup', async () => { + const fakePath = "/rendered/path/organizationLocationSecurityProfileGroup"; + const expectedParameters = { + organization: "organizationValue", + location: "locationValue", + security_profile_group: "securityProfileGroupValue", + }; + const client = new organizationaddressgroupserviceModule.v1.OrganizationAddressGroupServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.organizationLocationSecurityProfileGroupPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.organizationLocationSecurityProfileGroupPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('organizationLocationSecurityProfileGroupPath', () => { + const result = client.organizationLocationSecurityProfileGroupPath("organizationValue", "locationValue", "securityProfileGroupValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.organizationLocationSecurityProfileGroupPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchOrganizationFromOrganizationLocationSecurityProfileGroupName', () => { + const result = client.matchOrganizationFromOrganizationLocationSecurityProfileGroupName(fakePath); + assert.strictEqual(result, "organizationValue"); + assert((client.pathTemplates.organizationLocationSecurityProfileGroupPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromOrganizationLocationSecurityProfileGroupName', () => { + const result = client.matchLocationFromOrganizationLocationSecurityProfileGroupName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.organizationLocationSecurityProfileGroupPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchSecurityProfileGroupFromOrganizationLocationSecurityProfileGroupName', () => { + const result = client.matchSecurityProfileGroupFromOrganizationLocationSecurityProfileGroupName(fakePath); + assert.strictEqual(result, "securityProfileGroupValue"); + assert((client.pathTemplates.organizationLocationSecurityProfileGroupPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + describe('project', async () => { const fakePath = "/rendered/path/project"; const expectedParameters = { @@ -2752,6 +3542,144 @@ describe('v1.OrganizationAddressGroupServiceClient', () => { }); }); + describe('projectLocationFirewallEndpoints', async () => { + const fakePath = "/rendered/path/projectLocationFirewallEndpoints"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + firewall_endpoint: "firewallEndpointValue", + }; + const client = new organizationaddressgroupserviceModule.v1.OrganizationAddressGroupServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectLocationFirewallEndpointsPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationFirewallEndpointsPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationFirewallEndpointsPath', () => { + const result = client.projectLocationFirewallEndpointsPath("projectValue", "locationValue", "firewallEndpointValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.projectLocationFirewallEndpointsPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromProjectLocationFirewallEndpointsName', () => { + const result = client.matchProjectFromProjectLocationFirewallEndpointsName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.projectLocationFirewallEndpointsPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromProjectLocationFirewallEndpointsName', () => { + const result = client.matchLocationFromProjectLocationFirewallEndpointsName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.projectLocationFirewallEndpointsPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchFirewallEndpointFromProjectLocationFirewallEndpointsName', () => { + const result = client.matchFirewallEndpointFromProjectLocationFirewallEndpointsName(fakePath); + assert.strictEqual(result, "firewallEndpointValue"); + assert((client.pathTemplates.projectLocationFirewallEndpointsPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('projectLocationSecurityProfile', async () => { + const fakePath = "/rendered/path/projectLocationSecurityProfile"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + security_profile: "securityProfileValue", + }; + const client = new organizationaddressgroupserviceModule.v1.OrganizationAddressGroupServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectLocationSecurityProfilePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationSecurityProfilePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationSecurityProfilePath', () => { + const result = client.projectLocationSecurityProfilePath("projectValue", "locationValue", "securityProfileValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.projectLocationSecurityProfilePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromProjectLocationSecurityProfileName', () => { + const result = client.matchProjectFromProjectLocationSecurityProfileName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.projectLocationSecurityProfilePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromProjectLocationSecurityProfileName', () => { + const result = client.matchLocationFromProjectLocationSecurityProfileName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.projectLocationSecurityProfilePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchSecurityProfileFromProjectLocationSecurityProfileName', () => { + const result = client.matchSecurityProfileFromProjectLocationSecurityProfileName(fakePath); + assert.strictEqual(result, "securityProfileValue"); + assert((client.pathTemplates.projectLocationSecurityProfilePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('projectLocationSecurityProfileGroup', async () => { + const fakePath = "/rendered/path/projectLocationSecurityProfileGroup"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + security_profile_group: "securityProfileGroupValue", + }; + const client = new organizationaddressgroupserviceModule.v1.OrganizationAddressGroupServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectLocationSecurityProfileGroupPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationSecurityProfileGroupPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationSecurityProfileGroupPath', () => { + const result = client.projectLocationSecurityProfileGroupPath("projectValue", "locationValue", "securityProfileGroupValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.projectLocationSecurityProfileGroupPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromProjectLocationSecurityProfileGroupName', () => { + const result = client.matchProjectFromProjectLocationSecurityProfileGroupName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.projectLocationSecurityProfileGroupPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromProjectLocationSecurityProfileGroupName', () => { + const result = client.matchLocationFromProjectLocationSecurityProfileGroupName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.projectLocationSecurityProfileGroupPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchSecurityProfileGroupFromProjectLocationSecurityProfileGroupName', () => { + const result = client.matchSecurityProfileGroupFromProjectLocationSecurityProfileGroupName(fakePath); + assert.strictEqual(result, "securityProfileGroupValue"); + assert((client.pathTemplates.projectLocationSecurityProfileGroupPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + describe('serverTlsPolicy', async () => { const fakePath = "/rendered/path/serverTlsPolicy"; const expectedParameters = { @@ -2797,5 +3725,97 @@ describe('v1.OrganizationAddressGroupServiceClient', () => { .getCall(-1).calledWith(fakePath)); }); }); + + describe('tlsInspectionPolicy', async () => { + const fakePath = "/rendered/path/tlsInspectionPolicy"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + tls_inspection_policy: "tlsInspectionPolicyValue", + }; + const client = new organizationaddressgroupserviceModule.v1.OrganizationAddressGroupServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.tlsInspectionPolicyPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.tlsInspectionPolicyPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('tlsInspectionPolicyPath', () => { + const result = client.tlsInspectionPolicyPath("projectValue", "locationValue", "tlsInspectionPolicyValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.tlsInspectionPolicyPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromTlsInspectionPolicyName', () => { + const result = client.matchProjectFromTlsInspectionPolicyName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.tlsInspectionPolicyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromTlsInspectionPolicyName', () => { + const result = client.matchLocationFromTlsInspectionPolicyName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.tlsInspectionPolicyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchTlsInspectionPolicyFromTlsInspectionPolicyName', () => { + const result = client.matchTlsInspectionPolicyFromTlsInspectionPolicyName(fakePath); + assert.strictEqual(result, "tlsInspectionPolicyValue"); + assert((client.pathTemplates.tlsInspectionPolicyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('urlList', async () => { + const fakePath = "/rendered/path/urlList"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + url_list: "urlListValue", + }; + const client = new organizationaddressgroupserviceModule.v1.OrganizationAddressGroupServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.urlListPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.urlListPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('urlListPath', () => { + const result = client.urlListPath("projectValue", "locationValue", "urlListValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.urlListPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromUrlListName', () => { + const result = client.matchProjectFromUrlListName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.urlListPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromUrlListName', () => { + const result = client.matchLocationFromUrlListName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.urlListPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchUrlListFromUrlListName', () => { + const result = client.matchUrlListFromUrlListName(fakePath); + assert.strictEqual(result, "urlListValue"); + assert((client.pathTemplates.urlListPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); }); }); diff --git a/packages/google-cloud-networksecurity/test/gapic_organization_security_profile_group_service_v1.ts b/packages/google-cloud-networksecurity/test/gapic_organization_security_profile_group_service_v1.ts new file mode 100644 index 00000000000..acae0eadf59 --- /dev/null +++ b/packages/google-cloud-networksecurity/test/gapic_organization_security_profile_group_service_v1.ts @@ -0,0 +1,3933 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import * as protos from '../protos/protos'; +import * as assert from 'assert'; +import * as sinon from 'sinon'; +import {SinonStub} from 'sinon'; +import {describe, it} from 'mocha'; +import * as organizationsecurityprofilegroupserviceModule from '../src'; + +import {PassThrough} from 'stream'; + +import {protobuf, LROperation, operationsProtos, IamProtos, LocationProtos} from 'google-gax'; + +// Dynamically loaded proto JSON is needed to get the type information +// to fill in default values for request objects +const root = protobuf.Root.fromJSON(require('../protos/protos.json')).resolveAll(); + +// eslint-disable-next-line @typescript-eslint/no-unused-vars +function getTypeDefaultValue(typeName: string, fields: string[]) { + let type = root.lookupType(typeName) as protobuf.Type; + for (const field of fields.slice(0, -1)) { + type = type.fields[field]?.resolvedType as protobuf.Type; + } + return type.fields[fields[fields.length - 1]]?.defaultValue; +} + +function generateSampleMessage(instance: T) { + const filledObject = (instance.constructor as typeof protobuf.Message) + .toObject(instance as protobuf.Message, {defaults: true}); + return (instance.constructor as typeof protobuf.Message).fromObject(filledObject) as T; +} + +function stubSimpleCall(response?: ResponseType, error?: Error) { + return error ? sinon.stub().rejects(error) : sinon.stub().resolves([response]); +} + +function stubSimpleCallWithCallback(response?: ResponseType, error?: Error) { + return error ? sinon.stub().callsArgWith(2, error) : sinon.stub().callsArgWith(2, null, response); +} + +function stubLongRunningCall(response?: ResponseType, callError?: Error, lroError?: Error) { + const innerStub = lroError ? sinon.stub().rejects(lroError) : sinon.stub().resolves([response]); + const mockOperation = { + promise: innerStub, + }; + return callError ? sinon.stub().rejects(callError) : sinon.stub().resolves([mockOperation]); +} + +function stubLongRunningCallWithCallback(response?: ResponseType, callError?: Error, lroError?: Error) { + const innerStub = lroError ? sinon.stub().rejects(lroError) : sinon.stub().resolves([response]); + const mockOperation = { + promise: innerStub, + }; + return callError ? sinon.stub().callsArgWith(2, callError) : sinon.stub().callsArgWith(2, null, mockOperation); +} + +function stubPageStreamingCall(responses?: ResponseType[], error?: Error) { + const pagingStub = sinon.stub(); + if (responses) { + for (let i = 0; i < responses.length; ++i) { + pagingStub.onCall(i).callsArgWith(2, null, responses[i]); + } + } + const transformStub = error ? sinon.stub().callsArgWith(2, error) : pagingStub; + const mockStream = new PassThrough({ + objectMode: true, + transform: transformStub, + }); + // trigger as many responses as needed + if (responses) { + for (let i = 0; i < responses.length; ++i) { + setImmediate(() => { mockStream.write({}); }); + } + setImmediate(() => { mockStream.end(); }); + } else { + setImmediate(() => { mockStream.write({}); }); + setImmediate(() => { mockStream.end(); }); + } + return sinon.stub().returns(mockStream); +} + +function stubAsyncIterationCall(responses?: ResponseType[], error?: Error) { + let counter = 0; + const asyncIterable = { + [Symbol.asyncIterator]() { + return { + async next() { + if (error) { + return Promise.reject(error); + } + if (counter >= responses!.length) { + return Promise.resolve({done: true, value: undefined}); + } + return Promise.resolve({done: false, value: responses![counter++]}); + } + }; + } + }; + return sinon.stub().returns(asyncIterable); +} + +describe('v1.OrganizationSecurityProfileGroupServiceClient', () => { + describe('Common methods', () => { + it('has apiEndpoint', () => { + const client = new organizationsecurityprofilegroupserviceModule.v1.OrganizationSecurityProfileGroupServiceClient(); + const apiEndpoint = client.apiEndpoint; + assert.strictEqual(apiEndpoint, 'networksecurity.googleapis.com'); + }); + + it('has universeDomain', () => { + const client = new organizationsecurityprofilegroupserviceModule.v1.OrganizationSecurityProfileGroupServiceClient(); + const universeDomain = client.universeDomain; + assert.strictEqual(universeDomain, "googleapis.com"); + }); + + if (typeof process === 'object' && typeof process.emitWarning === 'function') { + it('throws DeprecationWarning if static servicePath is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const servicePath = organizationsecurityprofilegroupserviceModule.v1.OrganizationSecurityProfileGroupServiceClient.servicePath; + assert.strictEqual(servicePath, 'networksecurity.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + + it('throws DeprecationWarning if static apiEndpoint is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const apiEndpoint = organizationsecurityprofilegroupserviceModule.v1.OrganizationSecurityProfileGroupServiceClient.apiEndpoint; + assert.strictEqual(apiEndpoint, 'networksecurity.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + } + it('sets apiEndpoint according to universe domain camelCase', () => { + const client = new organizationsecurityprofilegroupserviceModule.v1.OrganizationSecurityProfileGroupServiceClient({universeDomain: 'example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'networksecurity.example.com'); + }); + + it('sets apiEndpoint according to universe domain snakeCase', () => { + const client = new organizationsecurityprofilegroupserviceModule.v1.OrganizationSecurityProfileGroupServiceClient({universe_domain: 'example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'networksecurity.example.com'); + }); + + if (typeof process === 'object' && 'env' in process) { + describe('GOOGLE_CLOUD_UNIVERSE_DOMAIN environment variable', () => { + it('sets apiEndpoint from environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = new organizationsecurityprofilegroupserviceModule.v1.OrganizationSecurityProfileGroupServiceClient(); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'networksecurity.example.com'); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + + it('value configured in code has priority over environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = new organizationsecurityprofilegroupserviceModule.v1.OrganizationSecurityProfileGroupServiceClient({universeDomain: 'configured.example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'networksecurity.configured.example.com'); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + }); + } + it('does not allow setting both universeDomain and universe_domain', () => { + assert.throws(() => { new organizationsecurityprofilegroupserviceModule.v1.OrganizationSecurityProfileGroupServiceClient({universe_domain: 'example.com', universeDomain: 'example.net'}); }); + }); + + it('has port', () => { + const port = organizationsecurityprofilegroupserviceModule.v1.OrganizationSecurityProfileGroupServiceClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new organizationsecurityprofilegroupserviceModule.v1.OrganizationSecurityProfileGroupServiceClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new organizationsecurityprofilegroupserviceModule.v1.OrganizationSecurityProfileGroupServiceClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new organizationsecurityprofilegroupserviceModule.v1.OrganizationSecurityProfileGroupServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.organizationSecurityProfileGroupServiceStub, undefined); + await client.initialize(); + assert(client.organizationSecurityProfileGroupServiceStub); + }); + + it('has close method for the initialized client', done => { + const client = new organizationsecurityprofilegroupserviceModule.v1.OrganizationSecurityProfileGroupServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize().catch(err => {throw err}); + assert(client.organizationSecurityProfileGroupServiceStub); + client.close().then(() => { + done(); + }).catch(err => {throw err}); + }); + + it('has close method for the non-initialized client', done => { + const client = new organizationsecurityprofilegroupserviceModule.v1.OrganizationSecurityProfileGroupServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.organizationSecurityProfileGroupServiceStub, undefined); + client.close().then(() => { + done(); + }).catch(err => {throw err}); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new organizationsecurityprofilegroupserviceModule.v1.OrganizationSecurityProfileGroupServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.auth.getProjectId = sinon.stub().resolves(fakeProjectId); + const result = await client.getProjectId(); + assert.strictEqual(result, fakeProjectId); + assert((client.auth.getProjectId as SinonStub).calledWithExactly()); + }); + + it('has getProjectId method with callback', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new organizationsecurityprofilegroupserviceModule.v1.OrganizationSecurityProfileGroupServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.auth.getProjectId = sinon.stub().callsArgWith(0, null, fakeProjectId); + const promise = new Promise((resolve, reject) => { + client.getProjectId((err?: Error|null, projectId?: string|null) => { + if (err) { + reject(err); + } else { + resolve(projectId); + } + }); + }); + const result = await promise; + assert.strictEqual(result, fakeProjectId); + }); + }); + + describe('getSecurityProfileGroup', () => { + it('invokes getSecurityProfileGroup without error', async () => { + const client = new organizationsecurityprofilegroupserviceModule.v1.OrganizationSecurityProfileGroupServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.GetSecurityProfileGroupRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.GetSecurityProfileGroupRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.SecurityProfileGroup() + ); + client.innerApiCalls.getSecurityProfileGroup = stubSimpleCall(expectedResponse); + const [response] = await client.getSecurityProfileGroup(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getSecurityProfileGroup as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getSecurityProfileGroup as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getSecurityProfileGroup without error using callback', async () => { + const client = new organizationsecurityprofilegroupserviceModule.v1.OrganizationSecurityProfileGroupServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.GetSecurityProfileGroupRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.GetSecurityProfileGroupRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.SecurityProfileGroup() + ); + client.innerApiCalls.getSecurityProfileGroup = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getSecurityProfileGroup( + request, + (err?: Error|null, result?: protos.google.cloud.networksecurity.v1.ISecurityProfileGroup|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getSecurityProfileGroup as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getSecurityProfileGroup as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getSecurityProfileGroup with error', async () => { + const client = new organizationsecurityprofilegroupserviceModule.v1.OrganizationSecurityProfileGroupServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.GetSecurityProfileGroupRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.GetSecurityProfileGroupRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.getSecurityProfileGroup = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getSecurityProfileGroup(request), expectedError); + const actualRequest = (client.innerApiCalls.getSecurityProfileGroup as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getSecurityProfileGroup as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getSecurityProfileGroup with closed client', async () => { + const client = new organizationsecurityprofilegroupserviceModule.v1.OrganizationSecurityProfileGroupServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.GetSecurityProfileGroupRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.GetSecurityProfileGroupRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.getSecurityProfileGroup(request), expectedError); + }); + }); + + describe('getSecurityProfile', () => { + it('invokes getSecurityProfile without error', async () => { + const client = new organizationsecurityprofilegroupserviceModule.v1.OrganizationSecurityProfileGroupServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.GetSecurityProfileRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.GetSecurityProfileRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.SecurityProfile() + ); + client.innerApiCalls.getSecurityProfile = stubSimpleCall(expectedResponse); + const [response] = await client.getSecurityProfile(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getSecurityProfile as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getSecurityProfile as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getSecurityProfile without error using callback', async () => { + const client = new organizationsecurityprofilegroupserviceModule.v1.OrganizationSecurityProfileGroupServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.GetSecurityProfileRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.GetSecurityProfileRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.SecurityProfile() + ); + client.innerApiCalls.getSecurityProfile = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getSecurityProfile( + request, + (err?: Error|null, result?: protos.google.cloud.networksecurity.v1.ISecurityProfile|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getSecurityProfile as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getSecurityProfile as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getSecurityProfile with error', async () => { + const client = new organizationsecurityprofilegroupserviceModule.v1.OrganizationSecurityProfileGroupServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.GetSecurityProfileRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.GetSecurityProfileRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.getSecurityProfile = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getSecurityProfile(request), expectedError); + const actualRequest = (client.innerApiCalls.getSecurityProfile as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getSecurityProfile as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getSecurityProfile with closed client', async () => { + const client = new organizationsecurityprofilegroupserviceModule.v1.OrganizationSecurityProfileGroupServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.GetSecurityProfileRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.GetSecurityProfileRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.getSecurityProfile(request), expectedError); + }); + }); + + describe('createSecurityProfileGroup', () => { + it('invokes createSecurityProfileGroup without error', async () => { + const client = new organizationsecurityprofilegroupserviceModule.v1.OrganizationSecurityProfileGroupServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.CreateSecurityProfileGroupRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.CreateSecurityProfileGroupRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createSecurityProfileGroup = stubLongRunningCall(expectedResponse); + const [operation] = await client.createSecurityProfileGroup(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createSecurityProfileGroup as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createSecurityProfileGroup as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createSecurityProfileGroup without error using callback', async () => { + const client = new organizationsecurityprofilegroupserviceModule.v1.OrganizationSecurityProfileGroupServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.CreateSecurityProfileGroupRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.CreateSecurityProfileGroupRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createSecurityProfileGroup = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createSecurityProfileGroup( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createSecurityProfileGroup as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createSecurityProfileGroup as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createSecurityProfileGroup with call error', async () => { + const client = new organizationsecurityprofilegroupserviceModule.v1.OrganizationSecurityProfileGroupServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.CreateSecurityProfileGroupRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.CreateSecurityProfileGroupRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.createSecurityProfileGroup = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.createSecurityProfileGroup(request), expectedError); + const actualRequest = (client.innerApiCalls.createSecurityProfileGroup as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createSecurityProfileGroup as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createSecurityProfileGroup with LRO error', async () => { + const client = new organizationsecurityprofilegroupserviceModule.v1.OrganizationSecurityProfileGroupServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.CreateSecurityProfileGroupRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.CreateSecurityProfileGroupRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.createSecurityProfileGroup = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.createSecurityProfileGroup(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.createSecurityProfileGroup as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createSecurityProfileGroup as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkCreateSecurityProfileGroupProgress without error', async () => { + const client = new organizationsecurityprofilegroupserviceModule.v1.OrganizationSecurityProfileGroupServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkCreateSecurityProfileGroupProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkCreateSecurityProfileGroupProgress with error', async () => { + const client = new organizationsecurityprofilegroupserviceModule.v1.OrganizationSecurityProfileGroupServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkCreateSecurityProfileGroupProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('updateSecurityProfileGroup', () => { + it('invokes updateSecurityProfileGroup without error', async () => { + const client = new organizationsecurityprofilegroupserviceModule.v1.OrganizationSecurityProfileGroupServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.UpdateSecurityProfileGroupRequest() + ); + request.securityProfileGroup ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.UpdateSecurityProfileGroupRequest', ['securityProfileGroup', 'name']); + request.securityProfileGroup.name = defaultValue1; + const expectedHeaderRequestParams = `security_profile_group.name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.updateSecurityProfileGroup = stubLongRunningCall(expectedResponse); + const [operation] = await client.updateSecurityProfileGroup(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateSecurityProfileGroup as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateSecurityProfileGroup as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateSecurityProfileGroup without error using callback', async () => { + const client = new organizationsecurityprofilegroupserviceModule.v1.OrganizationSecurityProfileGroupServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.UpdateSecurityProfileGroupRequest() + ); + request.securityProfileGroup ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.UpdateSecurityProfileGroupRequest', ['securityProfileGroup', 'name']); + request.securityProfileGroup.name = defaultValue1; + const expectedHeaderRequestParams = `security_profile_group.name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.updateSecurityProfileGroup = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateSecurityProfileGroup( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateSecurityProfileGroup as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateSecurityProfileGroup as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateSecurityProfileGroup with call error', async () => { + const client = new organizationsecurityprofilegroupserviceModule.v1.OrganizationSecurityProfileGroupServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.UpdateSecurityProfileGroupRequest() + ); + request.securityProfileGroup ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.UpdateSecurityProfileGroupRequest', ['securityProfileGroup', 'name']); + request.securityProfileGroup.name = defaultValue1; + const expectedHeaderRequestParams = `security_profile_group.name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateSecurityProfileGroup = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.updateSecurityProfileGroup(request), expectedError); + const actualRequest = (client.innerApiCalls.updateSecurityProfileGroup as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateSecurityProfileGroup as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateSecurityProfileGroup with LRO error', async () => { + const client = new organizationsecurityprofilegroupserviceModule.v1.OrganizationSecurityProfileGroupServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.UpdateSecurityProfileGroupRequest() + ); + request.securityProfileGroup ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.UpdateSecurityProfileGroupRequest', ['securityProfileGroup', 'name']); + request.securityProfileGroup.name = defaultValue1; + const expectedHeaderRequestParams = `security_profile_group.name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateSecurityProfileGroup = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.updateSecurityProfileGroup(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.updateSecurityProfileGroup as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateSecurityProfileGroup as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkUpdateSecurityProfileGroupProgress without error', async () => { + const client = new organizationsecurityprofilegroupserviceModule.v1.OrganizationSecurityProfileGroupServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkUpdateSecurityProfileGroupProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkUpdateSecurityProfileGroupProgress with error', async () => { + const client = new organizationsecurityprofilegroupserviceModule.v1.OrganizationSecurityProfileGroupServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkUpdateSecurityProfileGroupProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('deleteSecurityProfileGroup', () => { + it('invokes deleteSecurityProfileGroup without error', async () => { + const client = new organizationsecurityprofilegroupserviceModule.v1.OrganizationSecurityProfileGroupServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.DeleteSecurityProfileGroupRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.DeleteSecurityProfileGroupRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteSecurityProfileGroup = stubLongRunningCall(expectedResponse); + const [operation] = await client.deleteSecurityProfileGroup(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.deleteSecurityProfileGroup as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteSecurityProfileGroup as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteSecurityProfileGroup without error using callback', async () => { + const client = new organizationsecurityprofilegroupserviceModule.v1.OrganizationSecurityProfileGroupServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.DeleteSecurityProfileGroupRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.DeleteSecurityProfileGroupRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteSecurityProfileGroup = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteSecurityProfileGroup( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.deleteSecurityProfileGroup as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteSecurityProfileGroup as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteSecurityProfileGroup with call error', async () => { + const client = new organizationsecurityprofilegroupserviceModule.v1.OrganizationSecurityProfileGroupServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.DeleteSecurityProfileGroupRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.DeleteSecurityProfileGroupRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteSecurityProfileGroup = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.deleteSecurityProfileGroup(request), expectedError); + const actualRequest = (client.innerApiCalls.deleteSecurityProfileGroup as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteSecurityProfileGroup as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteSecurityProfileGroup with LRO error', async () => { + const client = new organizationsecurityprofilegroupserviceModule.v1.OrganizationSecurityProfileGroupServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.DeleteSecurityProfileGroupRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.DeleteSecurityProfileGroupRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteSecurityProfileGroup = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.deleteSecurityProfileGroup(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.deleteSecurityProfileGroup as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteSecurityProfileGroup as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkDeleteSecurityProfileGroupProgress without error', async () => { + const client = new organizationsecurityprofilegroupserviceModule.v1.OrganizationSecurityProfileGroupServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkDeleteSecurityProfileGroupProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkDeleteSecurityProfileGroupProgress with error', async () => { + const client = new organizationsecurityprofilegroupserviceModule.v1.OrganizationSecurityProfileGroupServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkDeleteSecurityProfileGroupProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('createSecurityProfile', () => { + it('invokes createSecurityProfile without error', async () => { + const client = new organizationsecurityprofilegroupserviceModule.v1.OrganizationSecurityProfileGroupServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.CreateSecurityProfileRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.CreateSecurityProfileRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createSecurityProfile = stubLongRunningCall(expectedResponse); + const [operation] = await client.createSecurityProfile(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createSecurityProfile as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createSecurityProfile as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createSecurityProfile without error using callback', async () => { + const client = new organizationsecurityprofilegroupserviceModule.v1.OrganizationSecurityProfileGroupServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.CreateSecurityProfileRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.CreateSecurityProfileRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createSecurityProfile = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createSecurityProfile( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createSecurityProfile as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createSecurityProfile as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createSecurityProfile with call error', async () => { + const client = new organizationsecurityprofilegroupserviceModule.v1.OrganizationSecurityProfileGroupServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.CreateSecurityProfileRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.CreateSecurityProfileRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.createSecurityProfile = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.createSecurityProfile(request), expectedError); + const actualRequest = (client.innerApiCalls.createSecurityProfile as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createSecurityProfile as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createSecurityProfile with LRO error', async () => { + const client = new organizationsecurityprofilegroupserviceModule.v1.OrganizationSecurityProfileGroupServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.CreateSecurityProfileRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.CreateSecurityProfileRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.createSecurityProfile = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.createSecurityProfile(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.createSecurityProfile as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createSecurityProfile as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkCreateSecurityProfileProgress without error', async () => { + const client = new organizationsecurityprofilegroupserviceModule.v1.OrganizationSecurityProfileGroupServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkCreateSecurityProfileProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkCreateSecurityProfileProgress with error', async () => { + const client = new organizationsecurityprofilegroupserviceModule.v1.OrganizationSecurityProfileGroupServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkCreateSecurityProfileProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('updateSecurityProfile', () => { + it('invokes updateSecurityProfile without error', async () => { + const client = new organizationsecurityprofilegroupserviceModule.v1.OrganizationSecurityProfileGroupServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.UpdateSecurityProfileRequest() + ); + request.securityProfile ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.UpdateSecurityProfileRequest', ['securityProfile', 'name']); + request.securityProfile.name = defaultValue1; + const expectedHeaderRequestParams = `security_profile.name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.updateSecurityProfile = stubLongRunningCall(expectedResponse); + const [operation] = await client.updateSecurityProfile(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateSecurityProfile as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateSecurityProfile as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateSecurityProfile without error using callback', async () => { + const client = new organizationsecurityprofilegroupserviceModule.v1.OrganizationSecurityProfileGroupServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.UpdateSecurityProfileRequest() + ); + request.securityProfile ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.UpdateSecurityProfileRequest', ['securityProfile', 'name']); + request.securityProfile.name = defaultValue1; + const expectedHeaderRequestParams = `security_profile.name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.updateSecurityProfile = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateSecurityProfile( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateSecurityProfile as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateSecurityProfile as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateSecurityProfile with call error', async () => { + const client = new organizationsecurityprofilegroupserviceModule.v1.OrganizationSecurityProfileGroupServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.UpdateSecurityProfileRequest() + ); + request.securityProfile ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.UpdateSecurityProfileRequest', ['securityProfile', 'name']); + request.securityProfile.name = defaultValue1; + const expectedHeaderRequestParams = `security_profile.name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateSecurityProfile = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.updateSecurityProfile(request), expectedError); + const actualRequest = (client.innerApiCalls.updateSecurityProfile as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateSecurityProfile as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateSecurityProfile with LRO error', async () => { + const client = new organizationsecurityprofilegroupserviceModule.v1.OrganizationSecurityProfileGroupServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.UpdateSecurityProfileRequest() + ); + request.securityProfile ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.UpdateSecurityProfileRequest', ['securityProfile', 'name']); + request.securityProfile.name = defaultValue1; + const expectedHeaderRequestParams = `security_profile.name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateSecurityProfile = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.updateSecurityProfile(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.updateSecurityProfile as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateSecurityProfile as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkUpdateSecurityProfileProgress without error', async () => { + const client = new organizationsecurityprofilegroupserviceModule.v1.OrganizationSecurityProfileGroupServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkUpdateSecurityProfileProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkUpdateSecurityProfileProgress with error', async () => { + const client = new organizationsecurityprofilegroupserviceModule.v1.OrganizationSecurityProfileGroupServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkUpdateSecurityProfileProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('deleteSecurityProfile', () => { + it('invokes deleteSecurityProfile without error', async () => { + const client = new organizationsecurityprofilegroupserviceModule.v1.OrganizationSecurityProfileGroupServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.DeleteSecurityProfileRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.DeleteSecurityProfileRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteSecurityProfile = stubLongRunningCall(expectedResponse); + const [operation] = await client.deleteSecurityProfile(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.deleteSecurityProfile as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteSecurityProfile as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteSecurityProfile without error using callback', async () => { + const client = new organizationsecurityprofilegroupserviceModule.v1.OrganizationSecurityProfileGroupServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.DeleteSecurityProfileRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.DeleteSecurityProfileRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteSecurityProfile = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteSecurityProfile( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.deleteSecurityProfile as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteSecurityProfile as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteSecurityProfile with call error', async () => { + const client = new organizationsecurityprofilegroupserviceModule.v1.OrganizationSecurityProfileGroupServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.DeleteSecurityProfileRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.DeleteSecurityProfileRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteSecurityProfile = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.deleteSecurityProfile(request), expectedError); + const actualRequest = (client.innerApiCalls.deleteSecurityProfile as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteSecurityProfile as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteSecurityProfile with LRO error', async () => { + const client = new organizationsecurityprofilegroupserviceModule.v1.OrganizationSecurityProfileGroupServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.DeleteSecurityProfileRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.DeleteSecurityProfileRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteSecurityProfile = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.deleteSecurityProfile(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.deleteSecurityProfile as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteSecurityProfile as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkDeleteSecurityProfileProgress without error', async () => { + const client = new organizationsecurityprofilegroupserviceModule.v1.OrganizationSecurityProfileGroupServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkDeleteSecurityProfileProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkDeleteSecurityProfileProgress with error', async () => { + const client = new organizationsecurityprofilegroupserviceModule.v1.OrganizationSecurityProfileGroupServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkDeleteSecurityProfileProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('listSecurityProfileGroups', () => { + it('invokes listSecurityProfileGroups without error', async () => { + const client = new organizationsecurityprofilegroupserviceModule.v1.OrganizationSecurityProfileGroupServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.ListSecurityProfileGroupsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.ListSecurityProfileGroupsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.networksecurity.v1.SecurityProfileGroup()), + generateSampleMessage(new protos.google.cloud.networksecurity.v1.SecurityProfileGroup()), + generateSampleMessage(new protos.google.cloud.networksecurity.v1.SecurityProfileGroup()), + ]; + client.innerApiCalls.listSecurityProfileGroups = stubSimpleCall(expectedResponse); + const [response] = await client.listSecurityProfileGroups(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listSecurityProfileGroups as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listSecurityProfileGroups as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listSecurityProfileGroups without error using callback', async () => { + const client = new organizationsecurityprofilegroupserviceModule.v1.OrganizationSecurityProfileGroupServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.ListSecurityProfileGroupsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.ListSecurityProfileGroupsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.networksecurity.v1.SecurityProfileGroup()), + generateSampleMessage(new protos.google.cloud.networksecurity.v1.SecurityProfileGroup()), + generateSampleMessage(new protos.google.cloud.networksecurity.v1.SecurityProfileGroup()), + ]; + client.innerApiCalls.listSecurityProfileGroups = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listSecurityProfileGroups( + request, + (err?: Error|null, result?: protos.google.cloud.networksecurity.v1.ISecurityProfileGroup[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listSecurityProfileGroups as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listSecurityProfileGroups as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listSecurityProfileGroups with error', async () => { + const client = new organizationsecurityprofilegroupserviceModule.v1.OrganizationSecurityProfileGroupServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.ListSecurityProfileGroupsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.ListSecurityProfileGroupsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.listSecurityProfileGroups = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listSecurityProfileGroups(request), expectedError); + const actualRequest = (client.innerApiCalls.listSecurityProfileGroups as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listSecurityProfileGroups as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listSecurityProfileGroupsStream without error', async () => { + const client = new organizationsecurityprofilegroupserviceModule.v1.OrganizationSecurityProfileGroupServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.ListSecurityProfileGroupsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.ListSecurityProfileGroupsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.networksecurity.v1.SecurityProfileGroup()), + generateSampleMessage(new protos.google.cloud.networksecurity.v1.SecurityProfileGroup()), + generateSampleMessage(new protos.google.cloud.networksecurity.v1.SecurityProfileGroup()), + ]; + client.descriptors.page.listSecurityProfileGroups.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listSecurityProfileGroupsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.networksecurity.v1.SecurityProfileGroup[] = []; + stream.on('data', (response: protos.google.cloud.networksecurity.v1.SecurityProfileGroup) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert((client.descriptors.page.listSecurityProfileGroups.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listSecurityProfileGroups, request)); + assert( + (client.descriptors.page.listSecurityProfileGroups.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listSecurityProfileGroupsStream with error', async () => { + const client = new organizationsecurityprofilegroupserviceModule.v1.OrganizationSecurityProfileGroupServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.ListSecurityProfileGroupsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.ListSecurityProfileGroupsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.descriptors.page.listSecurityProfileGroups.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listSecurityProfileGroupsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.networksecurity.v1.SecurityProfileGroup[] = []; + stream.on('data', (response: protos.google.cloud.networksecurity.v1.SecurityProfileGroup) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listSecurityProfileGroups.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listSecurityProfileGroups, request)); + assert( + (client.descriptors.page.listSecurityProfileGroups.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listSecurityProfileGroups without error', async () => { + const client = new organizationsecurityprofilegroupserviceModule.v1.OrganizationSecurityProfileGroupServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.ListSecurityProfileGroupsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.ListSecurityProfileGroupsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.networksecurity.v1.SecurityProfileGroup()), + generateSampleMessage(new protos.google.cloud.networksecurity.v1.SecurityProfileGroup()), + generateSampleMessage(new protos.google.cloud.networksecurity.v1.SecurityProfileGroup()), + ]; + client.descriptors.page.listSecurityProfileGroups.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.networksecurity.v1.ISecurityProfileGroup[] = []; + const iterable = client.listSecurityProfileGroupsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listSecurityProfileGroups.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listSecurityProfileGroups.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listSecurityProfileGroups with error', async () => { + const client = new organizationsecurityprofilegroupserviceModule.v1.OrganizationSecurityProfileGroupServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.ListSecurityProfileGroupsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.ListSecurityProfileGroupsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.descriptors.page.listSecurityProfileGroups.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listSecurityProfileGroupsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.networksecurity.v1.ISecurityProfileGroup[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listSecurityProfileGroups.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listSecurityProfileGroups.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('listSecurityProfiles', () => { + it('invokes listSecurityProfiles without error', async () => { + const client = new organizationsecurityprofilegroupserviceModule.v1.OrganizationSecurityProfileGroupServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.ListSecurityProfilesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.ListSecurityProfilesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.networksecurity.v1.SecurityProfile()), + generateSampleMessage(new protos.google.cloud.networksecurity.v1.SecurityProfile()), + generateSampleMessage(new protos.google.cloud.networksecurity.v1.SecurityProfile()), + ]; + client.innerApiCalls.listSecurityProfiles = stubSimpleCall(expectedResponse); + const [response] = await client.listSecurityProfiles(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listSecurityProfiles as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listSecurityProfiles as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listSecurityProfiles without error using callback', async () => { + const client = new organizationsecurityprofilegroupserviceModule.v1.OrganizationSecurityProfileGroupServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.ListSecurityProfilesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.ListSecurityProfilesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.networksecurity.v1.SecurityProfile()), + generateSampleMessage(new protos.google.cloud.networksecurity.v1.SecurityProfile()), + generateSampleMessage(new protos.google.cloud.networksecurity.v1.SecurityProfile()), + ]; + client.innerApiCalls.listSecurityProfiles = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listSecurityProfiles( + request, + (err?: Error|null, result?: protos.google.cloud.networksecurity.v1.ISecurityProfile[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listSecurityProfiles as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listSecurityProfiles as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listSecurityProfiles with error', async () => { + const client = new organizationsecurityprofilegroupserviceModule.v1.OrganizationSecurityProfileGroupServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.ListSecurityProfilesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.ListSecurityProfilesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.listSecurityProfiles = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listSecurityProfiles(request), expectedError); + const actualRequest = (client.innerApiCalls.listSecurityProfiles as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listSecurityProfiles as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listSecurityProfilesStream without error', async () => { + const client = new organizationsecurityprofilegroupserviceModule.v1.OrganizationSecurityProfileGroupServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.ListSecurityProfilesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.ListSecurityProfilesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.networksecurity.v1.SecurityProfile()), + generateSampleMessage(new protos.google.cloud.networksecurity.v1.SecurityProfile()), + generateSampleMessage(new protos.google.cloud.networksecurity.v1.SecurityProfile()), + ]; + client.descriptors.page.listSecurityProfiles.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listSecurityProfilesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.networksecurity.v1.SecurityProfile[] = []; + stream.on('data', (response: protos.google.cloud.networksecurity.v1.SecurityProfile) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert((client.descriptors.page.listSecurityProfiles.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listSecurityProfiles, request)); + assert( + (client.descriptors.page.listSecurityProfiles.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listSecurityProfilesStream with error', async () => { + const client = new organizationsecurityprofilegroupserviceModule.v1.OrganizationSecurityProfileGroupServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.ListSecurityProfilesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.ListSecurityProfilesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.descriptors.page.listSecurityProfiles.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listSecurityProfilesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.networksecurity.v1.SecurityProfile[] = []; + stream.on('data', (response: protos.google.cloud.networksecurity.v1.SecurityProfile) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listSecurityProfiles.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listSecurityProfiles, request)); + assert( + (client.descriptors.page.listSecurityProfiles.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listSecurityProfiles without error', async () => { + const client = new organizationsecurityprofilegroupserviceModule.v1.OrganizationSecurityProfileGroupServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.ListSecurityProfilesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.ListSecurityProfilesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.networksecurity.v1.SecurityProfile()), + generateSampleMessage(new protos.google.cloud.networksecurity.v1.SecurityProfile()), + generateSampleMessage(new protos.google.cloud.networksecurity.v1.SecurityProfile()), + ]; + client.descriptors.page.listSecurityProfiles.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.networksecurity.v1.ISecurityProfile[] = []; + const iterable = client.listSecurityProfilesAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listSecurityProfiles.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listSecurityProfiles.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listSecurityProfiles with error', async () => { + const client = new organizationsecurityprofilegroupserviceModule.v1.OrganizationSecurityProfileGroupServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networksecurity.v1.ListSecurityProfilesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.networksecurity.v1.ListSecurityProfilesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.descriptors.page.listSecurityProfiles.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listSecurityProfilesAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.networksecurity.v1.ISecurityProfile[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listSecurityProfiles.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listSecurityProfiles.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + describe('getIamPolicy', () => { + it('invokes getIamPolicy without error', async () => { + const client = new organizationsecurityprofilegroupserviceModule.v1.OrganizationSecurityProfileGroupServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.GetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy() + ); + client.iamClient.getIamPolicy = stubSimpleCall(expectedResponse); + const response = await client.getIamPolicy(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.iamClient.getIamPolicy as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + it('invokes getIamPolicy without error using callback', async () => { + const client = new organizationsecurityprofilegroupserviceModule.v1.OrganizationSecurityProfileGroupServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.GetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy() + ); + client.iamClient.getIamPolicy = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getIamPolicy( + request, + expectedOptions, + (err?: Error|null, result?: IamProtos.google.iam.v1.Policy|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }).catch(err => {throw err}); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.iamClient.getIamPolicy as SinonStub) + .getCall(0)); + }); + it('invokes getIamPolicy with error', async () => { + const client = new organizationsecurityprofilegroupserviceModule.v1.OrganizationSecurityProfileGroupServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.GetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.iamClient.getIamPolicy = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getIamPolicy(request, expectedOptions), expectedError); + assert((client.iamClient.getIamPolicy as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + }); + describe('setIamPolicy', () => { + it('invokes setIamPolicy without error', async () => { + const client = new organizationsecurityprofilegroupserviceModule.v1.OrganizationSecurityProfileGroupServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.SetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy() + ); + client.iamClient.setIamPolicy = stubSimpleCall(expectedResponse); + const response = await client.setIamPolicy(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.iamClient.setIamPolicy as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + it('invokes setIamPolicy without error using callback', async () => { + const client = new organizationsecurityprofilegroupserviceModule.v1.OrganizationSecurityProfileGroupServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.SetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy() + ); + client.iamClient.setIamPolicy = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.setIamPolicy( + request, + expectedOptions, + (err?: Error|null, result?: IamProtos.google.iam.v1.Policy|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }).catch(err => {throw err}); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.iamClient.setIamPolicy as SinonStub) + .getCall(0)); + }); + it('invokes setIamPolicy with error', async () => { + const client = new organizationsecurityprofilegroupserviceModule.v1.OrganizationSecurityProfileGroupServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.SetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.iamClient.setIamPolicy = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.setIamPolicy(request, expectedOptions), expectedError); + assert((client.iamClient.setIamPolicy as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + }); + describe('testIamPermissions', () => { + it('invokes testIamPermissions without error', async () => { + const client = new organizationsecurityprofilegroupserviceModule.v1.OrganizationSecurityProfileGroupServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsResponse() + ); + client.iamClient.testIamPermissions = stubSimpleCall(expectedResponse); + const response = await client.testIamPermissions(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.iamClient.testIamPermissions as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + it('invokes testIamPermissions without error using callback', async () => { + const client = new organizationsecurityprofilegroupserviceModule.v1.OrganizationSecurityProfileGroupServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsResponse() + ); + client.iamClient.testIamPermissions = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.testIamPermissions( + request, + expectedOptions, + (err?: Error|null, result?: IamProtos.google.iam.v1.TestIamPermissionsResponse|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }).catch(err => {throw err}); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.iamClient.testIamPermissions as SinonStub) + .getCall(0)); + }); + it('invokes testIamPermissions with error', async () => { + const client = new organizationsecurityprofilegroupserviceModule.v1.OrganizationSecurityProfileGroupServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.iamClient.testIamPermissions = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.testIamPermissions(request, expectedOptions), expectedError); + assert((client.iamClient.testIamPermissions as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + }); + describe('getLocation', () => { + it('invokes getLocation without error', async () => { + const client = new organizationsecurityprofilegroupserviceModule.v1.OrganizationSecurityProfileGroupServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ); + client.locationsClient.getLocation = stubSimpleCall(expectedResponse); + const response = await client.getLocation(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.locationsClient.getLocation as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + it('invokes getLocation without error using callback', async () => { + const client = new organizationsecurityprofilegroupserviceModule.v1.OrganizationSecurityProfileGroupServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ); + client.locationsClient.getLocation = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getLocation( + request, + expectedOptions, + ( + err?: Error | null, + result?: LocationProtos.google.cloud.location.ILocation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.locationsClient.getLocation as SinonStub) + .getCall(0)); + }); + it('invokes getLocation with error', async () => { + const client = new organizationsecurityprofilegroupserviceModule.v1.OrganizationSecurityProfileGroupServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.locationsClient.getLocation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getLocation(request, expectedOptions), expectedError); + assert((client.locationsClient.getLocation as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + }); + describe('listLocationsAsync', () => { + it('uses async iteration with listLocations without error', async () => { + const client = new organizationsecurityprofilegroupserviceModule.v1.OrganizationSecurityProfileGroupServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.ListLocationsRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedResponse = [ + generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ), + generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ), + generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ), + ]; + client.locationsClient.descriptors.page.listLocations.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: LocationProtos.google.cloud.location.ILocation[] = []; + const iterable = client.listLocationsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + it('uses async iteration with listLocations with error', async () => { + const client = new organizationsecurityprofilegroupserviceModule.v1.OrganizationSecurityProfileGroupServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.ListLocationsRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedError = new Error('expected'); + client.locationsClient.descriptors.page.listLocations.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listLocationsAsync(request); + await assert.rejects(async () => { + const responses: LocationProtos.google.cloud.location.ILocation[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + describe('getOperation', () => { + it('invokes getOperation without error', async () => { + const client = new organizationsecurityprofilegroupserviceModule.v1.OrganizationSecurityProfileGroupServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.GetOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const response = await client.getOperation(request); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0).calledWith(request) + ); + }); + it('invokes getOperation without error using callback', async () => { + const client = new organizationsecurityprofilegroupserviceModule.v1.OrganizationSecurityProfileGroupServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.GetOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + client.operationsClient.getOperation = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.operationsClient.getOperation( + request, + undefined, + ( + err?: Error | null, + result?: operationsProtos.google.longrunning.Operation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }).catch(err => {throw err}); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + it('invokes getOperation with error', async () => { + const client = new organizationsecurityprofilegroupserviceModule.v1.OrganizationSecurityProfileGroupServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.GetOperationRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(async () => {await client.getOperation(request)}, expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0).calledWith(request)); + }); + }); + describe('cancelOperation', () => { + it('invokes cancelOperation without error', async () => { + const client = new organizationsecurityprofilegroupserviceModule.v1.OrganizationSecurityProfileGroupServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.CancelOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.cancelOperation = stubSimpleCall(expectedResponse); + const response = await client.cancelOperation(request); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.operationsClient.cancelOperation as SinonStub) + .getCall(0).calledWith(request) + ); + }); + it('invokes cancelOperation without error using callback', async () => { + const client = new organizationsecurityprofilegroupserviceModule.v1.OrganizationSecurityProfileGroupServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.CancelOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.cancelOperation = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.operationsClient.cancelOperation( + request, + undefined, + ( + err?: Error | null, + result?: protos.google.protobuf.Empty | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }).catch(err => {throw err}); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.operationsClient.cancelOperation as SinonStub) + .getCall(0)); + }); + it('invokes cancelOperation with error', async () => { + const client = new organizationsecurityprofilegroupserviceModule.v1.OrganizationSecurityProfileGroupServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.CancelOperationRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.cancelOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(async () => {await client.cancelOperation(request)}, expectedError); + assert((client.operationsClient.cancelOperation as SinonStub) + .getCall(0).calledWith(request)); + }); + }); + describe('deleteOperation', () => { + it('invokes deleteOperation without error', async () => { + const client = new organizationsecurityprofilegroupserviceModule.v1.OrganizationSecurityProfileGroupServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.DeleteOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.deleteOperation = stubSimpleCall(expectedResponse); + const response = await client.deleteOperation(request); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.operationsClient.deleteOperation as SinonStub) + .getCall(0).calledWith(request) + ); + }); + it('invokes deleteOperation without error using callback', async () => { + const client = new organizationsecurityprofilegroupserviceModule.v1.OrganizationSecurityProfileGroupServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.DeleteOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.deleteOperation = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.operationsClient.deleteOperation( + request, + undefined, + ( + err?: Error | null, + result?: protos.google.protobuf.Empty | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }).catch(err => {throw err}); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.operationsClient.deleteOperation as SinonStub) + .getCall(0)); + }); + it('invokes deleteOperation with error', async () => { + const client = new organizationsecurityprofilegroupserviceModule.v1.OrganizationSecurityProfileGroupServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.DeleteOperationRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.deleteOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(async () => {await client.deleteOperation(request)}, expectedError); + assert((client.operationsClient.deleteOperation as SinonStub) + .getCall(0).calledWith(request)); + }); + }); + describe('listOperationsAsync', () => { + it('uses async iteration with listOperations without error', async () => { + const client = new organizationsecurityprofilegroupserviceModule.v1.OrganizationSecurityProfileGroupServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsRequest() + ); + const expectedResponse = [ + generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsResponse() + ), + generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsResponse() + ), + generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsResponse() + ), + ]; + client.operationsClient.descriptor.listOperations.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: operationsProtos.google.longrunning.IOperation[] = []; + const iterable = client.operationsClient.listOperationsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.operationsClient.descriptor.listOperations.asyncIterate as SinonStub) + .getCall(0).args[1], request); + }); + it('uses async iteration with listOperations with error', async () => { + const client = new organizationsecurityprofilegroupserviceModule.v1.OrganizationSecurityProfileGroupServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.descriptor.listOperations.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.operationsClient.listOperationsAsync(request); + await assert.rejects(async () => { + const responses: operationsProtos.google.longrunning.IOperation[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.operationsClient.descriptor.listOperations.asyncIterate as SinonStub) + .getCall(0).args[1], request); + }); + }); + + describe('Path templates', () => { + + describe('authorizationPolicy', async () => { + const fakePath = "/rendered/path/authorizationPolicy"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + authorization_policy: "authorizationPolicyValue", + }; + const client = new organizationsecurityprofilegroupserviceModule.v1.OrganizationSecurityProfileGroupServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.authorizationPolicyPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.authorizationPolicyPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('authorizationPolicyPath', () => { + const result = client.authorizationPolicyPath("projectValue", "locationValue", "authorizationPolicyValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.authorizationPolicyPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromAuthorizationPolicyName', () => { + const result = client.matchProjectFromAuthorizationPolicyName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.authorizationPolicyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromAuthorizationPolicyName', () => { + const result = client.matchLocationFromAuthorizationPolicyName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.authorizationPolicyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchAuthorizationPolicyFromAuthorizationPolicyName', () => { + const result = client.matchAuthorizationPolicyFromAuthorizationPolicyName(fakePath); + assert.strictEqual(result, "authorizationPolicyValue"); + assert((client.pathTemplates.authorizationPolicyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('authzPolicy', async () => { + const fakePath = "/rendered/path/authzPolicy"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + authz_policy: "authzPolicyValue", + }; + const client = new organizationsecurityprofilegroupserviceModule.v1.OrganizationSecurityProfileGroupServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.authzPolicyPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.authzPolicyPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('authzPolicyPath', () => { + const result = client.authzPolicyPath("projectValue", "locationValue", "authzPolicyValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.authzPolicyPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromAuthzPolicyName', () => { + const result = client.matchProjectFromAuthzPolicyName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.authzPolicyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromAuthzPolicyName', () => { + const result = client.matchLocationFromAuthzPolicyName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.authzPolicyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchAuthzPolicyFromAuthzPolicyName', () => { + const result = client.matchAuthzPolicyFromAuthzPolicyName(fakePath); + assert.strictEqual(result, "authzPolicyValue"); + assert((client.pathTemplates.authzPolicyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('backendAuthenticationConfig', async () => { + const fakePath = "/rendered/path/backendAuthenticationConfig"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + backend_authentication_config: "backendAuthenticationConfigValue", + }; + const client = new organizationsecurityprofilegroupserviceModule.v1.OrganizationSecurityProfileGroupServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.backendAuthenticationConfigPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.backendAuthenticationConfigPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('backendAuthenticationConfigPath', () => { + const result = client.backendAuthenticationConfigPath("projectValue", "locationValue", "backendAuthenticationConfigValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.backendAuthenticationConfigPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromBackendAuthenticationConfigName', () => { + const result = client.matchProjectFromBackendAuthenticationConfigName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.backendAuthenticationConfigPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromBackendAuthenticationConfigName', () => { + const result = client.matchLocationFromBackendAuthenticationConfigName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.backendAuthenticationConfigPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchBackendAuthenticationConfigFromBackendAuthenticationConfigName', () => { + const result = client.matchBackendAuthenticationConfigFromBackendAuthenticationConfigName(fakePath); + assert.strictEqual(result, "backendAuthenticationConfigValue"); + assert((client.pathTemplates.backendAuthenticationConfigPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('clientTlsPolicy', async () => { + const fakePath = "/rendered/path/clientTlsPolicy"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + client_tls_policy: "clientTlsPolicyValue", + }; + const client = new organizationsecurityprofilegroupserviceModule.v1.OrganizationSecurityProfileGroupServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.clientTlsPolicyPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.clientTlsPolicyPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('clientTlsPolicyPath', () => { + const result = client.clientTlsPolicyPath("projectValue", "locationValue", "clientTlsPolicyValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.clientTlsPolicyPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromClientTlsPolicyName', () => { + const result = client.matchProjectFromClientTlsPolicyName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.clientTlsPolicyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromClientTlsPolicyName', () => { + const result = client.matchLocationFromClientTlsPolicyName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.clientTlsPolicyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchClientTlsPolicyFromClientTlsPolicyName', () => { + const result = client.matchClientTlsPolicyFromClientTlsPolicyName(fakePath); + assert.strictEqual(result, "clientTlsPolicyValue"); + assert((client.pathTemplates.clientTlsPolicyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('dnsThreatDetector', async () => { + const fakePath = "/rendered/path/dnsThreatDetector"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + dns_threat_detector: "dnsThreatDetectorValue", + }; + const client = new organizationsecurityprofilegroupserviceModule.v1.OrganizationSecurityProfileGroupServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.dnsThreatDetectorPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.dnsThreatDetectorPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('dnsThreatDetectorPath', () => { + const result = client.dnsThreatDetectorPath("projectValue", "locationValue", "dnsThreatDetectorValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.dnsThreatDetectorPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromDnsThreatDetectorName', () => { + const result = client.matchProjectFromDnsThreatDetectorName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.dnsThreatDetectorPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromDnsThreatDetectorName', () => { + const result = client.matchLocationFromDnsThreatDetectorName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.dnsThreatDetectorPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDnsThreatDetectorFromDnsThreatDetectorName', () => { + const result = client.matchDnsThreatDetectorFromDnsThreatDetectorName(fakePath); + assert.strictEqual(result, "dnsThreatDetectorValue"); + assert((client.pathTemplates.dnsThreatDetectorPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('firewallEndpointAssociation', async () => { + const fakePath = "/rendered/path/firewallEndpointAssociation"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + firewall_endpoint_association: "firewallEndpointAssociationValue", + }; + const client = new organizationsecurityprofilegroupserviceModule.v1.OrganizationSecurityProfileGroupServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.firewallEndpointAssociationPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.firewallEndpointAssociationPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('firewallEndpointAssociationPath', () => { + const result = client.firewallEndpointAssociationPath("projectValue", "locationValue", "firewallEndpointAssociationValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.firewallEndpointAssociationPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromFirewallEndpointAssociationName', () => { + const result = client.matchProjectFromFirewallEndpointAssociationName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.firewallEndpointAssociationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromFirewallEndpointAssociationName', () => { + const result = client.matchLocationFromFirewallEndpointAssociationName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.firewallEndpointAssociationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchFirewallEndpointAssociationFromFirewallEndpointAssociationName', () => { + const result = client.matchFirewallEndpointAssociationFromFirewallEndpointAssociationName(fakePath); + assert.strictEqual(result, "firewallEndpointAssociationValue"); + assert((client.pathTemplates.firewallEndpointAssociationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('gatewaySecurityPolicy', async () => { + const fakePath = "/rendered/path/gatewaySecurityPolicy"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + gateway_security_policy: "gatewaySecurityPolicyValue", + }; + const client = new organizationsecurityprofilegroupserviceModule.v1.OrganizationSecurityProfileGroupServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.gatewaySecurityPolicyPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.gatewaySecurityPolicyPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('gatewaySecurityPolicyPath', () => { + const result = client.gatewaySecurityPolicyPath("projectValue", "locationValue", "gatewaySecurityPolicyValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.gatewaySecurityPolicyPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromGatewaySecurityPolicyName', () => { + const result = client.matchProjectFromGatewaySecurityPolicyName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.gatewaySecurityPolicyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromGatewaySecurityPolicyName', () => { + const result = client.matchLocationFromGatewaySecurityPolicyName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.gatewaySecurityPolicyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchGatewaySecurityPolicyFromGatewaySecurityPolicyName', () => { + const result = client.matchGatewaySecurityPolicyFromGatewaySecurityPolicyName(fakePath); + assert.strictEqual(result, "gatewaySecurityPolicyValue"); + assert((client.pathTemplates.gatewaySecurityPolicyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('gatewaySecurityPolicyRule', async () => { + const fakePath = "/rendered/path/gatewaySecurityPolicyRule"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + gateway_security_policy: "gatewaySecurityPolicyValue", + rule: "ruleValue", + }; + const client = new organizationsecurityprofilegroupserviceModule.v1.OrganizationSecurityProfileGroupServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.gatewaySecurityPolicyRulePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.gatewaySecurityPolicyRulePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('gatewaySecurityPolicyRulePath', () => { + const result = client.gatewaySecurityPolicyRulePath("projectValue", "locationValue", "gatewaySecurityPolicyValue", "ruleValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.gatewaySecurityPolicyRulePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromGatewaySecurityPolicyRuleName', () => { + const result = client.matchProjectFromGatewaySecurityPolicyRuleName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.gatewaySecurityPolicyRulePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromGatewaySecurityPolicyRuleName', () => { + const result = client.matchLocationFromGatewaySecurityPolicyRuleName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.gatewaySecurityPolicyRulePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchGatewaySecurityPolicyFromGatewaySecurityPolicyRuleName', () => { + const result = client.matchGatewaySecurityPolicyFromGatewaySecurityPolicyRuleName(fakePath); + assert.strictEqual(result, "gatewaySecurityPolicyValue"); + assert((client.pathTemplates.gatewaySecurityPolicyRulePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchRuleFromGatewaySecurityPolicyRuleName', () => { + const result = client.matchRuleFromGatewaySecurityPolicyRuleName(fakePath); + assert.strictEqual(result, "ruleValue"); + assert((client.pathTemplates.gatewaySecurityPolicyRulePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('interceptDeployment', async () => { + const fakePath = "/rendered/path/interceptDeployment"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + intercept_deployment: "interceptDeploymentValue", + }; + const client = new organizationsecurityprofilegroupserviceModule.v1.OrganizationSecurityProfileGroupServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.interceptDeploymentPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.interceptDeploymentPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('interceptDeploymentPath', () => { + const result = client.interceptDeploymentPath("projectValue", "locationValue", "interceptDeploymentValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.interceptDeploymentPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromInterceptDeploymentName', () => { + const result = client.matchProjectFromInterceptDeploymentName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.interceptDeploymentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromInterceptDeploymentName', () => { + const result = client.matchLocationFromInterceptDeploymentName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.interceptDeploymentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchInterceptDeploymentFromInterceptDeploymentName', () => { + const result = client.matchInterceptDeploymentFromInterceptDeploymentName(fakePath); + assert.strictEqual(result, "interceptDeploymentValue"); + assert((client.pathTemplates.interceptDeploymentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('interceptDeploymentGroup', async () => { + const fakePath = "/rendered/path/interceptDeploymentGroup"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + intercept_deployment_group: "interceptDeploymentGroupValue", + }; + const client = new organizationsecurityprofilegroupserviceModule.v1.OrganizationSecurityProfileGroupServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.interceptDeploymentGroupPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.interceptDeploymentGroupPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('interceptDeploymentGroupPath', () => { + const result = client.interceptDeploymentGroupPath("projectValue", "locationValue", "interceptDeploymentGroupValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.interceptDeploymentGroupPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromInterceptDeploymentGroupName', () => { + const result = client.matchProjectFromInterceptDeploymentGroupName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.interceptDeploymentGroupPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromInterceptDeploymentGroupName', () => { + const result = client.matchLocationFromInterceptDeploymentGroupName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.interceptDeploymentGroupPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchInterceptDeploymentGroupFromInterceptDeploymentGroupName', () => { + const result = client.matchInterceptDeploymentGroupFromInterceptDeploymentGroupName(fakePath); + assert.strictEqual(result, "interceptDeploymentGroupValue"); + assert((client.pathTemplates.interceptDeploymentGroupPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('interceptEndpointGroup', async () => { + const fakePath = "/rendered/path/interceptEndpointGroup"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + intercept_endpoint_group: "interceptEndpointGroupValue", + }; + const client = new organizationsecurityprofilegroupserviceModule.v1.OrganizationSecurityProfileGroupServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.interceptEndpointGroupPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.interceptEndpointGroupPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('interceptEndpointGroupPath', () => { + const result = client.interceptEndpointGroupPath("projectValue", "locationValue", "interceptEndpointGroupValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.interceptEndpointGroupPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromInterceptEndpointGroupName', () => { + const result = client.matchProjectFromInterceptEndpointGroupName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.interceptEndpointGroupPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromInterceptEndpointGroupName', () => { + const result = client.matchLocationFromInterceptEndpointGroupName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.interceptEndpointGroupPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchInterceptEndpointGroupFromInterceptEndpointGroupName', () => { + const result = client.matchInterceptEndpointGroupFromInterceptEndpointGroupName(fakePath); + assert.strictEqual(result, "interceptEndpointGroupValue"); + assert((client.pathTemplates.interceptEndpointGroupPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('interceptEndpointGroupAssociation', async () => { + const fakePath = "/rendered/path/interceptEndpointGroupAssociation"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + intercept_endpoint_group_association: "interceptEndpointGroupAssociationValue", + }; + const client = new organizationsecurityprofilegroupserviceModule.v1.OrganizationSecurityProfileGroupServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.interceptEndpointGroupAssociationPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.interceptEndpointGroupAssociationPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('interceptEndpointGroupAssociationPath', () => { + const result = client.interceptEndpointGroupAssociationPath("projectValue", "locationValue", "interceptEndpointGroupAssociationValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.interceptEndpointGroupAssociationPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromInterceptEndpointGroupAssociationName', () => { + const result = client.matchProjectFromInterceptEndpointGroupAssociationName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.interceptEndpointGroupAssociationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromInterceptEndpointGroupAssociationName', () => { + const result = client.matchLocationFromInterceptEndpointGroupAssociationName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.interceptEndpointGroupAssociationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchInterceptEndpointGroupAssociationFromInterceptEndpointGroupAssociationName', () => { + const result = client.matchInterceptEndpointGroupAssociationFromInterceptEndpointGroupAssociationName(fakePath); + assert.strictEqual(result, "interceptEndpointGroupAssociationValue"); + assert((client.pathTemplates.interceptEndpointGroupAssociationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('mirroringDeployment', async () => { + const fakePath = "/rendered/path/mirroringDeployment"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + mirroring_deployment: "mirroringDeploymentValue", + }; + const client = new organizationsecurityprofilegroupserviceModule.v1.OrganizationSecurityProfileGroupServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.mirroringDeploymentPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.mirroringDeploymentPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('mirroringDeploymentPath', () => { + const result = client.mirroringDeploymentPath("projectValue", "locationValue", "mirroringDeploymentValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.mirroringDeploymentPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromMirroringDeploymentName', () => { + const result = client.matchProjectFromMirroringDeploymentName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.mirroringDeploymentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromMirroringDeploymentName', () => { + const result = client.matchLocationFromMirroringDeploymentName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.mirroringDeploymentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchMirroringDeploymentFromMirroringDeploymentName', () => { + const result = client.matchMirroringDeploymentFromMirroringDeploymentName(fakePath); + assert.strictEqual(result, "mirroringDeploymentValue"); + assert((client.pathTemplates.mirroringDeploymentPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('mirroringDeploymentGroup', async () => { + const fakePath = "/rendered/path/mirroringDeploymentGroup"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + mirroring_deployment_group: "mirroringDeploymentGroupValue", + }; + const client = new organizationsecurityprofilegroupserviceModule.v1.OrganizationSecurityProfileGroupServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.mirroringDeploymentGroupPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.mirroringDeploymentGroupPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('mirroringDeploymentGroupPath', () => { + const result = client.mirroringDeploymentGroupPath("projectValue", "locationValue", "mirroringDeploymentGroupValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.mirroringDeploymentGroupPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromMirroringDeploymentGroupName', () => { + const result = client.matchProjectFromMirroringDeploymentGroupName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.mirroringDeploymentGroupPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromMirroringDeploymentGroupName', () => { + const result = client.matchLocationFromMirroringDeploymentGroupName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.mirroringDeploymentGroupPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchMirroringDeploymentGroupFromMirroringDeploymentGroupName', () => { + const result = client.matchMirroringDeploymentGroupFromMirroringDeploymentGroupName(fakePath); + assert.strictEqual(result, "mirroringDeploymentGroupValue"); + assert((client.pathTemplates.mirroringDeploymentGroupPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('mirroringEndpointGroup', async () => { + const fakePath = "/rendered/path/mirroringEndpointGroup"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + mirroring_endpoint_group: "mirroringEndpointGroupValue", + }; + const client = new organizationsecurityprofilegroupserviceModule.v1.OrganizationSecurityProfileGroupServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.mirroringEndpointGroupPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.mirroringEndpointGroupPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('mirroringEndpointGroupPath', () => { + const result = client.mirroringEndpointGroupPath("projectValue", "locationValue", "mirroringEndpointGroupValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.mirroringEndpointGroupPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromMirroringEndpointGroupName', () => { + const result = client.matchProjectFromMirroringEndpointGroupName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.mirroringEndpointGroupPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromMirroringEndpointGroupName', () => { + const result = client.matchLocationFromMirroringEndpointGroupName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.mirroringEndpointGroupPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchMirroringEndpointGroupFromMirroringEndpointGroupName', () => { + const result = client.matchMirroringEndpointGroupFromMirroringEndpointGroupName(fakePath); + assert.strictEqual(result, "mirroringEndpointGroupValue"); + assert((client.pathTemplates.mirroringEndpointGroupPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('mirroringEndpointGroupAssociation', async () => { + const fakePath = "/rendered/path/mirroringEndpointGroupAssociation"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + mirroring_endpoint_group_association: "mirroringEndpointGroupAssociationValue", + }; + const client = new organizationsecurityprofilegroupserviceModule.v1.OrganizationSecurityProfileGroupServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.mirroringEndpointGroupAssociationPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.mirroringEndpointGroupAssociationPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('mirroringEndpointGroupAssociationPath', () => { + const result = client.mirroringEndpointGroupAssociationPath("projectValue", "locationValue", "mirroringEndpointGroupAssociationValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.mirroringEndpointGroupAssociationPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromMirroringEndpointGroupAssociationName', () => { + const result = client.matchProjectFromMirroringEndpointGroupAssociationName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.mirroringEndpointGroupAssociationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromMirroringEndpointGroupAssociationName', () => { + const result = client.matchLocationFromMirroringEndpointGroupAssociationName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.mirroringEndpointGroupAssociationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchMirroringEndpointGroupAssociationFromMirroringEndpointGroupAssociationName', () => { + const result = client.matchMirroringEndpointGroupAssociationFromMirroringEndpointGroupAssociationName(fakePath); + assert.strictEqual(result, "mirroringEndpointGroupAssociationValue"); + assert((client.pathTemplates.mirroringEndpointGroupAssociationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('organization', async () => { + const fakePath = "/rendered/path/organization"; + const expectedParameters = { + organization: "organizationValue", + }; + const client = new organizationsecurityprofilegroupserviceModule.v1.OrganizationSecurityProfileGroupServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.organizationPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.organizationPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('organizationPath', () => { + const result = client.organizationPath("organizationValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.organizationPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchOrganizationFromOrganizationName', () => { + const result = client.matchOrganizationFromOrganizationName(fakePath); + assert.strictEqual(result, "organizationValue"); + assert((client.pathTemplates.organizationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('organizationLocation', async () => { + const fakePath = "/rendered/path/organizationLocation"; + const expectedParameters = { + organization: "organizationValue", + location: "locationValue", + }; + const client = new organizationsecurityprofilegroupserviceModule.v1.OrganizationSecurityProfileGroupServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.organizationLocationPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.organizationLocationPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('organizationLocationPath', () => { + const result = client.organizationLocationPath("organizationValue", "locationValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.organizationLocationPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchOrganizationFromOrganizationLocationName', () => { + const result = client.matchOrganizationFromOrganizationLocationName(fakePath); + assert.strictEqual(result, "organizationValue"); + assert((client.pathTemplates.organizationLocationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromOrganizationLocationName', () => { + const result = client.matchLocationFromOrganizationLocationName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.organizationLocationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('organizationLocationAddressGroup', async () => { + const fakePath = "/rendered/path/organizationLocationAddressGroup"; + const expectedParameters = { + organization: "organizationValue", + location: "locationValue", + address_group: "addressGroupValue", + }; + const client = new organizationsecurityprofilegroupserviceModule.v1.OrganizationSecurityProfileGroupServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.organizationLocationAddressGroupPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.organizationLocationAddressGroupPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('organizationLocationAddressGroupPath', () => { + const result = client.organizationLocationAddressGroupPath("organizationValue", "locationValue", "addressGroupValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.organizationLocationAddressGroupPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchOrganizationFromOrganizationLocationAddressGroupName', () => { + const result = client.matchOrganizationFromOrganizationLocationAddressGroupName(fakePath); + assert.strictEqual(result, "organizationValue"); + assert((client.pathTemplates.organizationLocationAddressGroupPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromOrganizationLocationAddressGroupName', () => { + const result = client.matchLocationFromOrganizationLocationAddressGroupName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.organizationLocationAddressGroupPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchAddressGroupFromOrganizationLocationAddressGroupName', () => { + const result = client.matchAddressGroupFromOrganizationLocationAddressGroupName(fakePath); + assert.strictEqual(result, "addressGroupValue"); + assert((client.pathTemplates.organizationLocationAddressGroupPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('organizationLocationFirewallEndpoints', async () => { + const fakePath = "/rendered/path/organizationLocationFirewallEndpoints"; + const expectedParameters = { + organization: "organizationValue", + location: "locationValue", + firewall_endpoint: "firewallEndpointValue", + }; + const client = new organizationsecurityprofilegroupserviceModule.v1.OrganizationSecurityProfileGroupServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.organizationLocationFirewallEndpointsPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.organizationLocationFirewallEndpointsPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('organizationLocationFirewallEndpointsPath', () => { + const result = client.organizationLocationFirewallEndpointsPath("organizationValue", "locationValue", "firewallEndpointValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.organizationLocationFirewallEndpointsPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchOrganizationFromOrganizationLocationFirewallEndpointsName', () => { + const result = client.matchOrganizationFromOrganizationLocationFirewallEndpointsName(fakePath); + assert.strictEqual(result, "organizationValue"); + assert((client.pathTemplates.organizationLocationFirewallEndpointsPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromOrganizationLocationFirewallEndpointsName', () => { + const result = client.matchLocationFromOrganizationLocationFirewallEndpointsName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.organizationLocationFirewallEndpointsPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchFirewallEndpointFromOrganizationLocationFirewallEndpointsName', () => { + const result = client.matchFirewallEndpointFromOrganizationLocationFirewallEndpointsName(fakePath); + assert.strictEqual(result, "firewallEndpointValue"); + assert((client.pathTemplates.organizationLocationFirewallEndpointsPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('organizationLocationSecurityProfile', async () => { + const fakePath = "/rendered/path/organizationLocationSecurityProfile"; + const expectedParameters = { + organization: "organizationValue", + location: "locationValue", + security_profile: "securityProfileValue", + }; + const client = new organizationsecurityprofilegroupserviceModule.v1.OrganizationSecurityProfileGroupServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.organizationLocationSecurityProfilePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.organizationLocationSecurityProfilePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('organizationLocationSecurityProfilePath', () => { + const result = client.organizationLocationSecurityProfilePath("organizationValue", "locationValue", "securityProfileValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.organizationLocationSecurityProfilePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchOrganizationFromOrganizationLocationSecurityProfileName', () => { + const result = client.matchOrganizationFromOrganizationLocationSecurityProfileName(fakePath); + assert.strictEqual(result, "organizationValue"); + assert((client.pathTemplates.organizationLocationSecurityProfilePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromOrganizationLocationSecurityProfileName', () => { + const result = client.matchLocationFromOrganizationLocationSecurityProfileName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.organizationLocationSecurityProfilePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchSecurityProfileFromOrganizationLocationSecurityProfileName', () => { + const result = client.matchSecurityProfileFromOrganizationLocationSecurityProfileName(fakePath); + assert.strictEqual(result, "securityProfileValue"); + assert((client.pathTemplates.organizationLocationSecurityProfilePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('organizationLocationSecurityProfileGroup', async () => { + const fakePath = "/rendered/path/organizationLocationSecurityProfileGroup"; + const expectedParameters = { + organization: "organizationValue", + location: "locationValue", + security_profile_group: "securityProfileGroupValue", + }; + const client = new organizationsecurityprofilegroupserviceModule.v1.OrganizationSecurityProfileGroupServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.organizationLocationSecurityProfileGroupPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.organizationLocationSecurityProfileGroupPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('organizationLocationSecurityProfileGroupPath', () => { + const result = client.organizationLocationSecurityProfileGroupPath("organizationValue", "locationValue", "securityProfileGroupValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.organizationLocationSecurityProfileGroupPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchOrganizationFromOrganizationLocationSecurityProfileGroupName', () => { + const result = client.matchOrganizationFromOrganizationLocationSecurityProfileGroupName(fakePath); + assert.strictEqual(result, "organizationValue"); + assert((client.pathTemplates.organizationLocationSecurityProfileGroupPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromOrganizationLocationSecurityProfileGroupName', () => { + const result = client.matchLocationFromOrganizationLocationSecurityProfileGroupName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.organizationLocationSecurityProfileGroupPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchSecurityProfileGroupFromOrganizationLocationSecurityProfileGroupName', () => { + const result = client.matchSecurityProfileGroupFromOrganizationLocationSecurityProfileGroupName(fakePath); + assert.strictEqual(result, "securityProfileGroupValue"); + assert((client.pathTemplates.organizationLocationSecurityProfileGroupPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('projectLocationAddressGroup', async () => { + const fakePath = "/rendered/path/projectLocationAddressGroup"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + address_group: "addressGroupValue", + }; + const client = new organizationsecurityprofilegroupserviceModule.v1.OrganizationSecurityProfileGroupServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectLocationAddressGroupPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationAddressGroupPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationAddressGroupPath', () => { + const result = client.projectLocationAddressGroupPath("projectValue", "locationValue", "addressGroupValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.projectLocationAddressGroupPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromProjectLocationAddressGroupName', () => { + const result = client.matchProjectFromProjectLocationAddressGroupName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.projectLocationAddressGroupPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromProjectLocationAddressGroupName', () => { + const result = client.matchLocationFromProjectLocationAddressGroupName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.projectLocationAddressGroupPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchAddressGroupFromProjectLocationAddressGroupName', () => { + const result = client.matchAddressGroupFromProjectLocationAddressGroupName(fakePath); + assert.strictEqual(result, "addressGroupValue"); + assert((client.pathTemplates.projectLocationAddressGroupPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('projectLocationFirewallEndpoints', async () => { + const fakePath = "/rendered/path/projectLocationFirewallEndpoints"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + firewall_endpoint: "firewallEndpointValue", + }; + const client = new organizationsecurityprofilegroupserviceModule.v1.OrganizationSecurityProfileGroupServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectLocationFirewallEndpointsPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationFirewallEndpointsPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationFirewallEndpointsPath', () => { + const result = client.projectLocationFirewallEndpointsPath("projectValue", "locationValue", "firewallEndpointValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.projectLocationFirewallEndpointsPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromProjectLocationFirewallEndpointsName', () => { + const result = client.matchProjectFromProjectLocationFirewallEndpointsName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.projectLocationFirewallEndpointsPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromProjectLocationFirewallEndpointsName', () => { + const result = client.matchLocationFromProjectLocationFirewallEndpointsName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.projectLocationFirewallEndpointsPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchFirewallEndpointFromProjectLocationFirewallEndpointsName', () => { + const result = client.matchFirewallEndpointFromProjectLocationFirewallEndpointsName(fakePath); + assert.strictEqual(result, "firewallEndpointValue"); + assert((client.pathTemplates.projectLocationFirewallEndpointsPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('projectLocationSecurityProfile', async () => { + const fakePath = "/rendered/path/projectLocationSecurityProfile"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + security_profile: "securityProfileValue", + }; + const client = new organizationsecurityprofilegroupserviceModule.v1.OrganizationSecurityProfileGroupServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectLocationSecurityProfilePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationSecurityProfilePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationSecurityProfilePath', () => { + const result = client.projectLocationSecurityProfilePath("projectValue", "locationValue", "securityProfileValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.projectLocationSecurityProfilePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromProjectLocationSecurityProfileName', () => { + const result = client.matchProjectFromProjectLocationSecurityProfileName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.projectLocationSecurityProfilePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromProjectLocationSecurityProfileName', () => { + const result = client.matchLocationFromProjectLocationSecurityProfileName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.projectLocationSecurityProfilePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchSecurityProfileFromProjectLocationSecurityProfileName', () => { + const result = client.matchSecurityProfileFromProjectLocationSecurityProfileName(fakePath); + assert.strictEqual(result, "securityProfileValue"); + assert((client.pathTemplates.projectLocationSecurityProfilePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('projectLocationSecurityProfileGroup', async () => { + const fakePath = "/rendered/path/projectLocationSecurityProfileGroup"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + security_profile_group: "securityProfileGroupValue", + }; + const client = new organizationsecurityprofilegroupserviceModule.v1.OrganizationSecurityProfileGroupServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectLocationSecurityProfileGroupPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationSecurityProfileGroupPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationSecurityProfileGroupPath', () => { + const result = client.projectLocationSecurityProfileGroupPath("projectValue", "locationValue", "securityProfileGroupValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.projectLocationSecurityProfileGroupPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromProjectLocationSecurityProfileGroupName', () => { + const result = client.matchProjectFromProjectLocationSecurityProfileGroupName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.projectLocationSecurityProfileGroupPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromProjectLocationSecurityProfileGroupName', () => { + const result = client.matchLocationFromProjectLocationSecurityProfileGroupName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.projectLocationSecurityProfileGroupPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchSecurityProfileGroupFromProjectLocationSecurityProfileGroupName', () => { + const result = client.matchSecurityProfileGroupFromProjectLocationSecurityProfileGroupName(fakePath); + assert.strictEqual(result, "securityProfileGroupValue"); + assert((client.pathTemplates.projectLocationSecurityProfileGroupPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('serverTlsPolicy', async () => { + const fakePath = "/rendered/path/serverTlsPolicy"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + server_tls_policy: "serverTlsPolicyValue", + }; + const client = new organizationsecurityprofilegroupserviceModule.v1.OrganizationSecurityProfileGroupServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.serverTlsPolicyPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.serverTlsPolicyPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('serverTlsPolicyPath', () => { + const result = client.serverTlsPolicyPath("projectValue", "locationValue", "serverTlsPolicyValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.serverTlsPolicyPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromServerTlsPolicyName', () => { + const result = client.matchProjectFromServerTlsPolicyName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.serverTlsPolicyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromServerTlsPolicyName', () => { + const result = client.matchLocationFromServerTlsPolicyName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.serverTlsPolicyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchServerTlsPolicyFromServerTlsPolicyName', () => { + const result = client.matchServerTlsPolicyFromServerTlsPolicyName(fakePath); + assert.strictEqual(result, "serverTlsPolicyValue"); + assert((client.pathTemplates.serverTlsPolicyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('tlsInspectionPolicy', async () => { + const fakePath = "/rendered/path/tlsInspectionPolicy"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + tls_inspection_policy: "tlsInspectionPolicyValue", + }; + const client = new organizationsecurityprofilegroupserviceModule.v1.OrganizationSecurityProfileGroupServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.tlsInspectionPolicyPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.tlsInspectionPolicyPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('tlsInspectionPolicyPath', () => { + const result = client.tlsInspectionPolicyPath("projectValue", "locationValue", "tlsInspectionPolicyValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.tlsInspectionPolicyPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromTlsInspectionPolicyName', () => { + const result = client.matchProjectFromTlsInspectionPolicyName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.tlsInspectionPolicyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromTlsInspectionPolicyName', () => { + const result = client.matchLocationFromTlsInspectionPolicyName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.tlsInspectionPolicyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchTlsInspectionPolicyFromTlsInspectionPolicyName', () => { + const result = client.matchTlsInspectionPolicyFromTlsInspectionPolicyName(fakePath); + assert.strictEqual(result, "tlsInspectionPolicyValue"); + assert((client.pathTemplates.tlsInspectionPolicyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('urlList', async () => { + const fakePath = "/rendered/path/urlList"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + url_list: "urlListValue", + }; + const client = new organizationsecurityprofilegroupserviceModule.v1.OrganizationSecurityProfileGroupServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.urlListPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.urlListPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('urlListPath', () => { + const result = client.urlListPath("projectValue", "locationValue", "urlListValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.urlListPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromUrlListName', () => { + const result = client.matchProjectFromUrlListName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.urlListPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromUrlListName', () => { + const result = client.matchLocationFromUrlListName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.urlListPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchUrlListFromUrlListName', () => { + const result = client.matchUrlListFromUrlListName(fakePath); + assert.strictEqual(result, "urlListValue"); + assert((client.pathTemplates.urlListPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + }); +});